Rasa forms: adding "more information" button and coming back to slots

I have working bot which asks 22 yes/no questions from a student and after asked all questions, will output links to courses where student replied “no” So this use forms and slots to mark users reply and then in actions.py function which output courses to display.

Now customer is asking to add third button “more information” where is more information about question (requirements for knowledge)

Now the question is how to go to this side path and then come back to form and continue to next question?

I think that there are several ways that it can be achieved. The first way is to create the following one rule:

- rule: action_more_information
  condition:
  - active_loop: yes_no_form
  steps:
  - intent: more_information
  - action: action_more_information

where action_more_information contains a 22 sized if that would utter the necessary phrase depending on the value of requested_slot

Another way is to “move” this if into rules explicitly. You can make your requested_slot a categorical slot, then write 22 of the following rules:

- rule: utter_more_information_for_some_slot
  condition:
  - active_loop: yes_no_form
  - slot_was_set:
    - requested_slot: some_slot
  steps:
  - intent: more_information
  - action: utter_more_information_for_some_slot
1 Like