From 4941a360cb66478feb1de33dddbd1f07be3f7af6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 13:02:17 -0800 Subject: [PATCH] fix: Restore import of LiteLLMExceptions in base_coder.py --- aider/coders/base_coder.py | 2 +- aider/exceptions.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 2029a2193..5867f54e6 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -19,10 +19,10 @@ from json.decoder import JSONDecodeError from pathlib import Path from typing import List -from aider.exceptions import LiteLLMExceptions from aider import __version__, models, prompts, urls, utils from aider.analytics import Analytics from aider.commands import Commands +from aider.exceptions import LiteLLMExceptions from aider.history import ChatSummary from aider.io import ConfirmGroup, InputOutput from aider.linter import Linter diff --git a/aider/exceptions.py b/aider/exceptions.py index 52558b576..fb473712a 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -12,18 +12,30 @@ EXCEPTIONS = [ ExInfo("APIConnectionError", True, None), ExInfo("APIError", True, None), ExInfo("APIResponseValidationError", True, None), - ExInfo("AuthenticationError", False, "The API provider is not able to authenticate you. Check your API key."), + ExInfo( + "AuthenticationError", + False, + "The API provider is not able to authenticate you. Check your API key.", + ), ExInfo("AzureOpenAIError", True, None), ExInfo("BadRequestError", False, None), ExInfo("BudgetExceededError", True, None), - ExInfo("ContentPolicyViolationError", True, "The API provider has refused the request due to a safety policy about the content."), - ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder + ExInfo( + "ContentPolicyViolationError", + True, + "The API provider has refused the request due to a safety policy about the content.", + ), + ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder ExInfo("InternalServerError", True, "The API provider's servers are down or overloaded."), ExInfo("InvalidRequestError", True, None), ExInfo("JSONSchemaValidationError", True, None), ExInfo("NotFoundError", False, None), ExInfo("OpenAIError", True, None), - ExInfo("RateLimitError", True, "The API provider has rate limited you. Try again later or check your quotas."), + ExInfo( + "RateLimitError", + True, + "The API provider has rate limited you. Try again later or check your quotas.", + ), ExInfo("RouterRateLimitError", True, None), ExInfo("ServiceUnavailableError", True, "The API provider's servers are down or overloaded."), ExInfo("UnprocessableEntityError", True, None),