Closed koenhindriks closed 4 years ago
class SelectRecipe(Move) has been added to standard_moves.py def select_recipe has been added to natural_language_generator.py A "select recipe" response has been added to agent_responses.json
An intent "Welke recepten" has been added in Diagflow with the following questions that the user can ask: Uit welke recepten kan ik kiezen? Welke recepten zijn er om uit te kiezen? Welke recepten zijn er? Waar kan ik uit kiezen?
Sketch of conversational pattern for Recipe Selection:
1 U: REQUEST RECIPE OPTIONS 2 A: SHOW RECIPE OPTIONS 3 U: SELECT RECIPE
(The direct step from 2 to 3 might not work well for the user, so the pattern may turn into the following conversational pattern: 1 U: REQUEST RECIPE OPTIONS 2 A: PARAPHRASE REQUEST 3 U: CONFIRM REQUEST 4 A: SHOW RECIPE OPTIONS 5 U: SELECT RECIPE 6 A: PARAPHRASE SELECTION (ASK FOR CONFIRMATION) 7 U: CONFIRM )
Based on the workshop on conversational design (di 21. apr) it might be a good idea to use categories for the recipes for example based on cuisine (Italian, Dutch, etc.) or course (main course, dessert, etc.). The small number of recipes to choose from right now is manageable for the user, but with more recipes it would probably feel like too much information at once.
In the standard_moves file: I added a function 'SelectRecipe' with the intent 'Welke recepten' from dialogflow as prior_moves.
In the agent responses file: I created 'Select recipe' responses such as: "De recepten waar je uit kunt kiezen zijn [recipe_options]."
In the dialog manager file: I added 'self.recipe_options = self.recipes["Recipe"].keys()' to the init to get the names of the recipes from the json recipe file. These recipes are placed in the 'self.NLG' in init of the dialog manager to get them to the natural language processor.
In the natural language processor file: I added self.recipe_options to the init which then contains the recipe dictkeys from the dialog manager. A select_recipe function was added that randomly outputs 'Select recipe' responses from the agent_responses file. In the function 'formulate_response' the recipe_options dictkeys are changed into a string and this string replaces the [recipe_options] in the sentences from the agent responses file.
With multiple recipes, a user needs a way to navigate the available recipes to find and select a recipe of his or her choice.