gentle-potato-90145
12/16/2025, 6:57 PMgentle-potato-90145
12/16/2025, 7:02 PMdef livekit_token(video_grant: nil, sip_grant: nil)
token = LiveKit::AccessToken.new(api_key: Rails.application.credentials.livekit.api_key!, api_secret: Rails.application.credentials.livekit.api_secret!)
token.identity = self.hashid
token.name = self.full_name
token.video_grant = video_grant if video_grant.present?
token.sip_grant = sip_grant if sip_grant.present?
token.room_config = {
agents: [
{
agentName: "stenographer",
metadata: { participant_identity: self.hashid }.to_json
}
]
}
token.to_jwt
end
that seems to only work for the first participant to join the room though.
{
"level": 30,
"time": 1765911658165,
"pid": 46,
"hostname": "deployment-p-2kd2aqoisur-ca-mpywkbmbkopd-65b657f948-4g7s9",
"version": "0.1.0",
"job": {
"id": "AJ_2uRxmUjAWeGt",
"type": "JT_ROOM",
"room": {
"sid": "RM_Vmn2uipAdLxd",
"name": "development/AdMtkd/mG0hO2",
"emptyTimeout": 300,
"maxParticipants": 0,
"creationTime": "1765911658",
"turnPassword": "",
"enabledCodecs": [
{
"mime": "audio/red",
"fmtpLine": ""
},
{
"mime": "video/H264",
"fmtpLine": ""
},
{
"mime": "video/VP8",
"fmtpLine": ""
},
{
"mime": "video/VP9",
"fmtpLine": ""
},
{
"mime": "video/AV1",
"fmtpLine": ""
},
{
"mime": "audio/opus",
"fmtpLine": ""
},
{
"mime": "audio/PCMU",
"fmtpLine": ""
},
{
"mime": "audio/PCMA",
"fmtpLine": ""
}
],
"metadata": "",
"numParticipants": 0,
"activeRecording": false,
"numPublishers": 0,
"version": {
"unixMicro": "1765911658063802",
"ticks": 0
},
"departureTimeout": 20,
"creationTimeMs": "1765911658060"
},
"namespace": "",
"metadata": "{\"participant_identity\":\"1DahXM\"}",
"agentName": "stenographer",
"state": {
"status": "JS_RUNNING",
"error": "",
"startedAt": "1765911658162381313",
"endedAt": "0",
"updatedAt": "1765911658162381313",
"participantIdentity": "agent_HLvZRVyNngaU",
"workerId": "CAW_3DN4X8GAWxwq",
"agentId": "CA_mPYwkBmBkoPD"
},
"dispatchId": "AD_AosVTz9gn65N",
"enableRecording": true
},
"resuming": false,
"agentName": "stenographer",
"msg": "received job request"
}
the other participants dont create an agentlively-winter-88668
12/17/2025, 9:55 AMgentle-potato-90145
12/17/2025, 2:53 PM