Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Dialogflow
Add the following intents, following the same procedure as you did for the ‘greeting’ intent. Use the intent names as specified below:
appreciation
If a user expresses appreciation or gratitude, for example, ‘thanks’.
checkCapability
the intent that represents a user querying what your agent can do. An example phrase would be “What can you do?”.
Fallback Intent
The Default Fallback Intent is one of the more important intents. It is already available when you create your Dialogflow agent. A fallback intent is triggered if a user's input is not matched by any of the other intents known by the agent, or if it matches the training phrases you input for this intent.
It is not necessary to add phrases that are completely unrelated to the topic of our recipe recommendation agent, as these would come back as an unknown intent. Thus, what you should do is think of related phrases that would be close to an intent but should not match with it. For example, “I do not like mushrooms” is food related and refers to an ingredient entity ‘mushroom’. Yet, you might argue that it should not be matched to any of the intents you specify because you do not want users to discuss their likes and dislikes with your agent. Alternatively, you could also argue to include ‘I like’ and ‘I dislike’ as training phrases for filtering by something. But that is a design decision for you to make! The Fallback Intent should be updated as you add more intents throughout the project.
Prolog and Patterns
B Patterns for Repair and Conversation Enrichment
A good handling of repair is vital to making your agent robust to misunderstanding. There are a few common ways in which misunderstanding occurs, that need to be addressed by proper repair patterns.
b12 The agent does not understand the user's’s utterance
Example:
U: Have you read the Hobbit?
...
Code Block |
---|
% Intent: paraphrase request text(c10, paraphraseRequest, ""). % we don't care exactly what user said. we got some response. text(a50recipeSelect, paraphraseRequest, " ") :- % this should be used if the number of filtered recipes is greater than 0 text(a50recipeSelect, paraphraseRequest, " ") :- % this should be used if the number of filtered recipes is 0 text(a50recipeConfirm, paraphraseRequest, ""). text(c43, paraphraseRequest, ""). |
b13 Out of Context.
The user said something that Dialogflow can identify with the user’s intent, but your agent is not at a stage where that intent is appropriate.
...
Make a contextMismatch response in response.pl.
b42 Appreciation
Example:
U: Thanks
A: You're welcome.
...
In patterns.pl specify the B42 pattern. Furthermore, go into responses.pl and create a corresponding text fact.
C pattern for Checking Capabilities
c30 General Capability Check
Your user wants to know what your agent does. Create a pattern for this.
...
In responses.pl find text(describeCapability, ""). and fill in the atom with an appropriate response.
Visuals
Nothing we ask you to do here for this capability. It’s up to you.
Test it Out
Say random stuff like “the sky is blue” in all steps and see how your agent responds and if it freezes or if you are allowed to continue.
...