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/flat-monkeys-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-server-sdk": patch
---

Add `deployment` to `CreateDispatchOptions`
2 changes: 1 addition & 1 deletion packages/livekit-server-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {
"@bufbuild/protobuf": "^1.10.1",
"@livekit/protocol": "^1.46.3",
"@livekit/protocol": "^1.46.6",
"camelcase-keys": "^9.0.0",
"jose": "^5.1.2"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/livekit-server-sdk/src/AgentDispatchClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ import { ServiceBase } from './ServiceBase.js';
import { type Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';

interface CreateDispatchOptions {
// any custom data to send along with the job.
// note: this is different from room and participant metadata
/** any custom data to send along with the job.
* note: this is different from room and participant metadata
*/
metadata?: string;
// controls whether the job should be restarted when it fails (cloud only)
/** controls whether the job should be restarted when it fails (cloud only) */
restartPolicy?: JobRestartPolicy;
/** optional deployment to dispatch to. Leave empty to target the production deployment. */
deployment?: string;
}

const svc = 'AgentDispatchService';
Expand Down Expand Up @@ -61,6 +64,7 @@ export class AgentDispatchClient extends ServiceBase {
agentName,
metadata: options?.metadata,
restartPolicy: options?.restartPolicy,
deployment: options?.deployment,
}).toJson();
const data = await this.rpc.request(
svc,
Expand Down
11 changes: 9 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading