icy-nightfall-64225
08/07/2025, 7:33 AMawait self.room.local_participant.publish_track(self._video_track)
which participant it actually refers to? Agent or user participant?tall-airline-16756
08/07/2025, 7:33 AMtall-airline-16756
08/07/2025, 7:33 AMawait self.room.local_participant.publish_track(self._video_track)
, the local_participant
refers to the user participant. It represents the local user who is publishing the track, not an agent participant.
Sources: Inside a session | LiveKit Docs | livekit/src/room/participant/local_participant.rs | Rooms, participants, and tracks | LiveKit Docsicy-nightfall-64225
08/07/2025, 7:34 AMicy-nightfall-64225
08/07/2025, 7:36 AMtall-airline-16756
08/07/2025, 7:36 AMagentParticipant
property on the Room
object to get the agent participant directly.
• JavaScript/TypeScript: You can filter the remoteParticipants
collection to find the one with kind === 'AGENT'
, and make sure it’s not an avatar worker by checking that the lk.publish_on_behalf
attribute isn’t there.
• React: The useVoiceAssistant
hook is your friend here—it gives you the agent participant along with its state and tracks.
If you want me to dive deeper or share some examples for a specific SDK, just give me a shout!icy-nightfall-64225
08/07/2025, 7:37 AMtall-airline-16756
08/07/2025, 7:37 AM