Skip to main content
Turn taking is when the agent speaks, when it stops, and when it checks the caller is still there. You set it with a few small helpers. The same names work on LiveKit and Pipecat. In the salon tutorial, Quiet callers and long calls builds this step by step.

Set the turn pace

A caller pauses mid-sentence. The pace says how long the agent waits before it decides the turn is over.
  1. Pick snappy, balanced or patient. balanced is the default.
  2. turn_window returns the wait that framework uses for that pace.
  3. 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.
  1. Call it once, after you build the session.
  2. The next reply answers everything the caller said.
  3. 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”. The interruption rule picks which.
  1. On LiveKit, keep and drop use LiveKit’s detector. It needs LIVEKIT_API_KEY or LIVEKIT_INFERENCE_API_KEY. Without one, the agent stops on any speech, as with stop.
  2. On Pipecat, keep counts words. Fewer than 3 words wait for the line to end. 3 or more stop the agent.

Turn off interruption or protect a line

  1. On Pipecat, protect names what the caller cannot cut off: the greeting, or a running tool.
  2. user_mute_strategies(enabled=False) mutes the caller while the agent speaks, so no line is cut off.
  3. 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.
  1. 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.
  2. The lines are spoken by code, with no model request. A nudge with no text is worded by the model.
  3. On LiveKit, leave user_away_timeout at None, and set delete_room_on_close=True so a phone caller is hung up. On Pipecat, leave the user aggregator’s user_idle_timeout unset.

Cap the call length

  1. CallLimit ends the call after the longest allowed length, with no closing line.
  2. cancel() stops the count.
  3. 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.