Start an AgentSession before starting AMD. Start AMD before creating a SIP
participant. execute() waits for completion, not the first machine prediction,
unless that stage's instructions are null.
The SDK owns classification and stage control. Models can use any provider.
AMD uses the customer's current Agent. Realtime models require client-side
turn detection, session or AMD STT, and per-response tool
control. Agent handoffs during AMD are not supported. Normal hooks, interruptions,
playback, and StopResponse stay in AgentSession. Menu events are informational
and never execute actions.
AMD enables interruptions on the session and current Agent, then restores
their settings when detection finishes. Direct speech generation during AMD
is not supported. To let the agent speak first, set openingText or
openingInstructions.
Ungated AMD (gateReplies: false) only listens and classifies. It does not hold,
cancel, or change replies. The realtime-model, handoff, and direct-speech limits do
not apply to it. Use it when the application ends calls with machines itself: the agent
can reply before the prediction, and a machine result cancels no speech.
Multi-turn answering-machine detection.
Start an AgentSession before starting AMD. Start AMD before creating a SIP participant.
execute()waits for completion, not the first machine prediction, unless that stage's instructions arenull. The SDK owns classification and stage control. Models can use any provider.AMD uses the customer's current Agent. Realtime models require client-side turn detection, session or AMD STT, and per-response tool control. Agent handoffs during AMD are not supported. Normal hooks, interruptions, playback, and StopResponse stay in AgentSession. Menu events are informational and never execute actions. AMD enables interruptions on the session and current Agent, then restores their settings when detection finishes. Direct speech generation during AMD is not supported. To let the agent speak first, set
openingTextoropeningInstructions.Ungated AMD (
gateReplies: false) only listens and classifies. It does not hold, cancel, or change replies. The realtime-model, handoff, and direct-speech limits do not apply to it. Use it when the application ends calls with machines itself: the agent can reply before the prediction, and a machine result cancels no speech.Example