This repository was archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
luis build support to extract authoringKey set by config:set #731
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6adc2f3
support extract authoringKey from config
feich-ms 58ea34e
Merge branch 'master' into feich/AddAuthoringKeyInConfig
vishwacsena 2a787c5
Merge branch 'master' into feich/AddAuthoringKeyInConfig
vishwacsena 041db20
Merge branch 'master' into feich/AddAuthoringKeyInConfig
vishwacsena 8049f67
Merge branch 'master' into feich/AddAuthoringKeyInConfig
vishwacsena 3063eaf
Merge branch 'master' into feich/AddAuthoringKeyInConfig
vishwacsena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ const Settings = require('@microsoft/bf-lu/lib/parser/lubuild/settings') | |
| const MultiLanguageRecognizer = require('@microsoft/bf-lu/lib/parser/lubuild/multi-language-recognizer') | ||
| const Recognizer = require('@microsoft/bf-lu/lib/parser/lubuild/recognizer') | ||
| const Builder = require('@microsoft/bf-lu/lib/parser/lubuild/builder').Builder | ||
| const utils = require('../../utils/index') | ||
|
|
||
| export default class LuisBuild extends Command { | ||
| static description = 'Build lu files to train and publish luis applications' | ||
|
|
@@ -27,7 +28,7 @@ export default class LuisBuild extends Command { | |
| static flags: flags.Input<any> = { | ||
| help: flags.help({char: 'h'}), | ||
| in: flags.string({char: 'i', description: 'Lu file or folder'}), | ||
| authoringKey: flags.string({description: 'LUIS authoring key', required: true}), | ||
| authoringKey: flags.string({description: 'LUIS authoring key'}), | ||
| botName: flags.string({description: 'Bot name'}), | ||
| region: flags.string({description: 'LUIS authoring region [westus|westeurope|australiaeast]', default: 'westus'}), | ||
| out: flags.string({char: 'o', description: 'Output file or folder name. If not specified, current directory will be used as output'}), | ||
|
|
@@ -43,6 +44,7 @@ export default class LuisBuild extends Command { | |
| async run() { | ||
| try { | ||
| const {flags} = this.parse(LuisBuild) | ||
| const userConfig = await utils.getUserConfig(this.config.configDir) | ||
|
|
||
| flags.stdin = await this.readStdin() | ||
|
|
||
|
|
@@ -66,6 +68,12 @@ export default class LuisBuild extends Command { | |
| throw new CLIError('Missing input. Please use stdin or pass a file or folder location with --in flag') | ||
| } | ||
|
|
||
| if (!flags.authoringKey && (!userConfig || !userConfig.authoringKey)) { | ||
| throw new CLIError('Missing luis authoring key. Please pass authoring key with --authoringKey flag') | ||
| } else { | ||
| flags.authoringKey = flags.authoringKey || userConfig.authoringKey | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is there a separate PR for adding this to config? Even if config allows anything, I would still expect to see documentation updates both for this command and for config. |
||
| } | ||
|
|
||
| if (!flags.botName) { | ||
| throw new CLIError('Missing bot name. Please pass bot name with --botName flag') | ||
| } | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should be LUIS.