paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
19.62k stars 1.8k forks source link

Uncaught AttributeError in sendchat.py line 30 #1844

Closed jsgoecke closed 4 hours ago

jsgoecke commented 4 hours ago

Aider version: 0.58.0 Python version: 3.10.14 Platform: macOS-15.0-arm64-arm-64bit Python implementation: CPython Virtual environment: No OS: Darwin 24.0.0 (64bit) Git version: git version 2.46.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "openai.py", line 778, in completion
    raise e
  File "openai.py", line 729, in completion
    return convert_to_model_response_object(
  File "utils.py", line 5821, in convert_to_model_response_object
    raise raised_exception
Exception

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 2051, in completion
    response = openai_chat_completions.completion(
  File "openai.py", line 788, in completion
    raise OpenAIError(
litellm.llms.OpenAI.openai.OpenAIError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1129, in send_message
    yield from self.send(messages, functions=self.functions)
  File "base_coder.py", line 1410, in send
    hash_object, completion = send_completion(
  File "sendchat.py", line 83, in send_completion
    res = litellm.completion(**kwargs)
  File "utils.py", line 1063, in wrapper
    raise e
  File "utils.py", line 947, in wrapper
    result = original_function(*args, **kwargs)
  File "main.py", line 2900, in completion
    raise exception_type(
  File "exception_mapping_utils.py", line 2033, in exception_type
    raise e
  File "exception_mapping_utils.py", line 1966, in exception_type
    raise APIError(
litellm.exceptions.APIError: litellm.APIError: APIError: OpenrouterException - 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
  File "main.py", line 727, in main
    coder.run()
  File "base_coder.py", line 730, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 773, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1131, in send_message
    except retry_exceptions() as err:
  File "sendchat.py", line 30, in retry_exceptions
    litellm.llms.anthropic.chat.AnthropicError,
AttributeError: module 'litellm.llms.anthropic.chat' has no attribute 'AnthropicError'
fry69 commented 4 hours ago

Thank you for filing this issue.

Please do not forget to exit and restart aider after it updated itself.

Duplicate #1278