I have written some stories and want to restart the conversation. The problem is after the story flow over, it starts behaving in strange ways. Dialogue management provides wrong bot action towards correctly identified the event.
There is a default action provided by Rasa called action_restart. Maybe you want to add that at the end of each story. The action is stated at Actions all the way at the bottom of the page.
with `utter_`. Error: {}".format(action_name, e))
ValueError: Action 'action_restart' doesn't correspond to a template / action. Module doesn't contain a class with this name. Remember to prefix actions that should utter a template with `utter_`. Error: 'action_restart'
class ActionRestarted(Action):
""" This is for restarting the chat"""
def name(self):
return "action_chat_restart"
def run(self, dispatcher, tracker, domain):
return [Restarted()]
Try training using Rasa X - Interactive Learning. While training it will generate a story. Train your bot the correct actions (also check if the intent is correct) it should perform in the interactive learning.
I tried all the above solutions mentioned here. But had no luck finding the solution.
I added the following code in the action.py file:
from rasa_core_sdk import Action
from rasa_core_sdk.events import Restarted
class ActionRestarted(Action):
""" This is for restarting the chat"""
def name(self):
return "action_restart"
def run(self, dispatcher, tracker, domain):
return [Restarted()]
and also
- action_restart
at the end of each story.
But still it throws some error in the terminal when I try to train the RASA model after making changes to these files using