<@U08CKJH7C12> Something I would love help with, I...
# agents
f
@refined-appointment-81829 Something I would love help with, I’m using a LiveKit voice agent to run mock interviews. Now I want to add a second mode (called human-led interviews) where two human users can join a video conference room using the same service flow (same pre-interview and post-interview logic). The issue is that when I create this conference room, the voice agent automatically joins as a participant. I am using explict dispatch for the agent and my entry code looks like this:
Copy code
if __name__ == "__main__":
    agents.cli.run_app(
        agents.WorkerOptions(entrypoint_fnc=entrypoint, agent_name="interview-agent")
    )
Here is what i tried: • passing the agent dispatch config conditionally as part of the token -- agent was still joining the room. • avoiding calling ctx.connect (I noticed thats when the agent joins) -- did not work. My current fix: • Mute the agent and hide its tile in the GridLayout component --not ideal for sure. What is the best way to conditionally choose if the agent should join? Thanks :)
r
Why are you dispatching the agent if you do not want it in the room?
f
@refined-appointment-81829 I started using explicit dispatch because earlier I had issues where the agent wouldn’t reliably connect to the room. That fixed the problem. But now I need to conditionally dispatch the agent depending on the session type. The challenge is that if I don’t specify an agent_name, LiveKit still seems to fall back to its auto-dispatch behavior, and the agent ends up joining the room anyway. What would be the best way to keep this single entrypoint for both session types, while still having full control over whether the agent should be dispatched or not?
Appreciate your help, been struggling to wrap my head around this for sometime. ✌🏻
r
Do you have a default agent (one without an agent_name set) running somewhere? If not an agent should not join the room unless you dispatch it.