-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with /restart and slot #5205
Comments
The problem here is the action prediction. There are at least two policies in play, the MappingPolicy, which handles the restart action and the FormPolicy for any FormAction. Both policies predict their action with a confidence of 1.0 in your case, but the FormPolicy has a higher priority than the MappingPolicy, which means that the FormPolicy always wins. So no restart may be triggered, if the form is never left. Which may happen, when you have 'self_from_text'-mapping for your slot. My solution to the problem is to use an additional custom-mapping policy, which handles the restart (and some custom debug actions in my case) with the highest priority of all policies, so it will always win the policy race. |
Thanks for your reply. Is there any documentation for custom-mapping policy? I am new to rasa, so it would be great if I could look into any example or documentation. Also is there any way to call action_restart while checking slot validation inside a form? |
Well, you could fix this in a really ugly way. Since youre overwriting the 'required_slots' method anyway, you could check there, if the current intent is 'restart' and raise an ActionExecutionRejection there, which will get you out of the form action. Or return an 'Restart' event in any method, that returns events. But as I said, this is ugly. A custom Policy, which inherits from MappingPolicy, but gets a high priority is the cleanest way imho. There's no documentation afaik, but just look at the MappingPolicy-code. It's pretty straightforward from there. You also have to include the new MappingPolicy in your policy ensemble in config.yml. |
Hello. I have developed a bot and created a custom action, where I will take input from the users and store their input in slots, later the input is used for authentication. The problem is when the action against slot is triggered, the /restart action doesn’t work. I want to clear the log when /restart action is called. How can I solve this problem?
The text was updated successfully, but these errors were encountered: