Warn when TEXT modality is set for Gemini Live, and remove 26d text example

All recent Gemini Live models (including the default
gemini-2.5-flash-native-audio-preview-12-2025, and going at least as
far back as gemini-2.5-flash-native-audio-preview-09-2025) only
support AUDIO as a response modality. We considered using
`modalities=TEXT` as a Pipecat-level signal to suppress audio output
frames (so developers could pair Gemini Live with an external TTS),
but the output transcription from the API arrives too late relative
to the audio to be useful for driving an external TTS service.

For now, just log a warning when a TEXT modality is configured
(at init or via set_model_modalities) and proceed as normal. The 26d
text-modality example is removed since it no longer represents a
viable configuration.
This commit is contained in:
Paul Kompfner
2026-03-27 16:15:27 -04:00
parent 4f9c8a6860
commit 04adb697be
2 changed files with 11 additions and 142 deletions

View File

@@ -787,6 +787,13 @@ class GeminiLiveLLMService(LLMService):
if settings is not None:
default_settings.apply_update(settings)
# Warn if user requested TEXT modality
if default_settings.modalities == GeminiModalities.TEXT:
logger.warning(
f"Modality {default_settings.modalities.value!r} may not be supported by recent "
"Gemini Live models."
)
super().__init__(
base_url=base_url,
settings=default_settings,
@@ -920,6 +927,10 @@ class GeminiLiveLLMService(LLMService):
Args:
modalities: The modalities to use for responses.
"""
if modalities == GeminiModalities.TEXT:
logger.warning(
f"Modality {modalities.value!r} may not be supported by recent Gemini Live models."
)
self._settings.modalities = modalities
def set_language(self, language: Language):