Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,22 @@ data class TokenRequestOptions(
val participantAttributes: Map<String, String>? = null,
val agentName: String? = null,
val agentMetadata: String? = null,
/**
* Optional deployment to target. Leave empty to target the production deployment.
*/
val agentDeployment: String? = null,
)

/**
* Converts a [TokenRequestOptions] to [TokenSourceRequest], a JSON serializable request body.
*/
fun TokenRequestOptions.toRequest(): TokenSourceRequest {
val agents = if (agentName != null || agentMetadata != null) {
val agents = if (agentName != null || agentMetadata != null || agentDeployment != null) {
listOf(
RoomAgentDispatch(
agentName = agentName,
metadata = agentMetadata,
deployment = agentDeployment,
),
)
} else {
Expand Down Expand Up @@ -105,6 +110,10 @@ data class RoomConfiguration(
data class RoomAgentDispatch(
val agentName: String? = null,
val metadata: String? = null,
/**
* Optional deployment to target. Leave empty to target the production deployment.
*/
val deployment: String? = null,
)

@SuppressLint("UnsafeOptInUsageError")
Expand Down