This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Rishabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! Could you please share a bit more about whether you’re looking for a specific format or naming style for the room name and ID? Also, if there are any particular rules or requirements for how these should be created, I’d love to know so I can assist you better.
Thanks for reaching out! In the LiveKit Swift SDK, the room SID is something the server assigns automatically during the connection process, so it can’t be set manually. But don’t worry—you can easily access it through the
sid
property of the
Room
class once you’re connected. Here’s a simple example to show you how to get the SID:
Copy code
let room = Room()
// After connecting...
if let roomSid = room.sid {
    print("Room SID: \(roomSid)")
}
If you prefer, there’s also an async method
sid()
that lets you wait until the SID is ready:
Copy code
do {
    let roomSid = try await room.sid()
    print("Room SID: \(roomSid)")
} catch {
    print("Failed to get SID: \(error)")
}
If you have any more questions or need a hand with anything else, just let me know—I’m here to help! Sources: Sources/LiveKit/Participant/RemoteParticipant.swift | Rooms, participants, and tracks | LiveKit Docs
m
I'm using the chat context that the agent API provides. How do I access the room details and room SID from the chat context?
t
I'd love to help you out! Could you please share a bit more about the chat context you're working with? For instance, is it a custom setup you've created or are you using a specific LiveKit SDK or library? Knowing this will really help me guide you on how to access the room details and the room SID. Looking forward to your reply!
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!
m
Try again.