Skip to main content

Module context_window

Module context_window 

Source
Expand description

Context window management: policy-driven message truncation.

When conversation history exceeds the model’s context window budget, older messages are dropped while preserving tool-call/result pairs and a minimum number of recent messages.

Structs§

ContextWindowPolicy
Context window management policy.
TruncationResult
Result of truncation.

Functions§

truncate_to_budget
Truncate conversation history to fit within the context window budget.