Skip to content

Log number of retries at INFO level #2404

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
1 task done
billierinaldi opened this issue Jun 10, 2025 · 0 comments
Open
1 task done

Log number of retries at INFO level #2404

billierinaldi opened this issue Jun 10, 2025 · 0 comments

Comments

@billierinaldi
Copy link

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

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