Setting a slot in Rasa's two stage fallback policy

Is it possible to set a slot in Rasa’s two stage fallback policy by returning [SlotSet(‘slot’: ‘value’)] from the run method of a custom action named “action_default_ask_affirmation”?

I think that the two stage fallback policy might be resetting all slots, which might be my problem, but I don’t know where to look up the code that actually implements the fallback policy, so I’d also appreciate if someone pointed me in the right direction regarding that.

Anyway, for my current issue, in the action_default_ask_affirmation action, I’m creating a message that says “did you mean” with buttons for the top confidence intents. It’s a pretty common pattern that I’ve seen in a lot of examples, and this is working fine. But I also want to add a button with a payload /search{‘search_slot’: tracker.latest_message[“text”]} so that it will run the custom search action on a faq database. It calls the search action fine, and I have the domain files set correctly, but in the search action, the value of tracker.get_slot(‘search_slot’) is always set to none.

I’ve figured out a way to fix this issue by just calling tracker.latest_message[‘text’] from the search action and parsing the string, but it seems kind of hacky and I’d rather use a slot. Is there any reason why my slot is always set to none, and is there anywhere I could read more about this fallback policy. Thanks in advance

Hello @plurn,

perhaps the slot value should be quoted too? like i did in Python below?

That’s a good tip, but I was already adding the quotation marks in my code. Just forgot to add them in my post.

I was able to figure out my problem, though. It turns out I was wrong when I said I had the domain set correctly. I didn’t have any entities set in my domain because I thought that the dictionary part of the button payload, /intent{‘search_value’:‘value’}, automatically set the slot. I didn’t realize it was using Rasa’s functionality of automatically setting entities to identically named slots, which means that I’d need to have a slot and entity named ‘search_value’.