pub async fn compact(
preparation: &CompactionPreparation,
api_key: &str,
model: &str,
system_prompt_override: Option<&str>,
thinking_level: ThinkingLevel,
model_config: Option<ModelConfig>,
) -> Result<CompactionResult, String>Expand description
Execute compaction: send messages to the provider for summarisation and return the result ready to append to the session.
model_config should be the session’s current model configuration.
thinking_level controls whether the summarization uses reasoning mode.