Skip to main content

Module history_summary

Module history_summary 

Source
Expand description

History-level compaction: summarises old messages to keep token usage under budget.

Implementations of HistoryCompactionStrategy decide whether and how to shorten the conversation. The default SummaryHistoryCompaction asks the model to summarise older turns in a single pass, then keeps that summary plus the most recent context.

Structs§

SummaryHistoryCompaction
Compacts by asking the model to summarise old messages, keeping the most recent N.

Traits§

HistoryCompactionStrategy
Strategy for compacting conversation history when tokens exceed a budget.