Questions regarding _find_agent_to_run function #3965
Replies: 2 comments 1 reply
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Thank you for your detailed questions. Here’s a summary of the design philosophy behind the
Here are the detailed answers to your questions: 1. Handling of Multiple Function ResponsesYou are correct in observing that the logic often selects the first function call or response from an event (e.g., using 2. Performance of Nested LoopsYour point about the computational complexity of nested loops is valid. However, in the context of a typical agent interaction, the number of events and function calls within a single turn is usually small. The developers likely made a trade-off, prioritizing code readability and maintainability over the performance gains of using a map. For the expected scale of inputs, the performance impact of the loops is negligible, and the straightforward loop structure is easier to understand and debug. 3. The
|
Beta Was this translation helpful? Give feedback.
-
|
If the only intended behaviour of disallow_transfer_to_parent is to create self contained subtask and return the control back to root, I believe it should be named something like transfer_to_root. Current variable name of disallow_transfer_to_parent gives impression that the control should be contained at that agent level. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From the code I understood that the agent is selected according to the following priority criteria-
I have several questions in this flow-
a. is_transferrable_across_agent_tree function checks for "disallow_transfer_to_parent" flag for each agent node from current to parent. So in a case where we have Agent -> sub_agent1(disallow_transfer_to_parent=True) -> sub_agent_of_sub_agent_1, I would expect the final control to remain with sub_agent1, but according to the code the control goes back to the root_agent
Therefore I am confused about the thought process behind this architecture. I would greatly appreciate if someone can explain this to me
Beta Was this translation helpful? Give feedback.
All reactions