Hello,
Someone can please help me understand how to deactivate a form in an active loop if the second input from the user does not fill the required slot?
for example:
when I write a form-type question in Rasa-shell:
> I want to set an alarm.
Then a form (set_an_alarm_form) suppose to be active because a slot is missing (entity name - time). The response from the domain is:
When would you like to set the alarm?
And then if I write a different form-type question:
> What's the weather like in New York?
The first form set_an_alarm_form suppose to be deactivated and a new form (get_weather_in_location_form) supposed to be active and the response from the domain suppose to be:
The weather in New York is 2 ° C.
I want the first form to deactivate and the second response should be about the second form question as usual.
I would be happy if anyone could help on the subject
stories.yml file
- story: Activate set an alarm form
steps:
- intent: set_an_alarm
- action: set_an_alarm_form
- active_loop: set_an_alarm_form
- story: Activate get weather in location form
steps:
- intent: get_weather_in_location
- action: get_weather_in_location_form
- active_loop: get_weather_in_location_form
roules.yml file
- rule: Submit set an alarm form
condition:
# Condition that form is active.
- active_loop: set_an_alarm_form
steps:
# Form is deactivated
- action: set_an_alarm_form
- active_loop: null
- slot_was_set:
- requested_slot: null
# The actions we want to run when the form is submitted.
- action: action_submit
- action: action_reset_slot
- rule: Submit get weather in location form
condition:
# Condition that form is active.
- active_loop: get_weather_in_location_form
steps:
# Form is deactivated
- action: get_weather_in_location_form
- active_loop: null
- slot_was_set:
- requested_slot: null
# The actions we want to run when the form is submitted.
- action: action_submit
- action: action_reset_slot