Base Observer
All observers must inherit fromBaseObserver
and implement the on_push_frame
method:
Available Observers
Pipecat provides several built-in observers:- LLMLogObserver: Logs LLM activity and responses
- TranscriptionLogObserver: Logs speech-to-text transcription events
- RTVIObserver: Converts internal frames to RTVI protocol messages for server to client messaging
Using Multiple Observers
You can attach multiple observers to a pipeline task. Each observer will be notified of all frames:Example: Debug Observer
Here’s an example observer that logs interruptions and bot speaking events:Common Use Cases
Observers are particularly useful for:- Debugging frame flow
- Logging specific events
- Monitoring pipeline behavior
- Collecting metrics
- Converting internal frames to external messages