feat(cohere): add timeout and max_retries to chat generator#2873
Open
Keyur-S-Patel wants to merge 2 commits intodeepset-ai:mainfrom
Open
feat(cohere): add timeout and max_retries to chat generator#2873Keyur-S-Patel wants to merge 2 commits intodeepset-ai:mainfrom
Keyur-S-Patel wants to merge 2 commits intodeepset-ai:mainfrom
Conversation
7c13187 to
f961fe7
Compare
Contributor
Author
Keyur-S-Patel
commented
Mar 5, 2026
Contributor
Author
Keyur-S-Patel
left a comment
There was a problem hiding this comment.
Gentle reminder about pr review @julian-risch
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.
Related Issues
Proposed Changes:
timeoutandmax_retriestoCohereChatGenerator.__init__as keyword-only params (aligned with Anthropic pattern).httpxtransport injection:HTTPTransport(retries=max_retries)AsyncHTTPTransport(retries=max_retries)httpx_clientintoClientV2/AsyncClientV2whenmax_retriesis set.**kwargsmerged intogeneration_kwargs).to_dict/from_dictexpectations fortimeoutandmax_retries.CohereGeneratortests to reflect current inherited behavior (generation_kwargsinstead of removedmodel_parameters).How did you test it?
hatch run test:unit tests/test_chat_generator.pyhatch run test:unit tests/test_generator.pyhatch run test:unit tests(full Cohere unit suite)All unit tests passed on this branch.
Notes for the reviewer
max_retriesis implemented viahttpxtransport retries because directmax_retriesconstructor support onClientV2is not consistent across environments/versions.tests/test_generator.pyfor currentCohereGeneratorbehavior.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.