We have a rule which redirects user to the operator if there is no stories for user’s intent. And Rule Policy works fine with intents. But if there is an entity (which fills the slot which influence the conversation) in the intent, Rule Policy doesn’t find applicable rule and pass decision on what to do to TED, and TED gives some crasy responses.
Here is the rule, under or statement listed almost 200 intents
How can I handle this situation? Should I write another rule where entity and slot is listed under every intent from this rule? And why Rule Policy acts like that?
Hi! This is expected behaviour, because you have set your slot to influence the conversation. You can ignore the entities by setting the slot to influence_conversation: false
Thank! Your answer made the problem clear. But I had the following question: could I write rules with condition: slot_was_set, but without specifying the value of the slot, if this slot is categorical, just to check if slot is not empty?
You’re welcome! Unfortunately, if you want the slot to affect the conversation (this includes just checking whether it’s set or not), you’ll have to write a rule for every slot value. We are considering allowing “OR” for slots, but this is still in discussion.
If it’s set to influence_conversation: true, then you’d have to do it for every possible value of the slot. If it’s not set to influence_conversation the rule will apply whether or not the slot is set.
If you have very many values for the slot, but you still want the rule to apply only if the slot is set, you could get around writing a rule for each value of the slot by creating another slot. This would be a boolean: true if the slot DEVICE was set, and false if the slot DEVICE was not set. You can have this boolean slot set internally, in a custom action triggered (for example) by the intent used to set the DEVICE slot. Let me know if you have questions about this last part.
Is the DEVICE slot part of a form? If yes, you can use FormValidationAction, which will be triggered when DEVICE is set. Otherwise, you can write a custom action that behaves similarly.
The boolean slot helps because you would only have to write two rules, one for when the slot is set, and one for when it isn’t.
Sorry to bring this up, but I’m facing some problems and I’d like to understand how rasa works in this part.
As you mentioned, in case of using slots that influence conversation, it is necessary to define rules with conditions for each possible value of the slots. However, this solution doesn’t seem very scalable, since as the number of slots grows or as you use non-boolean slots, handling rules with these conditions becomes impossible.
There seems to be some confusion with this, as the documentation does not clearly indicate that it is necessary to define these conditions when using slots that influence the conversation, and in some of the rasa examples, tutorials or videos they are not used at all, even when slots that influence conversation are being used.
I’ll pass you some post where you ask about it without reaching a clear solution: post 1, post 2 and post3.
However, in this post I was discussing with Claude that we have discovered that if you omit the initial value, it is no longer necessary to define the conditions for each rule and you can use slots that influence the conversation without problems.
This seems the logical behavior, but I doubt if it is a bug or there is an explanation behind it. In the documentation I haven’t found anything that indicates the initial value of a slot influences the rules this way.