From 600cd18cb7bfcb014dd01d09d630dcbde357b160 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Tue, 18 Nov 2025 19:50:14 -0300 Subject: [PATCH] Ensure to push LLMFullResponseEndFrame if the sentence is empty. --- src/pipecat/services/tts_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/tts_service.py b/src/pipecat/services/tts_service.py index f0d602a40..392c1e83f 100644 --- a/src/pipecat/services/tts_service.py +++ b/src/pipecat/services/tts_service.py @@ -364,7 +364,10 @@ class TTSService(AIService): sentence, includes_inter_frame_spaces=includes_inter_frame_spaces ) if isinstance(frame, LLMFullResponseEndFrame): - if self._push_text_frames: + # Ensure the sentence is not empty. In some cases, such as function calling, the + # LLMFullResponseEndFrame may never be pushed into the pipeline, which would + # cause issues if we proceed without "or not sentence" this check. + if self._push_text_frames or not sentence: await self.push_frame(frame, direction) else: await self.push_frame(frame, direction)