Action_listen after two stage fallback

Hello, After 2 failed Ask_affirmation, the bot always triggers action_listen I want it to trigger utter_out_of_scope I made this rule :

  • rule: Implementation of the Two-Stage-Fallback steps:
    • intent: nlu_fallback
    • action: action_two_stage_fallback
    • active_loop: action_two_stage_fallback
    • action: utter_out_of_scope

but I get a

  • the prediction of the action ‘utter_out_of_scope’ in rule ‘Implementation of the Two-Stage-Fallback’ is contradicting with rule(s) ‘handling active loops and forms’ which predicted action ‘action_listen’.

How can I change this behaviour ? Thanks

action: utter_out_of_scope should be predicted after the Two-Stage-Fallback failed, right? In that case you’d need a second rule which follows the syntax here:

- rule: Submit form
  condition:
  # Condition that fallback is active.
  - active_loop: action_two_stage_fallback
  steps:
  # Form is deactivated
  - action: action_two_stage_fallback
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  # The actions we want to run when the form is submitted.
  - action: utter_out_of_scope

Hello, thanks for your reply, I added the rule but now I have this error :

Tried to set non existent slot ‘requested_slot’. Make sure you added all your slots to your domain file.

Bug fixed : I had a story containing two stage fallback (generated from rasa interactive). I had an error of core dumped I removed the interactive story

UPDATE : I still have the same problem :

2021-01-25 18:14:58 DEBUG rasa.core.processor - Action ‘action_two_stage_fallback’ ended with events ‘[<rasa.shared.core.events.ActiveLoop object at 0x7f45a01a6fd0>, <rasa.shared.core.events.UserUtteranceReverted object at 0x7f45a00b0150>]’. 2021-01-25 18:14:58 DEBUG rasa.core.processor - Current slot values: action: None add: None article: None attrition: None basket: None biling: None cancel: None channel: None code: None concurrence: None confirmation: None country: None damaged: None date: None device: None discount: None email: None fdp: None free: None home: None missing: None mood_neg: None mood_pos: None order: None oui: None payment: None phone: None photo: None place: None pr: None present: None pwd: None requested_slot: None refund: None resend: None spam: None target: None transporter: None 2021-01-25 18:14:58 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00. 2021-01-25 18:14:58 DEBUG rasa.core.processor - Policy prediction ended with events ‘’. 2021-01-25 18:14:58 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘’. 2021-01-25 18:14:58 DEBUG rasa.core.lock_store - Deleted lock for conversation ‘9f1d0885bee6412e8e3bf283fcaab06c’. Your input →

And here is my rules.yml :

rules

  • rule: Implementation of the Two-Stage-Fallback steps:

    • intent: nlu_fallback
    • action: action_two_stage_fallback
    • active_loop: action_two_stage_fallback
  • rule: Submit form condition:

    • active_loop: action_two_stage_fallback steps:
    • action: action_two_stage_fallback
    • active_loop: null
    • action: utter_out_of_scope

Hello @Tobias_Wochinger

i have implemented two stage fallback

created rule

rules:

  • rule: Two stage fallback steps:
    • intent: nlu_fallback
    • action: action_two_stage_fallback
    • active_loop: action_two_stage_fallback

when i say something where core_fallback_threshold is less than 0.3

it provides 2 or more buttons. like this

“buttons”: [{“title”: “No Match”, “payload”: “/nlu_fallback”}, {“title”: “Something else”, “payload”: “/out_of_scope”}],

and with these buttons bot also says

Sorry, I’m not sure I’ve understood you correctly :thinking: Do you mean…

so first where it is coming from, as this sentence is nowhere in my code.

second when i click {“title”: “Something else”, “payload”: “/out_of_scope”}],

in log it shows

Current tracker state [{}, {‘user’: {‘intent’: ‘out_of_scope’}, ‘prev_action’: {‘action_name’: ‘action_listen’}}]

There is a memorised next action ‘action_out_of_scope’

but did not provide response as there in ‘action_out_of_scope’

but without two stage fallback action_out_of_scope is working

why my ‘action_out_of_scope’ is not responding with two stage fallback

class ActionOutOfScope(Action):

def name(self) -> Text:
    return "action_out_of_scope"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    user_intent = "out_of_scope"
    print("out of scope")

    bot_response = "I can't help you with that, I'm sorry.Out of Scope"
    dispatcher.utter_message(text=bot_response)

    return []

it is not going in there. as you can see i have ’ print(“out of scope”)’ but after clicking out_of_scope intent it is not working

when i say something where core_fallback_threshold is less than 0.3

Fallbacks for low core confidence uses a different fallback mechanism: Fallback and Human Handoff . TwoStageFallback only applies to NLU fallbacks.