Skip to content

Commit

Permalink
Retry 503 OpenAI errors
Browse files Browse the repository at this point in the history
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
  • Loading branch information
waynehamadi committed Jun 19, 2023
1 parent abb397e commit c5514df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogpt/llm/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _wrapped(*args, **kwargs):
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)
Expand Down

0 comments on commit c5514df

Please sign in to comment.