Skip to content

Commit

Permalink
add livekit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kian1354 committed Jul 8, 2024
1 parent 6598324 commit 1ab12dd
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
1 change: 0 additions & 1 deletion apps/livekit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file added docs/images/livekit_keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"open-source/python-quickstart",
"open-source/react-quickstart",
"open-source/telephony",
"open-source/livekit-webrtc",
"open-source/turn-based-conversation"
]
},
Expand Down
44 changes: 44 additions & 0 deletions docs/open-source/livekit-webrtc.mdx
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.

0 comments on commit 1ab12dd

Please sign in to comment.