I am building a bot with a form. When the bot asks a question to fill a given slot (e.g., bot: what flavor do you want?), the user might answer with an enquiry regarding the slot to be filled (e.g., user: what flavors can I choose from?). To handle this, I use a custom validation action that triggers both a LoopInterrupted event and an ActionExecutionRejected event to interrupt the form and use a rule similar to the following one to deal with the ‘unhappy’ path:
- rule: show available flavors condition: - active_loop: ice_cream_form - slot_was_set: - requested_slot: flavor steps: - intent: show_me_available_flavors - action: utter_show_flavors - action: action_listen - action: ice_cream_form - active_loop: ice_cream_form
Unfortunately, the resulting dialogue is not the expected one:
Bot: what flavor do you want? User: what flavors can I choose from? Bot: what flavor do you want? <---- OBS! Bot is asking again for the slot!!! DON´T WANT THIS Bot: You can choose banana and lemon flavors User: ...
I have checked the rasa financial demo and this same problem happens there when switching forms. E.g., I get the following output:
User: I want to pay my credit Bot: How much do you want to pay? User: I want to transfer money Bot: How much do you want to pay? <---- REPEATED!!! Bot: We haven't completed the credit card payment yet. Are you sure you want to switch to money transfer?
How can I prevent the bot from asking again for the slot before handling the deviation?