Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

Dialogflow

Extend your addFilter intent to include phrases and entities for excluding an ingredient. Example: “recipe without cucumber”.

Your Parameter table should be extended as follows:

...

Prolog and Patterns

In recipe_selection.pl add the following applyFilter functions

Predicate to filter recipes on the exclusion of a specific ingredient 

applyFilter('excludeingredient', Ingredient, RecipeIDsIn, RecipeIDsOut) :-

  • There is a predicate in ingredient_hierarchies.pl which one could consider useful

Predicate to filter recipes on the exclusion of a specific ingredient type (for example: ‘beef’)

applyFilter('excludeingredienttype', Ingredient, RecipeIDsIn, RecipeIDsOut) :-

  • The body of this rule is similar to the ‘exclude ingredient’ rule (the difference between ingredient and ingredient type is catered for in ingredient_hierarchy.pl)

Visuals

Nothing we ask you to do here for this capability. It’s up to you.

Test it Out

Try to filter by excluding an ingredient check the a50recipeConfirm page to ensure that the ingredient is not present when you select your recipe.

Extend

Extend your agent to be able to exclude a cuisine or a dietary restriction. Your addFilter intent Parameter table should be extended as follows:

...