Should open ai realtime model be able to see video...
# agents
m
Should open ai realtime model be able to see video? I ask it questions about things in my video frame and it either makes up answers or says it can't see it. Gemini realtime works totally fine though. I'll put my current code in the thread
Copy code
async def entrypoint(ctx: JobContext):
    await ctx.connect(auto_subscribe=AutoSubscribe.SUBSCRIBE_ALL)

    ############## Room Metadata ##############
    if not ctx.job.room.metadata and os.getenv("REPLAY_BASE_URL") == "http://localhost:3000":
        # Default metadata for local development
        metadata = RoomMetadata.get_default().to_dict()
    else:
        metadata = json.loads(ctx.job.room.metadata)
    room_metadata = RoomMetadata.from_dict(metadata)  # Extract room metadata
    usage_collector = metrics.UsageCollector()  # Begin collecting usage metrics
    state.initialize(room_metadata=room_metadata, room=ctx.room)  # Core state

    ############## Agent Session ##############
    session: AgentSession = None

    if room_metadata.realtime_provider:
        # Realtime Voice Pipeline (OpenAI)
        if room_metadata.realtime_provider == RealtimeProvider.OPENAI:
            session = AgentSession(
                llm=openai.realtime.RealtimeModel(
                    voice=room_metadata.voice.id,
                ),
            )

    # Realtime Voice Pipeline (Gemini)
        elif room_metadata.realtime_provider == RealtimeProvider.GEMINI:
            session = AgentSession(
                llm=google.beta.realtime.RealtimeModel(
                    voice=room_metadata.voice.id,
                    vertexai=True,
                    location="us-central1",
                    project="xxxxxx",
                ),
            )
I'm auto-subscribing to all tracks, which i thought would be all i need to do
g
Jackson, I’m right in the thick of navigating this myself. I’ll share the conclusions I’ve come to and hope that anyone who knows better than me can correct me on anything I’ve misunderstood: 1. Only Gemini Live API supports full video stream as vision input, and LK supports that well. 2. OpenAI’s Realtime API and gpt-realtime model (both GA as of last week) support vision input as still images (e.g. sampled from device-camera video feed), but LK doesn’t support this for OpenAI yet a. https://github.com/livekit/agents/issues/3297 b. https://github.com/livekit/agents/pull/3327 c. Seems like this may be blocked waiting on an update to OpenAI’s python SDK, which I suppose is a dependency for LK’s OpenAI support: https://github.com/openai/openai-python/issues/2600 3. For vision with any model other than Gemini Live, LK’s recommended approach for sampling frames from video feed to send to models that only support still images is here: https://github.com/livekit-examples/python-agents-examples/tree/main/complex-agents/vision Glad to be corrected or further enlightened on any of this — if anyone knows better!
🙌 1
🙏 1
f
+1
m
Sick! Thanks for letting me know @glamorous-architect-23034
🎉 1