GeminiLiveVoice Vertex AI WebSocket Connection Fails - @mastra/voice-google-gemini-live
Hi team! š
I'm experiencing WebSocket connection failures when using Vertex AI mode with
@mastra/voice-google-gemini-live.
The Problem
When configuring vertexAI: true, connections fail with these errors:
- HTTP 400 Bad Request - WebSocket connection rejected
- WebSocket Error 1007: Invalid resource field value - Invalid model path format
Root Cause Analysis
1. Wrong WebSocket endpoint: The package uses Live API endpoint (generativelanguage.googleapis.com) even when vertexAI: true is set
2. Model path format issue: Always adds models/ prefix, causing duplication with Vertex AI's full model paths like projects/{project}/locations/{location}/publishers/google/models/gemini-2.0-flash-live-001
Expected Behavior
- Vertex AI mode should use the correct endpoint: {location}-aiplatform.googleapis.com/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent
- Model paths should be used as-is for Vertex AI without adding models/ prefix
Configuration Used
3 Replies
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10256
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @ttsubasa for helping us improve Mastra!
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10257
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @ttsubasa for helping us improve Mastra!
Thanks for opening that PR @ttsubasa !
Thanks for checking it ! I'm happy it was merged !