From 1ad6405ebb33d651043eb6f73ab09d76d0f89771 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 12 Nov 2025 17:07:43 -0500 Subject: [PATCH] Override `includes_inter_frame_spaces` in: - `GoogleHttpTTSService` - `OpenAITTSService` The reason I skipped this work in an earlier PR was because these services seemed to be emitting long, punctuation-free text frames. It turns out that the issue was with the LLM prompt, though, resulting in the LLM nondeterministically excluding all punctuation. An upcoming commit will address that prompt issue. --- src/pipecat/services/google/tts.py | 9 +++++++++ src/pipecat/services/openai/tts.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/pipecat/services/google/tts.py b/src/pipecat/services/google/tts.py index bd3dbc203..5575d7d44 100644 --- a/src/pipecat/services/google/tts.py +++ b/src/pipecat/services/google/tts.py @@ -352,6 +352,15 @@ class GoogleHttpTTSService(TTSService): """ return True + @property + def includes_inter_frame_spaces(self) -> bool: + """Indicates that Google TTSTextFrames include necessary inter-frame spaces. + + Returns: + True, indicating that Google's text frames include necessary inter-frame spaces. + """ + return True + def language_to_service_language(self, language: Language) -> Optional[str]: """Convert a Language enum to Google TTS language format. diff --git a/src/pipecat/services/openai/tts.py b/src/pipecat/services/openai/tts.py index cdf0d11ac..af580e4a0 100644 --- a/src/pipecat/services/openai/tts.py +++ b/src/pipecat/services/openai/tts.py @@ -131,6 +131,15 @@ class OpenAITTSService(TTSService): """ return True + @property + def includes_inter_frame_spaces(self) -> bool: + """Indicates that OpenAI TTSTextFrames include necessary inter-frame spaces. + + Returns: + True, indicating that OpenAI's text frames include necessary inter-frame spaces. + """ + return True + async def set_model(self, model: str): """Set the TTS model to use.