Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 2.45 KB

README.md

File metadata and controls

92 lines (61 loc) · 2.45 KB
Twilio

aidungeon-twilio

About

This project shows how to integrate a custom machine learning model with an API to build an AI-powered conversational bot that builds a story based on your input.

Set up

Requirements

  • Python 3.4 or newer
  • A Twilio account — sign up
  • A Twilio phone number with Voice capabilities
  • A AIDungeon account — sign up

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it
git clone git@github.com:KNawm/aidungeon-twilio.git
cd aidungeon-twilio
  1. Create a new virtual environment
python3 -m venv venv
venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Set your environment variables
cp .env.example .env

Open .env in your favorite text editor and configure the following values.

Config Value Description
TWILIO_ACCOUNT_SID Your primary Twilio account identifier - find this in the console here.
TWILIO_AUTH_TOKEN Used to authenticate - you can get it at twilio.com/console.
AIDUNGEON_EMAIL Your AIDungeon account email - get a free account at play.aidungeon.io.
AIDUNGEON_PASS Your AIDungeon account password - just like the above, you'll get one here.
  1. Run the application
flask run

Alternatively, you can use this command to start the server in development mode. It will reload whenever you change any files.

export FLASK_ENV=development
flask run
  1. (optional) Run ngrok

If you are going to develop or test locally, Twilio won't be able to access localhost directly. You'll need to create a publicly accessible URL using a tool like ngrok to send HTTP/HTTPS traffic to a server running on your localhost.

./ngrok http 5000
  1. Configure Twilio

Enter here and configure your webhook.

That's it!

Contributing

This project is open source and welcomes contributions.