Confirmation and Closing
Prolog and Patterns
Confirming choice of recipe
After the user selects a recipe, the agent should allow the user to confirm their choice. We foresee two ways this part of the conversation can proceed:
A: Can you confirm ___* is the recipe you would like to cook?
U: Yes. (Alternatively: No.)
A: Great. (Alternatively: That is unfortunate. [Move back to the recipe selection stage])
* insert name of recipe here
After the agent performs a recipeCheck to ask whether the user can confirm that they would want to cook the recipe shown, a user can do either one of two things: they could provide a confirmation, or a disconfirmation. As appreciation (an intent we added earlier) is very close to confirmation, we also want to take that as a yes (i.e., if a user expresses appreciation in the conversational context of the recipe confirmation pattern a50recipeConfirm
, we also want the agent to proceed as if the user has expressed their confirmation). You should add these three different variants of the a50recipeConfirm
pattern to the patterns.pl
file. One thing to consider here is what should happen when this pattern is completed. After completing, when the user confirms, the conversation should move on to a closing (see below). However, when the user says they do not like the recipe, we do not want that! Instead, we want the conversation to go back to the conversational context of the a50recipeSelect
pattern. Think about how you can make that work!
Finally, don’t forget to add agent response to the responses.pl
file for the recipeCheck
intent!
Saying farewell
Add a pattern that models the following conversational closing pattern. In Moore and Arar’s taxonomy, this is a C4.3: Closing Farewell (Agent) pattern. In its most basic form, it goes like this:
A: goodbye.
U: bye.
Introduce 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.
As an extension, you can 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. See Visuals and Visual Requirements for more information.
Test it Out
Before you start testing, add the c43
to the agent’s agenda in the dialog_init,mod2g
file. Why do we not need to add the a50recipeConfirm
pattern to the agenda?