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

Slot mappings #549

Merged
merged 40 commits into from
Oct 14, 2021
Merged

Slot mappings #549

merged 40 commits into from
Oct 14, 2021

Conversation

alwx
Copy link
Contributor

@alwx alwx commented Sep 29, 2021

Proposed changes:

Status (please check what you already did):

  • made PR ready for code review
  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@alwx alwx requested a review from ancalita October 4, 2021 08:55
@alwx alwx marked this pull request as ready for review October 4, 2021 08:55
rasa_sdk/forms.py Outdated Show resolved Hide resolved
rasa_sdk/forms.py Outdated Show resolved Hide resolved
rasa_sdk/forms.py Outdated Show resolved Hide resolved
@alwx alwx changed the title Slot mappings WIP: Slot mappings Oct 8, 2021
@alwx alwx requested a review from ancalita October 12, 2021 07:20
rasa_sdk/forms.py Outdated Show resolved Hide resolved
rasa_sdk/forms.py Outdated Show resolved Hide resolved
rasa_sdk/forms.py Outdated Show resolved Hide resolved
rasa_sdk/forms.py Outdated Show resolved Hide resolved
validation_events = await self.validate(dispatcher, tracker, domain)
validation_events = await self.get_validation_events(
dispatcher, tracker, domain
)
tracker.add_slots(validation_events)

next_slot = await self.next_requested_slot(dispatcher, tracker, domain)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably either need a comment to specify that this is here to work for FormValidationAction, because it will always be None for global slot mappings, or run method needs to be refactored? This could be confusing if we mention in the docs only to use ValidationAction for slot validation outside forms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like it will always be None because required_slots can still be overridden in a specific implementation of ValidationAction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, however having a SlotSet event for requested_slot doesn't make sense in the context of the rasa action_extract_slots because this action doesn't request slots; it's only valid in case of a form so maybe there could be a way for this functionality only to be restricted to forms 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

rasa_sdk/forms.py Outdated Show resolved Hide resolved
tests/test_forms.py Outdated Show resolved Hide resolved
tests/test_forms.py Outdated Show resolved Hide resolved
@alwx alwx requested a review from ancalita October 13, 2021 10:21
Copy link
Member

@ancalita ancalita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for coping with all my comments 👍🏼 The only thing left to address is the removal of FormAction since that's been deprecated so it wasn't actually required to mirror changes from rasa-oss as mentioned in the implementation proposal - my bad for not realising this earlier 🙈

@alwx alwx requested a review from ancalita October 14, 2021 07:51
Copy link
Member

@ancalita ancalita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wohooo 🎉

@alwx alwx merged commit d122feb into main Oct 14, 2021
@alwx alwx deleted the global-slot-mappings-3.0 branch October 14, 2021 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.0 slot mappings: rasa-sdk implementation
3 participants