mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
fix: update litellm exception imports and error handling
This commit is contained in:
parent
513f06be46
commit
8e2a4b47d6
1 changed files with 13 additions and 13 deletions
|
@ -25,18 +25,18 @@ def retry_exceptions():
|
||||||
httpx.RemoteProtocolError,
|
httpx.RemoteProtocolError,
|
||||||
httpx.ReadTimeout,
|
httpx.ReadTimeout,
|
||||||
# litellm
|
# litellm
|
||||||
litellm.AuthenticationError,
|
litellm.exceptions.AuthenticationError,
|
||||||
litellm.PermissionDeniedError,
|
litellm.exceptions.PermissionDeniedError,
|
||||||
litellm.NotFoundError,
|
litellm.exceptions.NotFoundError,
|
||||||
litellm.UnprocessableEntityError,
|
litellm.exceptions.UnprocessableEntityError,
|
||||||
litellm.RateLimitError,
|
litellm.exceptions.RateLimitError,
|
||||||
litellm.InternalServerError,
|
litellm.exceptions.InternalServerError,
|
||||||
litellm.ContextWindowExceededError,
|
litellm.exceptions.ContextWindowExceededError,
|
||||||
litellm.ContentPolicyViolationError,
|
litellm.exceptions.ContentPolicyViolationError,
|
||||||
litellm.APIConnectionError,
|
litellm.exceptions.APIConnectionError,
|
||||||
litellm.APIError,
|
litellm.exceptions.APIError,
|
||||||
litellm.ServiceUnavailableError,
|
litellm.exceptions.ServiceUnavailableError,
|
||||||
litellm.Timeout,
|
litellm.exceptions.Timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,5 +110,5 @@ def simple_send_with_retries(model_name, messages, extra_params=None):
|
||||||
|
|
||||||
_hash, response = send_completion(**kwargs)
|
_hash, response = send_completion(**kwargs)
|
||||||
return response.choices[0].message.content
|
return response.choices[0].message.content
|
||||||
except (AttributeError, litellm.BadRequestError):
|
except AttributeError:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue