Handle restart in Rasa Forms

@Juste @Ghostvv @akelad Hey, I have a form in which i am setting multiple slots , if the user restarts the chat or refreshes the chat and some slots are left to be filled. Then even for right intent the bot doesnt repond and still keeps on requesting slots.

How should I make the bost to forget about slots on restart or brak of form and start afresh.??

1 Like

Hey @pranay_raj. You want to add AllSlotsReset() event to your assistant. You can find the details about it here.

The process is to add this event to one of your custom actions and this action at the end of your training stories so that when the conversation ends, all slots are reset

@Juste The issue is tracker isnt going to custom action, its predicting ‘action_listen’ even after ‘/restart’ intent is kicked or chat is restarted. Its predicting ‘action_listen’ because of the ‘requested_slot’ , so the formPolicy is activated and it predicts ‘action_listen’. so the custom actions arent even called then.

@pranay_raj but do you have the action_restart_slots in your training stories?

@Juste Sorry for the late reply. So yes, I do have. My stories are like this-

  • take_test
    • utter_start_form
    • restaurant_form
    • form{“name”: “restaurant_form”}
    • action_slot_reset
    • reset_slots But still action listen is called and the bot expects the form to be completed.

Oh, so this is because you don’t have an action which deactivates the form. At the end of your form, when it’s filled you should have an action form{"name":null} included so that your assistant would finish the from and allow other dialogue policies to take over and make the predictions. So for example, you story would look like the following:

* take_test
- utter_start_form
- restaurant_form
- form{“name”: “restaurant_form”}
- form{"name":null}
- action_slot_reset
1 Like

@Juste the link does not work, could you please re-answer