Welcome to the Voice Agent Workshop! In this workshop, you will learn how to build and test a production-ready voice agent using LiveKit and Coval.
To run this agent, you need the following
- A LiveKit Cloud account, project, and API keys
- A Python environment with uv installed
- An OpenAI account and API Key
- A Deepgram account and API Key
Step 1: Copy this repository (Click the green "Use this template" button on GitHub) Step 2: Clone your new copy to your local machine Step 3: Install dependencies using uv
```shell
uv sync
```
Step 4: Create a .env.local
file in the root of the project and add your API keys
```
LIVEKIT_URL=
LIVEKIT_API_KEY=
LIVEKIT_API_SECRET=
OPENAI_API_KEY=
DEEPGRAM_API_KEY=
```
Step 5: Run your new agent in the console
```shell
uv run agent.py console
```
This agent is compatible with the LiveKit Agents Playground.
To run the agent for the playground, use the dev
subcomand:
```shell
uv run agent.py dev
```
In this workshop, you will be adding features and functionality to the agent.py
file. You are free to use the playground or the console mode to speak with your agent as you work on it.
For the Coval sections of the workshop, you need to run your agent in dev
mode to make it available to Coval.
```shell
uv run agent.py dev
```
To setup the Coval connection, follow these steps:
- Create a Sandbox token server in LiveKit Cloud.
- Enter a name for your token server (can be anything).
- Create the server, dismiss the dialog, and click the "launch" button.
- Copy the Sandbox ID from this screen.
- Sign in to your Coval account (you should have an email invite already)
- Click the "Agents" menu item in the top left
- Click the "Connect Agent" button in the top right
- Enter a name for your agent
- Select "LiveKit" as the simulator type
- For token endpoint, use
https://cloud-api.livekit.io/api/sandbox/connection-details
- For Sandbox ID, use the name/ID from your token server
- Add your LiveKit server URL (it's in your
.env.local
file) - Set content type to
application/json
You should now be ready to test your agent in Coval.
You are welcome to continue working on your agent after the workshop, or start a new one. Here are some useful documentation links for content not covered in the workshop: