From 1abfd3b8082aa11b4eb4ec2e463ceb7cf6912c6e Mon Sep 17 00:00:00 2001 From: Engel Nyst Date: Thu, 3 Oct 2024 01:54:49 +0200 Subject: [PATCH] Retry on litellm's APIError, which includes 502 (#4167) --- openhands/llm/llm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index c9088b39550f..11a34a51218a 100644 --- a/openhands/llm/llm.py +++ b/openhands/llm/llm.py @@ -14,6 +14,7 @@ from litellm import completion_cost as litellm_completion_cost from litellm.exceptions import ( APIConnectionError, + APIError, InternalServerError, RateLimitError, ServiceUnavailableError, @@ -31,6 +32,7 @@ # tuple of exceptions to retry on LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = ( APIConnectionError, + APIError, InternalServerError, RateLimitError, ServiceUnavailableError,