Hello everyone,
It’s the first time i create a topic on rasa forum. I have a problem. I have created 3 forms. The first one activates, asks questions, then submits a solution, then the second one activates and submits its solution too and lastly a 3rd one that does the same thing. At the end of this chain, I ask the user if the final solution found matches the problem. But i’m don’t know how to do it. If the user answers that everything is fine, I want to conclude but if not, I want to go back to the 1st form and do another time the loop before. For that, I store in a slot the solution, which I delete if it’s not ok. And I keep in a slot the user’s answer about the usefulness of the final answer. Do you have any idea how to do this? With rules maybe?
////////////// Code ///////////// Rules.py
1st forms rules:
rule: Activate User forms Level0
condition:
- active_loop: null
steps:
-
intent: ask_for_help
-
action: utter_start_form
-
action: UserFormLevel0
-
active_loop: UserFormLevel0 wait_for_user_input: false
-
rule: Submit User Forms Level0
condition:
- active_loop: UserFormLevel0
steps:
- action: UserFormLevel0
- active_loop: null
- slot_was_set:
- requested_slot: null
- action: action_submit_user_form_level0 wait_for_user_input: false
2nde forms:
- rule: Activate User forms Level1
condition:
- active_loop: null
steps:
-
intent: action_submit_user_form_level0
-
action: UserFormLevel1
-
active_loop: UserFormLevel1 wait_for_user_input: false
-
rule: Submit User Forms Level1
condition:
- active_loop: UserFormLevel1
steps:
- action: UserFormLevel1
- active_loop: null
- slot_was_set:
- requested_slot: null
- action: action_submit_user_form_level1 wait_for_user_input: false
3rd forms:
- rule: Activate User forms Level2
condition:
- active_loop: null
steps:
-
intent: action_submit_user_form_level1
-
action: UserFormLevel2
-
active_loop: UserFormLevel2 wait_for_user_input: false
-
rule: Submit User Forms Level2
condition:
- active_loop: UserFormLevel2
steps:
- action: UserFormLevel2
- active_loop: null
- slot_was_set:
- requested_slot: null
- action: action_submit_user_form_level2 wait_for_user_input: false
The last ones to see if is the solution okay:
- rule: Activate isOkform
condition:
- active_loop: null
steps:
-
action: action_submit_user_form_level2
-
action: IsOkForm
-
active_loop: IsOkForm wait_for_user_input: false
-
rule: submit is ok form
condition:
- active_loop: isOkForm
steps:
- action: isOkForm
- active_loop: null
- action: action_again wait_for_user_input: false
and my idea to connect everything:
- rule: Activate User forms Level0 restart
condition:
- active_loop: null
- slot_was_set:
- is_ok: false
steps:
- action: action_again
- action: UserFormLevel0
- active_loop: UserFormLevel0 wait_for_user_input: false
Thanks for the help