-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Parse the Azure OpenAI rate limit message #5956
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
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
8d2d9c5 to
ade1eaa
Compare
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for the contribution, and apologies for the slow response. We were overwhelmed by PR request, and we're catching up on the backlog. I think this is a good change, but it would be better if it's a little more surgical. I'm guessing that it's AI-generated. Please take a look at my comments and questions. |
24df41c to
e28332e
Compare
|
I've updated the PR to be the bare minimum diff necessary. It was written with LLM assistance but ultimately the choice to defensively handle other units was mine. I've done some more research and it looks like Azure does always return seconds, so I've reverted that part. (also your response wasn't slow at all, I'm used to corporate open source projects taking much longer to review community PRs, so thank you!) |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Thanks again for the contribution! This will improve the experience for a lot of Azure OpenAI users. |
Fixes #4161
Currently Codex uses a regex to parse the "Please try again in 1.898s" OpenAI-style rate limit message, so that it can wait the correct duration before retrying. Azure OpenAI returns a different error that looks like "Rate limit exceeded. Try again in 35 seconds."
This PR extends the regex and parsing code to match in a more fuzzy manner, handling anything matching the pattern "try again in <duration><unit>".