From 1f9baefba8bab6a13c46ca1af129544f520e2a5a Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Sun, 27 Apr 2025 06:50:28 -0400 Subject: [PATCH] [WIP] AWS Nova Sonic service - added stubs for handling interruption and user-started-speaking frames --- src/pipecat/services/aws_nova_sonic/aws.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pipecat/services/aws_nova_sonic/aws.py b/src/pipecat/services/aws_nova_sonic/aws.py index 4e5619f52..737bc82fb 100644 --- a/src/pipecat/services/aws_nova_sonic/aws.py +++ b/src/pipecat/services/aws_nova_sonic/aws.py @@ -30,11 +30,15 @@ from pipecat.frames.frames import ( LLMFullResponseStartFrame, LLMTextFrame, StartFrame, + StartInterruptionFrame, + StopInterruptionFrame, TranscriptionFrame, TTSAudioRawFrame, TTSStartedFrame, TTSStoppedFrame, TTSTextFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame, ) from pipecat.processors.frame_processor import FrameDirection from pipecat.services.llm_service import LLMService @@ -131,6 +135,15 @@ class AWSNovaSonicService(LLMService): if isinstance(frame, InputAudioRawFrame): # TODO: check if _audio_input_paused? what causes that? await self._send_user_audio_event(frame) + # TODO: do we need to do anything for these? + elif isinstance(frame, StartInterruptionFrame): + print("[pk] StartInterruptionFrame") + elif isinstance(frame, UserStartedSpeakingFrame): + print("[pk] UserStartedSpeakingFrame") + elif isinstance(frame, StopInterruptionFrame): + print("[pk] StopInterruptionFrame") + elif isinstance(frame, UserStoppedSpeakingFrame): + print("[pk] UserStoppedSpeakingFrame") await self.push_frame(frame, direction)