Skip to content

pBread/twilio-conversation-relay-minimal-demo-11-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio Conversation Relay Template

This project provides a simple working example of an LLM powered voice bot using Twilio Conversation Relay.

Get Started

0. Prerequisites

1. Clone Repo

git clone https://github.com/pBread/twilio-conversation-relay-beta.git
cd twilio-conversation-relay-beta

2. Install Dependencies

npm install

3. Start Ngrok Tunnel

The application needs to know the domain (HOSTNAME) it is deployed to in order to function correctly. This domain is set in the HOSTNAME environment variable and it must be configured before starting the app.

Start ngrok by running this command.

ngrok http 3000

Then copy the domain

Note: ngrok provides static domains for all ngrok users. You can avoid updating the HOSTNAME every time by provisioning your own static domain.

4. Add Environment Variables

OPENAI_API_KEY=your-openai-api-key
HOSTNAME=your-ngrok-domain.ngrok.app

5. Run the App

This command will start the Express server which handles incoming Twilio webhook requests and media streams.

npm run dev

6. Configure Twilio Phone Number Webhooks

Go to your Twilio Console and configure the Voice webhooks for your Twilio phone number:

  • Incoming Call Webhook: Select POST and set url to: https://your-ngrok-domain.ngrok.app/incoming-call
  • Call Status Update Webhook: Select POST and set url to: https://your-ngrok-domain.ngrok.app/call-status-update

7. Place a Call to Your Twilio Phone Number

You're all set. Place a call to your Twilio Phone Number and you should see the real-time transcript logged to your local terminal.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published