Skip to content

πŸ™Œ OpenHands: AI-Driven Development

retry for internal server error (#2806)

Xingyao Wang82f486047067
diff --git a/opendevin/llm/llm.py b/opendevin/llm/llm.py
index 021bc9c2fd..225252588a 100644
--- a/opendevin/llm/llm.py
+++ b/opendevin/llm/llm.py
@@ -8,6 +8,7 @@ from litellm import completion as litellm_completion
from litellm import completion_cost as litellm_completion_cost
from litellm.exceptions import (
APIConnectionError,
+ InternalServerError,
RateLimitError,
ServiceUnavailableError,
)
@@ -184,7 +185,12 @@ class LLM:
stop=stop_after_attempt(num_retries),
wait=wait_random_exponential(min=retry_min_wait, max=retry_max_wait),
retry=retry_if_exception_type(
- (RateLimitError, APIConnectionError, ServiceUnavailableError)
+ (
+ RateLimitError,
+ APIConnectionError,
+ ServiceUnavailableError,
+ InternalServerError,
+ )
),
after=attempt_on_error,
)