mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-01 05:14:20 +01:00
Retry 503 OpenAI errors (#4745)
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
@@ -97,7 +97,9 @@ def retry_openai_api(
|
||||
user_warned = True
|
||||
|
||||
except APIError as e:
|
||||
if (e.http_status not in [502, 429]) or (attempt == num_attempts):
|
||||
if (e.http_status not in [429, 502, 503]) or (
|
||||
attempt == num_attempts
|
||||
):
|
||||
raise
|
||||
|
||||
backoff = backoff_base ** (attempt + 2)
|
||||
|
||||
Reference in New Issue
Block a user