Skip to main content

ContextConfig

Defined in the context module.
Rust AI Agent SDK Configuration for context management.

Fields

NameTypeDescription
modelStringModel name for token limits
max_tokensusizeMaximum context tokens (0 = auto from model)
strategyOptimizerStrategyOptimization strategy
monitoringboolEnable context monitoring
output_reserve_pctf64Output reserve percentage

Methods

new

fn new() -> Self
Create a new context config

model

fn model(mut self, model: impl Into<String>) -> Self
Set model Parameters:
NameType
modelimpl Into&lt;String&gt;

max_tokens

fn max_tokens(mut self, tokens: usize) -> Self
Set max tokens Parameters:
NameType
tokensusize

strategy

fn strategy(mut self, strategy: OptimizerStrategy) -> Self
Set optimization strategy Parameters:
NameType
strategyOptimizerStrategy

with_monitoring

fn with_monitoring(mut self) -> Self
Enable monitoring

output_reserve_pct

fn output_reserve_pct(mut self, pct: f64) -> Self
Set output reserve percentage Parameters:
NameType
pctf64

Source

View on GitHub

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