Does room.num_participants return total number of ...
# ask-ai
c
Does room.num_participants return total number of participants (agent included) or only remote participant?
t
Thanks for reaching out, Yousri. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — regarding your question about `room.num_participants`: that property is not documented as a standard LiveKit SDK field. The SDKs expose
remoteParticipants
(all other participants) and
localParticipant
(the current client). Agents join as full participants (
ParticipantKind.AGENT
), so any count that includes all participants would include agents. Can you tell me which SDK/language and version you’re using, or paste the code where you read
room.num_participants
? I’ll confirm how that value is being computed in your environment. Sources: Client SDKs | livekit/livekit_composite | DeepWiki | Agents (Python) | livekit/livekit_composite | DeepWiki | Livestream Mode, with interactive elements
c
it's defined on livekit repo, not livekit agents
t
Thanks — I’m following up on your note that
room.num_participants
is defined in the LiveKit repo (not LiveKit Agents). I can confirm the repo-level property’s behavior, but I need one quick detail: Which language/file in the repo defines
room.num_participants
for you (please share the file path or paste the snippet)? With that I’ll confirm whether it counts the local participant/agents, or only remote participants, and explain any livestream-mode nuances. Sources: server-sdk-ruby | livekit/livekit_composite | DeepWiki | client-sdk-js | livekit/livekit_composite | DeepWiki | LiveKit coming to React Native! | LiveKit | Livestream Mode, with interactive elements
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!