Skip to main content

apply_summary

Function apply_summary 

Source
pub fn apply_summary(
    conversation: &mut Conversation,
    replaces: &[Arc<Message>],
    state: &SummaryState,
) -> Option<Spliced>
Expand description

Puts the summary of state in place of replaces, the first messages of conversation as a compaction read them (CompactionPreparation::replaces), earlier summaries included: one user entry by summary_author, in one splice, which is the compaction’s whole record. Messages added after them stay. None, changing nothing, when replaces is empty, when the conversation no longer starts with those very messages, such as after an edit of one, so a summary never replaces what it did not read, or when what stays would start with a tool result whose call the summary replaced.