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.
ContextAgent
Defined in the specialized module.
Rust AI Agent SDK
Context agent for managing conversation context
Fields
| Name | Type | Description |
|---|
config | ContextAgentConfig | Configuration |
context | Vec<ContextEntry> | Context window |
max_entries | usize | Maximum entries |
Methods
new
fn new(config: ContextAgentConfig) -> Self
Create a new context agent
Parameters:
| Name | Type |
|---|
config | ContextAgentConfig |
add
fn add(&mut self, role: impl Into<String>, content: impl Into<String>) -> ()
Add an entry to context
Parameters:
| Name | Type |
|---|
role | impl Into<String> |
content | impl Into<String> |
get_context
fn get_context(&self) -> Vec<&ContextEntry>
Get context as messages
clear
fn clear(&mut self) -> ()
Clear context
len
Get context length
is_empty
fn is_empty(&self) -> bool
Check if context is empty
Source
View on GitHub
praisonai/src/parity/specialized.rs at line 46