Skip to content

Commit 4065b43

Browse files
Add deployment field to agent dispatch in TokenSource
Add support for targeting specific agent deployments when using TokenSource: - Add AgentDeployment property to TokenSourceFetchOptions - Add Deployment field to AgentDispatch class - Include deployment in BuildRequest when any agent field is set Leave deployment empty to target the production deployment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 74efbf2 commit 4065b43

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Runtime/Scripts/TokenSource/TokenSource.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private static TokenSourceRequest BuildRequest(TokenSourceFetchOptions options)
140140
request.ParticipantAttributes = null;
141141
}
142142

143-
if (!string.IsNullOrEmpty(options.AgentName) || !string.IsNullOrEmpty(options.AgentMetadata))
143+
if (!string.IsNullOrEmpty(options.AgentName) || !string.IsNullOrEmpty(options.AgentMetadata) || !string.IsNullOrEmpty(options.AgentDeployment))
144144
{
145145
request.RoomConfig = new RoomConfig
146146
{
@@ -149,7 +149,8 @@ private static TokenSourceRequest BuildRequest(TokenSourceFetchOptions options)
149149
new AgentDispatch
150150
{
151151
AgentName = NullIfEmpty(options.AgentName),
152-
Metadata = NullIfEmpty(options.AgentMetadata)
152+
Metadata = NullIfEmpty(options.AgentMetadata),
153+
Deployment = NullIfEmpty(options.AgentDeployment)
153154
}
154155
}
155156
};

Runtime/Scripts/TokenSource/TokenSourceData.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ public class TokenSourceFetchOptions
1515
public Dictionary<string, string> ParticipantAttributes { get; init; }
1616
public string AgentName { get; init; }
1717
public string AgentMetadata { get; init; }
18+
/// <summary>
19+
/// Optional deployment to target. Leave empty to target the production deployment.
20+
/// </summary>
21+
public string AgentDeployment { get; init; }
1822
}
1923

2024
class TokenSourceRequest
@@ -51,6 +55,12 @@ class AgentDispatch
5155

5256
[JsonProperty("metadata", NullValueHandling = NullValueHandling.Ignore)]
5357
public string Metadata;
58+
59+
/// <summary>
60+
/// Optional deployment to target. Leave empty to target the production deployment.
61+
/// </summary>
62+
[JsonProperty("deployment", NullValueHandling = NullValueHandling.Ignore)]
63+
public string Deployment;
5464
}
5565

5666
/// <summary>

0 commit comments

Comments
 (0)