Budget Allocation • Rust AI Agent SDK
BudgetAllocation: Budget allocation for different context components.
BudgetAllocation
Defined in the context module.
Rust AI Agent SDK
Budget allocation for different context components.
Fields
| Name | Type | Description |
|---|---|---|
total | usize | Total budget in tokens |
system | usize | Budget for system prompt |
history | usize | Budget for conversation history |
tools | usize | Budget for tools |
output_reserve | usize | Reserved for output |
Methods
new
fn new(total: usize) -> SelfCreate a new budget allocation
Parameters:
| Name | Type |
|---|---|
total | usize |
with_ratios
fn with_ratios(total: usize, system_pct: f64, history_pct: f64, tools_pct: f64) -> SelfCreate with custom ratios
Parameters:
| Name | Type |
|---|---|
total | usize |
system_pct | f64 |
history_pct | f64 |
tools_pct | f64 |
Source
View on GitHubpraisonai/src/context/mod.rs at line 146