Explorar o código

Retry on litellm's APIError, which includes 502 (#4167)

Engel Nyst hai 1 ano
pai
achega
1abfd3b808
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      openhands/llm/llm.py

+ 2 - 0
openhands/llm/llm.py

@@ -14,6 +14,7 @@ from litellm import completion as litellm_completion
 from litellm import completion_cost as litellm_completion_cost
 from litellm.exceptions import (
     APIConnectionError,
+    APIError,
     InternalServerError,
     RateLimitError,
     ServiceUnavailableError,
@@ -31,6 +32,7 @@ __all__ = ['LLM']
 # tuple of exceptions to retry on
 LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (
     APIConnectionError,
+    APIError,
     InternalServerError,
     RateLimitError,
     ServiceUnavailableError,