diff --git a/package.json b/package.json index 65b1ebb..d7497e7 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ "typescript-eslint": "^8.46.2" }, "dependencies": { - "@livekit/agents": "^1.0.11", - "@livekit/agents-plugin-livekit": "^1.0.11", - "@livekit/agents-plugin-silero": "^1.0.11", + "@livekit/agents": "~1.0.18", + "@livekit/agents-plugin-livekit": "~1.0.18", + "@livekit/agents-plugin-silero": "~1.0.18", "@livekit/noise-cancellation-node": "^0.1.9", "dotenv": "^17.2.3", "zod": "^3.25.76" diff --git a/src/agent.ts b/src/agent.ts index 391f1d5..d68b75d 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -1,7 +1,7 @@ import { type JobContext, type JobProcess, - WorkerOptions, + ServerOptions, cli, defineAgent, inference, @@ -79,6 +79,10 @@ export default defineAgent({ // See more at https://docs.livekit.io/agents/build/turns turnDetection: new livekit.turnDetector.MultilingualModel(), vad: ctx.proc.userData.vad! as silero.VAD, + voiceOptions: { + // Allow the LLM to generate a response while waiting for the end of turn + preemptiveGeneration: true, + }, }); // To use a realtime model instead of a voice pipeline, use the following session setup instead. @@ -123,4 +127,4 @@ export default defineAgent({ }, }); -cli.runApp(new WorkerOptions({ agent: fileURLToPath(import.meta.url) })); +cli.runApp(new ServerOptions({ agent: fileURLToPath(import.meta.url) }));