Im getting this error: ``` "/Users/malteholledig/F...
# ask-ai
a
Im getting this error:
Copy code
"/Users/malteholledig/Freja/freja-agent-python/venv/lib/                                                           
                                     python3.13/site-packages/google/cloud/texttospeech_v1/se                                                           
                                     rvices/text_to_speech/async_client.py", line 531, in                                                               
                                     synthesize_speech                                                                                                  
                                         response = await rpc(                                                                                          
                                                    ^^^^^^^^^^                                                                                          
                                         ...<4 lines>...                                                                                                
                                         )                                                                                                              
                                         ^                                                                                                              
                                       File                                                                                                             
                                     "/Users/malteholledig/Freja/freja-agent-python/venv/lib/                                                           
                                     python3.13/site-packages/google/api_core/grpc_helpers_as                                                           
                                     ync.py", line 88, in __await__                                                                                     
                                         raise exceptions.from_grpc_error(rpc_error) from                                                               
                                     rpc_error                                                                                                          
                                     google.api_core.exceptions.InvalidArgument: 400 This                                                               
                                     voice requires a model name to be specified.                                                                       
                                                                                                                                                        
                                     The above exception was the direct cause of the                                                                    
                                     following exception:                                                                                               
                                                                                                                                                        
                                     Traceback (most recent call last):                                                                                 
                                       File                                                                                                             
                                     "/Users/malteholledig/Freja/freja-agent-python/venv/lib/                                                           
                                     python3.13/site-packages/livekit/agents/tts/tts.py",                                                               
                                     line 257, in _main_task                                                                                            
                                         await self._run(output_emitter)                                                                                
                                       File                                                                                                             
                                     "/Users/malteholledig/Freja/freja-agent-python/venv/lib/                                                           
                                     python3.13/site-packages/livekit/plugins/google/tts.py",                                                           
                                      line 294, in _run                                                                                                 
                                         raise APIStatusError(e.message, status_code=e.code                                                             
                                     or -1) from e                                                                                                      
                                     livekit.agents._exceptions.APIStatusError: This voice                                                              
                                     requires a model name to be specified. (status_code=400,                                                           
                                     request_id=None, body=None, retryable=False)
When using this code:
Copy code
session = AgentSession(
            tts=google.TTS(
                voice_name=voice,
                language="da-DK",
                credentials_file="credentials-secret.json",
                use_streaming=False,
            ),
            llm=google.realtime.RealtimeModel(
                model=llm_model,
                voice=voice,
                temperature=temperature,
                instructions="",
                input_audio_transcription=InputAudioTranscription(
                    model=transcription_model,
                    language=language,
                    prompt="Context is a phone call in language {language}",
                ),
                enable_affective_dialog=True,
                proactivity=True,
                thinking_config=types.ThinkingConfig(include_thoughts=False),
            ),
            vad=silero.VAD.load(),
        )
It is because the tts wants a model specified but there is no param for this. Is that a bug?
t
Thanks for reaching out, Malte. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! The error you're seeing happens because the Google Cloud TTS voice you're using needs a specific model parameter, but currently, the LiveKit Google Cloud TTS plugin doesn’t support specifying a model name. This is just a limitation of the plugin itself, not the Google Cloud TTS API. Here are some ways to work around this: • You can use standard Google Cloud TTS voices that don’t require a model specification. For example:
Copy code
from livekit.plugins import google
tts = google.TTS(
    voice_name="en-US-Standard-H",  # Standard voice
    gender="female"
)
• Try to avoid HD or Chirp3 voices, as they do need that model specification. • Or, if it fits your needs, consider an alternative TTS plugin like Gemini TTS, which does support specifying a model:
Copy code
from livekit.plugins import google
tts = google.beta.GeminiTTS(
    model="gemini-2.5-flash-preview-tts",
    voice_name="Zephyr"
)
If you have any more questions or specific needs, please don’t hesitate to ask—I’m here to help! Sources: livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/tts.py | Groq TTS plugin guide | LiveKit Docs | Gemini TTS plugin guide | LiveKit Docs | Google Cloud TTS integration guide | LiveKit Docs