I wan my bot to be able to answer questions about some products (e.g., can I use tool_x with product_y?). Given that there can be many products and many tools, I opted for defining a single
use_tool_w_product intent and using entities (i.e.,
can I use [tool_x](tool) with [product_y](product)?).
A number of unhappy paths are possible. For example:
- It could happen that the user misspells the name of the product or the name of the tool. In this case the bot could present the user with a list of tools and/or products with a similar/close name to the given one for the user to choose.
- It could happen that the user gives the name of an unknown product/tool, so that the bot could ask the use to rewrite the name.
- It could happen that rasa misclassifies the user message as
use_tool_w_productintent and the
productentity is empty/missing. Then the bot could ask the user whether she is interested or not on knowing if the tool is compatible with some product.
I see several ways to deal with the unhappy paths:
- Encapsulate all the logic in a “complex” form (I could create a form with two initially unfilled slots:
product; and some initially pre-filled slots of the kind
deal_with_unhappy_path_1, which would be set to
Nonewhen an unhappy path is detected, so that the form asks the questions needed to deal with the unhappy path.)
- Use a “simple” form to validate the
productslots, but abandon the form (and eventually come back to it) to deal with the unhappy paths.
- Use a custom action to validate the value of the
productentities/slots and use stories to describe all the possible paths
What would be the preferred way?