Welcome to the Vapi Twilio sample project! This guide will walk you through integrating Vapi with your Twilio account.
To set up this project:
-
Create a Python Virtual Environment
python -m venv .venv source .venv/bin/activate
-
Set Up Environment Variables
-
Create a
.env
file in your repository:cp .env.example .env
-
Add your
VAPI_PRIVATE_TOKEN
to the.env
file.
-
-
Install Dependencies
pip install --upgrade pip &&\ pip install -r requirements.txt
-
Configure Your Twilio Number
- Go to your Twilio Console and navigate to your active number.
- In the Configuration section, change the "A call comes in" setting to Webhook.
- Set the webhook URL to
your_ngrok_url/twilio/inbound_call
and save the configuration.
-
Run the FastAPI Server
fastapi dev ./app/main.py
To make your local server accessible over the internet, you can use ngrok. Follow these steps:
-
Install ngrok
- Download ngrok from the official website.
- Unzip and install ngrok.
-
Expose Localhost
ngrok http 8000
- Assistant ID: After creating an assistant in the VAPI Dashboard, you will receive an assistant ID. Use this ID in your configurations.
- Phone Number ID: Purchase a Twilio phone number. The ID of this phone number can be used for your purposes.
This sample project demonstrates how to integrate a custom language model with Vapi. By following these steps, developers can create a more versatile and responsive voice assistant tailored to their users' unique needs.
For more help and detailed documentation, please refer to the official Vapi documentation.