Can I create a Fallback actions with input is random or meaningless word?

I’m struggling with Twostage fall back to handle with random input, I already executed Fallback for the fallback nlu which listed in NLU.yml. I also create a Two stage fallback using fallback trigger slot with float value.

from typing import Any, Dict, List, Text from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.events import SlotSet

class TwoStageFallbackAction(Action): def name(self) → Text: return “action_fallback”

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]
) -> List[Dict[Text, Any]]:
    fallback_triggered = float(tracker.get_slot("fallback_triggered"))
    print("---------slot--------",fallback_triggered)
    if fallback_triggered == 0.0: 
        dispatcher.utter_message(text="1s")
        return [SlotSet("fallback_triggered",str(fallback_triggered + 1.0))]
    else:
        dispatcher.utter_message(text="2")

Here are my action, any suggestion to imporve it to detect with latest intent. Thanks in advance

Hi @dohuyduc2002

You can handle nlu_fallback using a custom action which can revert the converstion to the previous story point. In between you can use LLM to respond back for any random text using OpenAI or any other open source LLM.

Here is one implementation you can take reference from: ChatGPT with RASA