|
@@ -8,6 +8,7 @@ from litellm import completion as litellm_completion
|
|
|
from litellm import completion_cost as litellm_completion_cost
|
|
from litellm import completion_cost as litellm_completion_cost
|
|
|
from litellm.exceptions import (
|
|
from litellm.exceptions import (
|
|
|
APIConnectionError,
|
|
APIConnectionError,
|
|
|
|
|
+ InternalServerError,
|
|
|
RateLimitError,
|
|
RateLimitError,
|
|
|
ServiceUnavailableError,
|
|
ServiceUnavailableError,
|
|
|
)
|
|
)
|
|
@@ -184,7 +185,12 @@ class LLM:
|
|
|
stop=stop_after_attempt(num_retries),
|
|
stop=stop_after_attempt(num_retries),
|
|
|
wait=wait_random_exponential(min=retry_min_wait, max=retry_max_wait),
|
|
wait=wait_random_exponential(min=retry_min_wait, max=retry_max_wait),
|
|
|
retry=retry_if_exception_type(
|
|
retry=retry_if_exception_type(
|
|
|
- (RateLimitError, APIConnectionError, ServiceUnavailableError)
|
|
|
|
|
|
|
+ (
|
|
|
|
|
+ RateLimitError,
|
|
|
|
|
+ APIConnectionError,
|
|
|
|
|
+ ServiceUnavailableError,
|
|
|
|
|
+ InternalServerError,
|
|
|
|
|
+ )
|
|
|
),
|
|
),
|
|
|
after=attempt_on_error,
|
|
after=attempt_on_error,
|
|
|
)
|
|
)
|