Your rules are in contradiction with the stories. Just to be on the same page here:
Rasa is trying to apply a rule that says “when the opt_form is deactivated because the is_authenticated slot was set to true, I have to say utter_otp_submitted.”
The story is telling Rasa to do something else after the is_authenticated slot is set to true, which is to either say utter_what_help_is_needed or utter_products_offers (depending on the intent).
My recommendation:
- Try to add
utter_otp_submittedandaction_get_account_detailsto your stories by inserting them right beforeutter_products_offerslike so:
- story: New offers & products and authentication
steps:
- slot_was_set:
- is_authenticated: false
- intent: new_offers
- action: otp_form
- active_loop: null
- slot_was_set:
- is_authenticated: true
- action: utter_otp_submitted
- action: action_get_account_details
- action: utter_products_offers
This is because the action that will be predicted after is_authenticated: true is utter_otp_submitted and not utter_products_offers. You have to do this for both stories since they rely on the same form.
- Choose which utterance to run based on the last detected intent and run these inside a custom action. For example, at the end of
action_get_account_details, you can dispatch the correct template (utter_products_offersorutter_what_help_is_needed). I personally dislike this approach become having the bulk of the conversation handled by Rasa rules and stories makes the code easier to read and debug. If you do this, your stories will just look like this:
- story: Account Details and authentication
steps:
- slot_was_set:
- is_authenticated: false
- intent: account_details
- action: otp_form
- active_loop: null
- slot_was_set:
- is_authenticated: true
- action: utter_otp_submitted
- action: action_get_account_details
- story: New offers & products and authentication
steps:
- slot_was_set:
- is_authenticated: false
- intent: new_offers
- action: otp_form
- active_loop: null
- slot_was_set:
- is_authenticated: true
- action: utter_otp_submitted
- action: action_get_account_details