happy-mouse-590
05/06/2026, 10:39 PMtall-airline-16756
05/06/2026, 10:39 PMtall-airline-16756
05/06/2026, 10:40 PMfrom livekit_agents import AgentSession, room_io
from livekit_agents.plugins.google import RealtimeModel
class VideoAssistant:
async def on_start(self, ctx):
# handle session start
pass
async def on_input(self, ctx, message):
# handle text/audio input and vision frames
pass
# create a session that enables camera/screen video input
session = AgentSession(
model=RealtimeModel(), # google realtime model (Gemini Live)
)
await session.start(
agent=VideoAssistant(),
room=ctx.room,
room_options=room_io.RoomOptions(video_input=True),
# optional: customize frame sampling
# video_sampler=CustomSampler(...)
)
Notes:
• The assistant uses the Gemini Live API via google.realtime.RealtimeModel from the Google plugin.
• By default the agent samples ~1 fps while the user speaks and ~1 frame every 3 seconds otherwise; you can customize sampling with video_sampler.
• For a full, complete recipe and more details (handling frames, outputs, and config), see the Gemini Vision recipe in the Vision guide.
Required LiveKit agent version
• Use livekit-agents with the Google plugin at version 1.5 or later. The docs show installing:
uv add "livekit-agents[google]~=1.5"
so ensure livekit-agents (and the Google plugin) are at least v1.5 to support Gemini Live Vision features.
If you want, I can:
• Paste the full Vision recipe example,
• Show a sample video_sampler implementation, or
• Help you confirm exact package versions from your environment — which would require the output of pip show livekit-agents (or your lockfile). Which do you prefer? Sources: Vision | LiveKit Documentation | Gemini Live API plugin | LiveKit Documentation, with interactive elements