Builds a pipeline spec with |>:
import Octoroom.Agent.Pipeline.Spec
processor(:vad, Octoroom.Agent.VAD.Silero)
|> processor(:turns, MyApp.Turns, threshold: 0.5)
|> processor(:llm, MyApp.LLM, model: "google:gemini-3.5-flash")A spec is a plain value: a chain of named stages. The editing helpers
(insert_after/3, insert_before/3, replace/3, remove/2) find stages
by name, so a default spec can be changed without rewriting it.
A stage's name defaults to its module. Names must be unique.
Summary
Functions
The usual pipeline of an agent, in two parts: {front_end, back_end}.
Each input runs its own front end, and their turns go into one back end
The pipeline of a Gemini Live agent: no front end (the agent mixes its
inputs) and one :gemini stage, Octoroom.Agent.Processors.GeminiLive,
which takes opts: :model (needed), :voice, :api_key,
:context_window_compression (false or [trigger_tokens: ..., target_tokens: ...]),
:input_audio_transcription, :output_audio_transcription, and
:response_modalities.
Inserts the stages of insert right after the stage name.
Inserts the stages of insert right before the stage name.
Names of the stages, in order.
An empty spec.
The pipeline of an OpenAI Live agent: no front end (the agent mixes its
inputs) and one :openai stage, Octoroom.Agent.Processors.OpenAILive,
which takes opts: :model (needed, such as "gpt-live-1.1"), :voice
(default "marin"), :api_key (default OPENAI_API_KEY), :transport
(:webrtc, the default, or :websocket), :sample_rate (24_000 default,
or 16_000; WebSocket only), :delegation (:client,
[model: "...", ...], or a delegation map), :idle_timeout_s (5..60
seconds before standby, or nil; WebRTC only), :wake_policy (:speech or
[type: :speech, vad_threshold: 0.5]; WebRTC only), and :initial_items.
The options of the stage named name, or nil when there's none.
Adds a stage to the end of a spec.
Removes the stage name.
Replaces the stage name with the stages of replacement.
Checks that the spec has at least one stage, that names are unique, and
that every module implements Octoroom.Agent.Processor.
Types
Functions
The usual pipeline of an agent, in two parts: {front_end, back_end}.
Each input runs its own front end, and their turns go into one back end:
front: vad -> stt -> turns
back: context -> llm -> tools -> chunker -> tts -> collectorIt picks no provider and no model: :stt, :llm and :tts are needed,
each naming both. Options are their stage's, passed on as they are:
:stt-Octoroom.Agent.Processors.STT's:llm-Octoroom.Agent.Processors.LLM's:tts-Octoroom.Agent.Processors.TTS's:vad-Octoroom.Agent.Processors.VAD's (the local Silero model).falseleaves the VAD out: turn taking and barge-in fall back to the STT provider.:preemptive- boolean forwarded toOctoroom.Agent.Processors.STTTurnsto enable or disable preemptive LLM generation while STT finalizes (defaults totruewhen VAD is enabled,falsewhenvad: false).
:stt, :llm and :tts also take just a "provider:model" string (or
model: "provider:model" alongside extra stage options).
Spec.default(
stt: "soniox:stt-rt-v6",
llm: "google:gemini-3.5-flash",
tts: [provider: :assembly_ai, model: "assemblyai-tts-1", voice: "aai-titus"]
)With stt: false (half-cascaded) the LLM hears each turn as audio, so it
must be a Gemini model, the VAD can't be left out, and :transcriber
(Octoroom.Agent.Processors.Transcriber's options) names the model that
writes each turn down afterwards:
front: vad -> turns (AudioTurns, Smart Turn)
back: transcriber -> context -> llm -> tools -> chunker -> tts -> collectorThe front end's turn stage doesn't interrupt; the agent decides who may. Change either part with the editing helpers.
The pipeline of a Gemini Live agent: no front end (the agent mixes its
inputs) and one :gemini stage, Octoroom.Agent.Processors.GeminiLive,
which takes opts: :model (needed), :voice, :api_key,
:context_window_compression (false or [trigger_tokens: ..., target_tokens: ...]),
:input_audio_transcription, :output_audio_transcription, and
:response_modalities.
Spec.gemini_live(
model: "gemini-3.8-live",
voice: "Puck",
context_window_compression: [trigger_tokens: 24_000, target_tokens: 12_000]
)
Inserts the stages of insert right after the stage name.
Inserts the stages of insert right before the stage name.
Names of the stages, in order.
An empty spec.
The pipeline of an OpenAI Live agent: no front end (the agent mixes its
inputs) and one :openai stage, Octoroom.Agent.Processors.OpenAILive,
which takes opts: :model (needed, such as "gpt-live-1.1"), :voice
(default "marin"), :api_key (default OPENAI_API_KEY), :transport
(:webrtc, the default, or :websocket), :sample_rate (24_000 default,
or 16_000; WebSocket only), :delegation (:client,
[model: "...", ...], or a delegation map), :idle_timeout_s (5..60
seconds before standby, or nil; WebRTC only), :wake_policy (:speech or
[type: :speech, vad_threshold: 0.5]; WebRTC only), and :initial_items.
Spec.openai_live(
model: "gpt-live-1.1",
voice: "marin",
delegation: [model: "gpt-5.4-mini"],
idle_timeout_s: 15,
wake_policy: [type: :speech, vad_threshold: 0.5]
)
The options of the stage named name, or nil when there's none.
Adds a stage to the end of a spec.
Accepts, optionally after a spec to pipe into: module, name, module,
module, opts, or name, module, opts.
Removes the stage name.
Replaces the stage name with the stages of replacement.
Checks that the spec has at least one stage, that names are unique, and
that every module implements Octoroom.Agent.Processor.