googleapis / python-aiplatform

A Python SDK for Vertex AI, a fully managed, end-to-end platform for data science and machine learning.
Apache License 2.0
581 stars 320 forks source link

Reasoning Engine Error #4022

Open dtcyad1 opened 1 week ago

dtcyad1 commented 1 week ago

Hi,

Getting this error in both local and deployed versions. I it happening very frequently.

Environment details

Steps to reproduce

  1. During local testing, the error pops out at the creation of the agent
  2. ?

Code example

agent = reasoning_engines.LangchainAgent(
    prompt=prompt,
    model=model,
    chat_history=get_session_history,
    model_kwargs={"temperature": 0},
    tools=[get_retail_products_function],
    agent_executor_kwargs={"return_intermediate_steps": True},
)

Local Trace

Stack trace

Exception has occurred: InternalServerError
500 Internal error occurred.
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INTERNAL
    details = "Internal error occurred."
    debug_error_string = "UNKNOWN:Error received from peer ipv4:142.250.64.170:443 {created_time:"2024-06-27T16:23:11.783472-04:00", grpc_status:13, grpc_message:"Internal error occurred."}"

Deployed trace from Logs Explorer: Reasoning Engine Execution failed. Error Details: {"detail":"Traceback (most recent call last):\n File \"/usr/local/lib/python3.11/site-packages/google/api_core/grpc_helpers.py\", line 116, in next\n return next(self._wrapped)\n ^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/grpc/_channel.py\", line 543, in next\n return self._next()\n ^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/grpc/_channel.py\", line 969, in _next\n raise self\ngrpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:\n\tstatus = StatusCode.INTERNAL\n\tdetails = \"Internal error occurred.\"\n\tdebug_error_string = \"UNKNOWN:Error received from peer ipv4:209.85.145.95:443 {created_time:\"2024-06-26T20:44:55.403459018+00:00\", grpc_status:13, grpc_message:\"Internal error occurred.\"}\"\n>\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/code/app/api/factory/python_file_api_builder.py\", line 109, in handler\n output = invocation_callable(invocation_payload)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/vertexai/preview/reasoning_engines/templates/langchain.py\", line 500, in query\n self._runnable.invoke(input=input, config=config, kwargs)\n File \"/usr/local/lib/python3.11/site-packages/langchain_core/runnables/base.py\", line 4525, in invoke\n return self.bound.invoke(\n ^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/langchain_core/runnables/base.py\", line 4525, in invoke\n return self.bound.invoke(\n ^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/langchain_core/runnables/base.py\", line 2499, in invoke\n input = step.invoke(\n ^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/langchain_core/runnables/base.py\", line 4525, in invoke\n return self.bound.invoke(\n ^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.11/site-packages/langchain/chains/base.py\", line 163, in invoke\n raise e\n File \"/usr/local/lib/python3.11/site-packages/langchain/chains/base.py\", line 153, in invoke\n self._call(inputs, run_manager=run_manager)\n File \"/usr/local/lib/python3.11/site-packages/langchain/agents/agent.py\", line 1432, in _call\n next_step_output = self._take_next_step(\n ^^^^^^^^^^^^^^^^^^^^^\… [message truncated due to size] Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

averikitsch commented 3 days ago

I am unable to reproduce the error. Can you share example code of your prompt and get_session_history function?