AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
handle API timeouts (#3024)
Soheil Sam Yasrebi794a164098dc
diff --git a/autogpt/llm_utils.py b/autogpt/llm_utils.pyindex ba7521a459..cc650f21f7 100644--- a/autogpt/llm_utils.py+++ b/autogpt/llm_utils.py@@ -5,7 +5,7 @@ from typing import List, Optionalimport openaifrom colorama import Fore, Style-from openai.error import APIError, RateLimitError+from openai.error import APIError, RateLimitError, Timeoutfrom autogpt.api_manager import api_managerfrom autogpt.config import Config@@ -123,7 +123,7 @@ def create_chat_completion(+ f"You can read more here: {Fore.CYAN}https://github.com/Significant-Gravitas/Auto-GPT#openai-api-keys-configuration{Fore.RESET}")warned_user = True- except APIError as e:+ except (APIError, Timeout) as e:if e.http_status != 502:raiseif attempt == num_retries - 1:@@ -172,7 +172,7 @@ def create_embedding_with_ada(text) -> list:)except RateLimitError:pass- except APIError as e:+ except (APIError, Timeout) as e:if e.http_status != 502:raiseif attempt == num_retries - 1: