-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Dynamic Form Docs Section Update #10734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small word order things =)
docs/docs/forms.mdx
Outdated
@@ -388,6 +388,35 @@ class ValidateRestaurantForm(FormValidationAction): | |||
return additional_slots + domain_slots | |||
``` | |||
|
|||
If conversely, you'd prefer to remove a slot from the form's `required_slots` defined in the domain file in certain conditions, | |||
we recommend to copy the `domain_slots` over to a new variable and applying changes to that new variable instead of modifying directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we recommend to copy the `domain_slots` over to a new variable and applying changes to that new variable instead of modifying directly | |
you can copy the `domain_slots` over to a new variable and apply changes to that new variable instead of directly modifying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will anything bad happen if they do modify it directly or is it just for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They won't get the behaviour they want (not requesting the removed slot), because Rasa will instead use the list of required slots defined in the domain, I explained how this occurs in the comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see thanks!
In that case we should be stronger in the wording e.g.
you should copy the `domain_slots` over to a new variable and apply changes to that new variable instead of directly modifying `domain_slots`. Directly modifying `domain_slots` can cause unexpected behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)