PipelineTask: use QueueTaskFrame
This commit is contained in:
@@ -35,6 +35,7 @@ from pipecat.frames.frames import (
|
|||||||
InterruptionFrame,
|
InterruptionFrame,
|
||||||
InterruptionTaskFrame,
|
InterruptionTaskFrame,
|
||||||
MetricsFrame,
|
MetricsFrame,
|
||||||
|
QueueTaskFrame,
|
||||||
StartFrame,
|
StartFrame,
|
||||||
StopFrame,
|
StopFrame,
|
||||||
StopTaskFrame,
|
StopTaskFrame,
|
||||||
@@ -756,6 +757,9 @@ class PipelineTask(BasePipelineTask):
|
|||||||
# pipeline-ending frame to finish traversing the pipeline.
|
# pipeline-ending frame to finish traversing the pipeline.
|
||||||
logger.debug(f"{self}: received interruption task frame {frame}")
|
logger.debug(f"{self}: received interruption task frame {frame}")
|
||||||
await self._pipeline.queue_frame(InterruptionFrame())
|
await self._pipeline.queue_frame(InterruptionFrame())
|
||||||
|
elif isinstance(frame, QueueTaskFrame):
|
||||||
|
logger.debug(f"{self}: received queue task frame {frame}")
|
||||||
|
await self.queue_frames(frame.frames)
|
||||||
elif isinstance(frame, ErrorFrame):
|
elif isinstance(frame, ErrorFrame):
|
||||||
await self._call_event_handler("on_pipeline_error", frame)
|
await self._call_event_handler("on_pipeline_error", frame)
|
||||||
if frame.fatal:
|
if frame.fatal:
|
||||||
|
|||||||
Reference in New Issue
Block a user