witty-kangaroo-6889
09/05/2025, 3:11 AMtall-airline-16756
09/05/2025, 3:11 AMtall-airline-16756
09/05/2025, 3:12 AMparticipant_connected event might not fire in the Agent Playground because the RoomIO class filters participants based on certain criteria. This filtering is managed through RoomInputOptions when you set up RoomIO.
To make sure the event triggers for the participants you want, here are a few things you can try:
• Adjust `participant_kinds`: You can include participant kinds like AGENT if that fits your needs. For example:
from livekit import rtc
from livekit.agents.voice.room_io import RoomInputOptions
input_options = RoomInputOptions(
participant_kinds=[
rtc.ParticipantKind.PARTICIPANT_KIND_SIP,
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD,
rtc.ParticipantKind.PARTICIPANT_KIND_AGENT # Include agents
]
)
• Set `participant_identity`: If you want the event to fire for a specific participant, just set their identity like this:
input_options = RoomInputOptions(
participant_identity="desired-participant-identity"
)
• Initialize RoomIO with options: When you create your RoomIO instance, be sure to pass in the RoomInputOptions you configured:
room_io = RoomIO(
agent_session=agent_session,
room=room,
input_options=input_options
)
One more thing to keep in mind: make sure the participant connecting doesn’t have the publish_on_behalf attribute set to the agent's identity, since those participants get filtered out.
Sources: livekit-agents/livekit/agents/voice/room_io/room_io.py