-
Notifications
You must be signed in to change notification settings - Fork 7
refactor: equip the langchain summarizer with a retry decorator. #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: equip the langchain summarizer with a retry decorator. #90
Conversation
… and LangchainSummarizer
…y decorator settings
…r environment variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces enhanced configurability and reliability to the summarization workflow by adding retry logic with exponential backoff and jitter, and refactoring the summarizer to use the retry decorator pattern.
- Adds granular retry configuration fields to
SummarizerSettingswith optional override capabilities - Refactors
LangchainSummarizerto use async chunk processing with the retry decorator pattern - Updates dependency injection to wire retry settings and fixes the typo in
maximum_concurrency
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| langchain_summarizer.py | Refactored to use async chunk processing with retry decorator and exponential backoff |
| summarizer_settings.py | Added optional retry configuration fields and fixed typo in maximum_concurrency |
| dependency_container.py | Added retry decorator settings registration and updated summarizer wiring |
| README.md | Added documentation for summarizer retry behavior configuration |
| values.yaml | Added default retry configuration values for summarizer |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
libs/admin-api-lib/src/admin_api_lib/impl/summarizer/langchain_summarizer.py
Outdated
Show resolved
Hide resolved
libs/admin-api-lib/src/admin_api_lib/impl/summarizer/langchain_summarizer.py
Show resolved
Hide resolved
…/langchain_summarizer.py Co-authored-by: Copilot <[email protected]>
This pull request introduces enhanced configurability and reliability to the summarization workflow by adding granular retry and concurrency settings, and refactoring the summarizer to use them. The changes allow for more robust handling of transient failures and better control over resource usage.
Configuration enhancements:
max_retries,retry_base_delay,retry_max_delay,backoff_factor,attempt_cap,jitter_min,jitter_max) to theSummarizerSettingsclass, allowing fine-grained control over retry behavior for summarization tasks. [1] [2]SummarizerSettingsfield name frommaximum_concurrrenytomaximum_concurrency. [1] [2]Dependency injection and wiring:
RetryDecoratorSettingsin the dependency container and passed both summarizer and global retry settings to theLangchainSummarizerinstance, enabling summarizer-specific overrides. [1] [2] [3]Summarizer logic refactoring:
LangchainSummarizerto:These changes collectively improve the reliability, configurability, and maintainability of the summarization pipeline.
fixes partly following issue
#87