Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
ThinkingBudget
Defined in the thinking module.
Rust AI Agent SDK
Budget constraints for extended thinking. Controls how much thinking/reasoning the LLM can do before producing a response.
Fields
| Name | Type | Description |
|---|
max_tokens | usize | Maximum tokens for thinking |
max_time_seconds | Option<f64> | Maximum time in seconds (optional) |
adaptive | bool | Whether to adapt budget based on complexity |
level | Option<BudgetLevel> | Budget level (if using predefined) |
min_tokens | usize | Minimum tokens for adaptive budgeting |
complexity_multiplier | f64 | Complexity multiplier for adaptive budgeting |
Methods
new
fn new() -> ThinkingBudgetBuilder
Create a new ThinkingBudget with default values.
from_level
fn from_level(level: BudgetLevel) -> Self
Create a budget from a predefined level.
Parameters:
minimal
Create a minimal budget.
low
Create a low budget.
medium
Create a medium budget.
high
Create a high budget.
maximum
Create a maximum budget.
get_tokens_for_complexity
fn get_tokens_for_complexity(&self, complexity: f64) -> usize
Get token budget based on task complexity. # Arguments * complexity - Complexity score (0.0 to 1.0) # Returns Adjusted token budget
Parameters:
to_map
fn to_map(&self) -> HashMap<String, serde_json::Value>
Convert to HashMap for serialization.
Source
View on GitHub
praisonai/src/thinking/mod.rs at line 80