``` agent_dispatch = RoomAgentDispatch(agen...
# ask-ai
b
Copy code
agent_dispatch = RoomAgentDispatch(agent_name=agentName)

        created_room_info = await lkapi.room.create_room(
            api.CreateRoomRequest(name=room_name, agents=[agent_dispatch])
        )
so with this code we specify that only one agent will be able to run in one room. is it possible that we can allow multiple agents within the same room?
g
Yes, you can allow multiple agents within the same room by specifying multiple
RoomAgentDispatch
entries in the
agents
list when creating a room. Each
RoomAgentDispatch
can have a different
agent_name
, allowing multiple agents to be dispatched to the same room.
Copy code
agent_dispatch1 = RoomAgentDispatch(agent_name="agent1")
agent_dispatch2 = RoomAgentDispatch(agent_name="agent2")

created_room_info = await lkapi.room.create_room(
    api.CreateRoomRequest(name=room_name, agents=[agent_dispatch1, agent_dispatch2])
)
This code snippet demonstrates how to dispatch multiple agents to a room by including them in the
agents
list. Would you like more details on this process? Sources: - Dispatching agents 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.