I’ve build a short survey bot with a form and within the form filling process I would like to restart the process and go back to the beginning. I’ve made several attempts on this and it’s not working as expected. For example, have *restart as an intent and then trigger action_restart as part of the story —but this doesn’t work and looking through other submitted questions/issues it might be due to the mapping_policy. However, I thought I could do a work around by resetting ALL slots through the required_slots function (see below). Please note that the intent under my domain.yml & stories is called restarts and triggered by the word “restart” etc.
from rasa_sdk.events import AllSlotsReset
if tracker.latest_message['intent'].get('name')=='restarts': return [AllSlotsReset(None)]
If i do print ( tracker.latest_message[‘intent’].get(‘name’)==‘restarts’) . I am able to see the most recent intent. However, I get the following
error self.slot_mappings().get(slot_to_fill, self.from_entity(slot_to_fill)) TypeError: unhashable type: ‘dict’
As above, I’ve attempted the legacy rasa restart/rest all slots method as highlighted above but it’s not working either and reading through this might be due to the mapping policy taking precedence.
Does anyone have an idea of how I can resolve the above problem? My goal here is to reset all slots within the form .
Thank you so much!