Skip to content

Commit 677433b

Browse files
feat: add deployment field to agent dispatch (#968)
Add `deployment` field to `RoomAgentDispatch` and `agentDeployment` to `TokenRequestOptions` for targeting specific agent deployments. Leave empty to target the production deployment. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b6bc06e commit 677433b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • livekit-android-sdk/src/main/java/io/livekit/android/token

livekit-android-sdk/src/main/java/io/livekit/android/token/TokenSource.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,22 @@ data class TokenRequestOptions(
3535
val participantAttributes: Map<String, String>? = null,
3636
val agentName: String? = null,
3737
val agentMetadata: String? = null,
38+
/**
39+
* Optional deployment to target. Leave empty to target the production deployment.
40+
*/
41+
val agentDeployment: String? = null,
3842
)
3943

4044
/**
4145
* Converts a [TokenRequestOptions] to [TokenSourceRequest], a JSON serializable request body.
4246
*/
4347
fun TokenRequestOptions.toRequest(): TokenSourceRequest {
44-
val agents = if (agentName != null || agentMetadata != null) {
48+
val agents = if (agentName != null || agentMetadata != null || agentDeployment != null) {
4549
listOf(
4650
RoomAgentDispatch(
4751
agentName = agentName,
4852
metadata = agentMetadata,
53+
deployment = agentDeployment,
4954
),
5055
)
5156
} else {
@@ -105,6 +110,10 @@ data class RoomConfiguration(
105110
data class RoomAgentDispatch(
106111
val agentName: String? = null,
107112
val metadata: String? = null,
113+
/**
114+
* Optional deployment to target. Leave empty to target the production deployment.
115+
*/
116+
val deployment: String? = null,
108117
)
109118

110119
@SuppressLint("UnsafeOptInUsageError")

0 commit comments

Comments
 (0)