How to retrive actions in utter template

I was trying to retrive actions inside utter template but it’s not working ,

example : custom action ():

 do something 
 dispatcher.utter_template("action_dosomething", tracker)

like in the above example i want to call another action inside custom action ,any suggestions will be helpful on this.

Here’s a complete example of an action that retrieves the current version of Rasa & Rasa X and utters a message with the response:

class ActionVersion(Action):
    def name(self):
        return "action_version"

    def run(self, dispatcher, tracker, domain):
        request = json.loads(requests.get('http://rasa-x:5002/api/version').text)
        dispatcher.utter_message("Rasa X: {}\nRasa:  {}".format(request['rasa-x'], request['rasa']['production']))
        return []

hey @stephens i mean to say like i want to retrive action inside another action means i will have all the action inside action.py file and for few case like i want to execute my action like below example:

class AreaAction(Action): def name(self): return “action_area”

def run(self, dispatcher, tracker, domain):
    ar = tracker.get_slot('area')
    buttons = []
    mov = tracker.get_slot('movie')
    for i in moviez:
        moviename = i['@name']
        if (moviename.casefold() == mov.casefold()):
            Theater = i['Theatre']
            try:
                for j in Theater:
                    cinema = j['@name']
                    buttonsz = [{"title": cinema, "payload": '/area_byuser {"area": "' + cinema + '"}'}]
                    buttons.extend(buttonsz)
                dispatcher.utter_button_message("May i know where you would like to watch movie, Please select to proceed ", buttons)
            except:
                cinema = Theater['@name']
                buttonsz = [{"title": cinema, "payload": '/area_byuser {"area": "' + cinema + '"}'}]
                buttons.extend(buttonsz)
                dispatcher.utter_button_message("Movie is available only on  ", buttons)

like the above example i have try and expect for both case m returing some buttons in dispatcher but instead of that i want to return action inside dispatcher(like the action will be something which is present in the action.py file so how can i do that )

i want to return action inside dispatcher(like the action will be something which is present in the action.py file so how can i do that )

I think you’re asking a Python question or maybe a dispatcher question. You can find the dispatcher and it’s available methods here.

If you want to call one of the dispatcher methods and pass another method as a parameter, then that method would need to return a value of the correct type. Something like this:

def my_message():
    return 'hello world'

def my_buttons():
    return [{"title": cinema, "payload": '/area_byuser {"area": "' + cinema + '"}'}]

dispatcher.utter_button_message(my_message(), my_buttons())