-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ version = "0.1.0" | |
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
readme = "README.md" | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: "Working with WebRTC" | ||
description: "Use LiveKit to connect Vocode Agents to WebRTC" | ||
--- | ||
|
||
# Overview | ||
|
||
[WebRTC](https://webrtc.org/) is an alternative to websockets for real-time P2P communication. Vocode Agents are compatible with both WebRTC and websockets, enabling developers to pick | ||
the stack best suited for their application. | ||
|
||
To connect Vocode agents to WebRTC, Vocode uses [LiveKit](https://livekit.io/)–an open source platform for building on WebRTC. For a background on how LiveKit | ||
works, please see their [documentation](https://docs.livekit.io/home/get-started/intro-to-livekit/). | ||
|
||
In this guide, we'll be walking through how to connect a Vocode Agent to the [LiveKit Agents Playground](https://agents-playground.livekit.io/). | ||
|
||
# Walkthrough: hooking up a Vocode Agent to a LiveKit Room | ||
|
||
## Setting up your LiveKit Server | ||
|
||
First, you'll want to set up a LiveKit Server for your Agent. For simplicity, we are using LiveKit's hosted offering–but it can also be self hosted. | ||
|
||
In our LiveKit dashboard, we first generate our websocket URL, API key, and Secret Key. | ||
|
||
![Setup](/images/livekit_keys.png) | ||
|
||
## Deploying your Vocode agent to a LiveKit Room | ||
|
||
Once you have your LiveKit Server credentials, we can hook it up to Vocode via the `LiveKitConversation` abstraction. Using the starter code in | ||
[vocode-core/apps/livekit/app.py](https://github.com/vocodedev/vocode-core/blob/main/apps/livekit/app.py), you can quickly deploy a Vocode Agent to | ||
a LiveKit Room. | ||
|
||
Fill in your credentials: | ||
|
||
```python | ||
|
||
LIVEKIT_SERVER_URL=wss://vocode-agent-b5oqfgl9.livekit.cloud | ||
LIVEKIT_API_KEY="KEY" | ||
LIVEKIT_API_SECRET="SECRET" | ||
``` | ||
|
||
Followed by | ||
`poetry run python app.py dev` | ||
|
||
And now you can connect to the [Agents Playground](https://agents-playground.livekit.io/) to interact with your agent. |