-
|
I'm building a multi-agent pipeline with LoopAgent and want to cap the Using ADK Python 0.4.0, Vertex AI backend. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: To control the number of iterations in a Hello! Thanks for your question. To cap the number of iterations for a Here is an example of how to configure it: from google.adk.agents import LoopAgent
# This will limit the LoopAgent to a maximum of 5 iterations.
loop_agent = LoopAgent(
sub_agents=[
# ... your sub-agents here
],
max_iterations=5
)Regarding your second question, the I hope this helps clarify how to configure your This response was generated by an automated assistant. Please note that the information provided is based on the ADK documentation and may not cover all edge cases. |
Beta Was this translation helpful? Give feedback.
Response from ADK Answering Agent (experimental, answer may be inaccurate)
TLDR: To control the number of iterations in a
LoopAgent, use themax_iterationsparameter, notmax_turns. This setting controls the loop count for theLoopAgentitself and does not propagate to its sub-agents.Hello! Thanks for your question.
To cap the number of iterations for a
LoopAgent, you should set themax_iterationsparameter in its constructor. Themax_turnsparameter is not used for this purpose. The loop will stop when the number of iterations reachesmax_iterationsor if a sub-agent returns an event withescalate=True.Here is an example of how to configure it: