mirror of
https://github.com/hwchase17/langchain
synced 2024-11-16 06:13:16 +00:00
fix litellm openai imports (#13307)
This commit is contained in:
parent
1c67db4c18
commit
5a920e14c0
@ -62,14 +62,13 @@ def _create_retry_decorator(
|
|||||||
] = None,
|
] = None,
|
||||||
) -> Callable[[Any], Any]:
|
) -> Callable[[Any], Any]:
|
||||||
"""Returns a tenacity retry decorator, preconfigured to handle PaLM exceptions"""
|
"""Returns a tenacity retry decorator, preconfigured to handle PaLM exceptions"""
|
||||||
import openai
|
import litellm
|
||||||
|
|
||||||
errors = [
|
errors = [
|
||||||
openai.error.Timeout,
|
litellm.Timeout,
|
||||||
openai.error.APIError,
|
litellm.APIError,
|
||||||
openai.error.APIConnectionError,
|
litellm.APIConnectionError,
|
||||||
openai.error.RateLimitError,
|
litellm.RateLimitError,
|
||||||
openai.error.ServiceUnavailableError,
|
|
||||||
]
|
]
|
||||||
return create_base_retry_decorator(
|
return create_base_retry_decorator(
|
||||||
error_types=errors, max_retries=llm.max_retries, run_manager=run_manager
|
error_types=errors, max_retries=llm.max_retries, run_manager=run_manager
|
||||||
|
Loading…
Reference in New Issue
Block a user