Resetting Slot Prior to action execution

When a certain intent is triggered, the story looks something like.



  • slot(“entity”:“value”}
  • action

In the case that this intent is triggered, prior to the slot being set, I want to clear any data that might be in the slots. Is there any way to reset slots prior to an action starting? I only know how to reset slots in the return statement.

Any help would be great. Thanks

As actions are mediated through the server I think they cannot change the state of the tracker (eg unset slots) directly. You can solve this problem by creating another action to unset all the slots. However, why do you need this? If the intent is triggered there will be no data in slots unless you specified a default value in your domain.

Once a slot is set, the tracker holds that value forever it seems. The situation is this, if intent1 triggers, I set a slot. After intent1 triggers, I use that slot for intent2, which could be fired infinite times after intent1. However, prior to intent1 firing again, I want to reset the slot since the slot value persists until a new one takes its place.

The problem is this. If someone inputs an entity that is not recognized by rasaNLU, then the tracker uses whatever slot value was stored in it, whether it be none or a previously found value. I want the tracker to be cleaned out prior to my intent1 triggered, but intent2 requires that slot set from intent1, so I can’t just reset my slots after intent1 triggers.

If I understand you correctly you want to fill a slot with an entity extracted from intent1 and use this slot for intent2. And then when intent1 occurs again without and entity being recognized you want the slow to be reset? If that is the case I recommend writing stories that cover these cases and including an action resetting the slot if no entity is detected in intent1. (You can use checkpoints to avoid duplicating a lot of code if you have long stories using these intents).