I have a custom action where I have 3 dispatch utter messages. These 3 print together only when the entire code of the custom action is run.
I want to print these messages when there respective codes are done.
Current Scenario
- wait for code1 and code2 execution
- bot: We are searching for your details. Kindly wait…"
- bot: An OTP has been sent to your email id
- bot: Kindly enter OTP to verify your account
Expected situation
- bot: We are searching for your details. Kindly wait…"
- wait as code1 executes
- bot: An OTP has been sent to your email id
- wait as code2 executes
- bot: Kindly enter OTP to verify your account
################### Code Below ##################
class ExistingCustomerCheckAction(Action):
def name(self) -> Text:
return "action_ask_customer"
async def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict) -> List[Dict[Text, Any]]:
dispatcher.utter_message(text="We are searching for your details. Kindly wait...")
some code 1
dispatcher.utter_message(text="An OTP has been sent to your email id")
some code 2
dispatcher.utter_message(text="Kindly enter OTP to verify your account")
return []