Skip to content

AnthropicBedrock retry policy not consistent with Bedrock Response #940

Open
@RonakPai

Description

@RonakPai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions