Skip to content

Commit

Permalink
Add common exceptions for retry
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Feb 26, 2025
1 parent 772b577 commit 77609ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion openhands/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@
__all__ = ['LLM']

# tuple of exceptions to retry on
LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (RateLimitError,)
LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (
APIConnectionError,
# FIXME: APIError is useful on 502 from a proxy for example,
# but it also retries on other errors that are permanent
APIError,
InternalServerError,
RateLimitError,
ServiceUnavailableError,
)

# cache prompt supporting models
# remove this when we gemini and deepseek are supported
Expand Down

0 comments on commit 77609ee

Please sign in to comment.