From ec02c88bb8092088e2aa1ee152ad3f7686a7ccc0 Mon Sep 17 00:00:00 2001 From: Aref Ghodamai Date: Sun, 22 Oct 2023 18:02:50 +0330 Subject: [PATCH] add logs --- vocode/streaming/streaming_conversation.py | 2 ++ vocode/streaming/transcriber/deepgram_transcriber.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vocode/streaming/streaming_conversation.py b/vocode/streaming/streaming_conversation.py index fa5800647..b8a6b37b3 100644 --- a/vocode/streaming/streaming_conversation.py +++ b/vocode/streaming/streaming_conversation.py @@ -208,6 +208,7 @@ def interrupt_current_filler_audio(self): async def process(self, item: InterruptableAgentResponseEvent[FillerAudio]): try: + self.conversation.logger.debug(f"Waiting for {self.name} to start") filler_audio = item.payload assert self.config is not None filler_synthesis_result = filler_audio.create_synthesis_result() @@ -216,6 +217,7 @@ async def process(self, item: InterruptableAgentResponseEvent[FillerAudio]): self.config.silence_threshold_seconds ) await asyncio.sleep(silence_threshold) + self.conversation.logger.debug(f"Finished waiting for {self.name} to start") self.conversation.logger.debug(f"Sending {self.name} to output") self.filler_audio_started_event = threading.Event() await self.conversation.send_speech_to_output( diff --git a/vocode/streaming/transcriber/deepgram_transcriber.py b/vocode/streaming/transcriber/deepgram_transcriber.py index f60a1032a..c20491e6f 100644 --- a/vocode/streaming/transcriber/deepgram_transcriber.py +++ b/vocode/streaming/transcriber/deepgram_transcriber.py @@ -250,7 +250,7 @@ async def receiver(ws: WebSocketClientProtocol): else: buffer_avg_confidence = ( buffer_avg_confidence - + confidence / (num_buffer_utterances) + + confidence / num_buffer_utterances ) * (num_buffer_utterances / (num_buffer_utterances + 1)) num_buffer_utterances += 1 if speech_final: @@ -262,7 +262,6 @@ async def receiver(ws: WebSocketClientProtocol): is_final=True, ) ) - self.logger.debug(f"after speech final, buffer: {buffer}") buffer = "" buffer_avg_confidence = 0 num_buffer_utterances = 1