Hello, how do I disable the current active form action through a custom action?
Background: I have a form action that has 4 slots. When the user is replying to one of the ask_slots, he suddenly turns idle. For every validate_slot, I would return a ReminderScheduler to check if the user is inactive for a period of time. When the action gets trigger, I would want to deactive the current form and proceed to ask the user if he wants to continue or not. The user would then replies either Yes or No.
For this to work, I guess I have to disable the current active form so that the user replies would not affect the slot. I have tested this out without having a form and it works. But with form action, the story would still always be in the happy path 1 and not go to user inactive although action_inactive is being triggered.
Conversation:
User: Hi
Bot: Hi, what drink would you like to order?
User: (inactive for 5min)
Bot: Do you want to continue?
User: No
Bot: Thanks for using the service we hope to see you again.
## happy path 1
* greet
- restaurant_form
- form{"name" : "restaurant_form"}
- form{"name": null}
## user inactive
- action_inactive
* deny
- utter_noted
- action_restart
*UPDATE,
class ActionInactivityScheduler(Action):
def name(self):
return "action_inactivity_scheduler"
def run(self, dispatcher, tracker, domain):
dispatcher.utter_message("Do you want to continue?")
return [Form(None), SlotSet("requested_slot", None)]
I saw the return from forms.deactivate, not sure if I am able to use it for my custom action or not.