Skip to content

AnthropicBedrock retry policy not consistent with Bedrock Response #940

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

Open
RonakPai opened this issue Apr 14, 2025 · 0 comments
Open

AnthropicBedrock retry policy not consistent with Bedrock Response #940

RonakPai opened this issue Apr 14, 2025 · 0 comments

Comments

@RonakPai
Copy link

The should_retry function defined here https://github.com/anthropics/anthropic-sdk-python/blob/main/src/anthropic/_base_client.py#L747 does not always correctly correspond with the errors that should be retried from the Bedrock server responses.

For example, while streaming response, it's possible to occasionally get the below error from Bedrock with status code 400. This would not be retried by the SDK, but should be.

Image

Would it be feasible to allow the user to input their own should_retry function like they do for max_retries? Happy to open a PR here as well

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

No branches or pull requests

1 participant