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.
ContextConfig
Defined in the context module.
Rust AI Agent SDK
Configuration for context management.
Fields
| Name | Type | Description |
|---|
model | String | Model name for token limits |
max_tokens | usize | Maximum context tokens (0 = auto from model) |
strategy | OptimizerStrategy | Optimization strategy |
monitoring | bool | Enable context monitoring |
output_reserve_pct | f64 | Output reserve percentage |
Methods
new
Create a new context config
model
fn model(mut self, model: impl Into<String>) -> Self
Set model
Parameters:
| Name | Type |
|---|
model | impl Into<String> |
max_tokens
fn max_tokens(mut self, tokens: usize) -> Self
Set max tokens
Parameters:
strategy
fn strategy(mut self, strategy: OptimizerStrategy) -> Self
Set optimization strategy
Parameters:
| Name | Type |
|---|
strategy | OptimizerStrategy |
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:
Source
View on GitHub
praisonai/src/context/mod.rs at line 194