paul-gauthier / aider

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

Uncaught AttributeError in sendchat.py line 30 #1771

Closed shock closed 3 days ago

shock commented 3 days ago

Model: deepseek/deepseek-coder with diff edit format, prompt cache, infinite output Git repo: .git with 16 files Repo-map: using 1024 tokens, auto refresh

...

Aider version: 0.56.0 Python version: 3.12.4 Platform: macOS-14.4.1-arm64-arm-64bit Python implementation: CPython Virtual environment: No OS: Darwin 23.4.0 (64bit) Git version: git version 2.46.2

An uncaught exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1124, in send_message
    continue
  File "base_coder.py", line 1413, in send
    format_content("ASSISTANT", self.partial_response_content),
    ^^^^^^^^^
  File "base_coder.py", line 1408, in send
    self.keyboard_interrupt()
        ^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1482, in show_send_output_stream
    func = chunk.choices[0].delta.function_call
  File "utils.py", line 10027, in __next__
    response: Optional[ModelResponse] = self.chunk_creator(chunk=chunk)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "utils.py", line 9837, in chunk_creator
    choice_json = choice.model_dump()
                  ^^^^^^^^^^^^^^^^^^^
  File "main.py", line 390, in model_dump
    return self.__pydantic_serializer__.to_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt

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
    return 1
  File "base_coder.py", line 735, in run
    return self.io.get_input(
                ^^^^^^^^^^^^^^
  File "base_coder.py", line 778, in run_one
    def check_for_urls(self, inp):
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1126, in send_message
    interrupted = True
       ^^^^^^^^^^^^^^^^
  File "sendchat.py", line 30, in retry_exceptions
    litellm.llms.anthropic.chat.AnthropicError,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'litellm.llms.anthropic' has no attribute 'AnthropicError'
fry69 commented 3 days ago

Thank you for filing this issue.

The fix is in the latest version (0.57.1), please update aider with

aider --upgrade

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

Duplicate #1278