Skip to main content

compact_history_with_budget

Function compact_history_with_budget 

Source
pub async fn compact_history_with_budget(
    provider: &dyn LLMProvider,
    model: &str,
    history: &[Message],
    config: &CompactionConfig,
    context_budget: Option<usize>,
) -> Result<Vec<Message>>
Expand description

Compact conversation history using a caller-resolved context budget for input bounding and locally rebuilt output. Standalone native responses are returned as the provider’s canonical next context window.