-
Notifications
You must be signed in to change notification settings - Fork 8
[EAGLE-7083]: Add retry logic to OpenAI API calls #878
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
base: master
Are you sure you want to change the base?
Conversation
Implements an automatic retry mechanism for OpenAI API calls to handle transient `httpx.ConnectError` exceptions. - Adds `tenacity` as a dependency. - Wraps all OpenAI API calls in `OpenAIModelClass` with a `@retry` decorator. - Configures the retry to happen up to 3 times with exponential backoff on `httpx.ConnectError`.
|
@copilot, fix tests |
|
@patricklundquist I've opened a new pull request, #879, to work on those changes. Once the pull request is ready, I'll request review from you. |
…879) * Initial plan * Fix tests: Add missing mock methods to MockOpenAIClient Add models.list(), images.generate(), and embeddings.create() mock methods to MockOpenAIClient to support the retry logic that was added to OpenAIModelClass. Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com>
|
@copilot fix per the build test failures |
|
@patricklundquist I've opened a new pull request, #894, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Add httpx dependency for retry logic httpx is imported in openai_class.py for ConnectError exception but was missing from requirements.txt. This was causing import failures during tests. Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com>
Minimum allowed line rate is |
ackizilkale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks food
Implements an automatic retry mechanism for OpenAI API calls to handle transient
httpx.ConnectErrorexceptions.tenacityas a dependency.OpenAIModelClasswith a@retrydecorator.httpx.ConnectError.