frames: remove StopInterruptionFrame

This commit is contained in:
Aleix Conchillo Flaqué
2025-08-29 16:40:01 -07:00
parent 81325be4f3
commit bd7d9346b7
10 changed files with 9 additions and 32 deletions

View File

@@ -869,19 +869,6 @@ class StartInterruptionFrame(SystemFrame):
pass
@dataclass
class StopInterruptionFrame(SystemFrame):
"""Frame indicating user stopped speaking (interruption ended).
Emitted by the BaseInputTransport to indicate that a user has stopped
speaking (i.e. no more interruptions). This is similar to
UserStoppedSpeakingFrame except that it should be pushed concurrently
with other frames (so the order is not guaranteed).
"""
pass
@dataclass
class UserStartedSpeakingFrame(SystemFrame):
"""Frame indicating user has started speaking.

View File

@@ -27,7 +27,6 @@ from pipecat.frames.frames import (
InterimTranscriptionFrame,
StartFrame,
StartInterruptionFrame,
StopInterruptionFrame,
STTMuteFrame,
TranscriptionFrame,
UserStartedSpeakingFrame,
@@ -206,7 +205,6 @@ class STTMuteFilter(FrameProcessor):
frame,
(
StartInterruptionFrame,
StopInterruptionFrame,
VADUserStartedSpeakingFrame,
VADUserStoppedSpeakingFrame,
UserStartedSpeakingFrame,

View File

@@ -30,7 +30,6 @@ from pipecat.frames.frames import (
FrameProcessorResumeUrgentFrame,
StartFrame,
StartInterruptionFrame,
StopInterruptionFrame,
SystemFrame,
)
from pipecat.metrics.metrics import LLMTokenUsage, MetricsData
@@ -587,8 +586,6 @@ class FrameProcessor(BaseObject):
elif isinstance(frame, StartInterruptionFrame):
await self._start_interruption()
await self.stop_all_metrics()
elif isinstance(frame, StopInterruptionFrame):
self._should_report_ttfb = True
elif isinstance(frame, CancelFrame):
await self.__cancel(frame)
elif isinstance(frame, (FrameProcessorPauseFrame, FrameProcessorPauseUrgentFrame)):

View File

@@ -32,7 +32,6 @@ from pipecat.frames.frames import (
LLMUpdateSettingsFrame,
StartFrame,
StartInterruptionFrame,
StopInterruptionFrame,
TranscriptionFrame,
TTSAudioRawFrame,
TTSStartedFrame,
@@ -653,7 +652,6 @@ class OpenAIRealtimeBetaLLMService(LLMService):
await self.start_ttfb_metrics()
await self.start_processing_metrics()
await self._stop_interruption()
await self.push_frame(StopInterruptionFrame())
await self.push_frame(UserStoppedSpeakingFrame())
async def _maybe_handle_evt_retrieve_conversation_item_error(self, evt: events.ErrorEvent):

View File

@@ -38,7 +38,6 @@ from pipecat.frames.frames import (
StartFrame,
StartInterruptionFrame,
StopFrame,
StopInterruptionFrame,
SystemFrame,
UserStartedSpeakingFrame,
UserStoppedSpeakingFrame,
@@ -374,7 +373,6 @@ class BaseInputTransport(FrameProcessor):
await self.push_frame(frame)
if self.interruptions_allowed:
await self._stop_interruption()
await self.push_frame(StopInterruptionFrame())
#
# Handle bot speaking state

View File

@@ -39,7 +39,6 @@ from pipecat.frames.frames import (
SpriteFrame,
StartFrame,
StartInterruptionFrame,
StopInterruptionFrame,
SystemFrame,
TransportMessageFrame,
TransportMessageUrgentFrame,
@@ -273,7 +272,7 @@ class BaseOutputTransport(FrameProcessor):
elif isinstance(frame, CancelFrame):
await self.cancel(frame)
await self.push_frame(frame, direction)
elif isinstance(frame, (StartInterruptionFrame, StopInterruptionFrame)):
elif isinstance(frame, StartInterruptionFrame):
await self.push_frame(frame, direction)
await self._handle_frame(frame)
elif isinstance(frame, TransportMessageUrgentFrame):