Skip to content
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

Respect the retry time from a 429 #1108

Open
1 task done
BjoernRave opened this issue Sep 30, 2024 · 2 comments
Open
1 task done

Respect the retry time from a 429 #1108

BjoernRave opened this issue Sep 30, 2024 · 2 comments

Comments

@BjoernRave
Copy link

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

  • This is a feature request for the Node library

Describe the feature or improvement you're requesting

The library is already able to retry failed requests, but only "Certain errors will be automatically retried 2 times by default, with a short exponential backoff. ". this sugests that all error types will be handled the same. For 429 the API actually returns a time in seconds when the request should be retried. It would be great if the library would respect this and only retry after the given time.

Additional context

429 Requests to the ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-15-preview have exceeded token rate limit of your current OpenAI S0 pricing tier. Please retry after 33 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.

@RobertCraigie
Copy link
Collaborator

The SDK should already respect any explicit retry timeouts, maybe you're seeing that error because the retry limit was reached?

@BjoernRave
Copy link
Author

just searched the code, should've done it before opening the issue and it seems that in fact its respecting the retry-after header, as long as the time is not more than 60 seconds:

// About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
. Maybe documenting this could be good, but then I need to check my code again

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

2 participants