In this tutorial, We will show you how you can create a simple chat app (chatbot) using Python , Wit.ai and MessengerX.io.
Requirements
Clone the wit.ai sample template repository
Here you will need to clone the template repository.
git clone https://github.com/machaao/machaao-wit-template.git
cd machaao-wit-template
pip install -r requirements.txt
Basic Training with Wit.ai
- Log on to Wit.ai
- Create a new app
- Open the chatbot
- Open Traits from left sidebar
- Click on Add Train
- Select “Add built-in traits”
- Select “wit/bye” and “wit/greetings”
- Open Settings
- Copy “Server Access Token”
Creating a Chat App on MessengerX.io
To host the chat app on your website, will need to get a token from MessengerX.io.
Follow this below tutorial to create the same and get an API token.
How to get API Token for MessengerX.io Chat App Marketplace?
Configuring your chat app server
- Create “.env” file in root directory of the project
WIT_ACCESS_TOKEN=<YOU-WIT-ACCESS-TOKEN>
MESSENGERX_API_TOKEN=<YOU-MESSENGERX-API-KEY>
MESSENGERX_BASE_URL=https://ganglia-dev.machaao.com
- machaao run -p 5000 -t <MESSENGERX API TOKEN>