-
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
Bypass NLU pipeline when message is /intent or /intent + entities - [ENG 286] #12480
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.
Good job so far! Can you also add the changelog file?
If we really wanted to do this right we should probably also address the following:
- This change is currently difficult to test, because the
RegexMessageHandler
is still in the graph. We should remove the RegexMessageHandler from the graph ultimately, but this also involves touching the default recipe etc, because all NLU calls currently target this component as the execution target if I remember correctly. - We'd need to take a deeper look whether the http interpreters should actually also be covered by the regex parsing. This could be relevant if we remove the RegexMessageParser from the graph and then the http interpreters might not have any regex message parsing at all anymore. I am not really familiar with them
Skip sequential integration tests on release tag
Thanks a lot @twerkmeister, your review was very helpful. Is it better that I create a separate task to handle the comments that you said here? |
@varunshankar given that |
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.
🚀
with mock.patch( | ||
"rasa.core.processor.MessageProcessor._parse_message_with_graph" | ||
) as mocked_function: | ||
# Case1: message has intent and entities explicitly set. | ||
message = UserMessage('/greet{"name": "boy"}') | ||
parsed = await default_processor.parse_message(message) | ||
assert parsed["intent"][INTENT_NAME_KEY] == "greet" | ||
assert parsed["entities"][0]["entity"] == "name" | ||
mocked_function.assert_not_called() | ||
|
||
# Case2: Normal user message. | ||
parse_data = { | ||
"text": "mocked", | ||
"intent": {"name": None, "confidence": 0.0}, | ||
"entities": [], | ||
} | ||
mocked_function.return_value = parse_data | ||
message = UserMessage("hi hello how are you?") | ||
parsed = await default_processor.parse_message(message) | ||
mocked_function.assert_called() |
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.
This is really smart, I didn't know something like this was possible 😎. Very cool!
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.
Thanks Thomas, means a lot 😄
🚀 A preview of the docs have been deployed at the following URL: https://12480--rasahq-docs-rasa-v2.netlify.app/docs/rasa |
…ENG 286] (#12480) * Bypass NLU pipeline when a message is /intent or /intent + entities
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)