fix litellm openai imports (#13307)

pull/13322/head
Krish Dholakia 11 months ago committed by GitHub
parent 1c67db4c18
commit 5a920e14c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,14 +62,13 @@ def _create_retry_decorator(
] = None,
) -> Callable[[Any], Any]:
"""Returns a tenacity retry decorator, preconfigured to handle PaLM exceptions"""
import openai
import litellm
errors = [
openai.error.Timeout,
openai.error.APIError,
openai.error.APIConnectionError,
openai.error.RateLimitError,
openai.error.ServiceUnavailableError,
litellm.Timeout,
litellm.APIError,
litellm.APIConnectionError,
litellm.RateLimitError,
]
return create_base_retry_decorator(
error_types=errors, max_retries=llm.max_retries, run_manager=run_manager

Loading…
Cancel
Save