Hi, I tried pausing the conversation by updating the tracker tracker.update(ConversationPaused()) However it returns the following error: AttributeError: 'Tracker' object has no attribute 'update'
I cannot use return[ConversationPaused()] as I need the conversation to be resumed in the same custom action.
Is there any way to pause and resume the conversation in the same custom action?
Itās by design that custom actions cannot modify the tracker directly, they can only return events which will be used to update the tracker. So, Iām afraid you are not able to pause and resume the conversation in the same custom action.
Hey @Tanja, I want to pause the conversation to handoff to a human agent and resume the conversation once the human agent has completed the required task. What is the best procedure in rasa to implement this?
As you already mentioned you can pause the bot by return[ConversationPaused()] from a custom action. You can resume the bot with the event ConversationResumed. However, you cannot sent an event from the āoutsideā to the bot at the moment. But we are working on it (see Support for external triggers / asynchronous actions Ā· Issue #3789 Ā· RasaHQ/rasa Ā· GitHub). This PR will allow you in the future to send an ConversationResumed event once the human agent has completed the required task to the bot.
Thanks @Tanja, I will keep an eye out for that PR. I managed to resume the conversation by scheduling a custom action to return ConversationResumed event after the conversation has been paused. The scheduling is done by returning ReminderScheduled event. Once this action has been scheduled, another custom action will pause the conversation and handoff to a human agent. This way the conversation is resumed after the specified time. This might not be the best approach to solve this problem, but it gets the job done.
Thanks for this @ShavinKalu . Iām hesitant on using reminders to āunpauseā the conversation due to how non-standard it can be. But that seems to be one of the possible solutions to solve this problem.
On the bright side, Iām seeing that the PR for external triggers is accepted so I might check that out.