You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the error will not contain the retry-after header.
openai.error.RateLimitError: The server is currently overloaded with other requests. Sorry about that! You can retry your request, or contact us through an Azure support request at: https://go.microsoft.com/fwlink/?linkid=2213926 if the error persists.
vi issue.md
ISSUE=$(cat issue.md)
gpt ask --dir src/gpt_review/ "$ISSUE determine which file must be updated to fix this issue, and suggest a way to fix it"
Response
To fix this issue, you should update the _call_gpt() function in the _openai.py file. The function currently assumes the presence of a Retry-After header in the error object, but as the error message suggests, it might not always be present. You can add a fallback value for the retry_after variable in case the header is missing.
In this example, I've changed the line that retrieves the Retry-After header to use the get() method, which allows providing a default value (C.DEFAULT_RETRY_AFTER) if the header is not present. Make sure to define C.DEFAULT_RETRY_AFTER with a suitable default value in the configuration/constants module.
gpt-review/src/gpt_review/_openai.py
Line 114 in 714d9ff
Sometimes the error will not contain the
retry-after
header.openai.error.RateLimitError: The server is currently overloaded with other requests. Sorry about that! You can retry your request, or contact us through an Azure support request at: https://go.microsoft.com/fwlink/?linkid=2213926 if the error persists.
https://github.com/microsoft/gpt-review/actions/runs/4994531239/jobs/8945207747#step:7:191
The text was updated successfully, but these errors were encountered: