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

a50recipeConfirm: Confirming a Recipe in patterns.pl

After the user selects a recipe, the agent should confirm the user’s allow the user to confirm their choice. We foresee two potential situations for this conversation, which can be accommodated by making two a50recipeConfirm patterns. After the agent uses ‘recipeCheck’ to ask if the user can look over the recipe information to decide if they want to cook that recipe, the user could confirm (1), or deny (2).

In patterns.pl, make the a50recipeConfirm patterns for the two scenarios mentioned above. Look at Dialogflow for the appropriate Intent identification naming. If the user says it does not want to choose that recipe, we need to go back to a50recipeSelect. How would one do this?

In responses.pl fill in ‘text(recipeCheck, “”)’ response.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 confirmthat 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 would 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!

c43: Farewell in patterns.pl

...

% Pattern C4.3: Closing Farewell (Agent)
% Example:
% A: goodbye
% U: bye
% Instruction:
% 1. Introduce an intent ‘farewell' for saying goodbye by adding this intent to your Dialogflow
% agent (for user recognition) and the response.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

Add a closing page at the end of the program to bid farewell and thank the user.

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

Extend

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.

...