Geography Quiz Chatbot is a chatbot where users can play 🏙️ Guess the capital (given a country the user must select the correct capital from a range of choices) or 🗺️ Guess the country (given the outlines of a country the user must select the correct country from a range of choices). The questions will be delivered and checked by Python Lambdas. The following short screen recording shows an interaction with the chatbot via WhatsApp.
The chatbot is built on a variety of serverless cloud technologies, namely:
The project is laid out like this:
├── autopilot
├── data
├── README.md
├── screenshot.png
└── serverless
autopilot
contains the Twilio Autopilot definitions. The main file is schema.json
located under autopilot/geography-quiz-chatbot/model
.
data
holds the source files and images (the outlines of the countries) which are used in the geography questions. It also contains a Python script (build-and-upload-images-v2.py
) to build the images.
serverless
contains the Python Lambdas which ask and evaluate the questions.
You can use the Twilio CLI to invoke and test the Twilio Autopilot locally, e.g.:
$ cd autopilot/geography-quiz-bot
$ twilio autopilot:deploy -l debug --target model
$ twilio autopilot:simulate --assistant-sid ASSISTANT-SID
To get help type twilio autopilot --help
.
Similarily you can use the Serverless CLI to invoke and test the Python Lambdas locally, e.g.:
$ cd serverless/geography-quiz-bot
$ sls invoke local --function capital
$ sls invoke local --function country
To get help type sls --help
.
You can find much more information about the chatbot in my blog post Building a Simple Quiz Chatbot With Twilio Autopilot and Serverless.