How to make the bot actively stop a conversion after waiting for the user's input a period of time?

Hi Guys,

Currently I’m facing a problem about training the bot to automatically stops a conversation by response a timeout_listen_action, detailed is when a user asks a bot a question, the bot will answer the question in order to gather more information about the user’s question, but then the user does not respond to the bot. What will bot do? As far as I understand, the bot will keep the status of this chat / story forever, right? Is there any idea to make the bot to automatically take an action to proactively stop the conversation like: ‘I’ve been waiting for your response for 15 minutes, please check and answer soon :)’

1 Like

Hi @namnguy32157553, you can use reminder actions to schedule actions to be executed in the future. You could trigger one of these actions after every bot utterance to be run 15 minutes later. The reminder can be cancelled with the kill_on_user_message parameter set to True. Please check out the docs on reminders

Hi, How did you implement that? I had the same idea as @ricwo . But in console mode the bot utterance (utter_ask_continue) isn’t displayed. I’m using rasa_core 12.2 Here is what I did:

in rasa_core/events/

class BotUttered(Event):
   def apply_to(self, tracker):
      # type: (DialogueStateTracker) -> None
      tracker.latest_bot_utterance = self
      tracker.followup_action = "action_schedule_reminder" 

Then in

class ActionScheduleReminder(Action):
    def name(self):
        return "action_schedule_reminder"
    def run(self, dispatcher, tracker, domain):
        return [ReminderScheduled(action_name="action_reminder", + timedelta(minutes=1), kill_on_user_message=True)]

class ActionReminder(Action):
    def name(self):
        return "action_reminder"

    def run(self, dispatcher, tracker, domain):
         **DO WHAT I WANT
           dispatcher.utter_template('utter_ask_continue', tracker)

Thank you for your help!