fix context order when using interruption strategies

This commit is contained in:
Aleix Conchillo Flaqué
2025-10-06 14:58:47 -07:00
parent 2576d0f340
commit de8ee96927
7 changed files with 59 additions and 15 deletions

View File

@@ -849,13 +849,15 @@ class FrameProcessorResumeUrgentFrame(SystemFrame):
class InterruptionFrame(SystemFrame):
"""Frame indicating user started speaking (interruption detected).
Emitted by the BaseInputTransport to indicate that a user has started
speaking (i.e. is interrupting). This is similar to
UserStartedSpeakingFrame except that it should be pushed concurrently
with other frames (so the order is not guaranteed).
Usually emitted by the pipeline task to indicate that all frame processors
should be interrrupted.
Parameters:
pushed_by_task: Whether this interruption was pushed from the pipeline
task.
"""
pass
pushed_by_task: bool = False
@dataclass
@@ -886,6 +888,17 @@ class StartInterruptionFrame(InterruptionFrame):
)
@dataclass
class InterruptionCompletedFrame(SystemFrame):
"""Frame indicating that the whole pipeline has been interrupted.
This is emitted by the pipeline task when an InterruptionFrame has made it
all the way to the end of pipeline, interrupting all the frame processors.
"""
pass
@dataclass
class UserStartedSpeakingFrame(SystemFrame):
"""Frame indicating user has started speaking.