Chatbots
Last updated
Last updated
ADR-0005 - Use Dialogflow for chatbots
Guide: Google Documenation
Here is the plantuml activity diagram
Create a "Default Welcome Intent" with answers: "Hi I am your personal trainer, let me advice you on your health. I can currently calculate your BMI, store the BMI and advices you on your BMI."
After creating the intent add training phrases and activate webhook fulfilment (this is required to check if allready a user exists for this profile):
Do the same for the update_bmi intent (training phrase: My hight is 177 cm, I weigh 80 kg and my birthday is 19.12.1987). How to handle partial dates (https://miningbusinessdata.com/dialogflow-tutorial-setting-context-from-your-inline-webhook-using-contextout/)
To start it makes sense to implement all fulfillments in one webhook on firebases. Later for more complex logic it is adviced to move this logic to it's own webhooks that are then called from the fulfillment webhook. For more details see the later section.
Setup Firebase (https://den.gitbook.io/developerplaybook/services-api/firebase)
Guide: Google Documentation
"we highly recommend that you use the Node.js client library to process requests and return responses"
First build a webhook with a fullfilment router
https://medium.com/@pallavtrivedi03/how-to-make-a-webhook-for-dialogflow-fulfillment-d02835cc50bf
Sample: https://github.com/miningbusinessdata/apiai-python-webhook/blob/master/app.py