Best practices for properly terminating Pipecat pipelines
EndFrame
from outside your pipeline using the pipeline task:EndTaskFrame
upstream from inside your pipeline. For example, inside a function call:EndFrame
is pushed downstream from the beginning of the pipeline:
EndFrame
s are queued, so they’ll process after any pending frames (like goodbye messages)EndFrame
EndFrame
reaches the sink of the PipelineTask
, the Pipeline is ready to shut downCancelFrame
:
task.cancel()
is called, which pushes a CancelFrame
downstream from the PipelineTask
CancelFrame
s are SystemFrame
s and are not queuedCancelFrame
immediate shutdown and push the frame downstreamCancelFrame
reaches the sink of the PipelineTask
, the Pipeline is ready to shut down