diff options
author | Merwane Hamadi <merwanehamadi@gmail.com> | 2023-06-19 12:49:56 -0700 |
---|---|---|
committer | Merwane Hamadi <merwanehamadi@gmail.com> | 2023-06-19 13:12:33 -0700 |
commit | 1fead303a0955d60730f1c46ac33321487326003 (patch) | |
tree | 38c1252c1fa8acfe9405f2397ca8226397a9a4f0 | |
parent | Release v0.4.1 (#4686) (diff) | |
download | Auto-GPT-1fead303a0955d60730f1c46ac33321487326003.tar.gz Auto-GPT-1fead303a0955d60730f1c46ac33321487326003.tar.bz2 Auto-GPT-1fead303a0955d60730f1c46ac33321487326003.zip |
Retry 503 OpenAI errorsv0.4.2
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
-rw-r--r-- | autogpt/llm/utils/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/autogpt/llm/utils/__init__.py b/autogpt/llm/utils/__init__.py index 736745cf8..cd2c1c0a3 100644 --- a/autogpt/llm/utils/__init__.py +++ b/autogpt/llm/utils/__init__.py @@ -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) |