Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Dialogflow
Extend your addFilter intent to include and add training phrases and entities for excluding an ingredient . Example: “recipe without cucumber”.Your Parameter table (type). For example, your Dialogflow agent should be able to make sense of the phrase “recipe without cucumber”. To make sure that the MARBEL agent will be able to handle these ingredients differently from the ones a user wants to include, you should create new parameter names that suggest the ingredient (type) should be excluded instead of included. The table in the Action and parameters section should be extended as follows:
...
Make sure to annotate plenty of phrases again with examples of the use of these parameters! Only if there are enough of these phrases will your Dialogflow agent be robust for all kinds of user input.
As a next step, in a similar vein, extend your agent such that it is able to exclude a cuisine or a dietary restriction (a recipe should not be Japanese or vegan). The table in the Action and parameters section for your addFilter intent should be extended as follows:
...
Prolog and Patterns
In your recipe_selection.pl
file, add the following applyFilter functions
Predicate to filter recipes on the exclusion of a specific ingredient | applyFilter('excludeingredient', Ingredient, RecipeIDsIn, RecipeIDsOut) :- |
|
Predicate to filter recipes on the exclusion of a specific ingredient type (for example: ‘beef’) | applyFilter('excludeingredienttype', Ingredient, RecipeIDsIn, RecipeIDsOut) :- |
|
Visuals
Nothing we ask you to do here for this capability. It’s up to yourules for applying the corresponding filters to the new entities we introduced above. You should define four applyFilter/4
rules where the first argument is instantiated with, respectively, ‘excludeingredient'
, 'excludeingredienttype'
, 'excludedietaryrestriction'
, and 'excludecuisine'
. You should note that to implement these rules it is sufficient to simply require the opposite (the negation) of the basic condition that you used for the rule for 'ingredient'
, etc.
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
Try to filter by excluding an ingredient check ingredient. Verify that the ingredient is not listed on the a50recipeConfirm
page to ensure that the ingredient is not present when in a recipe you select your recipe.
Extend
Extend . Verify that your agent to be is also able to exclude filter recipes based on the exclusion of a cuisine or a dietary restriction. Your addFilter intent Parameter table should be extended as follows:
...
Test it Out
Test your agent on its ability to exclude a cuisine and a dietary restriction.
Info |
---|
All done? Proceed with https://socialrobotics.atlassian.net/wiki/spaces/PM2/pages/2216001572/BuildingDesigning+and+Developing+Your+Agent#Agent-Capability-8%3A9%3A-Confirm-the-Chosen-Recipe |