adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Errors regarding tool names that are not used in a project.

Open jeremypeters opened this issue 1 year ago • 4 comments

It seems that somewhere in the pipeline tool names in an agent's tool list are being ignored and ADK is making up it's own.

For example in my project I have a documentation agent with one tool called vertex_rag_retrieval_tool that makes use of VertexAiRagRetrieval. When a suitable question is asked that makes use of this agent there is a 500 error response, and the error in the console is valueError: Function query_rag is not found in the tools_dict. - there is no query_rag tool used in the project. Other times I will get the same error, but with a slightly different tool name that is also not used anywhere in the project.

Checking the trace (using Phoenix) shows that control is being transferred to the relevant agent.

jeremypeters avatar Sep 11 '25 12:09 jeremypeters

Ok, it seems the VertexAiRagRetrieval tool is the culprit - I made my own RAG retreival tool using the Vertex API and the issue has resolved. It has also fixed agent transfer issues I've spent days going round in circles trying to fix.

jeremypeters avatar Sep 11 '25 14:09 jeremypeters

Hi,

I had the same problem, but it’s not an issue with the adk library itself. Check which API version you’re setting in your model configuration—LiteLLM doesn’t configure structured outputs for anything below:

API_VERSION_YEAR_SUPPORTED_RESPONSE_FORMAT = 2024 API_VERSION_MONTH_SUPPORTED_RESPONSE_FORMAT = 8

see: GitHub link litellm/types/llms/azure.py

In my case, I just had to set the API version to the most recent one: 2025-04-01-preview.

Hope this helps!

FrigaZzz avatar Sep 26 '25 02:09 FrigaZzz

@FrigaZzz Thanks for the suggestion. I am not using LiteLLM though - I'm using Vertex AI, and as explained above the fix for my situation was to not use the VertexAiRagRetrieval tool and use the Vertex API instead.

jeremypeters avatar Sep 26 '25 08:09 jeremypeters

Function call hallucination is from model itself. this tool can partially alleviate it: https://github.com/google/adk-python/blob/main/src/google/adk/plugins/reflect_retry_tool_plugin.py

hangfei avatar Oct 29 '25 00:10 hangfei