Skip to main content

Frame

Enum Frame 

Source
pub enum Frame {
Show 49 variants Start(StartParams), Cancel { reason: Option<String>, }, Error { message: String, fatal: bool, processor: Option<Arc<str>>, }, Interruption, InputAudio(Arc<AudioFrame>), UserAudio { audio: Arc<AudioFrame>, user_id: Arc<str>, }, InputText(String), InputDtmf(KeypadEntry), UserStartedSpeaking, UserStoppedSpeaking, UserSpeaking, BotStartedSpeaking, BotStoppedSpeaking, BotSpeaking, VadUserStartedSpeaking { start_secs: f32, }, VadUserStoppedSpeaking { stop_secs: f32, }, SttMute(bool), Metrics(Vec<MetricsData>), TransportMessage { payload: Value, urgent: bool, }, ClientConnected, BotConnected, FunctionCallsStarted(Vec<FunctionCall>), FunctionCallInProgress { call: FunctionCall, cancel_on_interruption: bool, }, FunctionCallCancel { function_name: String, tool_call_id: String, }, OutputAudio(Arc<AudioFrame>), TtsAudio { audio: Arc<AudioFrame>, context_id: Option<Arc<str>>, }, Text(String), LlmText(String), Transcription { text: String, user_id: Arc<str>, language: Option<Language>, final_: bool, }, InterimTranscription { text: String, user_id: Arc<str>, language: Option<Language>, }, TtsSpeak { text: String, append_to_context: Option<bool>, }, TtsText { text: String, context_id: Option<Arc<str>>, }, FunctionCallResult(FunctionCallResult), LlmRun, LlmContext(Arc<LlmContext>), OutputDtmf(Vec<KeypadEntry>), End { reason: Option<String>, }, Stop, LlmResponseStart, LlmResponseEnd, TtsStarted { context_id: Option<Arc<str>>, }, TtsStopped { context_id: Option<Arc<str>>, }, UpdateSettings { target: ServiceKind, settings: Value, }, SpeechControlParams { vad: Option<VadParams>, turn: Option<TurnParams>, }, Heartbeat { timestamp_ns: i64, }, OutputTransportReady, FilterEnable(bool), MixerEnable(bool), Custom(Arc<dyn CustomFrame>),
}
Expand description

The frame that flows through every processor. One closed enum mirroring the pipecat frame tree (frames.py), plus Frame::Custom for OSS extensions.

The hot audio variants box their payload in Arc<AudioFrame> so cloning a frame for the broadcast/observer paths never copies PCM.

Variants§

§

Start(StartParams)

Pipeline init: carries sample rates + metric/trace toggles (StartFrame).

§

Cancel

Immediate stop; flush nothing (CancelFrame).

Fields

§reason: Option<String>
§

Error

Error notification pushed upstream (ErrorFrame). fatal ⇒ task cancels.

Fields

§message: String
§fatal: bool
§processor: Option<Arc<str>>
§

Interruption

Barge-in (InterruptionFrame). Broadcast both directions.

§

InputAudio(Arc<AudioFrame>)

Raw caller audio from a transport input (InputAudioRawFrame).

§

UserAudio

User-associated audio (UserAudioRawFrame) — carries user_id.

Fields

§user_id: Arc<str>
§

InputText(String)

Raw text input from a transport (InputTextRawFrame) — text-chat path.

§

InputDtmf(KeypadEntry)

Inbound DTMF keypress (InputDTMFFrame).

§

UserStartedSpeaking

VAD/turn lifecycle (frames.py:971-1104). One variant per pipecat frame.

§

UserStoppedSpeaking

§

UserSpeaking

§

BotStartedSpeaking

§

BotStoppedSpeaking

§

BotSpeaking

§

VadUserStartedSpeaking

Definitive VAD edges with the deciding secs (VAD*SpeakingFrame).

Fields

§start_secs: f32
§

VadUserStoppedSpeaking

Fields

§stop_secs: f32
§

SttMute(bool)

Mute/unmute the STT service (STTMuteFrame).

§

Metrics(Vec<MetricsData>)

Performance metrics (MetricsFrame) — TTFB/processing/usage/turn.

§

TransportMessage

Transport-level message in/out urgent (Input/OutputTransportMessage*).

Fields

§payload: Value
§urgent: bool
§

ClientConnected

SFU/transport lifecycle (ClientConnected).

§

BotConnected

SFU/transport lifecycle (BotConnected).

§

FunctionCallsStarted(Vec<FunctionCall>)

Function-call signalling (FunctionCallsStarted).

