Skip to content

Latest commit

 

History

History
39 lines (21 loc) · 2.53 KB

File metadata and controls

39 lines (21 loc) · 2.53 KB

Dialogflow Integration with Snatchbot using Python

Snatchbot is a one of the popular chatbot development platform where user can easily create chatbot for their purpose and integrate on multiple channels.

To take advantage of powerful NLP provided by Dialogflow this script is created to provide bridge between Dialogflow and Snatchbot responses.

It is a Flask based script in Python which uses Dialogflow SDK. It accepts request from Snatchbot, passes on to Dialogflow, get response from Dialogflow and pass it back to Snatchbot with Snatchbot compatible JSON.

Steps for integration

  1. Get your Agent Project Id from Dialogflow console.

Project ID

  1. Download Service Account Credential file from GCP.

Service Account

  1. Enter the file path downloaded above in the app.py file on line number 16.

  2. Run your code using Ngrok if you are using this integrator from local machine and copy the Ngrok url.

Run Ngrok

Ngrok

  1. Go to your snatchbot account and create a new bot or select existing bot.

  2. In the bot create new interaction of JSON API type. Select JSON API interaction

  3. In the JSON API interaction set the API Address of ngrok obtained in 4th step. Also, set the Error Message so that if snatchbot is not able to connect to your API URL then it will display this error message. Set API URL

  4. You're done! Now, when this JSON API interaction is called in your chat flow, it will make request to Dialogflow and fetch response from there.

This script is still work in progress and more features will be added in future. You are welcome to fork it and add more changes.

Developed by Pragnakalp Solutions - Chatbots Development(Dialogflow, Snatchbot, Chatfuel), Python Development