Skip to content

Commit 6683597

Browse files
authored
Merge pull request #17 from livekit-examples/kat/dpro-564-upgrade-node-example-to-use-agentserver
Update WorkerOptions
2 parents 28cd562 + 279c73e commit 6683597

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"typescript-eslint": "^8.46.2"
3434
},
3535
"dependencies": {
36-
"@livekit/agents": "^1.0.11",
37-
"@livekit/agents-plugin-livekit": "^1.0.11",
38-
"@livekit/agents-plugin-silero": "^1.0.11",
36+
"@livekit/agents": "^1.0.21",
37+
"@livekit/agents-plugin-livekit": "^1.0.21",
38+
"@livekit/agents-plugin-silero": "^1.0.21",
3939
"@livekit/noise-cancellation-node": "^0.1.9",
4040
"dotenv": "^17.2.3",
4141
"zod": "^3.25.76"

src/agent.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
type JobContext,
33
type JobProcess,
4-
WorkerOptions,
4+
ServerOptions,
55
cli,
66
defineAgent,
77
inference,
@@ -79,6 +79,10 @@ export default defineAgent({
7979
// See more at https://docs.livekit.io/agents/build/turns
8080
turnDetection: new livekit.turnDetector.MultilingualModel(),
8181
vad: ctx.proc.userData.vad! as silero.VAD,
82+
voiceOptions: {
83+
// Allow the LLM to generate a response while waiting for the end of turn
84+
preemptiveGeneration: true,
85+
},
8286
});
8387

8488
// To use a realtime model instead of a voice pipeline, use the following session setup instead.
@@ -123,4 +127,4 @@ export default defineAgent({
123127
},
124128
});
125129

126-
cli.runApp(new WorkerOptions({ agent: fileURLToPath(import.meta.url) }));
130+
cli.runApp(new ServerOptions({ agent: fileURLToPath(import.meta.url) }));

0 commit comments

Comments
 (0)