-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Orchestrator Recognizer Preview (#4867)
* bf-orchestrator lib integration * add orchestrator uischema * Update Orchestrator Libs (minor interface changes) * Add Orchestrator Recognizer to AzureWebApp * Keep native libs out of asar package because of relative linking * Local scenario POC * Update orchestrator-core for electron * write downsampling result to the interruption folder * Update orchestrator-core critical bits for mac build * Move download of model back to "start bot" * First pass putting orchestrator behind feature flag * filter the publish and separate the lu files * start bot error fix * Minor cleanup * Fix linter error * Remove obsolete test code * Change writefile to async variation in fs-extra * Add safeguard to prevent endless loop * Move FeatureFlag types, address typing issues * Interface tweaks * update the type and dispatcher * remove the luprovider:'' * remove invalid import * Minor tweak to single import * Strengthen the check to prevent UI infinite loop * Minor UI fix after feature flag is deselected Co-authored-by: leilzh <leilzh@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
- Loading branch information
1 parent
9ec8735
commit c874aa0
Showing
51 changed files
with
889 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
Composer/packages/adaptive-form/src/components/fields/RecognizerField/getDropdownOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { RecognizerSchema, FallbackRecognizerKey } from '@bfc/extension-client'; | ||
import { RecognizerSchema, FallbackRecognizerKey, ShellApi, ShellData } from '@bfc/extension-client'; | ||
|
||
import { recognizerOrderMap } from './defaultRecognizerOrder'; | ||
import { mapRecognizerSchemaToDropdownOption } from './mappers'; | ||
|
||
const getRankScore = (r: RecognizerSchema) => { | ||
const getRankScore = (r: RecognizerSchema, shellData: ShellData, shellApi: ShellApi) => { | ||
// Always put disabled recognizer behind. Handle 'disabled' before 'default'. | ||
if (r.disabled) return Number.MAX_VALUE; | ||
if ((typeof r.disabled === 'function' && r.disabled(shellData, shellApi)) || r.disabled) return Number.MAX_VALUE; | ||
// Always put default recognzier ahead. | ||
if (r.default) return -1; | ||
// Put fallback recognizer behind. | ||
if (r.id === FallbackRecognizerKey) return Number.MAX_VALUE - 1; | ||
return recognizerOrderMap[r.id] ?? Number.MAX_VALUE - 1; | ||
}; | ||
|
||
export const getDropdownOptions = (recognizerConfigs: RecognizerSchema[]) => { | ||
export const getDropdownOptions = (recognizerConfigs: RecognizerSchema[], shellData: ShellData, shellApi: ShellApi) => { | ||
return recognizerConfigs | ||
.filter((r) => !r.disabled) | ||
.filter((r) => (typeof r.disabled === 'function' && !r.disabled(shellData, shellApi)) || !r.disabled) | ||
.sort((r1, r2) => { | ||
return getRankScore(r1) - getRankScore(r2); | ||
return getRankScore(r1, shellData, shellApi) - getRankScore(r2, shellData, shellApi); | ||
}) | ||
.map(mapRecognizerSchemaToDropdownOption); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 26 additions & 2 deletions
28
Composer/packages/client/src/recoilModel/dispatchers/recognizers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.