-
Notifications
You must be signed in to change notification settings - Fork 378
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
feat: UI Schema - Recognizer #4135
Conversation
@yeze322 we want to allow PVA or another runtime to model the Default Recognizer to be their recognizer instead of our Luis + QnA cross-trained components. So the scenario is: I can provide a schema + uischema that allows me to override the behavior & configuration of the default recognizer with my own behavior & configuration In PVA's case they will essentially alias the Default Recognizer to be their PVARecognizer component because there are no additional build steps. |
@cwhitten Yes we can, I added a new field Take the PVA scenario as an example, we want PVARecognizer become the default recognizer. We override the uischema with this JSON: {
"Microsoft.CrossTrainRecognizerSet": {
"recognizer": {
"displayName": "LUIS Recognizer",
"default": false
}
},
"Microsoft.PVA.Recognizer": {
"recognizer": {
"displayName": "Default Recognizer (PVA)",
"default": true
}
}
} |
Composer/packages/adaptive-form/src/components/fields/RecognizerField/useMigrationEffect.ts
Show resolved
Hide resolved
Composer/packages/client/src/pages/design/createDialogModal.tsx
Outdated
Show resolved
Hide resolved
Composer/packages/extension-client/src/hooks/useRecognizerConfig.ts
Outdated
Show resolved
Hide resolved
Composer/packages/extension-client/src/hooks/useRecognizerConfig.ts
Outdated
Show resolved
Hide resolved
Composer/packages/ui-plugins/composer/src/defaultRecognizerSchema.ts
Outdated
Show resolved
Hide resolved
Composer/packages/ui-plugins/composer/src/defaultRecognizerSchema.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Brown <asbrown002@gmail.com>
…ramework-Composer into uischema/recognizer
@liweitian There are several questions about issues left over from QnA PR in Andy's code review, could you answer them? |
* main: fix: update l10n file (microsoft#4247) fix: fix loading of extensions by removing sample-ui-plugin (microsoft#4251) fix: split qna resource to another template (microsoft#4212) feat: UI Schema - Recognizer (microsoft#4135) fix: Change http to https for petstore.swagger.io calls (microsoft#4238) feat: install remote extensions from npm (microsoft#4224) fix: refactored select skill ui-plugin (microsoft#4207) feat: Added fieldSets to UIOptions (microsoft#4231) fix: New LG template not sync to other locale files (microsoft#4230)
* main: fix: update l10n file (microsoft#4247) fix: fix loading of extensions by removing sample-ui-plugin (microsoft#4251) fix: split qna resource to another template (microsoft#4212) feat: UI Schema - Recognizer (microsoft#4135) fix: Change http to https for petstore.swagger.io calls (microsoft#4238) feat: install remote extensions from npm (microsoft#4224) fix: refactored select skill ui-plugin (microsoft#4207) feat: Added fieldSets to UIOptions (microsoft#4231) fix: New LG template not sync to other locale files (microsoft#4230)
* main: fix: update l10n file (#4247) fix: fix loading of extensions by removing sample-ui-plugin (#4251) fix: split qna resource to another template (#4212) feat: UI Schema - Recognizer (#4135) fix: Change http to https for petstore.swagger.io calls (#4238) feat: install remote extensions from npm (#4224) fix: refactored select skill ui-plugin (#4207) feat: Added fieldSets to UIOptions (#4231) fix: New LG template not sync to other locale files (#4230)
* chore: turn RecognizerField to folder * extract 'useMigrationEffect' * remove dup & no ref file 'defaultRecognizers' * move out complicated selectedType func && var names * use 'dropdownOption' to replace 'isCustomType' which is anti-pattern * add 'default' and 'disabled' to RecognizerSchema * set CrossTrain to default, disable Luis * impl 'getRecognizerDefinition()' * move DefaultRecognizers to separated file * rename: 'editor' -> 'intentEditor' * impl 'recognizerEditor' in Recognizer schema * adapt to schema's 'disabled' property * sort recognizer options * make renameIntent optional * make handleRecognizerChange optional & impl fallback submit func * impl mappers to map among 'schema', 'dropdown', 'value' * provide 'findRecognizer' as hook's buitin func * apply findRecognizer to RecognizerField * mark isSelected optional * add a todo * merge 'recognizers' to uiSchema * migrate to new RecognizerUISchema * don't show non-recognizer $kinds as dropdown * adjust dropdown order * make the 'Custom Rec' with JSON editor as fallback option * fix tslint error * omi RegexRecognizer's `isSelected` option * resolve intentEditor logic leaks * fix UT * fix UT * impl getDefaultRecognizer() * create default recognizer when seeding new dialog * fix UT * copyright * del 'default' opt from crosstrain plugin Due to uischema merge priority, plugin settings are hard to be overrided. CrossTrain is already set to default in 'useRecongizerConfig.ts/getDefaultRecognizer' * migrate handleRecognizerChange to seedNewRecognizer * mark a todo * update `seedNewRecongnizer` interface & apply to dialog modal * Fix wording issue in comments Co-authored-by: Andy Brown <asbrown002@gmail.com> * minor fixes on code style & comments * type the 'disabled' field strictly * more strict `isSelected()` method in CrossTrainReocognizer shema * update default recognizer value * provide 'current' and 'default' recognizer schema in useRecognizerConfig() * fix UTs * remove custom recognizer template * write `displayName` as function to support multi-locale Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com> Co-authored-by: Andy Brown <asbrown002@gmail.com>
Description
Use uischema to control which Recognizers can be used in Composer. Including
displayName
default: true
disabled: true
Remainings
When seeding a new Dialog, use the default recognizer described by uischemaIntegartion with publish flow(Will be covered in another PR)Code cleanup (//leak, //TODO)Fix the UT (broken by schema change)Usage
(To make it simple, use sdk.override.uischema as an example.)
sdk.override.uischema
file under a bot project (DO use override schema due to plugin has higher priority than sdk.uischema. Will be moved to botbuilder component schema)PVARecognizer will be added to dropdown menu.

Task Item
closes #4111
Screenshots