I am having a hard time writing rules and stories to abort and retry slot filling. I have a form to fill in 2 slots. The intended behavior is twofold:
- The user should be able to abort filling any of the 2 slots and quitting the form. For that I use a button that triggers an /abort intent, which sets the requested slot to None (i.e., using slot mapping from_intent).
- If the user provides a value for the slot and the value is incorrect, an “Invalid value. Do you want to retry?” message with two buttons (/abort and /retry) is uttered. To achieve this I have defined custom validation functions for the slots:
async def validate_X(...) -> Dict[Text, Any]: if self.is_correct(slot_value): return {"X": slot_value} else: dispatcher.utter_message(template="utter_unknown_X") return {"X": None} `
I have tried defining some stories in different ways to achieve the above behavior, but I do not get it to work 100% as intended. What rules or stories should I specify to achieve the intended behavior? Thanks!