Skip to main content

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.

truncate_context

Method
This is a method of the RAG class in the rag module.
Truncate context to fit token budget

Signature

def truncate_context(&self, context: &str, max_tokens: usize) -> String

Parameters

context
&str
required
No description available.
max_tokens
usize
required
No description available.

Returns

Returns
String
The result of the operation.

Rust Context Management

Rust Token Management