How to call triger_followup_action from run method?

I am trying to call a utter_ action using triger_followuo_action in run method. But i am getting an error:

AttributeError: ‘Tracker’ object has no attribute ‘trigger_followup_action’

Here is my code

      def run(self,dispatcher,tracker,domain):
        slot_phone_no = tracker.get_slot('phone_no')
        print('slot_phone_no',slot_phone_no)
        if slot_phone_no and slot_phone_no in phone_customer_data:

            customer = phone_customer_data[slot_phone_no]
            if customer:
                # SlotSet("patient_name",customer)
                dispatcher.utter_message("Hi "+customer+", we have found your name  from old records.\n \
                Please confirm your name to complete the booking process.")

                # dispatcher.utter_template('utter_ask_confirm',tracker)
                return [SlotSet("patient_name",customer)]
            else:
                print('elseeeeeeeeeeeeee')
                dispatcher.utter_message("Sorry!!!, we didn't find any records for the phone number "+slot_phone_no+"")
                dispatcher.utter_template("utter_try_again",tracker)
        else:
            dispatcher.utter_message("Sorry!!!, the given phone number is invalid")
            tracker.trigger_followup_action('utter_ask_phone_no')
            # dispatcher.utter_template("utter_ask_phone_no",tracker)
        return []

How can i solve this?

hey @kabeer, Use FollowupAction(“action_name”) and don’t forget to import it before use from rasa_sdk.events import FollowupAction. you could also refer : Getting action_listen for followup_action value even after adding a followup action

1 Like