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

Warning when using custom slot mapping action #10144

Closed
wochinge opened this issue Nov 10, 2021 · 3 comments · Fixed by #10236
Closed

Warning when using custom slot mapping action #10144

wochinge opened this issue Nov 10, 2021 · 3 comments · Fixed by #10236
Assignees
Labels
3.0.0rc-QA-issue A problem found during the QA of rasa==3.0.0 release candidate area:rasa-oss 🎡 Anything related to the open source Rasa framework feature:3.0/slot-mappings type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@wochinge
Copy link
Contributor

Rasa Open Source version

3.0.0rc1

Rasa SDK version

No response

Rasa X version

No response

Python version

3.8

What operating system are you using?

OSX

What happened?

I ran into this warning when using a custom slot mapping action:

2021-11-09 15:28:38 INFO     rasa.core.actions.action  - Running custom action 'action_validate_slot_mappings' has resulted in an event of type 'slot'. This is disallowed and the tracker will not be updated with this event.

I guess this happens because of the

if (
    isinstance(event, SlotSet)
    # this triggers if the action extracted the same slot again
    and tracker.get_slot(event.key) != event.value
)
class BetterConditionalResponseValidator(ValidationAction):

    async def extract_better(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> Dict[Text, Any]:

        return {"better": bool(len(tracker.events) % 2)}

Command / Request

No response

Relevant log output

No response

@wochinge wochinge added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. area:rasa-oss 🎡 Anything related to the open source Rasa framework 3.0.0rc-QA-issue A problem found during the QA of rasa==3.0.0 release candidate labels Nov 10, 2021
@carlad
Copy link
Contributor

carlad commented Nov 15, 2021

@m-vdb What is the expected behaviour here?

@wochinge
Copy link
Contributor Author

slot events are expected and shouldn't raise a warning. Means that this warning shouldn't appear when using custom slot mappings:

2021-11-09 15:28:38 INFO     rasa.core.actions.action  - Running custom action 'action_validate_slot_mappings' has resulted in an event of type 'slot'. This is disallowed and the tracker will not be updated with this event.

@ancalita
Copy link
Member

@carlad @wochinge yup I just replicated myself (by testing something else) by creating a custom slot mapping that extracts the slot via a custom action extending sdk Action and then also using ValidationAction to write custom validation code for the extracted value.

@carlad Let me know if you have any other questions otherwise happy to review the fix once ready 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0.0rc-QA-issue A problem found during the QA of rasa==3.0.0 release candidate area:rasa-oss 🎡 Anything related to the open source Rasa framework feature:3.0/slot-mappings 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.

4 participants