We are building a bot that is giving advices to people based on their answers on several questions. When the person has come to an advice from the bot, we would like the conversation to start all over and all slots to be reset. So we have our button return_to_start
, that is triggerring the return_to_start
action. This action utters the disclaimer
, which is the starting state in our bot.
Here isn the code of the action:
class ReturnToStart(Action):
def name(self) -> Text:
return "return_to_start"
def run(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict[Text, Any]]:
if logger.isEnabledFor(DEBUG):
logger.debug("Return to start")
return [AllSlotsReset(), UserUttered("disclaimer")]
And here is the trigger:
- return_to_start:
triggers: return_to_start
But hen the bot comes to return_to_start
, the bot won’t coninue.We receive the following error:
2019-08-21 01:16:42 ERROR rasa.core.processor - Encountered an exception while running action 'return_to_start'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2019-08-21 01:16:42 DEBUG rasa.core.processor - 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\processor.py", line 439, in _run_action
events = await action.run(output_channel, nlg, tracker, self.domain)
File "c:\users\melania\anaconda3\envs\regbot\lib\asyncio\coroutines.py", line 110, in __next__
return self.gen.send(None)
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\actions\action.py", line 409, in run
evts = events.deserialise_events(events_json)
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\events\__init__.py", line 30, in deserialise_events
event = Event.from_parameters(e)
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\events\__init__.py", line 119, in from_parameters
return event._from_parameters(parameters)
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\events\__init__.py", line 142, in _from_parameters
result = cls._from_story_string(parameters)
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\events\__init__.py", line 269, in _from_story_string
parameters.get("input_channel"),
File "c:\users\melania\anaconda3\envs\regbot\lib\site-packages\rasa\core\events\__init__.py", line 212, in _from_parse_data
parse_data.get("intent"),
AttributeError: 'NoneType' object has no attribute 'get'
2019-08-21 01:16:42 DEBUG rasa.core.processor - Action 'return_to_start' ended with events '[]'
Any ideas what is the problem and how it can be fixed?
Thanks in advance!