Skip to content
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

Closed
AsfiaKawnine opened this issue Feb 9, 2020 · 4 comments · Fixed by #5448
Closed

Issue with /restart and slot #5205

AsfiaKawnine opened this issue Feb 9, 2020 · 4 comments · Fixed by #5448
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@AsfiaKawnine
Copy link

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?

Capture

@sara-tagger
Copy link
Collaborator

Thanks for raising this issue, @Ghostvv will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗

@IgNoRaNt23
Copy link

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.

@AsfiaKawnine
Copy link
Author

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?

@IgNoRaNt23
Copy link

IgNoRaNt23 commented Feb 11, 2020

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.

@tabergma tabergma added the area:rasa-oss 🎡 Anything related to the open source Rasa framework label Feb 24, 2020
@tabergma tabergma added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 24, 2020
@Ghostvv Ghostvv assigned Ghostvv and unassigned JEM-Mosig Mar 18, 2020
@tttthomasssss tttthomasssss added this to the Rasa 1.9 milestone Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants