PipelineTask: handle BotInterruptionFrame in PipelineTask

This allows having processors before the input transport or even not having an
input transport.
This commit is contained in:
Aleix Conchillo Flaqué
2025-08-27 18:17:29 -07:00
parent 947faf8a39
commit 901899aa19
4 changed files with 18 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ from pipecat.frames.frames import (
KeypadEntry,
TranscriptionFrame,
)
from pipecat.pipeline.task import PipelineParams
from pipecat.processors.aggregators.dtmf_aggregator import DTMFAggregator
from pipecat.tests.utils import SleepFrame, run_test
@@ -69,6 +70,8 @@ class TestDTMFAggregator(unittest.IsolatedAsyncioTestCase):
aggregator,
frames_to_send=frames_to_send,
expected_down_frames=expected_down_frames,
# TODO(aleix): we should handle StartInterruptionFrame
pipeline_params=PipelineParams(allow_interruptions=False),
)
# Find the TranscriptionFrames
@@ -105,6 +108,8 @@ class TestDTMFAggregator(unittest.IsolatedAsyncioTestCase):
aggregator,
frames_to_send=frames_to_send,
expected_down_frames=expected_down_frames,
# TODO(aleix): we should handle StartInterruptionFrame
pipeline_params=PipelineParams(allow_interruptions=False),
)
transcription_frames = [
@@ -134,6 +139,8 @@ class TestDTMFAggregator(unittest.IsolatedAsyncioTestCase):
aggregator,
frames_to_send=frames_to_send,
expected_down_frames=expected_down_frames,
# TODO(aleix): we should handle StartInterruptionFrame
pipeline_params=PipelineParams(allow_interruptions=False),
send_end_frame=False, # We're sending one in the test to test EndFrame logic
)