Processors
FrameProcessor
Base class for all frame processors in Pipecat, providing core processing functionality
Overview
FrameProcessor
is the foundation class for all processors in Pipecat. It provides essential functionality for frame handling, pipeline linking, metrics collection, and event management.
Constructor Parameters
name
str | None
Custom name for the processor. Defaults to “ClassName#N”
metrics
FrameProcessorMetrics | None
Custom metrics collector for the processor
loop
asyncio.AbstractEventLoop | None
Custom event loop for the processor
Core Properties
Identification
Pipeline Links
Processing Control
Frame Processing
Main Processing Method
Frame Direction
Frame Pushing
Push Methods
Single Push Task Rule
The processor maintains a single task for pushing frames to ensure ordering:
Metrics Support
Metrics Methods
Event Handling
Event Registration
Interruption Handling
Resource Management
Usage Example
Frame Flow
Notes
- Maintains single push task for frame ordering
- Handles system frames separately from data frames
- Supports bidirectional frame flow
- Provides metrics collection infrastructure
- Manages processor lifecycle
- Handles interruptions gracefully
- Thread-safe frame processing