Skip to main content

compact_conversation

Function compact_conversation 

Source
pub async fn compact_conversation(
    api_messages: &[SharedMessage],
    runtime: &Runtime,
    custom_instructions: Option<&str>,
) -> Result<CompactionOutcome>
Expand description

Serialize the in-memory API message history into a policy-filtered transcript and produce the typed CompactionOutcome. Remote mode asks the configured summarizer model; local-only mode (spec §9.4) derives the summary in-process and constructs NO network request. Called by /compact and every auto-compaction path.