Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Dialogflow
When a user has added their preferences and chosen a recipe, they land on the recipe confirmation page. On that page, a user can check the recipe details (see Capability 6: Filter by Number of Ingredients & Recipe Steps) and decide whether they would like to cook that recipe or not. You should now enable the user to also indicate their decision to the conversational agent. To make that happen, your Dialogflow agent should be able to recognize whether the user confirms, or disconfirms the choice of recipe. For this, add the following intents, using the intent names as specified below:
...
For all of these intents, make sure you try to cover as many ways a user can express confirmation, disconfirmation, or saying goodbye.
Prolog and Patterns
Confirming choice of recipe
...
A: goodbye.
U: bye.
Introduce an a farewell intent for saying goodbye by adding this intent to your Dialogflow agent, and also add this intent to the responses.pl file for generating an agent response. Again, there are many different ways of saying goodbye, and many places where you can find inspiration for how you want your agent to say goodbye, e.g. here, or ask ChatGPT for help to shape your agent’s farewell message. Also, add a c43
pattern to the patterns.pl
file.
Finally, add a last topic check to your farewell pattern to see if the user wants anything else or wishes to find another recipe. If they indicate they want that, restart the entire conversation. You can do this by using the special action restart
. Check out how this action is processed in the dialog_update.mod2g
file to better understand what it does. Add [agent, restart]
to the pattern when a user confirms they want to restart; this resets the agent's agenda to the initial agenda it started with at the start of conversation.
Visuals
You should create one more page to match the top level intent c43
. Add a closing page at the end of the program to bid farewell and thank the user in the html.pl
file.
...