From 98706d429c6acd22a725d2c3df5c10b89643239f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 21 Feb 2025 10:12:54 -0800 Subject: [PATCH] LLMUserContextAggregator: make sure incoming transcription has text --- src/pipecat/processors/aggregators/llm_response.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pipecat/processors/aggregators/llm_response.py b/src/pipecat/processors/aggregators/llm_response.py index 017973fda..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.