Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add confirmation entity in dialogflow (api.ai)

I need to add a confirmation entity so I get a 'Yes' or a 'Cancel' in the parameters of a certain operation in dialogflow (api.ai). Say a user is purchasing a coffee, I'd ask details about the coffee and the quantity and finally i need a confirmation, what entity should i apply for that? any tutorial that refers to the same will also be helpful.

like image 876
jamian Avatar asked Oct 17 '17 07:10

jamian


2 Answers

DialogFlow has a concept called a follow-up intent that you could use in a case like this:

Adding a follow-up intent

You would create a "yes" follow-up to capture if the user wants to proceed, a "no" to cancel, and a "fallback" to explain to the user what is happening and what are acceptable answers.

If you are working with Actions on Google, you could also use askForConfirmation which is done completely from within your webhook code.

You can choose the most appropriate way depending on how your code is structured.

like image 191
Wayne Piekarski Avatar answered Oct 10 '22 22:10

Wayne Piekarski


The other way would be to create a confirmation entity and prompt for it in your intent.

Create entty: Create 2 rows, one for yes and another for no, with the appropriate synonyms.

Create a Confirmation entity

Adding it as a parameter with the entity you just created, and add the appropriate prompt.

Adding Prompt

Adding parameter

like image 37
Shaunith Avatar answered Oct 11 '22 00:10

Shaunith