It sounds like the Gemini Realtime API stopping after 5 minutes might be due to some external factors or server-side policies, rather than an issue with the LiveKit client itself. Let’s walk through a few steps that could help you troubleshoot and hopefully fix this:
•
Check Application Logs: Take a look at your logs for any warnings or messages that suggest the server is asking to disconnect. This can help confirm if the Gemini Live API service is the one initiating the disconnect.
•
Inspect Network Traffic: Try using browser developer tools or a network analyzer to see if the disconnection is coming from the server or maybe some network component in between.
•
Review Service Policies: Sometimes, a 5-minute limit is actually a design choice by the Gemini Live API. It might be worth checking out their official documentation or reaching out to Google to get the details on any session duration limits.
•
Implement Automatic Reconnection: You could add some logic to handle when disconnections happen, so your app can automatically start a new session and keep things running smoothly. If the API supports it, using a session resumption feature can make reconnections even more seamless.
If you want, I’m here to help you with any of these steps—just let me know!
Sources:
livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... |
plugins/google/src/beta/gemini_tts.ts