Class TaskSubAgentDemo
java.lang.Object
com.example.workflows.TaskSubAgentDemo
A port of ADK Kotlin's task sub-agent sample, which ports adk-python's
task_sub_agent: a
food-delivery coordinator delegates to two task sub-agents, one that collects the order and one
that collects the payment details. Each holds its own conversation with the user until it
finishes its task with structured data, which answers the coordinator's call, and the coordinator
then places the order with a tool.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA mock food-delivery backend whose methods the agents call as tools.static final recordOne item of a food order.static final recordThe card that pays for an order. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowBuilds a workflow with the coordinator as its only node, running every agent onmodel.static voidRuns a conversation in which the user orders food and then pays, printing each message and tool call and approving any tool call that asks.
-
Method Details
-
create
-
main
Runs a conversation in which the user orders food and then pays, printing each message and tool call and approving any tool call that asks. It calls Gemini, so it needs the credentials the README describes; the first argument, if any, overrides the model.
-