In recipe bot post, we created a bot that helps you find a recipe for a food item. Obviously, there are many ways you can make a certain dish and there are many recipes available for the same item. We will handle that scenario here and let bot give user more options using Follow-up intents.
Api.ai introduced Follow-up intents recently ( in March 2017) and it’s a great way to organize your intents. Read more about it at their blog.
We will create a new follow up Intent of type “more”, show me more recipes, under our Recipe-Search Intent. So hover over parent intent, Recipe-Search, and there will be an option to create a follow-up intent. Choose “more” from the drop-down.
You can see it grouped under parent intent.
You will not have to, almost, set up any thing in this intent apart from hooking it up with WebHook from Fulfillment section. It will be pre-populated with predefined user inputs. Of course, you can add more customized user inputs.
The good thing here is that you don’t need to setup contexts, as they are automatically setup for us. However, we will need to add the FoodItem param to be passed down to our hook.
Set it a new param named “FoodItem” associated @FoodItem entity and value as #FoodItem.FoodItem ( #FoodItem is our parent context).
Don’t forget to Check “Use Webhook” under fulfillment.
Our webhook already randomize the recipes so we don’t need to customize it. Every time, you say “more”, there will be a new recipe.
Here is a screenshot of this bot working with Telegram: