导入
Orchestration 入门
学习如何使用 ADK 的确定性编排代理创建结构化且可预测的多智能体工作流。
...
Dynamic routing vs. deterministic orchestration
...
Working of the sequential agent
The SequentialAgent
1from google.adk.agents.sequential_agent import SequentialAgent 2 3# The root_agent is a workflow that orchestrates other agents 4root_agent = SequentialAgent( 5 name="sequential_workflow", 6 sub_agents=[sub_agent_1, sub_agent_2, sub_agent_3] 7)
...
Working of the parallel agent
The ParallelAgent
1from google.adk.agents.parallel_agent import ParallelAgent 2 3# Define the ParallelAgent to manage the concurrent execution 4root_agent = ParallelAgent( 5 name="parallel_workflow", 6 sub_agents=[independent_task_agent_A, independent_task_agent_B] 7)
...
Working of the loop agent
The LoopAgent
1from google.adk.agents.loop_agent import LoopAgent 2 3# Define the LoopAgent itself 4repeating_process = LoopAgent( 5 name="repeating_process", 6 sub_agents=[iterative_task_agent_A, iterative_task_agent_B], 7 max_iterations=5 8)
...
Hybrid agent architectures