Set the turn pace
A caller pauses mid-sentence. The pace says how long the agent waits before it decides the turn is over.- Pick
snappy,balancedorpatient.balancedis the default. turn_windowreturns the wait that framework uses for that pace.- The framework’s helper turns the window into its own options.
Drop a reply the caller spoke over
A caller says “Hi.”, pauses, then says “I’d like to book a haircut”. LiveKit ends their turn at the pause, and plays the reply over them.yield_to_caller drops that reply.
- Call it once, after you build the session.
- The next reply answers everything the caller said.
- A reply with a tool running is kept, because dropping it would cancel the tool.
Choose what speech over a line does
A “mm-hm” or a “yes” over the agent can mean “go on” or “that is my answer”. Theinterruption rule picks which.
- On LiveKit,
keepanddropuse LiveKit’s detector. It needsLIVEKIT_API_KEYorLIVEKIT_INFERENCE_API_KEY. Without one, the agent stops on any speech, as withstop. - On Pipecat,
keepcounts words. Fewer than 3 words wait for the line to end. 3 or more stop the agent.
Turn off interruption or protect a line
- On Pipecat,
protectnames what the caller cannot cut off: the greeting, or a running tool. user_mute_strategies(enabled=False)mutes the caller while the agent speaks, so no line is cut off.- On LiveKit, a greeting nobody may cut off is
Greeting(interruptible=False). A tool call that runs always finishes.
Nudge a quiet caller
IdleNudges holds up to two nudges and a final line. After the last one, the call ends.
- The timer runs only while the agent listens. Any word from the caller, or any reply from the agent, starts it again from the first nudge.
- The lines are spoken by code, with no model request. A nudge with no text is worded by the model.
- On LiveKit, leave
user_away_timeoutatNone, and setdelete_room_on_close=Trueso a phone caller is hung up. On Pipecat, leave the user aggregator’suser_idle_timeoutunset.
Cap the call length
CallLimitends the call after the longest allowed length, with no closing line.cancel()stops the count.- The adapters also take it as
max_duration, on LiveKit and on Pipecat.
Where to go next
Turn taking reference
Every argument, pace window, rule and error.
LiveKit
The session, the greeting and the call limit on LiveKit.
Pipecat
The pipeline, the greeting hold and the call limit on Pipecat.
The call's life
The greeting, the failure line and the end of the call.
Telemetry
Where the idle nudge and interruption events show.