aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught NotFoundError in utils.py line 7480

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-41-generic-x86_64-with-glibc2.39 Python implementation: CPython Virtual environment: Yes OS: Linux 6.8.0-41-generic (64bit) Git version: git version 2.43.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "vertex_httpx.py", line 1481, in completion
    response.raise_for_status()
  File "_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5:generateContent?key=AIzaSyAJdEpOLj80WvggpYByemvYBXJVrk50730'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 2006, in completion
    response = vertex_chat_completion.completion(  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "vertex_httpx.py", line 1484, in completion
    raise VertexAIError(status_code=error_code, message=err.response.text)
litellm.llms.vertex_httpx.VertexAIError: {
  "error": {
    "code": 404,
    "message": "models/gemini-1.5 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.",
    "status": "NOT_FOUND"
  }
}


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 7480, in exception_type
    raise NotFoundError(
litellm.exceptions.NotFoundError: litellm.NotFoundError: VertexAIException - {
  "error": {
    "code": 404,
    "message": "models/gemini-1.5 is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.",
    "status": "NOT_FOUND"
  }
}


kotiacash avatar Sep 10 '24 22:09 kotiacash

Thanks for trying aider and filing this issue.

It looks like you have specified an invalid vertex LLM model?

When reporting problems, it is very helpful if you can provide:

  • Aider version
  • LLM model you are using
  • A description of what you were doing when the error happened.

Including the “announcement” lines that aider prints at startup is an easy way to share some of this helpful info.

Aider v0.37.1-dev
Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo
Git repo: .git with 243 files
Repo-map: using 1024 tokens

paul-gauthier avatar Sep 11 '24 21:09 paul-gauthier

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

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