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.
- Get your Agent Project Id from Dialogflow console.
- Download Service Account Credential file from GCP.
-
Enter the file path downloaded above in the app.py file on line number 16.
-
Run your code using Ngrok if you are using this integrator from local machine and copy the Ngrok url.
-
Go to your snatchbot account and create a new bot or select existing bot.
-
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.
-
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