Slide 1

Slide 1 text

Building a Conversational Bot for WhatsApp - Mridu Bhatnagar

Slide 2

Slide 2 text

Vocabulary Bot (Vocab Bot) - Features 1. Word definition 2. Synonyms 3. Antonyms 4. Examples

Slide 3

Slide 3 text

Requirements - Python Version 3.6+ - Flask - ngrok - A smartphone with active phone number and WhatsApp installed. - Twilio Account - https://www.twilio.com/try-twilio?promo=d34aPv

Slide 4

Slide 4 text

Configure the Twilio WhatsApp Sandbox - Open the Twilio WhatsApp Sandbox - https://www.twilio.com/console/sms/whatsapp/learn

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Configure the Twilio WhatsApp Sandbox - Check your WhatsApp contact list. Newly saved number would appear in contacts. This is our Bot: Vocab Bot :-)

Slide 7

Slide 7 text

Create a Python Virtual Environment

Slide 8

Slide 8 text

For Mac/Linux Users

Slide 9

Slide 9 text

For Windows Users

Slide 10

Slide 10 text

Create a Flask ChatBot Service

Slide 11

Slide 11 text

Create a Webhook

Slide 12

Slide 12 text

Receiving the incoming message from user

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

TwiML Message Response Object

Slide 15

Slide 15 text

Bot Response Logic Incoming message format - “Hi” Output message - “Hello hi”

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Twilio’s Response Template Format

Slide 18

Slide 18 text

Running the application

Slide 19

Slide 19 text

Run ngrok

Slide 20

Slide 20 text

Output of ngrok terminal

Slide 21

Slide 21 text

Twilio Sandbox for WhatsApp NOTE - Add your ngrok forwarding url in the textbox corresponding to When a message comes in field.

Slide 22

Slide 22 text

Sending Dynamic Responses

Slide 23

Slide 23 text

Data Source - API - Either create your own API or you can use any public APIs that are available. - Example Use Cases - Google Maps API - Cat Pictures API - Twitter API - Google News API - Github API

Slide 24

Slide 24 text

Integrating a API using Python

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Detailed Resource Link for Building your own Bot - Tutorial - Build a Vocabulary Bot for WhatsApp with Python and Twilio - Flask 101 - https://flask.palletsprojects.com/en/1.1.x/ - List of Public APIs - https://github.com/public-apis/public-apis

Slide 27

Slide 27 text

No content