Skip to content

Commit 25ebe61

Browse files
committed
feat: send agentIdentity in realtime session livekit payload
Allows the avatar worker to filter DataStream audio by sender identity, so only the agent's audio drives lip sync.
1 parent 5f6161a commit 25ebe61

2 files changed

Lines changed: 2558 additions & 2533 deletions

File tree

livekit-plugins/livekit-plugins-runway/livekit/plugins/runway/avatar.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ async def start(
101101
)
102102

103103
job_ctx = get_job_context()
104-
local_participant_identity = job_ctx.local_participant_identity
104+
self._local_participant_identity = job_ctx.local_participant_identity
105105

106106
livekit_token = (
107107
api.AccessToken(api_key=livekit_api_key, api_secret=livekit_api_secret)
108108
.with_kind("agent")
109109
.with_identity(self._avatar_participant_identity)
110110
.with_name(self._avatar_participant_name)
111111
.with_grants(api.VideoGrants(room_join=True, room=room.name))
112-
.with_attributes({ATTRIBUTE_PUBLISH_ON_BEHALF: local_participant_identity})
112+
.with_attributes({ATTRIBUTE_PUBLISH_ON_BEHALF: self._local_participant_identity})
113113
.to_jwt()
114114
)
115115

@@ -134,6 +134,7 @@ async def _create_session(self, livekit_url: str, livekit_token: str, room_name:
134134
"url": livekit_url,
135135
"token": livekit_token,
136136
"roomName": room_name,
137+
"agentIdentity": self._local_participant_identity,
137138
},
138139
}
139140

0 commit comments

Comments
 (0)