-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
When using gemini-3.1-flash-live-preview as the realtime model, the agent fails to generate the first reply immediately after joining the room. It times out waiting for the generation_created event. The exact same code with gemini-2.5-flash works without any issues.
Expected Behavior
Agent should generate and speak the first reply immediately after joining the room, same as it does with gemini-2.5-flash
Reproduction Steps
1.Create an AgentSession with google.realtime.RealtimeModel using model gemini-3.1-flash-live-preview
2.Start the session with session.start()
3.Call session.generate_reply() for the opening dialogue
Minimal Reproducible Example
from livekit import agents
from livekit.plugins import google, silero
from livekit.agents import AgentSession
@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
session = AgentSession(
llm=google.realtime.RealtimeModel(
model="gemini-3.1-flash-live-preview", # ❌ fails
voice="Puck",
),
vad=silero.VAD.load(),
)
await session.start(ctx.room, participant=ctx.room.remote_participants)
await session.generate_reply(
instructions="Greet the user."
)Operating System
Windows11
Models Used
gemini-3.1-flash-live-preview
Package Versions
livekit-agents==1.5.1Logs
ERROR… livekit.…ns.google error in receive task: 1007 None.
Request contains an invalid argument.
websockets.exceptions.ConnectionClosedError:
received 1007 (invalid frame payload data) Request contains an invalid argument.;
then sent 1007 (invalid frame payload data) Request contains an invalid argument.
google.genai.errors.APIError: 1007 None. Request contains an invalid argument.
ERROR… livekit.agents failed to generate a reply:
generate_reply timed out waiting for
generation_created event.
WARNI… livekit.…ns.google received server content but no active generation.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working