Skip to main content

trim_to_reported_budget_with_crumb

Function trim_to_reported_budget_with_crumb 

pub fn trim_to_reported_budget_with_crumb(
    history: Vec<ChatMessage>,
    budget_tokens: usize,
    reported_input_tokens: usize,
    reported_population_estimated: usize,
    tool_schema_tokens: usize,
    crumb_present: bool,
) -> TrimResult
Expand description

Crumb-aware variant: when crumb_present is true the population carries the synthetic breadcrumb immediately after leading system messages. The breadcrumb is never counted as a turn and never dropped.