agents
agents copied to clipboard
generate_reply timed out waiting for generation_created event in LiveKit Agents (Gemini Live 2.5 Flash with Vertex AI) randomly.
Bug Description
Description When using Gemini Live 2.5 Flash models via Google Vertex AI with LiveKit Agents, the agent frequently throws the following error during response generation:
generate_reply timed out waiting for generation_created event This occurs after calling generate_reply() on an active LiveKit LLM session, particularly when connected to a Vertex AI gemini-live-2.5-flash model through the google-vertexai provider.
Expected Behavior
The LiveKit agent should receive the generation_created event from the Vertex AI Gemini model and begin streaming a response.
Reproduction Steps
Steps to Reproduce
Configure a LiveKit Agent to use:
Provider: google-vertexai
Model: gemini-live-2.5-flash
Livekit Agent version: 1.2.17
Start a standard session and attempt to generate replies multiple times.
Observe that:
In some runs, the agent streams replies normally.
In others, it hangs for several seconds and then times out with:
generate_reply timed out waiting for generation_created event
The error occurs even with stable network conditions and identical setup parameters.
Operating System
Ubuntu 24
Models Used
No response
Package Versions
LiveKit Agents version: 1.2.17
Google GenAI SDK version: google-genai >= 1.41.0
Python version: 3.13
Model: gemini-live-2.5-flash
Provider: google-vertexai
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response