Skip to main content

prepare_compaction

Function prepare_compaction 

Source
pub fn prepare_compaction(
    conversation: &Conversation,
    keep_recent_tokens: u64,
    overflowed: bool,
) -> Option<CompactionPreparation>
Expand description

What a compaction of conversation, keeping about keep_recent_tokens, summarizes, or None when nothing would be, as when nothing was added since the last one (already_compacted); overflowed after the provider refused a request as too long (find_cut_point), which is compacted for even then, as the summary before it may have gone in after its prompt. The earlier summaries (summarized_prefix) are never cut again: the new summary updates the newest one.