Aider-AI / aider

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

Uncaught AttributeError in sendchat.py line 30 #2073

Closed Zersya closed 1 week ago

Zersya commented 1 week ago

Aider version: 0.56.0 Python version: 3.11.7 Platform: macOS-14.0-arm64-arm-64bit Python implementation: CPython Virtual environment: No OS: Darwin 23.0.0 (64bit) Git version: git version 2.46.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "utils.py", line 10022, in __next__
    chunk = next(self.completion_stream)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "chat.py", line 1365, in __next__
    return self.chunk_parser(chunk=data_json)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "chat.py", line 1325, in chunk_parser
    raise AnthropicError(
litellm.llms.anthropic.chat.AnthropicError: Overloaded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1124, in send_message
    exhausted = False
                ^^^^^^
  File "base_coder.py", line 1408, in send
    temp = self.temperature
        ^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1482, in show_send_output_stream
    show_resp = self.render_incremental_response(True)
  File "utils.py", line 10110, in __next__
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "utils.py", line 8194, in exception_type
    raise e
  File "utils.py", line 6680, in exception_type
    raise litellm.InternalServerError(
litellm.exceptions.InternalServerError: litellm.InternalServerError: AnthropicException - Overloaded. Handle with `litellm.InternalServerError`.

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 698, in main
    if args.lint or args.test or args.commit:
            ^^^^^^^^^^^
  File "base_coder.py", line 735, in run
    return

  File "base_coder.py", line 778, in run_one
    if self.num_reflections >= self.max_reflections:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1126, in send_message
    try:

  File "sendchat.py", line 30, in retry_exceptions
    litellm.llms.anthropic.chat.AnthropicError,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'litellm.llms.anthropic' has no attribute 'AnthropicError'
paul-gauthier commented 1 week ago

Thanks for trying aider and filing this issue.

This looks like a duplicate of #1414. Please see the comments there for more information, and feel free to continue the discussion within that issue.

I'm going to close this issue for now. But please let me know if you think this is actually a distinct issue and I will reopen this issue.