Prerequisites
- Python 3.7 or higher
- Spitch API key
- Livekit API key, URL and secret key
Installation & Setup
Install the following modules into your Python environment and setup your *.env* file with the following parameters.Integrating Spitch STT with Livekit
STT Parameters
Integrating Spitch TTS with Livekit
TTS Parameters
Building a Voice Agent with Spitch
In this section, we would build an end-to-end voice agent using Spitch and Livekit. The flowchart below summarizes the architecture of our agent: To get started, you’ll need API keys for Spitch, Livekit and your preffered LLM. We will be making use of OpenAI in this demo. To find out more about which LLMs are available on Livekit, check out this doc.Install packages
Install the following packages on your local computer to get started.Set up your environment variables
.env
Voice Agent Code
agent.py
Running the Agent
Download model files
Download the model files first to use the turn-detector, silero, or noise-cancellation plugins:
Speak to the agent
Start your agent in console mode to run inside your terminal:
Connect the agent to the playground
Start the agent in dev mode to connect it to LiveKit and make it available from anywhere on the internet: