Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
We have taken you by the hand thus far and walked you through the code you were asked to produce step-by-step. We will still be providing useful information for you to learn more about developing conversational agents, but now we will change gears a bit and leave more for you to figure out yourself, too. Remember that you can find useful information and links on the page.
Prolog and Patterns
Repair
When a conversational agent does not understand a user, it needs to have the conversational competence to deal with the situation. Here, we will make two important distinctions related to the type of misunderstanding. The first case is that the agent is not able to match what a user says with an intent and the Dialogflow agent matches with a fallback intent. The second case is quite different. Here the Dialogflow agent can make sense of what a user says and matches it with one of the intents created for that agent. The conversational agent, however, has trouble handling the intent within the conversational context as defined by the active conversational pattern. In other words, the intent does not fit into that pattern and the question is how the agent should deal with this. We provide two repair mechanisms using (somewhat special) patterns again for the agent to deal with each of these situations.
Responding to a fallback with a paraphrase request
An example of a user expression that will not be recognized by our Dialogflow agent is the following:
...
Don’t forget to add textual responses in the responses.pl
for the paraphraseRequest
intent. You can use the Responses section of the fallback intent in your Dialogflow agent for inspiration.
Responding to an out-of-context user intent
Now suppose that the user said something that Dialogflow can match with one of the agent’s intents but that intent does not fit into the active conversational pattern. An example of handling a situation like that is the following:
...
It will also require you to still add a lot more code for handling the other patterns that we have (though you might also figure out that doing that work does not make sense for all possible pattern contexts and out-of-context intents; in a greeting context, for example, your agent might simply not care that much and define text(c10, contextMismatch(_), "")
). Moreover, you should not forget to update your code for generating responses for the contextMismatch(Intent)
intent when you add more patterns and intents to your Dialogflow agent. The pay-off, however, will be that your conversational agent will be much more clear, useful, and appreciated by its users.
Appreciation
A simple example of a pattern where a user first expresses their appreciation and the agent receives this well is the following:
...
In Moore and Arar’s taxonomy, this classifies as a b42
sequence closer appreciation pattern. Implement this pattern in patterns.pl
. You should use the intent labels: appreciation
and appreciationReceipt
. Add phrases the agent can use for expressing the receipt of the user’s appreciation in the responses.pl
file.
Checking capabilities
When a user wants to know what your agent can do for it, i.e., check what capabilities it has, the agent should be able to provide an appropriate reply. The key challenge here is to fill in the ___ in the example below. What would be a good response to such a general request for information from a user? The capability check should give a user enough guidance to understand how to talk to the agent or, even better, ideally also to ask more specific questions about its capabilities, for example, “Tell me more about the recipe features you know about” (cf. Moore and Arar, 2019).
...
Info |
---|
A similar design choice for specifying the response applies to the |
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.
Test it Out
Before we added the repair patterns above, the agent got stuck if it misunderstood something and was not able to proceed with the conversation. With the changes made now, you should be able to say something random, the agent should indicate that it does not understand, and you should be able to continue with the ongoing, active pattern.
...