From 8e2a4b47d643c7f74c0076c38f75cffac1d0e55e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 28 Oct 2024 14:29:42 -0700 Subject: [PATCH] fix: update litellm exception imports and error handling --- aider/sendchat.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/aider/sendchat.py b/aider/sendchat.py index 1a27c1a25..f860f2327 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -25,18 +25,18 @@ def retry_exceptions(): httpx.RemoteProtocolError, httpx.ReadTimeout, # litellm - litellm.AuthenticationError, - litellm.PermissionDeniedError, - litellm.NotFoundError, - litellm.UnprocessableEntityError, - litellm.RateLimitError, - litellm.InternalServerError, - litellm.ContextWindowExceededError, - litellm.ContentPolicyViolationError, - litellm.APIConnectionError, - litellm.APIError, - litellm.ServiceUnavailableError, - litellm.Timeout, + litellm.exceptions.AuthenticationError, + litellm.exceptions.PermissionDeniedError, + litellm.exceptions.NotFoundError, + litellm.exceptions.UnprocessableEntityError, + litellm.exceptions.RateLimitError, + litellm.exceptions.InternalServerError, + litellm.exceptions.ContextWindowExceededError, + litellm.exceptions.ContentPolicyViolationError, + litellm.exceptions.APIConnectionError, + litellm.exceptions.APIError, + litellm.exceptions.ServiceUnavailableError, + litellm.exceptions.Timeout, ) @@ -110,5 +110,5 @@ def simple_send_with_retries(model_name, messages, extra_params=None): _hash, response = send_completion(**kwargs) return response.choices[0].message.content - except (AttributeError, litellm.BadRequestError): + except AttributeError: return