Pipeline wires these components together and
exposes hooks for observing and shaping each turn.
Pipeline
The providers a call runs on: what hears, what thinks, what speaks. Two shapes are valid. A cascade namesstt, llm and tts
separately; a realtime pipeline names a speech-to-speech model in llm
alone, because a realtime model is the language model. realtime= is
accepted as the older spelling of the same slot; naming both is rejected.
A fallback slot — stt, llm, tts — also takes a list, in which
case the head serves and the tail stands by. Wrap that list in FallbackSTT,
FallbackLLM or FallbackTTS to say how it demotes as well as what it
falls back to; each slot carries its own settings.
Fields
The language model — a text LLM for a cascade, a
FallbackLLM chain of them, or a speech-to-speech model for a realtime pipeline.PronunciationRule substitutions applied to generated text on its way to TTS.VoiceMailDetector — answering-machine detection, for outbound calls that may be picked up by one.on
stt
and llm, and the turn hooks user_turn_start, user_turn_end,
agent_turn_start and agent_turn_end.
An async generator registered on llm is filed as llm_stream: it
is handed the model’s output as a stream and yields what should be
spoken, so it can buffer, rewrite or drop the turn. A plain coroutine on
the same event sees the finished text instead.
Per-component latency is a separate family, registered through its own
namespace rather than by spelling the prefix here::
@pipeline.metrics.on(“stt”)
def on_stt(data: dict) -> None:
…
hooks
chain
A tuple of provider objects; empty when nothing is set for
slot or it is not a known component.primary
None if it has none.
fallbacks
fallback_settings
None where nothing was tuned.
fallbacks is who a slot falls back to; this is how.
providers
NO_CHANGE
change_component(denoise=None) takes denoising off a running call, while
leaving denoise out keeps whatever the call is already denoising with.
PronunciationRule
Rewrite generated text on its way to TTS.Fields
Match case exactly. Off by default, because the model capitalises the same word differently at the start of a sentence.
ContextWindow
Keep a long conversation inside the model’s context, automatically.Fields
Recent user turns kept verbatim. The default is 3, and it is worth keeping several — summarising the sentence the caller just said is how an agent starts answering the wrong question.
EOUConfig
When the caller is judged to have finished speaking.Fields
DEFAULT waits a fixed time after speech stops. ADAPTIVE varies it with how certain the turn detector is — longer when the sentence sounds unfinished.[min, max] seconds to wait before treating silence as the end of a turn. [0.0, 0.0] answers as soon as the detector says the turn is complete, which is snappy but cuts off anyone who pauses to think.Treat “mhm”, “haan”, “right” as listening noises rather than turns.
None takes the default, which is on for turn detectors that support it.InterruptConfig
What counts as the caller interrupting, rather than just making a noise.Fields
VAD_ONLY reacts to any speech-like audio — fastest, and the most easily fooled by a cough or a door. STT_ONLY waits for words. HYBRID uses both.Seconds of speech before it counts. Raising this is the usual fix for an agent that stops every time someone breathes.
Pick the sentence back up when the interruption proves false, rather than dropping it.
Seconds to fade the agent’s audio out over. An instant cut sounds like a dropped call.
None keeps the ZeroRuntime default (0.4 s); 0 turns the fade off.Short replies that interrupt even below
interrupt_min_words — e.g. ["stop", "wait"]. Matched against the whole utterance, ignoring case and trailing punctuation. Cascade pipelines only.FallbackSTT
Speech-to-text providers to try in order, and how they demote. The first provider serves the call; the rest stand by and take over, in order, when it fails. A failed provider is set aside fortemporary_disable_sec and then tried again; after
permanent_disable_after_attempts failed retries it is dropped for the
rest of the call. By default only errors cause a switch; set
latency_threshold_ms to also switch away from a provider that is too
slow.
Fields
The speech-to-text providers, in priority order. Must not be empty.
Seconds a failed provider is skipped before it is retried.
None takes the default (60). Must be > 0.Failed recovery attempts after which a provider is dropped for the rest of the call.
None takes the default (3). Must be > 0.Latency budget in milliseconds, measured as the STT’s latency on each turn. A turn over budget counts against the provider.
None (the default) leaves latency-based switching off. Must be > 0.Turns in a row over
latency_threshold_ms before switching to the next provider, so one slow turn does not move the call off a healthy provider. None takes the default (3). Must be > 0.FallbackLLM
Language models to try in order, and how they demote. The first provider serves the call; the rest stand by and take over, in order, when it fails. A failed provider is set aside fortemporary_disable_sec and then tried again; after
permanent_disable_after_attempts failed retries it is dropped for the
rest of the call. By default only errors cause a switch; set
latency_threshold_ms to also switch away from a provider that is too
slow.
Fields
The language-model providers, in priority order. Must not be empty.
Seconds a failed provider is skipped before it is retried.
None takes the default (60). Must be > 0.Failed recovery attempts after which a provider is dropped for the rest of the call.
None takes the default (3). Must be > 0.Latency budget in milliseconds, measured as time to the model’s first token. A turn over budget counts against the provider.
None (the default) leaves latency-based switching off. Must be > 0.Turns in a row over
latency_threshold_ms before switching to the next provider, so one slow turn does not move the call off a healthy provider. None takes the default (3). Must be > 0.FallbackTTS
Text-to-speech providers to try in order, and how they demote. The first provider serves the call; the rest stand by and take over, in order, when it fails. A failed provider is set aside fortemporary_disable_sec and then tried again; after
permanent_disable_after_attempts failed retries it is dropped for the
rest of the call. By default only errors cause a switch; set
latency_threshold_ms to also switch away from a provider that is too
slow.
Fields
The text-to-speech providers, in priority order. Must not be empty.
Seconds a failed provider is skipped before it is retried.
None takes the default (60). Must be > 0.Failed recovery attempts after which a provider is dropped for the rest of the call.
None takes the default (3). Must be > 0.Latency budget in milliseconds, measured as time to the first byte of audio. A turn over budget counts against the provider.
None (the default) leaves latency-based switching off. Must be > 0.Turns in a row over
latency_threshold_ms before switching to the next provider, so one slow turn does not move the call off a healthy provider. None takes the default (3). Must be > 0.DTMFHandler
Deliver the caller’s keypad tones to the agent instead of dropping them.Fields
What runs per keypress, taking
(key) or (key, payload). Left None, the agent’s on_dtmf method is called instead — which is the usual shape, because a keypad menu almost always wants the agent’s own state to accumulate a multi-digit entry into. Either way it is called once per key; a PIN is accumulated on your side, not handed over whole.VoiceMailDetector
Detect an answering machine on an outbound call. The detector buffers the opening speech forduration seconds and asks llm whether it is a
person or a greeting.
Fields
The classifier. Required: without one there is nothing to classify with, and the detector is simply not installed.
What runs on detection. Left
None, the agent’s on_voicemail method is called instead. Either is awaited, so anything said in it finishes before the call is ended.Seconds of speech to buffer before deciding. The default is 2.0 — long enough for “Hi, you’ve reached…”.
PipelineMode
Which shape a pipeline resolved to. Derived from the slots that were filled rather than set by hand; read it offPipeline.mode.
KnowledgeBase
Answer from the knowledge documents uploaded in the dashboard. Every user turn searches the documents, and the best sections are placed above the user’s message in the prompt.Fields
Dashboard IDs of the documents to search. All of them are searched on every turn. Empty is rejected.
retrieve
Pipeline(knowledge_base=...), not
both, or each turn searches twice.