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..ae0b23507 100644 --- a/src/pipecat/processors/aggregators/llm_response.py +++ b/src/pipecat/processors/aggregators/llm_response.py @@ -293,7 +293,13 @@ class LLMUserContextAggregator(LLMContextResponseAggregator): await self.push_aggregation() async def _handle_transcription(self, frame: TranscriptionFrame): - self._aggregation += f" {frame.text}" if self._aggregation else frame.text + text = frame.text + + # Make sure we really have some text. + if not text.strip(): + return + + self._aggregation += f" {text}" if self._aggregation else text # We just got a final result, so let's reset interim results. self._seen_interim_results = False # Reset aggregation timer. @@ -301,8 +307,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())