I found this code in Rasa demo project.rasa-demo/actions.py at master · RasaHQ/rasa-demo · GitHub
Could anybody explain the purpose of restart button ,UserUtteranceReverted() and ConversationPaused() in 2 way fall back.?
class ActionDefaultFallback(Action):
def name(self) -> Text:
return "action_default_fallback"
def run(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List["Event"]:
# Fallback caused by TwoStageFallbackPolicy
if (
len(tracker.events) >= 4
and tracker.events[-4].get("name") == "action_default_ask_affirmation"
):
dispatcher.utter_template("utter_restart_with_button", tracker)
return [SlotSet("feedback_value", "negative"), ConversationPaused()]
# Fallback caused by Core
else:
dispatcher.utter_template("utter_default", tracker)
return [UserUtteranceReverted()]