I have an action which sets a categorical slot which can take up to 5 possible values, and these values will influence the story later on which is why the slot has to be of type categorical. The current set up for the stories is:
As some of the slot values will result in the same questions being asked later on, does RASA allow for multiple values to be put in the slot_was_set event, and if the action updates the slot value with just one of the options, it will continue on with the story? I currently plan to have another similar situation later into the stories so I was facing potentially having to write 100+ stories to account for every possible combination of slot values. Is something like this possible:
Currently I have tried with and without values enclosed in [ ], using yaml list format,
and trying with an āORā statement with no success. Is this even possible with RASA, or would it require going into the source code for slot_was_set to achieve this?
I am not entirely sure I understand you correctly. Do you want to store some list of items at the beginning of the dialogue, and then later ask the user about each item separately later in the dialogue? Depending on the specifics, this might be done with a list type slot, but then your conversation would only depend on whether the list has items or not.
A custom action can set as many slots as you like at once. You can also put any kind of information into a slot (given it has the right type). I assume you are struggling because the categorical type featurizes as āeither A or B or C orā¦ā, but you are looking for something like āA and C, but not Bā? In this case you have to implement your own custom slot type. To do this, add a file addons.py to your project (same directory as the domain, config, etc.), and implement a new class BooleanVectorSlot, say, derived from Slot, as shown in the documentation Iāve linked to. Then youād use the slot type addons.BooleanVectorSlot instead of categorical.
Essentially I have a list of 5 possible values which ācategoriseā the conversation. In the actual bot they are types of disputes the user wants to submit a claim about. These values will result in individual stories, but some values will need similar questions to be asked such as asking about things like details of the claim.
I currently have a custom action which sets the value of the slot, which basically just checks if the user response matches with a list of the 5 possible values, and if it is then the slot is filled. This works totally fine but it means that I have to have an individual story for each value like this:
@FGA-Traverse
Thank you for your explanation! The or-connection of slots is not yet possible, but weāre working on something that should help here. In the meantime you can proceed as follows.
If the entire conversation will only depend on whether or not your categorical slot was filled, then just use a text slot instead. Rasa will only notice whether the text has been set or not.
If only the later part of the conversation will depend on the particular setting, but the earlier part does not (this is what I think you have in mind), then you can first store the information in a text slot, and later, when the details become relevant, run a custom action that fills a categorical slot from the text slot. I know that this is not very elegant, but it should work for now and it saves you from writing all those stories.
If only the later part of the conversation will depend on the particular setting, but the earlier part does not (this is what I think you have in mind), then you can first store the information in a text slot, and later, when the details become relevant, run a custom action that fills a categorical slot from the text slot. I know that this is not very elegant, but it should work for now and it saves you from writing all those stories.
Iāve just managed to implement this and it works perfectly! Thank you so much for the suggestion!