From b99a213832719437cedc94b8357a1f0054c657a3 Mon Sep 17 00:00:00 2001 From: shijing xian Date: Wed, 17 Jun 2026 11:17:21 +0800 Subject: [PATCH] docs: add deployment field documentation for agent dispatch Update docstrings and examples to document the deployment field for agent dispatch. The deployment field allows targeting a specific agent deployment (e.g., "staging"). Leave empty to target the production deployment. Co-Authored-By: Claude Opus 4.5 --- .changeset/agent-deployment-docs.md | 5 +++++ examples/agent_dispatch/src/main.rs | 9 ++++++++- livekit-api/src/services/agent_dispatch.rs | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/agent-deployment-docs.md diff --git a/.changeset/agent-deployment-docs.md b/.changeset/agent-deployment-docs.md new file mode 100644 index 000000000..929df7e14 --- /dev/null +++ b/.changeset/agent-deployment-docs.md @@ -0,0 +1,5 @@ +--- +"livekit-api": patch +--- + +Add deployment field documentation for agent dispatch diff --git a/examples/agent_dispatch/src/main.rs b/examples/agent_dispatch/src/main.rs index 96bf8c368..c22b48fdf 100644 --- a/examples/agent_dispatch/src/main.rs +++ b/examples/agent_dispatch/src/main.rs @@ -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] @@ -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() }; diff --git a/livekit-api/src/services/agent_dispatch.rs b/livekit-api/src/services/agent_dispatch.rs index 902cee627..a2a0bd45d 100644 --- a/livekit-api/src/services/agent_dispatch.rs +++ b/livekit-api/src/services/agent_dispatch.rs @@ -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