aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught APIError in utils.py line 6841

Open kotiacash opened this issue 1 year ago • 1 comments

Aider version: 0.56.0 Python version: 3.12.3 Platform: Linux-6.8.0-44-generic-x86_64-with-glibc2.39 Python implementation: CPython Virtual environment: Yes OS: Linux 6.8.0-44-generic (64bit) Git version: git version 2.43.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "openai.py", line 1033, in completion
    raise e
  File "openai.py", line 966, in completion
    return convert_to_model_response_object(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "utils.py", line 6016, 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 1345, in completion
    raise e
  File "main.py", line 1318, in completion
    response = openai_chat_completions.completion(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "openai.py", line 1039, in completion
    raise OpenAIError(status_code=e.status_code, message=str(e))
litellm.llms.openai.OpenAIError

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
    coder.run()
  File "base_coder.py", line 735, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 778, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1202, in send_message
    saved_message = self.auto_commit(edited)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1885, in auto_commit
    res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repo.py", line 102, in commit
    commit_message = self.get_commit_message(diffs, context)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "repo.py", line 187, in get_commit_message
    commit_message = simple_send_with_retries(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 44, in wrapper
    return decorated_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 106, in simple_send_with_retries
    _hash, response = send_completion(**kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 86, in send_completion
    res = litellm.completion(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "utils.py", line 1078, in wrapper
    raise e
  File "utils.py", line 966, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "main.py", line 2766, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "utils.py", line 8438, in exception_type
    raise e
  File "utils.py", line 6841, in exception_type
    raise APIError(
litellm.exceptions.APIError: litellm.APIError: APIError: OpenAIException - 

kotiacash avatar Sep 16 '24 11:09 kotiacash

Thank you for filing this issue.

Without more context (e.g. the actual error message from OpenAI) this error is inconclusive.

Can you please provide more background? What model were you using? Did you see any additional error somewhere?

fry69 avatar Sep 16 '24 11:09 fry69

This looks like a duplicate of #1406, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue.

paul-gauthier avatar Sep 20 '24 18:09 paul-gauthier