SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Why Does <ConversationRelay> Return "Invalid Speech Model" for Google Transcription?

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 hints attribute from your <ConversationRelay> TwiML.
  • Check Google's documentation to find and use a different speechModel that explicitly supports Model adaptation for your chosen transcriptionLanguage.

 

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.

Have more questions? Submit a request
Powered by Zendesk