Ensure to push LLMFullResponseEndFrame if the sentence is empty.

This commit is contained in:
Filipi Fuchter
2025-11-18 19:50:14 -03:00
parent a60618b0ca
commit 600cd18cb7

View File

@@ -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)