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

Eng 496 intentless changes #12900

Merged
merged 18 commits into from
Oct 12, 2023
Merged

Eng 496 intentless changes #12900

merged 18 commits into from
Oct 12, 2023

Conversation

twerkmeister
Copy link
Contributor

Proposed changes:

  • knowledge and chitchat commands now add their respective pattern stack frames onto the stack
  • triggering doc search and intentless can be done through actions that put those policies' frames onto the stack
  • a number of refactorings

Status (please check what you already did):

  • 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)

@twerkmeister twerkmeister requested a review from tmbo October 6, 2023 13:24
@twerkmeister twerkmeister requested a review from a team as a code owner October 6, 2023 13:24
Copy link
Member

@tmbo tmbo left a comment

Choose a reason for hiding this comment

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

lgtm but couldn't do a detailed review in the short time i have today - overall looks good, don't have any structural concerns but someone should do a line by line review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added the new actions and the previously missing ActionCleanStack to the default action list

Copy link
Contributor Author

@twerkmeister twerkmeister Oct 9, 2023

Choose a reason for hiding this comment

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

Added the action that puts a ChitchatStackFrame on the stack - which in turn allows the intentless policy to act. So this action needs to be triggered by the chitchat flow if one wants to use the intentless policy for chitchat

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the action that puts a SearchStackFrame on the stack - which in turn allows the doc search policy to act. So this action needs to be triggered by the search flow if one wants to use the doc search policy for knowledge based questions

Copy link
Contributor Author

@twerkmeister twerkmeister Oct 9, 2023

Choose a reason for hiding this comment

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

Instead of directly putting a ChitchatStackFrame (which allows the intentless policy to act) we put a ChitchatPatternFlowStackFrame on the stack which executes pattern_chitchat. pattern_chitchat can then be configured to use a free generation or execute action_trigger_chitchat (which then allows the intentless policy to act).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above for the chitchat

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PatternFlowStackFrame for the pattern_chitchat. Was missing so far despite the pattern being there

Copy link
Contributor Author

@twerkmeister twerkmeister Oct 9, 2023

Choose a reason for hiding this comment

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

  • adjusted all patterns to use the new flow syntax
  • added pattern_search with a default utterance when not connected to a knowledge base (e.g. doc search being not present)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added flow stack frame for pattern_search

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • added property to retrieve all utterances used in a flow - relevant for validation and also for intentless in rasa-pro
  • added a method for deriving default names for flows from their id instead of going with empty names

Copy link
Member

Choose a reason for hiding this comment

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

I think this might still fail the new json schema validation, I've asked Uros yesterday to make flow name as required property. Best to discuss with him if he should revert that?

Copy link
Contributor Author

@twerkmeister twerkmeister Oct 9, 2023

Choose a reason for hiding this comment

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

Moved helper method that was originally in tests here to also be able to use it in rasa-pro tests for my PR on intentless policy changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed utterance collection logic here from the validation as it's present in reusable form as part of the flow objects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Adjusted a test to be compatible with actions being added without failing
  • Added a test that checks that default action names and default actions are in sync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test that the validator catches empty flow names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this method to be reusable by rasa pro

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added action names for new actions

@ancalita ancalita self-requested a review October 10, 2023 07:54
@sonarcloud
Copy link

sonarcloud bot commented Oct 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 5 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 49 Code Smells

0.0% 0.0% Coverage
1.0% 1.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

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.

LGTM 💯

The created `DialogueStackFrame`.
"""
return ChitchatPatternFlowStackFrame(
frame_id=data["frame_id"],
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this is a parent class attribute that gets inherited?

Copy link
Member

Choose a reason for hiding this comment

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

I think this might still fail the new json schema validation, I've asked Uros yesterday to make flow name as required property. Best to discuss with him if he should revert that?

@twerkmeister twerkmeister merged commit ff6d3d9 into dm2 Oct 12, 2023
101 checks passed
@twerkmeister twerkmeister deleted the ENG-496-intentless-changes branch October 12, 2023 06:05
tabergma pushed a commit that referenced this pull request Oct 12, 2023
* retrieving all utterances from flows with new attribute

* Added trigger actions for search and chitchat

* added search pattern

* adjusted patterns for new yaml format

* added test for default action + name consistency

* fixed default flows

* setting default flow name, if there is none
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 participants