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.
ContextSegment
Defined in the context module.
Rust AI Agent SDK
A segment of context with token count.
Fields
| Name | Type | Description |
|---|
name | String | Segment name/type |
tokens | usize | Token count for this segment |
priority | i32 | Priority (higher = more important) |
content | Option<String> | Content of the segment |
Methods
new
fn new(name: impl Into<String>, tokens: usize) -> Self
Create a new context segment
Parameters:
| Name | Type |
|---|
name | impl Into<String> |
tokens | usize |
priority
fn priority(mut self, priority: i32) -> Self
Set priority
Parameters:
content
fn content(mut self, content: impl Into<String>) -> Self
Set content
Parameters:
| Name | Type |
|---|
content | impl Into<String> |
Source
View on GitHub
praisonai/src/context/mod.rs at line 54