Question
Why do I receive the WebSocket error {"type":"error","description":"Invalid speech model for Google: [model_name]"} when using <ConversationRelay> with transcriptionProvider="Google" even when the speech model is valid as per the documentation?
Product
Conversations
Environment
Twilio Console
Answer
This error occurs when you pass the hints attribute in your <ConversationRelay> TwiML while using a speechModel and transcriptionLanguage combination that does not support Google's "Model adaptation" feature.
Twilio's hints attribute relies on the underlying "Model adaptation" feature in Google Cloud Speech-to-Text V2. If you request a specific speech model (such as telephony) alongside hints for a language where Google does not support Model adaptation for that model, Google rejects the request. This rejection bubbles up and surfaces in Twilio as an Invalid speech model error.
To resolve this issue, you must do one of the following:
- Remove the
hintsattribute from your<ConversationRelay>TwiML. - Check Google's documentation to find and use a different
speechModelthat explicitly supports Model adaptation for your chosentranscriptionLanguage.
Additional Information
For a comprehensive list of which models support Model adaptation by language, please refer to the Google Cloud Speech-to-Text V2 supported languages documentation.