I’m using FormAction to fill a bunch of slots. For all my 12 slots I’m using 3 FormActions. I’m asking myself if it’s possible to “reask” some slots which were already set by a FormAction when an user want so?
For example: during the conversation the Slot userName got filled and the user sees a typo in it. He wants to correct it by stating “Wait a second, I want to correct my username!” It would be perfect if the bot now resets the appropiate slot(s) and reasks them via the FormAction.
Hey,
my first intuition would be to create an extra intent let’s say change_slot and two additional slots, which contain the name of the slot you want to change changing_slot_name and the value changing_slot_value.
Then you add a custom actions which is triggered when your intent is recognized and tries to set the slot with changing_slot_name to changing_slot_value.
Your stories would then look something like this (taken from the example stories in the docs):
I’m by no means an expert, so this might not be helpful at all.
Also I don’t think there is a build-in function for “re-asking” for FormActions, the only thing you could do is use the validate() function of FormFields to atleast catch “false” entries.
@raghavendrav1210 I’m not sure if I completly understand what you want to achieve.
Do you want to set a slot when an utter_action is called?
If that in fact is what you want to do, I don’t think it’s possible, but it is also pretty simple to achieve that with a custom action, which would look something like thiat:
thanks for the idea @momo! Yes, I also thinked about this in a pretty similiar way. The only thing I’m struggenling with is the fact that I’m having ~20 Slots and I need a good way to distinguish between them when the Intent change_slot is recognized.
Thanks @momo it solves part of my problem. I have another question not related to this but can you help me to understand this. I’m always getting next_action as action_listen. Do you have any idea why?
@mjoellnier Yeah I was actually thinking about that when writing up my answer and don’t really have a solution.
But do you really have the need to distinguish them? Wouldn’t it be enough for the action to check if the the slot_name is in tracker.slots and if it is just set the slot to the aquired slot_value?