Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Prolog and Patterns
We will begin with implementing a pattern for allowing a user to express they are done, and then get back to what is still missing to implement requests to remove a filter.
...
There is still one thing missing… Just by talking the agent will not change the page that is displayed. Recall that you have created two pages for the a50recipeSelect
pattern for [TBU] Filtering by Inclusion . When the agent grants the user’s request we still need to make sure that the second recipe recommendation page showing the recipe pictures is displayed. To make that happen, we need to change the condition for showing that page. We need the store the fact that the user requested this. The idea is to use the conversational memory of the agent for that and update it with this information. Therefore, when the agent grants the user's request, the version of that pattern should end with the agent updating its memory using an [agent, update(['show'='true'])]
actor-intent pair. To change the condition for showing the page in the html.pl
file, we can then use the memoryKeyValue/2
predicate defined in the dialog.pl
file to add an alternative condition for showing this pageYou now must find a way to pass information that the recipe overview pages should change.
Finishing the implementation for removing filters
...
Use a response text similar to "Here are some recipes that fit your requirements.".
Use the
recipesFiltered/1
predicate to get the filtered list, and check that the length is less than 16 but more than 0, or (use a semicolon;
which represents a logical OR) check that the memory key-value pair ‘show', 'true'
is stored in the agent’s conversational memory.Note the terms used here can be used to condition the recipe overview pages in your javascript and html.
This completes the implementation of all the different cases for the agent’s response. The patterns for removing filters should now work!
Visuals
What you do visually for this capability is up to you. Think about the fact that users could end up going from Recipe Overview 2 page to Recipe Overview 1.
Test it Out
Now [TBU]Run your Conversational Agent again and try to remove some of the recipe constraints after you added them.
...