Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Prolog and Patterns
Now that we have introduced a new intent for asking for a specific recipe by its name, we can add a new variant of the a50recipeSelect
pattern that we introduced earlier for [TBU]Request a Recommendation. To illustrate it, we repeat the example of the type of pattern that we have in mind:
...
The new agent intent label recipeChoiceReceipt
that we introduced also needs to be added to the responses.pl
file. To specify a phrase or response the agent can use when performing the intent, you should take into account that the name of the recipe should be part of the response (see the example again: Artichoke and pine nut pasta is a great choice!). As before, defining the response, therefore, requires a rule to define the text(recipeChoiceReceipt, Txt)
clause. The idea is that the agent first finds the current recipe stored in its conversational memory, retrieves the recipe's name, and finally constructs a response using the template string_concat(PhrasePart1, PhrasePart2, Txt)
where you need to replace the PhrasePart1
and PhrasePart2
arguments.
Visuals
You can update the visuals based on what you think will help the user the most. Think about how you can support the implemented capability visually.
...
Note |
---|
As we noted already in the Test it Out section for [TBU]Greet, and Self-Identify, Dialogflow may not be able to recognize what you are saying correctly (ASR failure), and, as a result, the agent may receive a default fallback intent and get stuck because the agent cannot handle these yet (which we will fix when implementing the next [TBU]Unexpected Intents). For now (and this will be useful throughout the project), you can also avoid ASR failures by adding and using a chatbox to a page in which you can type a response (instead of using the microphone). We have already provided you with the option to add a chatbox to the footer of pages, but the code is still commented out (check the code for the |
...
All done?
...