Skip to content

Log number of retries at INFO level #2404

Open
@billierinaldi

Description

@billierinaldi

Confirm this is a feature request for the Python library and not the underlying OpenAI API.

  • This is a feature request for the Python library

Describe the feature or improvement you're requesting

In the _sleep_for_retry methods in _base_client.py, the fact that a retry is happening is logged at the INFO level, but the retries_taken and max_retries are only logged at DEBUG level. It would be useful to add the information "retry {retries_taken} of {max_retries}" to the INFO log, and the DEBUG logs would no longer be necessary. Since there is already a log statement at INFO level, it would not be increasing the verbosity of the logging.

https://github.com/openai/openai-python/blob/main/src/openai/_base_client.py#L1051
https://github.com/openai/openai-python/blob/main/src/openai/_base_client.py#L1569

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions