Hi. I have a chatbot which displays a button called “start a new conversation” at the end of every conversation.
When a user clicks this button, I want to
reset the conversation. [intent for default action -> action_restart, which resets all the slots]
followed by intent_greet.
So, I want these 2 things to happen when the user clicks this button. Basically adding 2 payloads for a button.
Please let me know if anyone has got some ideas.
Thankyou.
First you are resetting the slots in your actions.py and then resume the remaining conversation in your stories.md and finally calling action_restart will reset the conversation.
Hi, @MuraliChandran14. Thank you very much for your suggestion.
My bot is designed such that, on start of a new conversation it gives a welcome response. So when I click the start a new conversation button, it should
Delete all chat history in the UI window.
Reset all slots.
Invoke greet response.
So, I have to use create a custom action and use
return [Restarted()] from rasa_sdk.events import Restarted
But, like we are guessing, once Restarted() is invoked, the story stops as the bot is forgetting the story and next actions.
As u suggested, I overcame this by writing those greet responses before calling Restarted().