Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using gemini-1.5-pro #4172

Closed
alanreynosov opened this issue Jun 13, 2024 · 7 comments
Closed

Error using gemini-1.5-pro #4172

alanreynosov opened this issue Jun 13, 2024 · 7 comments

Comments

@alanreynosov
Copy link

Getting this trying to use gemini-1.5-pro

15:39:02 - opendevin:INFO: agent_controller.py:183 - [Agent Controller 8d07b043-c7d8-476b-b2da-96b2314f8dbf] Setting agent(CodeActAgent) state from AgentState.LOADING to AgentState.INIT
15:39:02 - opendevin:INFO: agent_controller.py:127 - [Agent Controller 8d07b043-c7d8-476b-b2da-96b2314f8dbf] Starting step loop...
INFO:     192.168.65.1:40365 - "GET /api/list-files?path=/ HTTP/1.1" 200 OK
15:39:06 - opendevin:INFO: browser_env.py:58 - Browser env started.
15:39:09 - OBSERVATION
**MessageAction** (source=EventSource.USER)
CONTENT: test
15:39:09 - opendevin:INFO: agent_controller.py:183 - [Agent Controller 8d07b043-c7d8-476b-b2da-96b2314f8dbf] Setting agent(CodeActAgent) state from AgentState.INIT to AgentState.RUNNING
INFO:     192.168.65.1:21319 - "GET /api/list-files?path=/ HTTP/1.1" 200 OK


==============
CodeActAgent LEVEL 0 STEP 0


Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai.py", line 559, in completion
    import vertexai
ModuleNotFoundError: No module named 'vertexai'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 1901, in completion
    model_response = vertex_ai.completion(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai.py", line 561, in completion
    raise VertexAIError(
litellm.llms.vertex_ai.VertexAIError: vertexai import failed please run `pip install google-cloud-aiplatform`

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/opendevin/controller/agent_controller.py", line 130, in _start_step_loop
    await self._step()
  File "/app/opendevin/controller/agent_controller.py", line 290, in _step
    action = self.agent.step(self.state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/agenthub/codeact_agent/codeact_agent.py", line 228, in step
    response = self.llm.do_completion(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/llm/llm.py", line 217, in do_completion
    resp = self._completion(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 330, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 467, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 368, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 390, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 470, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/llm/llm.py", line 197, in wrapper
    resp = completion_unwrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3415, in wrapper
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3306, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 2447, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 9989, in exception_type
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 9173, in exception_type
    raise BadRequestError(
litellm.exceptions.BadRequestError: VertexAIException BadRequestError - vertexai import failed please run `pip install google-cloud-aiplatform`
15:39:10 - opendevin:ERROR: agent_controller.py:136 - Error while running the agent: VertexAIException BadRequestError - vertexai import failed please run `pip install google-cloud-aiplatform`
15:39:10 - opendevin:ERROR: agent_controller.py:137 - Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai.py", line 559, in completion
    import vertexai
ModuleNotFoundError: No module named 'vertexai'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 1901, in completion
    model_response = vertex_ai.completion(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai.py", line 561, in completion
    raise VertexAIError(
litellm.llms.vertex_ai.VertexAIError: vertexai import failed please run `pip install google-cloud-aiplatform`

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/opendevin/controller/agent_controller.py", line 130, in _start_step_loop
    await self._step()
  File "/app/opendevin/controller/agent_controller.py", line 290, in _step
    action = self.agent.step(self.state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/agenthub/codeact_agent/codeact_agent.py", line 228, in step
    response = self.llm.do_completion(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/llm/llm.py", line 217, in do_completion
    resp = self._completion(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 330, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 467, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 368, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 390, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 470, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/opendevin/llm/llm.py", line 197, in wrapper
    resp = completion_unwrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3415, in wrapper
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 3306, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 2447, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 9989, in exception_type
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 9173, in exception_type
    raise BadRequestError(
litellm.exceptions.BadRequestError: VertexAIException BadRequestError - vertexai import failed please run `pip install google-cloud-aiplatform`

15:39:10 - opendevin:INFO: agent_controller.py:183 - [Agent Controller 8d07b043-c7d8-476b-b2da-96b2314f8dbf] Setting agent(CodeActAgent) state from AgentState.RUNNING to AgentState.ERROR
INFO:     192.168.65.1:21319 - "GET /api/list-files?path=/ HTTP/1.1" 200 OK
@ishaan-jaff
Copy link
Contributor

@alanreynosov is this with litellm proxy server ? or litellm python SDK ?

Can you run pip install google-cloud-aiplatform and see if the issue is solved

@alanreynosov
Copy link
Author

alanreynosov commented Jun 14, 2024

I assume litellm because this output

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

installed both, google-cloud-aiplatform and vertexai, now requesting for google auth default application credentials

litellm.exceptions.APIError: VertexAIException APIError - Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

@krrishdholakia
Copy link
Contributor

that looks like it came from google.

Were you trying to use Google AI studio or Vertex AI @alanreynosov

if google ai studio, just append gemini/ to the model name

@alanreynosov
Copy link
Author

Got it, Ian using it with open devin, let me take a look , ty

@krrishdholakia
Copy link
Contributor

@alanreynosov bump on this - was this litellm related?

@toniengelhardt
Copy link
Contributor

Might be related to #4333

@krrishdholakia
Copy link
Contributor

unrelated @toniengelhardt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants