frame_filter
Frame filtering processor for the Pipecat framework.
- class pipecat.processors.filters.frame_filter.FrameFilter(types: tuple[type[Frame], ...])[source]
Bases:
FrameProcessorA frame processor that filters frames based on their types.
This processor acts as a selective gate in the pipeline, allowing only frames of specified types to pass through. System and end frames are automatically allowed to pass through to maintain pipeline integrity.
- __init__(types: tuple[type[Frame], ...])[source]
Initialize the frame filter.
- Parameters:
types – Tuple of frame types that should be allowed to pass through the filter. All other frame types (except SystemFrame and EndFrame) will be blocked.
- async process_frame(frame: Frame, direction: FrameDirection)[source]
Process an incoming frame and conditionally pass it through.
- Parameters:
frame – The frame to process.
direction – The direction of frame flow in the pipeline.