...
Tasks Focused on Visual Support
Create a Welcoming Page
Define
page(c10, _, Html)
inhtml.pl
to create a welcoming page. Include a microphone icon for user interaction and dynamically display the agent’s name if availableDesign Visual Elements
Use Bootstrap components to organize text, images, and interactive elements into sections like greetings and microphone access.
.
...
Tasks Focused on Debugging and Testing
...
Tasks Focused on Visual Support
Design Recipe Recommendation Page
Define
page(a50recipeSelect, _, Html)
inhtml.pl
to display:A simple heading asking for user preferences.
A microphone button for user input.
Overview 1 Page
Design Recipe Confirmation Page
Define
page(a50recipeConfirm, _, Html)
inhtml.pl
to display:The recommended recipe name and image.
A microphone button for user confirmation.
...
Tasks Focused on Debugging and Testing
...
Update Visuals for Recipe Request
Adjust the recipe recommendation page (
page(a50recipeSelect, _, Html)
) inhtml.pl
to clearly guide users toward selecting a recipe by name.Ensure the page is engaging and displays useful instructions or examples for specifying a recipe.
Support Alternate Input Methods
Uncomment the chatbox code in the
footer/1
predicate inhtml.pl
to allow users to type their recipe request as an alternative to voice input.
...
Tasks Focused on Debugging and Testing
...
Implementation Tasks Overview
Tasks Focused on Filtering Logic
Refine the Recipe Filtering Logic
Expand the
recipesFiltered/3
predicate to handle lists of filters.Implement recursive filtering by applying each filter to the recipe list sequentially:
Apply the first filter and pass the remaining recipes to the next recursive call.
Continue until all filters have been applied.
Define Ingredient-Based Filtering
Add rules for the
hasIngredient/2
predicate:Check if a recipe contains a specific ingredient (e.g., "ginger").
Check if a recipe uses an ingredient type (e.g., "meat") by associating it with specific examples (e.g., "chicken").
Use the
typeIngredient/2
predicate for hierarchical ingredient filtering.
Add Filtering by Cuisine and Meal Type
Extend the
applyFilter/4
predicate to include filtering by:Cuisine: Ensure recipes match a specified cuisine type (e.g., "Italian").
Meal Type: Filter recipes based on meal categories (e.g., "dessert").
Support Dietary Restrictions
Add logic for filtering recipes by dietary restrictions:
Implement the
diet/2
predicate to check if a recipe satisfies restrictions like vegetarian, vegan, gluten-free, or spicy.Use the
ingredientsMeetDiet/2
helper predicate to validate dietary restrictions for all ingredients in a recipe.
...
Tasks Focused on Dialogue Patterns
Enable Recipe Feature Requests
Add a new
a21featureRequest
pattern for user requests to refine filters dynamically.Design two variants of the pattern:
Recipe Selection Context: The user requests a feature during the recipe selection phase (
a50recipeSelect
).Recipe Confirmation Context: The user requests a feature while reviewing a specific recipe (
a50recipeConfirm
).
Handle Conflicting Feature Requests
Use the
removeConflicts(Params)
action to handle conflicts when a new feature request overrides an existing one.Ensure the agent acknowledges conflicts and updates filters accordingly.
Agent Responses
Implement agent intents and responses:
ackFilter
: Acknowledge successful application of filters.noRecipesLeft
: Inform the user when no recipes match their filters.featureRemovalRequest
: Prompt the user to remove conflicting filters.
...
Tasks Focused on Visual Support
Extend Recipe Overview Pages
Recipe Overview 1 Page:
Show user-requested filters when more than 15 recipes remain.
Display only a summary of filters to avoid overwhelming the user.
Recipe Overview 2 Page:
Display recipe titles and images when the filtered list has 15 or fewer recipes.
Use visually appealing cards to present recipe details.
Extend the Recipe Confirmation Page
Add detailed recipe information, including:
Cooking instructions.
Ingredient list with quantities.
Estimated preparation/cooking time.
Number of servings.
Optionally, include a summary of user-applied filters for context.
...
Tasks Focused on Debugging and Testing
Test Filtering Functionality
Test the new filtering logic with various scenarios:
Combine filters for ingredients, cuisine, and dietary restrictions.
Verify that recipes are correctly filtered and conflicts are resolved.
Validate Feature Requests
Confirm that the agent correctly handles feature requests in both
a50recipeSelect
anda50recipeConfirm
contexts.Check the agent’s responses and ensure they align with the updated logic.
Ensure Robust Filtering
Test edge cases:
Apply filters that leave no recipes (e.g., contradictory filters).
Apply multiple filters that narrow down to fewer than 16 recipes.
...
Instructions
...
Implementation Tasks Overview
Instructions
9. Removing Filters and Showing Recipes on Demand
...