> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Thinking Budget Builder • Rust AI Agent SDK

> ThinkingBudgetBuilder: Builder for ThinkingBudget.

# ThinkingBudgetBuilder

> Defined in the [**thinking**](../modules/thinking) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Builder for ThinkingBudget.

## Fields

| Name                    | Type                        | Description |
| ----------------------- | --------------------------- | ----------- |
| `max_tokens`            | `Option&lt;usize&gt;`       | -           |
| `max_time_seconds`      | `Option&lt;f64&gt;`         | -           |
| `adaptive`              | `Option&lt;bool&gt;`        | -           |
| `level`                 | `Option&lt;BudgetLevel&gt;` | -           |
| `min_tokens`            | `Option&lt;usize&gt;`       | -           |
| `complexity_multiplier` | `Option&lt;f64&gt;`         | -           |

## Methods

### `max_tokens`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_tokens(mut self, tokens: usize) -> Self
```

Set maximum tokens.

**Parameters:**

| Name     | Type    |
| -------- | ------- |
| `tokens` | `usize` |

### `max_time_seconds`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_time_seconds(mut self, seconds: f64) -> Self
```

Set maximum time in seconds.

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `seconds` | `f64` |

### `adaptive`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn adaptive(mut self, adaptive: bool) -> Self
```

Set adaptive mode.

**Parameters:**

| Name       | Type   |
| ---------- | ------ |
| `adaptive` | `bool` |

### `level`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn level(mut self, level: BudgetLevel) -> Self
```

Set budget level.

**Parameters:**

| Name    | Type          |
| ------- | ------------- |
| `level` | `BudgetLevel` |

### `min_tokens`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn min_tokens(mut self, tokens: usize) -> Self
```

Set minimum tokens for adaptive budgeting.

**Parameters:**

| Name     | Type    |
| -------- | ------- |
| `tokens` | `usize` |

### `complexity_multiplier`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn complexity_multiplier(mut self, multiplier: f64) -> Self
```

Set complexity multiplier.

**Parameters:**

| Name         | Type  |
| ------------ | ----- |
| `multiplier` | `f64` |

### `build`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn build(self) -> ThinkingBudget
```

Build the ThinkingBudget.

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/thinking/mod.rs#L182">
  `praisonai/src/thinking/mod.rs` at line 182
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Thinking" icon="lightbulb" href="/docs/rust/thinking" />

  <Card title="Rust Reasoning" icon="brain" href="/docs/rust/reasoning" />

  <Card title="Rust Agent UI" icon="display" href="/docs/rust/agent-ui-agui" />

  <Card title="Rust AGUI" icon="display" href="/docs/rust/agui" />

  <Card title="Rust Budget" icon="wallet" href="/docs/rust/budget" />
</CardGroup>
