Accessing events of grandchild agent
How do I access event by an agent used as a tool by another agent, which is used as as a tool by my root agent?
Callbacks' toolcontext and callback_context do not seem to be able to access event.
On the other hand, runner on the root agent only tracks root agent's events, and count tooluse as function calls, which do no log full details of the events by child / grandchild agents.
Could you help advise? Thanks!
Could you explain a bit about the use case? What events do you want to access and why? This will help us design the feature.
Trying to solve for this: event.grounding_metadata, as you mentioned here. When I run https://github.com/google/adk-python/issues/219
Because the search agent is used as a tool on the grandchildren level from the root_agent. I cannot see the event from iterating through the events on root level. I could see the event by tool_use google_search if I set web search agent as the runner root. I tried the callback approach (after tool use, or before model), but tool_context and callback_context only have access to session states, ids, agent name, tool name, etc.. Let me know I missed anything in the api doc, but I don't see a way to access a particular event from callbacks or from root agent events?
Figured out that llmresponse contains the event contents. Suggest the documentation be clearer about what different callbacks contexts can exactly access. Can close this ticket. Thanks.