Replies: 2 comments
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Yes, you can prevent a tool's output from being sent to the LLM by using an That's an excellent question. Handling large tool outputs is a common challenge, and you are right to be concerned about the cost and potential for truncation. The Agent Development Kit (ADK) provides a flexible mechanism to achieve exactly what you're asking for through callbacks. The recommended approach is to use the Here’s a conceptual example of how you could implement this:
By using this pattern, the LLM is still responsible for deciding to call the This approach gives you fine-grained control over the data flow in your agent, allowing you to optimize for performance and cost while still leveraging the LLM's reasoning capabilities. For more details, you can refer to the ADK documentation on Callbacks and Session State. [1, 3] [1] https://google.github.io/adk-docs/tutorials/agent-team/ |
Beta Was this translation helpful? Give feedback.
-
Closing as a duplicate question with #2619 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am not sure if it's possible.
I am reading a large file through a read_file tool in my agent.
There are multiple tools available to the agent - like read_file, write_file etc. So I want the LLM to make the reasoning/decision to call the appropriate tool i.e. read the file in this case.
But I don't want the LLM to read the file content. If it reads, sometimes the content in truncated or if the full file is available, it's going to be costly.
Is there a way to not send the output of a tool to LLM?
Beta Was this translation helpful? Give feedback.
All reactions