Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

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

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:

...

Finally, don’t forget to add agent response to the responses.pl file for the recipeCheck intent!

c43: Farewell in patterns.pl

...

Saying farewell

Add a pattern that encapsulates models the following conversation called c43.% Pattern conversational closing pattern. In Moore and Arar’s taxonomy, this is a C4.3: Closing Farewell (Agent)
% Examplepattern. In its most basic form, it goes like this:%

A: goodbye.

...

U: bye.

% Instruction:
% 1. Introduce an farewell intent ‘farewell' for saying goodbye by adding this intent to your Dialogflow
% agent (for user recognition) and the responseand also add this intent to the responses.pl file ( for agent text generation).
% 2. Add a pattern here where the agent initiates (i.e. starts) saying goodbye and then the user is
% allowed to say goodbye.
% 3. Add the c43 pattern you introduced to the agent’s agenda.

Visuals

generating an agent response. 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.

Code Block
%%% Thank you page at the end.
page(c43, _, Html) :-

...

Introduce a last topic check to your farewell pattern to see if the user wants anything else or wishes to find another recipe. If they do restart the entire conversation. Note: this can be done using [agent, restart] which resets the agent agenda to the initial agenda at the start of session.

Test it Out

Add Before you start testing, add the c43 to the agent agent’s agenda in the dialog_init,mod2g file. Why do we not need to add the a50recipeConfirm pattern to the agenda?

Run the agent all the Now you should be able to Run your Conversational Agent and talk your way through from an initial greeting to the closing part of a recipe recommendation conversation.

Info

All done?

Proceed with https://socialrobotics.atlassian.net/wiki/spaces/PM2/pages/2216001572/BuildingDesigning+and+Developing+Your+Agent#Agent-Capability-9%3A-Allow-for-Filter-Removal-10%3A-Removing-Filters-and-Showing-Recipes-on-Demand