Expand description
RTVI-protocol observer (pure frame→message mapping, no network).
Translates pipeline Frames into outgoing RTVI client-protocol
messages (user/bot transcription, speaking edges, LLM/TTS lifecycle,
function-call signalling, metrics). Mirrors pipecat’s
processors/frameworks/rtvi/observer.py (RTVIObserver) and the v1 message
shapes in .../rtvi/models.py.
This module is pure: it maps a frame to an RtviMessage and hands it to
an injectable RtviSink. The actual transport (WebSocket/Daily/etc.) lives
in the embedder; tests use the in-memory VecSink. No reqwest/network dep
is pulled into flowcat-core (the networked OTel/Sentry/Langfuse exporters live
in flowcat-services instead).
§What is mapped (parity with pipecat RTVIObserver.on_push_frame)
| Frame | RTVI message type |
|---|---|
Frame::UserStartedSpeaking | user-started-speaking |
Frame::UserStoppedSpeaking | user-stopped-speaking |
Frame::BotStartedSpeaking | bot-started-speaking |
Frame::BotStoppedSpeaking | bot-stopped-speaking |
Frame::SttMute | user-mute-started / user-mute-stopped |
Frame::Transcription (user_id != "bot") | user-transcription (final: true) |
Frame::Transcription (user_id == "bot", realtime s2s) | bot-transcription |
Frame::InterimTranscription (user_id != "bot") | user-transcription (final: false) |
Frame::LlmResponseStart | bot-llm-started |
Frame::LlmResponseEnd | bot-llm-stopped |
Frame::LlmText | bot-llm-text (+ bot-transcription on sentence end) |
Frame::TtsStarted | bot-tts-started |
Frame::TtsStopped | bot-tts-stopped |
Frame::TtsText | bot-tts-text + bot-output (spoken: true) |
Frame::FunctionCallsStarted | llm-function-call-started (per call) |
Frame::FunctionCallInProgress | llm-function-call-in-progress |
Frame::FunctionCallResult | llm-function-call-stopped (cancelled: false) |
Frame::FunctionCallCancel | llm-function-call-stopped (cancelled: true) |
Frame::Metrics | metrics (bucketed ttfb/processing/tokens/characters) |
Structs§
- Rtvi
Message - One outgoing RTVI server→client message. Serializes to the exact pipecat v1
wire shape:
{ "label": "rtvi-ai", "type": "<type>", "data"?: { … } }. - Rtvi
Observer - Pure frame→RTVI-message observer (PROCESSOR-DESIGN §5.1; pipecat
RTVIObserver). Plugs into the pipelineObserverfan-out viaFrameObserver; for each pushed frame it emits zero or moreRtviMessages to the injectedRtviSink. - Rtvi
Observer Params - Toggles for which RTVI message families the observer emits. Mirrors pipecat
RTVIObserverParams. All default to on (the conventional client UX), except audio levels (off — those need the audio payload + a rate limiter). - VecSink
- An in-memory
RtviSinkthat records every message — the test/inspection sink. Cheap to clone-share viaArc.
Enums§
- Function
Call Report Level - How much function-call detail an RTVI message exposes (pipecat
RTVIFunctionCallReportLevel). Defaults toNone— the most secure level that still emits the event (tool-call-id only, no name/args).
Constants§
- MESSAGE_
LABEL - The constant
labelon every RTVI message (pipecatMESSAGE_LABEL). - PROTOCOL_
VERSION - RTVI protocol version this observer emits (mirrors pipecat
models.PROTOCOL_VERSION).
Traits§
- Rtvi
Sink - Where the
RtviObserverhands finished messages. Decouples the pure frame→message mapping from any transport — the live transport (WS/Daily) in the embedder implements this; tests useVecSink.