From 41720b1a13d7c4d90aff389f3aa9352274f272f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 20 Feb 2025 15:07:35 -0800 Subject: [PATCH] LLMUserContextAggregator: don't reset timer with interim transcription It turns out that in some cases we only get interim transcriptions (e.g. someone is speaking very very softly or someone is talking in the background). In those cases we don't want to interrupt the bot because there's really nothing to interrupt the bot for. We originally thought we should interrupt the bot right at the time we got an interim frame, but this is causing too many false positives. It's actually better to simply wait for a real transcription before interrupting (in case VAD didn't interrupt). --- CHANGELOG.md | 7 ++++++- src/pipecat/processors/aggregators/llm_response.py | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ba16255..760c79cee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,12 @@ stt = DeepgramSTTService(..., live_options=LiveOptions(model="nova-2-general")) ### Fixed -- Fixed an issue where `EndTaskFrame` was not triggering `on_client_disconnected` or closing the WebSocket in FastAPI. +- Fixed an issue that would cause undesired interruptions via + `EmulateUserStartedSpeakingFrame` when only interim transcriptions (i.e. no + final transcriptions) where received. + +- Fixed an issue where `EndTaskFrame` was not triggering + `on_client_disconnected` or closing the WebSocket in FastAPI. - Fixed a context aggregator issue that would not append the LLM text response to the context if a function call happened in the same LLM turn. diff --git a/src/pipecat/processors/aggregators/llm_response.py b/src/pipecat/processors/aggregators/llm_response.py index 6f1da5af4..017973fda 100644 --- a/src/pipecat/processors/aggregators/llm_response.py +++ b/src/pipecat/processors/aggregators/llm_response.py @@ -301,8 +301,6 @@ class LLMUserContextAggregator(LLMContextResponseAggregator): async def _handle_interim_transcription(self, _: InterimTranscriptionFrame): self._seen_interim_results = True - # Reset aggregation timer. - self._aggregation_event.set() def _create_aggregation_task(self): self._aggregation_task = self.create_task(self._aggregation_task_handler())