You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following server code from the repo sample produces the subsequent errors:
importtype{JobProcess}from'@livekit/agents';import{AutoSubscribe,typeJobContext,WorkerOptions,cli,defineAgent,llm,pipeline,}from'@livekit/agents';import*asdeepgramfrom'@livekit/agents-plugin-deepgram';import*asopenaifrom'@livekit/agents-plugin-openai';import*assilerofrom'@livekit/agents-plugin-silero';importdotenvfrom'dotenv';importpathfrom'node:path';import{fileURLToPath}from'node:url';import{z}from'zod';const__dirname=path.dirname(fileURLToPath(import.meta.url));constenvPath=path.join(__dirname,'../.env.local');dotenv.config({path: envPath});exportdefaultdefineAgent({prewarm: async(proc: JobProcess)=>{proc.userData.vad=awaitsilero.VAD.load();},entry: async(ctx: JobContext)=>{constvad=ctx.proc.userData.vad!assilero.VAD;constinitialContext=newllm.ChatContext().append({role: llm.ChatRole.SYSTEM,text:
'You are a voice assistant created by LiveKit. Your interface with users will be voice. '+'You should use short and concise responses, and avoiding usage of unpronounceable '+'punctuation.',});awaitctx.connect(undefined,AutoSubscribe.AUDIO_ONLY);console.log('waiting for participant');constparticipant=awaitctx.waitForParticipant();console.log(`starting assistant example agent for ${participant.identity}`);constfncCtx: llm.FunctionContext={weather: {description: 'Get the weather in a location',parameters: z.object({location: z.string().describe('The location to get the weather for'),}),execute: async({ location })=>{console.debug(`executing weather function for ${location}`);constresponse=awaitfetch(`https://wttr.in/${location}?format=%C+%t`);if(!response.ok){thrownewError(`Weather API returned status: ${response.status}`);}constweather=awaitresponse.text();return`The weather in ${location} right now is ${weather}.`;},},};constagent=newpipeline.VoicePipelineAgent(vad,newdeepgram.STT(),newopenai.LLM(),newopenai.TTS(),{chatCtx: initialContext, fncCtx },);agent.start(ctx.room,participant);awaitagent.say('Hey, how can I help you today',true);},});cli.runApp(newWorkerOptions({agent: fileURLToPath(import.meta.url)}));
waiting for participant
starting assistant example agent for voice_assistant_user_1461
file:///Users/****/Desktop/livekit/livekit-node-test/node_modules/@livekit/agents/dist/tts/tts.js:167
charactersCount: this.#text.length,
^
TypeError: Cannot read properties of undefined (reading 'length')
at ChunkedStream.monitorMetrics (file:///Users/****/Desktop/livekit/livekit-node-test/node_modules/@livekit/agents/dist/tts/tts.js:167:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.17.0
[10:39:54.476] WARN (63126): job process exited unexpectedly
err: {
"type": "Error",
"message": "Channel closed",
"stack":
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at target.send (node:internal/child_process:754:16)
at Timeout._onTimeout (file:///Users/****/Desktop/livekit/livekit-node-test/node_modules/@livekit/agents/dist/ipc/proc_job_executor.js:47:18)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
"code": "ERR_IPC_CHANNEL_CLOSED"
}
The text was updated successfully, but these errors were encountered:
The following server code from the repo sample produces the subsequent errors:
The text was updated successfully, but these errors were encountered: