Using https://flowiseai.com/ as the Agent Builder with ConversationRelay. This code-sample uses conversationrelay-bridge npmjs package.
For local development, make sure you have Node and ngrok installed.
- Clone this repo
- Run
npm install
. Thencp .env.example .env
and set up the variables. We will get the Flowise values from the next step - Modify
handlers/twiml.ts
to change the default greeting message or any other changes you want to ConversationRelay. All available attributes can be found on TwiML™ Voice: - Run
npm run dev
to start the dev server. Expose your local server to the internet usingngrok http 8080
- Visit Twilio Console page to purchase a number. Then configure the Incoming Webhook to point to
ngrokDomain/twiml
- Visit https://flowiseai.com/ and sign up for an account
- Go to the Credentials tab and create a new credential for LLM model of choice
- Go to Agentflows and create a new Flow - call it VoiceAgent.
- Create your flow as you see fit.
- Click the
</>
icon on the top right corner and make sure thedefault
API key is selected. - Grab the
FLOWISE_CHATFLOW_ID
(from the URL) and update your local.env
- Visit the
API Keys
on the homepage to grab theFLOWISE_API_KEY
You are now ready to call your number!
We suggest using Fly.IO to host your application. It supports long-running WebSocket connections and is free (when you signup, you have to add your credit card, but you can deploy free servers for testing purposes).
This repo includes the cofiguration for easily deploying the application to Fly.IO. All the configurations are located in the fly.toml
file.
- Sign up for Fly.IO and install/setup the CLI.
- Create a new Fly App:
fly apps create cr-flowiseai
- Grab the domain name of your newly created Fly app and update your local
.env
with theDOMAIN
value. - Setup the secrets:
fly secrets import < .env
- Deploy the application:
fly deploy
- View the logs:
fly logs
You can now set the Incoming Webhook of your Twilio number to point to DOMAIN/twiml
.