Skip to content

Commit

Permalink
Retry on litellm's APIError, which includes 502 (#4167)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst authored Oct 2, 2024
1 parent e059443 commit 1abfd3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openhands/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from litellm import completion_cost as litellm_completion_cost
from litellm.exceptions import (
APIConnectionError,
APIError,
InternalServerError,
RateLimitError,
ServiceUnavailableError,
Expand All @@ -31,6 +32,7 @@
# tuple of exceptions to retry on
LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (
APIConnectionError,
APIError,
InternalServerError,
RateLimitError,
ServiceUnavailableError,
Expand Down

0 comments on commit 1abfd3b

Please sign in to comment.