Intent not triggered from button response of a custom action


I’m working with rasa 3.x, and I have defined a custom action which in turn provides response to the user in the form of buttons, the number of buttons are dynamic (i.e. the number of buttons per session might vary). I also have set the payload to the desired intent. But when the button is pressed in Rasa shell, the payload shows the correct intent, but the correct response is not retrieved for that intent.

for e.g.: The custom action provides the user with 2 buttons, Yes(/yes) and No(/no). if the user presses the button yes, the dispatcher should trigger the /yes intent and utter_yes (response to the intent) should be provided to the user as it is provided as a rule. But the issue is, when the user presses the Yes button, even if the rasa shell shows the payload to be /yes, the utter_yes response is not retrieved, instead the fallback mechanism kicks in, signifying no intent was found with a major confidence.

has anybody faced this previously?

Thanks a lot for your help !

I’m attaching the code of the custom action:

class ActionGetSearchConfirmation(Action):

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

    async def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        level = tracker.get_slot("level")
        domain = tracker.get_slot("domain")
        exp = tracker.get_slot("experience")

        intent = tracker.get_slot("form_confirmation_search")
        buttons = []
        if intent == True :
            found = search(evel, domain, exp)

            if type(found) is dict:
                found_dict = found

                msg = found
                dispatcher.utter_message(text = msg)
            for key, value in found_dict.items():
                buttons.append({'payload': ' /results{"id": "' + key +'"}','title': value})
                dispatcher.utter_message(text = 'found : ', buttons = buttons)
            return []

Here, the buttons should be shown and the ‘/results’ intent should be triggered with its entities, but it does not happen.

Can somebody please help as to what I’m missing to make this work.

Thanks a lot for your help !!