From c614d4f010c884ce4b2d0de98b6bfb0b5298cf44 Mon Sep 17 00:00:00 2001 From: Peter Nga Date: Thu, 26 Sep 2024 10:53:43 -0700 Subject: [PATCH 1/2] Adds a log to see what caused an interrupt --- vocode/streaming/streaming_conversation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vocode/streaming/streaming_conversation.py b/vocode/streaming/streaming_conversation.py index a880faf3a3..75c397f0be 100644 --- a/vocode/streaming/streaming_conversation.py +++ b/vocode/streaming/streaming_conversation.py @@ -273,6 +273,10 @@ async def process(self, transcription: Transcription): ) self.has_associated_unignored_utterance = not transcription.is_final if self.conversation.current_transcription_is_interrupt: + if self.conversation.transcript.get_last_user_message() is not None: + logger.debug( + f"Last user message when interrupted: {self.conversation.transcript.get_last_user_message()[1]}" + ) logger.debug("sent interrupt") logger.debug("Human started speaking") self.conversation.is_human_still_there = True From 85ed2438ba44b5d643d11810952fa05151618231 Mon Sep 17 00:00:00 2001 From: Peter Nga Date: Thu, 26 Sep 2024 14:15:02 -0700 Subject: [PATCH 2/2] Change to transcription instead of last message --- vocode/streaming/streaming_conversation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vocode/streaming/streaming_conversation.py b/vocode/streaming/streaming_conversation.py index 75c397f0be..e6c7d746dc 100644 --- a/vocode/streaming/streaming_conversation.py +++ b/vocode/streaming/streaming_conversation.py @@ -273,10 +273,9 @@ async def process(self, transcription: Transcription): ) self.has_associated_unignored_utterance = not transcription.is_final if self.conversation.current_transcription_is_interrupt: - if self.conversation.transcript.get_last_user_message() is not None: - logger.debug( - f"Last user message when interrupted: {self.conversation.transcript.get_last_user_message()[1]}" - ) + logger.debug( + f"Interrupting transcription: {transcription.message}, confidence: {transcription.confidence}" + ) logger.debug("sent interrupt") logger.debug("Human started speaking") self.conversation.is_human_still_there = True