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

NameTypeDescription
totalusizeTotal budget in tokens
systemusizeBudget for system prompt
historyusizeBudget for conversation history
toolsusizeBudget for tools
output_reserveusizeReserved for output

Methods

new

rust
fn new(total: usize) -> Self

Create a new budget allocation

Parameters:

NameType
totalusize

with_ratios

rust
fn with_ratios(total: usize, system_pct: f64, history_pct: f64, tools_pct: f64) -> Self

Create with custom ratios

Parameters:

NameType
totalusize
system_pctf64
history_pctf64
tools_pctf64

Source

View on GitHub

praisonai/src/context/mod.rs at line 146


Related Documentation