Skip to main content

Module frame

Module frame 

Source
Expand description

The pipeline Frame taxonomy (PROCESSOR-DESIGN §1).

A closed Frame enum mirroring the pipecat frame tree (pipecat/src/pipecat/frames/frames.py), plus a single Frame::Custom variant carrying Arc<dyn CustomFrame> as the OSS extension hatch. Core processors match on named variants (alloc-free, branch-predicted, exhaustiveness-checked); OSS extensions ride in Custom and are downcast only by the processors that care.

NOTE: this is distinct from crate::types (today’s data-shape module, renamed from frame.rs in step M0). Frame here is the pipeline frame that flows between FrameProcessors.

Structs§

AudioFrame
Mono 16-bit LE PCM with an explicit sample rate and channel count. Mirrors today’s crate::types::AudioChunk (PROCESSOR-DESIGN §1.1) but adds num_channels; Arc-wrapped in the Frame enum so the hot path never copies PCM. Convertible from/to AudioChunk (mono) via From.
FrameMeta
Per-frame metadata, carried out of band in the channel Envelope so the hot enum variant (OutputAudio(Arc<AudioFrame>)) stays a thin pointer move (PROCESSOR-DESIGN §1.1). Mirrors the pipecat Frame base fields (frames.py:73-79). Cheap to clone (the extra map is Arced).
FunctionCall
A function/tool call request. Mirrors pipecat FunctionCallFromLLM.
FunctionCallResult
A function/tool call result, fed back to the LLM. Mirrors pipecat FunctionCallResultFrame (frames.py:719). Uninterruptible.
Language
A spoken-language tag (BCP-47-ish). Mirrors pipecat Language (string-backed here so the long enum doesn’t bloat core; promote to a real enum if exhaustive matching is needed).
LlmContext
The universal LLM context to run. Mirrors pipecat LLMContext (frames.py:502). Opaque message list — providers interpret it.
StartParams
Pipeline init params. Mirrors pipecat StartFrame (frames.py:847).
TurnParams
Turn-analyzer parameter bundle. Mirrors pipecat turn params.
VadParams
VAD parameter bundle broadcast on Frame::SpeechControlParams. Mirrors pipecat VADParams.

Enums§

Direction
Direction of frame flow. Mirrors pipecat FrameDirection (frame_processor.py:56). Downstream = source→sink; Upstream = sink→source (errors, end-of-task requests, RTVI acks).
Frame
The frame that flows through every processor. One closed enum mirroring the pipecat frame tree (frames.py), plus Frame::Custom for OSS extensions.
FrameClass
Frame scheduling class — mirrors pipecat’s three base classes (frames.py:95/106/118). Drives queue priority and interruptibility: System jumps the queue and survives interruption; Data is dropped on interruption; Control is ordered like Data but also survives interruption when uninterruptible() is set (e.g. End, Stop).
FrameKind
A payload-free discriminant for Frame, used by event hooks (on_frame_reached_*), idle-frame detection, and observers that filter by type. Mirrors using isinstance on a pipecat frame class.
KeypadEntry
A telephony keypad entry (DTMF). Mirrors pipecat KeypadEntry.
ServiceKind
Which service a Frame::UpdateSettings / control frame targets. Mirrors pipecat’s settings-frame routing (frames.py:1878).

Traits§

CustomFrame
OSS extension point: a frame type defined outside flowcat-core, carried in Frame::Custom. Processors that understand it downcast_ref via CustomFrame::as_any; everyone else forwards it unchanged.

Functions§

next_frame_id
Allocate the next process-unique monotonic frame id.