§

FunctionCallInProgress

Function-call signalling (FunctionCallInProgress).

Fields

§cancel_on_interruption: bool
§

FunctionCallCancel

Function-call signalling (FunctionCallCancel).

Fields

§function_name: String
§tool_call_id: String
§

OutputAudio(Arc<AudioFrame>)

Output audio to a transport (OutputAudioRawFrame).

§

TtsAudio

TTS-generated audio, tagged with its context id (TTSAudioRawFrame).

Fields

§context_id: Option<Arc<str>>
§

Text(String)

Generic text (TextFrame) — flows LLM→aggregator→TTS.

§

LlmText(String)

LLM-generated text chunk (LLMTextFrame).

§

Transcription

Final transcription (TranscriptionFrame).

Fields

§text: String
§user_id: Arc<str>
§language: Option<Language>
§final_: bool
§

InterimTranscription

Interim/partial transcription (InterimTranscriptionFrame).

Fields

§text: String
§user_id: Arc<str>
§language: Option<Language>
§

TtsSpeak

Text the TTS should speak (TTSSpeakFrame).

Fields

§text: String
§append_to_context: Option<bool>
§

TtsText

Word/segment text emitted by TTS with its context (TTSTextFrame).

Fields

§text: String
§context_id: Option<Arc<str>>
§

FunctionCallResult(FunctionCallResult)

Function-call result, fed back to the LLM (FunctionCallResultFrame). Uninterruptible — once produced, context must always be updated.

§

LlmRun

Trigger an LLM run over the current context (LLMRunFrame).

§

LlmContext(Arc<LlmContext>)

The universal LLM context to run (LLMContextFrame).

§

OutputDtmf(Vec<KeypadEntry>)

Outbound DTMF (OutputDTMFFrame).

§

End

Graceful shutdown after flush (EndFrame). Uninterruptible.

Fields

§reason: Option<String>
§

Stop

Stop but keep processors connected (StopFrame). Uninterruptible.

§

LlmResponseStart

LLM response framing (LLMFullResponseStart).

§

LlmResponseEnd

LLM response framing (LLMFullResponseEnd).

§

TtsStarted

TTS response framing (TTSStartedFrame).

Fields

§context_id: Option<Arc<str>>
§

TtsStopped

TTS response framing (TTSStoppedFrame).

Fields

§context_id: Option<Arc<str>>
§

UpdateSettings

Update a service’s settings live (ServiceUpdateSettingsFrame). Uninterruptible. target = STT/TTS/LLM/Filter/Mixer/All.

Fields

§settings: Value
§

SpeechControlParams

Speech-control params broadcast (SpeechControlParamsFrame) + VAD param updates (VADParamsUpdateFrame).

§

Heartbeat

Liveness probe (HeartbeatFrame).

Fields

§timestamp_ns: i64
§

OutputTransportReady

Output transport ready (OutputTransportReadyFrame).

§

FilterEnable(bool)

Enable/disable an input-leg audio filter at runtime (FilterEnableFrame, frames.py:1971). Promoted out of Custom (PROCESSOR-DESIGN §1.2) so the AudioFilterProcessor can be toggled hot. Control class (ordered, interruptible).

§

MixerEnable(bool)

Enable/disable an output-leg audio mixer at runtime (MixerEnableFrame, frames.py:2000). Promoted out of Custom. Toggles the MixerProcessor. Control class.

§

Custom(Arc<dyn CustomFrame>)

Implementations§

Source§

impl Frame

Source

pub fn class(&self) -> FrameClass

Scheduling class — drives queue priority + interruptibility (PROCESSOR-DESIGN §2.3). Custom delegates to CustomFrame::frame_class.

Source

pub fn uninterruptible(&self) -> bool

True ⇒ kept in the queue and not cancelled on interruption (pipecat UninterruptibleFrame: End, Stop, FunctionCallResult, UpdateSettings). Custom delegates to CustomFrame::uninterruptible.

Source

pub fn name(&self) -> &'static str

A stable, human-readable name for tracing/observers/meta.

Source

pub fn is_terminal(&self) -> bool

Whether this frame is a terminal lifecycle frame (End/Stop/Cancel) that ends a PipelineTask when it reaches the sink.

Source

pub fn kind(&self) -> FrameKind

The discriminant kind, for event-hook / idle-frame matching without carrying the payload. See FrameKind.

Trait Implementations§

Source§

impl Clone for Frame

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Frame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Frame

§

impl !UnwindSafe for Frame

§

impl Freeze for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more