pub struct SummarizeOptions {
pub trigger_token_budget: usize,
pub keep_recent_messages: usize,
pub summary_system_prompt: String,
pub summary_max_tokens: Option<u32>,
pub redact_tool_content: bool,
pub redact_roles: Vec<Role>,
}Expand description
Tunables for summarize_history.
Fields§
§trigger_token_budget: usizeToken threshold above which summarization fires. When the loaded
history fits below this budget, summarize_history returns
Ok(None) and the call is a no-op.
keep_recent_messages: usizeNumber of most-recent messages to keep verbatim (uncompressed). Older messages are passed to the summarizer.
summary_system_prompt: StringSystem prompt prefix passed to the summarizer LLM call.
summary_max_tokens: Option<u32>Optional cap on the summary’s max output tokens.
redact_tool_content: boolWhen true (the default), Role::Tool message bodies are
substituted with a redaction marker before being rendered into
the summarizer transcript. This prevents tool arguments / results
— which routinely carry credentials, API keys, or compliance-
restricted content — from leaving the host process via a third-
party summarizer LLM.
Caller is responsible for ensuring sensitive content does not
reach the summarizer LLM. The default redact_tool_content = true is conservative; callers needing tool-content visibility
in the summary must opt out explicitly.
Has no effect when Self::redact_roles is non-empty —
redact_roles takes precedence.
redact_roles: Vec<Role>Explicit set of roles whose content is replaced by the redaction
marker. When non-empty, this overrides Self::redact_tool_content
entirely: the redaction set is exactly the listed roles.
Use this for finer-grained control — for example, to redact
Role::Tool AND Role::System while leaving everything else
verbatim, set redact_roles = vec![Role::Tool, Role::System].
Trait Implementations§
Source§impl Clone for SummarizeOptions
impl Clone for SummarizeOptions
Source§fn clone(&self) -> SummarizeOptions
fn clone(&self) -> SummarizeOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more