chatbot  is a software application capable of conducting a conversation with a human user through written or spoken language. The level of “intelligence” among chatbots varies widely. While some chatbots have a very basic understanding of the language, others employ sophisticated artificial intelligence (AI) and machine learning (ML) algorithms to achieve an almost human level of conversation.

In this tutorial I will show you how easy it is to build a WhatsApp chatbot using the Twilio API for WhatsApp  and Flask framework  for Python. Below you can see an example of interaction with the chatbot:

project demo

Tutorial Requirements

To follow this tutorial you need the following components:

  • Python 3.6 or later. If your operating system does not have a Python interpreter, you can go to python.org  to download the installer.
  • Flask . We are going to create a web application that responds to messages coming from WhatsApp.
  • ngrok . We will use this utility to connect the Flask application running on your system to a public URL that Twilio can connect to. This is necessary for the development version of the application, because your computer is probably behind a router or firewall and is therefore not directly accessible on the Internet. If you do not have ngrok installed, you can download a copy for Windows, MacOS or Linux .
  • A smartphone with an active phone number and WhatsApp installed.
  • A Twilio account. If you’re new to Twilio, create a free account  now  You can review the features and limitations of the free Twilio account .

#code #tutorials and hacks #flask

Build a Chatbot for WhatsApp with Python, Flask and Twilio
11.30 GEEK