Skip to content

Add custom automatic context summarization callback - #5684

Open
AzizMuminov wants to merge 3 commits into
pipecat-ai:mainfrom
AzizMuminov:AzizMuminov/should-summarize-callback
Open

Add custom automatic context summarization callback#5684
AzizMuminov wants to merge 3 commits into
pipecat-ai:mainfrom
AzizMuminov:AzizMuminov/should-summarize-callback

Conversation

@AzizMuminov

@AzizMuminov AzizMuminov commented Sep 10, 2026

Copy link
Copy Markdown

Summary

  • Add an optional should_summarize_callback for application-defined automatic context-summarization policies.
  • Expose the callback through LLMAssistantAggregatorParams and preserve existing threshold behavior when it is unset.
  • Skip built-in token estimation and threshold evaluation when the callback is configured.

Testing

  • uv run pytest tests/test_llm_context_summarizer.py tests/test_context_summarization.py -q
  • uv run ruff check src/pipecat/processors/aggregators/llm_context_summarizer.py src/pipecat/processors/aggregators/llm_response_universal.py tests/test_llm_context_summarizer.py

Fixes

@AzizMuminov

Copy link
Copy Markdown
Author

Hi @markbackman — when you have a moment, would you be willing to review this small opt-in API for #4795? It preserves existing automatic threshold behavior unless should_summarize_callback is configured, and the callback path is covered through LLMAssistantAggregator as well as the standalone summarizer. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add should_summarize_callback param to LLMContextSummarizer

1 participant