diff --git a/src/pipecat/services/gemini_multimodal_live/gemini.py b/src/pipecat/services/gemini_multimodal_live/gemini.py index 57753e9cd..0241b3b64 100644 --- a/src/pipecat/services/gemini_multimodal_live/gemini.py +++ b/src/pipecat/services/gemini_multimodal_live/gemini.py @@ -288,6 +288,10 @@ class GeminiMultimodalLiveLLMService(LLMService): ) async def _handle_transcribe_model_audio(self, audio, context): + # Early return if modalities are not set to audio. + if self._settings["modalities"] != GeminiMultimodalModalities.AUDIO: + return + text = await self._transcribe_audio(audio, context) logger.debug(f"[Transcription:model] {text}") # We add user messages directly to the context. We don't do that for assistant messages,