Quickstart
agent.py
book group. It runs verify_customer, then manage_booking. The group names its steps in order. Each step is a task of the same TasksSpec. The main agent gets one tool for the whole group, and a step runs when the one before it ends. When the caller’s phone is already confirmed, the group skips verify_customer.
Why use unmute for this
You list the steps and the library runs them in order. It carries what each step saved to the next one, skips a step whose value is already confirmed, and always hands the caller back to the main agent when a step fails.Group fields
name is lower snake case, and a task and a group may not share a name. steps are the task names, in order. There must be at least one. Each runs at most once in the group.
context_scope is required:
shared: each step hears the steps before it.isolated: each step starts fresh.
whensays when the main agent starts the group.announceholds lines spoken as it starts.non_blockingnames steps whose failure the group records and carries on past. Each must be one of its steps.skip_when_confirmedmaps a step to the State value whose confirmation lets the group skip it. The step must be the one that confirms that value.inputsis what every step reads at the end of its prompt, before its own inputs.argumentsare State values the main agent passes when it starts the group. Each call saves all of them.
What a group does when it finishes
then sets what follows a group that completes.
then_targetis required withtransfer, and refused withreturnorend.- The adapter’s
then_targetsmaps each target to the handoff that gives it the call. A target it does not name is refused when the agent is built. See Handoffs. - A group that hands the caller back, or fails, always returns to the main agent. So the caller is never dropped mid-request.
- The main agent’s tool description says that the flow ends the call, or hands the caller on.
- Use
sharedwhen a later step needs what an earlier one heard. - Use
transferonly with athen_targetthe adapter’sthen_targetsholds.
Troubleshooting
A group that transfers is refused when the agent is built
The group’sthen_target is not a key of then_targets.
Fix: add the target to the adapter’s then_targets, as shown above.
A step of a group never starts by itself
A task with nowhen must be a step of a group, or be entered by a via tool.
Fix: put the task in a group’s steps.
In the salon tutorial: Book step by step.
Every argument: Tasks reference.
Where to go next
How a step ends
The finish check, a held finish and going back.
Handoffs
Give the call to another agent from a step or a group.
Your first task
Define a task and check it with TaskPlan.