aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught AuthenticationError in utils.py line 6747

Open moonmonsta opened this issue 1 year ago • 0 comments

Aider version: 0.56.0 Python version: 3.12.5 Platform: Linux-6.10.7-200.fc40.x86_64-x86_64-with-glibc2.39 Python implementation: CPython Virtual environment: No OS: Linux 6.10.7-200.fc40.x86_64 (64bit) Git version: git version 2.46.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "openai.py", line 1033, in completion
    raise e
  File "openai.py", line 928, in completion
    openai_client = self._get_openai_client(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "openai.py", line 750, in _get_openai_client
    _new_client = OpenAI(
                  ^^^^^^^
  File "_client.py", line 105, in __init__
    raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

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 1041, in completion
    raise OpenAIError(status_code=500, message=traceback.format_exc())
litellm.llms.openai.OpenAIError: Traceback (most recent call last):
  File "openai.py", line 1033, in completion
    raise e
  File "openai.py", line 928, in completion
    openai_client = self._get_openai_client(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "openai.py", line 750, in _get_openai_client
    _new_client = OpenAI(
                  ^^^^^^^
  File "/home/jay/.local/lib/python3.12/site-packages/openai/_client.py", line 105, in __init__
    raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable


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 6747, in exception_type
    raise AuthenticationError(
litellm.exceptions.AuthenticationError: litellm.AuthenticationError: AuthenticationError: OpenAIException - Traceback (most recent call last):
  File "openai.py", line 1033, in completion
    raise e
  File "openai.py", line 928, in completion
    openai_client = self._get_openai_client(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "openai.py", line 750, in _get_openai_client
    _new_client = OpenAI(
                  ^^^^^^^
  File "/home/jay/.local/lib/python3.12/site-packages/openai/_client.py", line 105, in __init__
    raise OpenAIError(
openai.openaiError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable


moonmonsta avatar Sep 14 '24 23:09 moonmonsta