Truncate Context • Rust AI Agent SDK

truncate_context: Truncate context to fit token budget

truncate_context

Method

</div>

This is a method of the RAG class in the rag module.

Truncate context to fit token budget

Signature

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

Parameters

ParamField &str

No description available.

ParamField usize

No description available.

Returns

ResponseField String

The result of the operation.


Related Documentation