Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/agent-deployment-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-api": patch
---

Add deployment field documentation for agent dispatch
9 changes: 8 additions & 1 deletion examples/agent_dispatch/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ struct Args {
/// Registered agent name to dispatch
#[arg(long, default_value = "my-agent")]
agent_name: String,

/// Optional deployment to target. Leave empty to target production deployment.
#[arg(long, default_value = "")]
deployment: String,
}

#[tokio::main]
Expand All @@ -36,10 +40,13 @@ async fn main() {
// Instantiate the AgentDispatch service client
let client = AgentDispatchClient::with_api_key(&host, &args.api_key, &args.api_secret);

// Create a dispatch for the given agent into the room
// Create a dispatch for the given agent into the room.
// The `deployment` field can be used to target a specific agent deployment.
// Leave empty to target the production deployment.
let req = proto::CreateAgentDispatchRequest {
agent_name: args.agent_name,
room: args.room_name,
deployment: args.deployment,
..Default::default()
};

Expand Down
4 changes: 3 additions & 1 deletion livekit-api/src/services/agent_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ impl AgentDispatchClient {
/// To use explicit dispatch, your agent must be registered with an `agent_name`.
///
/// # Arguments
/// * `req` - Request containing dispatch creation parameters
/// * `req` - Request containing dispatch creation parameters. The request can include
/// an optional `deployment` field to target a specific agent deployment.
/// Leave empty to target the production deployment.
///
/// # Returns
/// The created agent dispatch object
Expand Down
Loading