Skip to content

Commit

Permalink
retry for internal server error (All-Hands-AI#2806)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww authored Jul 5, 2024
1 parent 298956c commit 82f4860
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion opendevin/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from litellm import completion_cost as litellm_completion_cost
from litellm.exceptions import (
APIConnectionError,
InternalServerError,
RateLimitError,
ServiceUnavailableError,
)
Expand Down Expand Up @@ -184,7 +185,12 @@ def attempt_on_error(retry_state):
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,
)
Expand Down

0 comments on commit 82f4860

Please sign in to comment.