π OpenHands: AI-Driven Development
Retry on litellm's APIError, which includes 502 (#4167)
Engel Nyst1abfd3b8082a
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.pyindex c9088b3955..11a34a5121 100644--- a/openhands/llm/llm.py+++ b/openhands/llm/llm.py@@ -14,6 +14,7 @@ from litellm import completion as litellm_completionfrom litellm import completion_cost as litellm_completion_costfrom litellm.exceptions import (APIConnectionError,+ APIError,InternalServerError,RateLimitError,ServiceUnavailableError,@@ -31,6 +32,7 @@ __all__ = ['LLM']# tuple of exceptions to retry onLLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (APIConnectionError,+ APIError,InternalServerError,RateLimitError,ServiceUnavailableError,