diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index 02ca62ea8..3bb750218 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -8,7 +8,7 @@ import asyncio from asyncio import AbstractEventLoop from enum import Enum -from pipecat.frames.frames import Frame +from pipecat.frames.frames import ErrorFrame, Frame from pipecat.utils.utils import obj_count, obj_id from loguru import logger @@ -42,6 +42,9 @@ class FrameProcessor: async def process_frame(self, frame: Frame, direction: FrameDirection): pass + async def push_error(self, error: ErrorFrame): + await self.push_frame(error, FrameDirection.UPSTREAM) + async def push_frame(self, frame: Frame, direction: FrameDirection = FrameDirection.DOWNSTREAM): if direction == FrameDirection.DOWNSTREAM and self._next: logger.trace(f"Pushing {frame} from {self} to {self._next}")