...
We shall start by considering how a greeting could go. When the agent does not introduce itself, the most common greeting pattern would look as follows:
Example:
A: hello
U: hi
In this example conversation, we see A(Agent) greets the user and U(User) greets as well. The first thing in our list within our pattern predicate is always the pattern identification code. In the case of greeting, this is c10. After this identification code, the dialogue moves in the pattern are specified consecutively . Such a move is represented as a two-element list, where the first element is the person speaking ('agent' or ‘user’) and the second element is the agent response label or the user’s intent (which should share a name with an intent on Dialogflow, be sure to communicate with your groupmates). Thus for this greeting, we reach the following rule head:
pattern([c10, [agent, greeting], [user, greeting]])
As mentioned before, this greeting should occur if the agent does not know its name. If the bot knows its name it should introduce itself.
Thus the complete rule should specify this condition, which could be done as follows:
pattern([c10, [agent, greeting], [user, greeting]]) :- not(agentName(_)).
c10 Greeting with Introduction
Pattern C10.1: Opening Self-Identification (Agent)
Example:
A: hello
A: I'm _____
U: hi
This pattern will be quite similar to the one above but should include the predicate 'selfIdentification'. Also, note that the agent must have a name in order to self-identify.
c10 responses.pl
In responses.pl you will see the fact text(greeting, ""). Fill in the “” with a response you want your agent to give as a greeting
...
This rule should produce a response that is returned as Txt, and should include the robot's name.
c30 General Capability Check
Your user wants to know what your bot does. Create a pattern for this.
Example:
U: what can you do?
A: At the moment I can ….
You should use the intents/predicates 'checkCapability' (for the user) and 'describeCapability' (for the agent).
...
b12 The agent does not understand the user utterance
Example:
U: chicken soup
A: what do you mean?
Your user has just said something odd or not matching the current situation and so your Dialogflow cannot identify the user's intention and goes to a default fallback intent. In this pattern, your agent can try to come to an understanding by asking for a rephrasing with paraphraseRequest. Add a b12 pattern using the defaultFallback and paraphraseRequest intent.
...
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.
Example:
A: what recipe would you like to cook?
U: goodbye
A: not sure what that means in this context.
Think about what feature in Prolog you could use to symbolize that there is some intent identified, regardless of what particular intent it is. The agent should respond with a ‘contextMismatch’ response.
Fill in all the contextMismatch responses in response.pl. Like the paraphrasing response, it depends on where the user is in your agent’s program.
...
In responses.pl fill in a response for the repeatedUserIntent.
b42 Appreciation
ExampleExample:
U: Thanks
A: You're welcome.
Your user says thank you and shows some ‘appreciation’ and your agent should respond apropriately with an ‘appreciationReceipt’.
Go into responses.pl and fill in the corresponding text fact.
a50recipeSelect: Selecting a Recipe
Example:
A: Let us find a recipe together.
A: what recipe would you like to cook?
U: I'd like to make pasta (or, simply: pasta)
A: pasta is a great choice!
In the a50recipeSelect pattern, the pattern name is not just a50 but a50recipeSelect please note that when building your pattern. In this conversation your agent should specify its goal with the user, make a recipe inquiry, get a recipe request from the user, the agent should respond to the user's choice and then the agent should insert the next pattern in the conversation which is a50recipeConfirm. To do this you should use the responses specifyGoal, recipeInquiry, and recipeChoiceReceipt. The user intent is called recipeRequest. To insert something into the bot’s agenda you can use the insert().
In responses.pl fill in the corresponding responses for specifying goal and recipe inquiry. recipeChoiceReceipt requires a rule. To respond the agent must find the current recipe, access a list of all recipe IDs using the predicate recipeIDs(), check that the current recipe is a member of the list(better safe than sorry), get the recipes name, return a response using string_concat(“Phrase Part 1”, “Phrase Part 2”, Txt).
...
In responses.pl fill in text ( recipeCheck, “”) .
a21noMoreFilters
Example:
A: “What other filters would you like to add”
U: “I do not want more filters “
A: “Ok. Here is a list of recipes” / “Sorry the list is too long still to show”
a21noMoreFilters pattern handles a user request to not add more feature requests, preferences, or requirements. When filtering the recipes the user is not shown the list of filtered recipes until there are only 15(or fewer) recipes. It could be though that the user does not wish to filter recipes further. The user would then use the NoMoreFilters intent. The agent can then allow the user to see the list with grantPicture response, or deny the user with pictureNotGranted. If the agent grants the user’s request the pattern should end with the agent updating its memory with [agent, update(['show'='true'])] this triggers the showing of recipes by updating the bot’s memory.
...
Pattern a21featureRequest
...
Pattern A2.10: Open Request Series
ExampleExample:
U: A recipe from Japan.
...
A: Do you want to add another filter?
U: Recipes that use pasta (penne).
A: What recipe would you like to cook? (assuming only <6 left which are displayed on screen)
U: Curry noodle soup.
A: You're welcome!
There will be 4 variants of feature requesting:
...
In responses.pl you have to fill in an appropriate phrase in text( featureRemovalRequest, “”) .
Variant 3: a21featureRequest
...
if the list of recipes is smaller than 16 then your bot should show recipes.
if the list is greater than 890(the size of the database) then the recipes has not been filtered yet.
Variant 4: a21featureRequest
The user is in the a50recipeSelect step and they ask for a filter that results in no recipes. This pattern is the exact same as variant 2 except for one exception. What should be left out?