livekit-examples / realtime-playground

Play with OpenAI's new Realtime API in your browser
https://playground.livekit.io
Apache License 2.0
215 stars 67 forks source link

agent服务node版本服务运行不起来 #17

Closed langduhau closed 1 month ago

langduhau commented 1 month ago
微信图片_20241012161403
davidzhao commented 1 month ago

the error message indicates LIVEKIT_API_KEY is not set

langduhau commented 1 month ago

设置了的, image

abbeyseto commented 1 month ago

I have exactly the same issue. All env is set but I still get

/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/@livekit/agents/src/worker.ts:279 throw new MissingCredentialsError( ^

MissingCredentialsError: API Key is required: Set LIVEKIT_API_KEY, run with --api-key, or pass apiKey in WorkerOptions at Worker (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/@livekit/agents/src/worker.ts:279:13) at runWorker (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/@livekit/agents/src/cli.ts:25:18) at Command. (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/@livekit/agents/src/cli.ts:134:7) at Command.listener [as _actionHandler] (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:542:17) at /Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1502:14 at Command._chainOrCall (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1386:12) at Command._parseCommand (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1501:27) at /Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1265:27 at Command._chainOrCall (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1386:12) at Command._dispatchSubcommand (/Users/abiodun/PROJECTS/Personal/ConversationalAI/realtime-playground/agent/node_modules/commander/lib/command.js:1261:25)

abbeyseto commented 1 month ago

i figured out what the issue was.

The command you use to set environment variables from a .env.local file in the terminal depends on your operating system and shell. Based on the README content you provided, here are the recommended commands:

  1. For macOS and Linux (bash or similar shells): source .env.local

  2. For Windows (PowerShell): set -a; . .env.local; set +a

These commands are mentioned in the README under the "Agent Setup" section, specifically for the Python version. However, they can be used generally to load environment variables from a .env.local file.

Readme needs to be updated