M
Mastra•4w ago
ttsubasa

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
new GeminiLiveVoice({
vertexAI: true,
project: 'my-project',
location: 'us-east5',
model: 'projects/my-project/locations/us-east5/publishers/google/models/gemini-2.0-flash-live-001'
})
new GeminiLiveVoice({
vertexAI: true,
project: 'my-project',
location: 'us-east5',
model: 'projects/my-project/locations/us-east5/publishers/google/models/gemini-2.0-flash-live-001'
})
3 Replies
Mastra Triager
Mastra Triager•4w ago
šŸ“ 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!
Abhi Aiyer
Abhi Aiyer•4w ago
Thanks for opening that PR @ttsubasa !
ttsubasa
ttsubasaOP•3w ago
Thanks for checking it ! I'm happy it was merged !

Did you find this page helpful?