How to pass information from Fallback policy to the following action

I have a customized fallback policy to handle more cases. For example, when the intent in user’s reply doesn’t match what we expected, the fallback will be triggered; when a reply doesn’t have required entities, say, restaurant name, the fallback policy will also trigger.

In the action triggered by the fallback policy, I would like to have more customized response to the user. For example, if the intent is wrong, the reply could be “Sorry I don’t understand what you said”; if the restaurant name is missing, the reply could be “Sorry, I didn’t get the restaurant name. Please try again.”.

The problem is, in the following action, I have no way to know why the fallback is triggered. Even tho I do have that information in my customized fallback policy. My question is, is there a way to passing some information from the fallback policy to the following action?


something like that works fine:

class ActionColl(Action):
    def name(self):
        return "action_coll"

    def run(self, dispatcher, tracker, domain):
        # what your action should do

        coll = tracker.get_slot('coll')
        if(coll is not None):
                message = "asi se crea una coleccion de tipo " + coll
        # sustituir con llamada a base de datos
            message = "el campo de referencia esta vacio porfavor escriba lo que quiere de forma distinta"
            return [FollowupAction('action_default_fallback')] 

But can I do slotset in a policy class? I tried? It doesn’t do anything. So I couldn’t use the slot values in the following action

Where are the slot value are set in your case?

i don’t set slot values i only show the message and go to back action, but if you want to set some slot value you need to do it on the return something like this, try it and say to me if that works

return [FollowupAction(‘action_default_fallback’),SlotSet(“slotname”,slotvalue)]

What I meant was, where the slot “coll” was set? In my case, my fallback policy made decision to fallback due to user’s intent doesn’t match what we expected. How do I pass that info (fallback due to wrong intent) to the action?