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.