refactor: equip the langchain summarizer with a retry decorator.#90
Merged
a-klos merged 9 commits intofeat/exponential-retry-decoratorfrom Oct 9, 2025
Merged
Conversation
… and LangchainSummarizer
…y decorator settings
…r environment variables
Contributor
There was a problem hiding this comment.
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 <175728472+Copilot@users.noreply.github.com>
manu-hoffmann
approved these changes
Oct 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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