helpful-author-83080
09/17/2025, 8:43 AMtall-airline-16756
09/17/2025, 8:43 AMtall-airline-16756
09/17/2025, 8:44 AMconnect() method.
• Server-Side Updates: You can update participant attributes and metadata using the server APIs, but the identity itself can’t be changed once the participant has joined.
If you'd like, I’m here to provide more details or examples for any specific SDK you’re working with—just let me know!
Sources: livekit-rtc/livekit/rtc/e2ee.py | Rooms, participants, and tracks | LiveKit Docs | Runtime/Scripts/Proto/E2Ee.cs | How to set a fixed participant for agent audio processing | Participant attributes and metadata | LiveKit Docshelpful-author-83080
09/17/2025, 8:44 AMtall-airline-16756
09/17/2025, 8:45 AMrequest_fnc function using the identity parameter inside req.accept(). This step happens before the job starts and makes sure the identity is ready as soon as the agent joins the room.
Here’s a simple example to guide you:
async def request_fnc(req: JobRequest):
await req.accept(
name="agent", # Participant name (display name)
identity="my-agent-123", # Participant identity
attributes={"role": "bot"} # Custom attributes
)
opts = WorkerOptions(entrypoint_fnc=entrypoint, request_fnc=request_fnc)
Just a few important notes to keep in mind:
• Prewarm Limitation: The prewarm_fnc is mainly for preloading models or data, so it can’t be used to set participant identity.
• Entrypoint Limitation: Identity needs to be set before the job starts, which means it can’t be assigned inside the entrypoint function.
• Immutable Identity: Once the identity is set and the participant joins the room, it can’t be changed afterward.
If anything is unclear or if you’d like me to walk you through this further, please don’t hesitate to ask—I’m here to help!
Sources: Anatomy of an Agent | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | Worker options | LiveKit Docs | Rooms, participants, and tracks | LiveKit Docshelpful-author-83080
09/17/2025, 8:46 AMtall-airline-16756
09/17/2025, 8:46 AMparticipant_identity field while creating the SIP participant through the CreateSIPParticipant API. This helps you give a custom identity to the SIP participant in your room, making things clearer and more personalized.
Here’s a little example to guide you:
response = await livekit_api.sip.create_sip_participant(
api.CreateSIPParticipantRequest(
sip_trunk_id="your_trunk_id",
sip_call_to="+1234567890",
room_name="my-room",
participant_identity="custom-sip-identity", # Set your desired identity here
participant_name="SIP Caller"
)
)
A couple of helpful notes to keep in mind:
• If you don’t set participant_identity, LiveKit will use the phone number as the identity by default—unless hide_phone_number is enabled, in which case it will generate a random identity for you.
• Make sure the identity is unique within the room because if there’s a duplicate, the older participant will be disconnected.
If you have any questions or need more help, please don’t hesitate to ask. I’m here to support you!
Sources: livekit-protocol/src/livekit.rs | protobufs/livekit_sip.proto | SIP APIs | LiveKit Docs | SIP Integration | livekit/livekit_composite | DeepWiki | SIP & Telephony Integration | livekit/livekit_composite | DeepWikihelpful-author-83080
09/17/2025, 8:48 AMtall-airline-16756
09/17/2025, 8:49 AMrequest_fnc function by specifying the identity parameter in the req.accept() call. This identity links directly to the Participant.identity field.
Here’s a friendly example to guide you:
async def request_fnc(req: JobRequest):
await req.accept(
name="agent", # The agent's name (Participant.name)
identity="my-agent-identity", # The agent's identity (Participant.identity)
attributes={"myagent": "rocks"}, # Optional attributes
)
A couple of helpful notes:
• If you don’t set the identity explicitly, it will default to agent-<jobid>.
• When working with avatar plugins like Simli, Tavus, or Hedra, you can set the identity using the avatar_participant_identity parameter in the AvatarSession constructor.
If anything feels unclear or if you’d like a hand with this, please don’t hesitate to reach out—I’m here to help!
Sources: livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/avatar.py | Dispatching agents | LiveKit Docshelpful-author-83080
09/17/2025, 8:56 AMtall-airline-16756
09/17/2025, 8:57 AM# Python Example
from livekit import api
async def list_participants(room_name: str):
lkapi = api.LiveKitAPI()
participants_response = await lkapi.room.list_participants(
room=room_name
)
return [
{"identity": p.identity, "name": p.name, "sid": p.sid}
for p in participants_response.participants
]
And don’t worry if you’re using Node.js, Kotlin, or other server SDKs — similar methods are available there too.
2. Client-Side: Using Room Object
If you’re working on the client side, you can access participants directly like this:
• Swift: Just use the allParticipants property on the Room object.
• JavaScript/React: The useRemoteParticipants hook is your friend for grabbing remote participants.
// JavaScript Example
import { useRemoteParticipants } from '@livekit/components-react';
const participants = useRemoteParticipants();
participants.forEach(p => console.log(p.identity));
If you’d like me to walk you through more details or provide examples for a specific SDK, just let me know — I’m here to help!
Sources: livekit-rtc/livekit/rtc/room.py | packages/livekit-server-sdk/src/RoomServiceClient.ts | src/main/kotlin/io/livekit/server/RoomServiceClient.kt | Tests/LiveKitTests/ParticipantTests.swift | packages/react/src/hooks/useRemoteParticipants.tshelpful-author-83080
09/17/2025, 8:58 AMtall-airline-16756
09/17/2025, 8:58 AMentrypoint function! You can do this by accessing the room.remote_participants dictionary from the JobContext after you've connected to the room. Each key here represents a participant's identity, and the value is a RemoteParticipant object.
Here's a little example to guide you:
async def entrypoint(ctx: JobContext):
room = ctx.room
# Connect to the room
await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
# Iterate through all currently connected remote participants
for rp in room.remote_participants.values():
print(rp.identity) # Print participant identity
This will fetch all participants already in the room when your agent joins. Also, if you want to catch participants who join afterwards, you can set up a listener for the "participant_connected" event.
Please feel free to reach out if you'd like me to explain anything further or if you need any more help!
Sources: Inside a session | LiveKit Docs | Building an Automated IVR Menu Caller | LiveKit Docs | livekit-api/livekit/api/room_service.pyhelpful-author-83080
09/17/2025, 9:13 AMtall-airline-16756
09/17/2025, 9:14 AMJobContext. Are you looking to log the identity, use it for routing, or maybe perform a specific action with it? Knowing this will really help me offer the best guidance tailored to your needs.helpful-author-83080
09/17/2025, 9:14 AMtall-airline-16756
09/17/2025, 9:15 AMhelpful-author-83080
09/17/2025, 10:45 AMtall-airline-16756
09/17/2025, 10:46 AMroom.local_participant.
On the other hand, for everyone else in the room, the AI Agent shows up as a remote participant. It's specially marked as a participant of kind AGENT, which sets it apart from regular end-users.
If you have any questions or need a hand with your Participant Egress request, please don’t hesitate to reach out—I’m here to help!
Sources: Inside a session | LiveKit Docs | Inside a session | LiveKit Docs | agents/src/job.ts | packages/react/src/hooks/useVoiceAssistant.ts | Rooms, participants, and tracks | LiveKit Docshelpful-author-83080
09/17/2025, 10:47 AMtall-airline-16756
09/17/2025, 10:48 AMhelpful-author-83080
09/17/2025, 10:49 AMtall-airline-16756
09/17/2025, 10:49 AM