Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 6a0f42c

Browse files
authored
clean docs of luis:build and qna build and cross-train (#982)
* clean docs * update doc 2 * resolve typo
1 parent 737fe95 commit 6a0f42c

File tree

7 files changed

+92
-89
lines changed

7 files changed

+92
-89
lines changed

packages/cli/README.md

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -736,28 +736,27 @@ USAGE
736736
$ bf luis:build
737737
738738
OPTIONS
739-
-f, --force If --dialog flag is provided, overwrites relevant dialog file
740-
-h, --help show CLI help
739+
-f, --force If --out flag is provided with the path to an existing file, overwrites that file
740+
-h, --help luis:build command help
741741
-i, --in=in Lu file or folder
742742
743-
-o, --out=out Output file or folder name. If not specified, current directory will be used as
744-
output
745-
743+
-o, --out=out Output folder name to write out .dialog and settings files. If not specified, application
744+
setting will be output to console
745+
746746
--authoringKey=authoringKey LUIS authoring key
747747
748748
--botName=botName Bot name
749749
750750
--defaultCulture=defaultCulture Culture code for the content. Infer from .lu if available. Defaults to en-us
751751
752-
--deleteOldVersion Delete old version of LUIS application after building new one.
752+
--deleteOldVersion Deletes old version of LUIS application after building new one.
753753
754-
--dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type
755-
[multiLanguage|crosstrained] is specified by --dialog
754+
--dialog=dialog [default: multiLanguage] Dialog recognizer type [multiLanguage|crosstrained]
756755
757756
--fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only
758-
valid if --dialog is set
757+
valid if --out is set
759758
760-
--log write out log messages to console
759+
--log Writes out log messages to console
761760
762761
--luConfig=luConfig Path to config for lu build which can contain switches for arguments
763762
@@ -766,10 +765,15 @@ OPTIONS
766765
--suffix=suffix Environment name as a suffix identifier to include in LUIS app name. Defaults to
767766
current logged in user alias
768767
768+
--endpoint Luis authoring endpoint for publishing
769+
770+
--schema=schema Defines $schema for generated .dialog files
771+
772+
--isStaging Publishes luis application to staging slot if set. Default to production slot
773+
769774
EXAMPLE
770775
771-
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog
772-
multiLanguage
776+
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME}
773777
```
774778

775779
_See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/build.ts)_
@@ -808,20 +812,20 @@ USAGE
808812
$ bf luis:cross-train
809813
810814
OPTIONS
811-
-h, --help luis:cross-train help
812-
-i, --in=in source lu and qna files folder
815+
-f, --force [default: false] If --out flag is provided with the path to an existing file, overwrites that file
816+
-h, --help luis:cross-train command help
817+
-i, --in=in Source lu and qna files folder
813818
814-
-o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained
819+
-o, --out=out Output folder name. If not specified, the cross trained files will be wrote to cross-trained
815820
folder under folder of current command
816821
817-
--config=config path to config file of mapping rules which is relative to folder specified by --in. If not
818-
specified, it will read default config.json from the folder specified by --in
822+
--config=config Path to config file of mapping rules
819823
820824
--intentName=intentName [default: _Interruption] Interruption intent name
821825
822-
--rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not
823-
specified, cross-trian will automatically construct the config from file system based on root
824-
dialog file
826+
--rootDialog=rootDialog Root dialog file path
827+
828+
--log [default: false] Writes out log messages to console
825829
```
826830

827831
_See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/cross-train.ts)_
@@ -1337,36 +1341,40 @@ USAGE
13371341
13381342
OPTIONS
13391343
-b, --botName=botName (required) Bot name
1340-
-f, --force If --dialog flag is provided, overwirtes relevant dialog file
1341-
-h, --help show CLI help
1344+
-f, --force [default: false] If --out flag is provided with the path to an existing file, overwrites that file
1345+
-h, --help qnamaker:build command help
13421346
-i, --in=in Source .qna file or folder
13431347
1344-
-o, --out=out Output file or folder name. If not specified, current directory will be used as
1345-
output
1348+
-o, --out=out Output folder name to write out .dialog and settings files. If not specified, knowledge base
1349+
setting will be output to console
13461350
13471351
-s, --subscriptionKey=subscriptionKey (required) QnA maker subscription key
13481352
13491353
--defaultCulture=defaultCulture Culture code for the content. Infer from .qna if available. Defaults to en-us
13501354
if not set
13511355
1352-
--dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type
1353-
[multiLanguage|crosstrained] is specified by --dialog
1356+
--dialog=dialog [default: multiLanguage] Dialog recognizer type [multiLanguage|crosstrained]
13541357
13551358
--fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found.
1356-
Only valid if --dialog is set
1359+
Only valid if --out is set
1360+
1361+
--log [default: false] Writes out log messages to console
13571362
1358-
--log write out log messages to console
1363+
--qnaConfig=qnaConfig Path to config for qnamaker build which can contain switches for arguments
13591364
13601365
--region=region [default: westus] Overrides public endpoint
13611366
https://<region>.api.cognitive.microsoft.com/qnamaker/v4.0/
13621367
13631368
--suffix=suffix Environment name as a suffix identifier to include in qnamaker kb name.
13641369
Defaults to current logged in user alias
1370+
1371+
--endpoint=endpoint Qnamaker authoring endpoint for publishing
13651372
1373+
--schema=schema Defines $schema for generated .dialog files
1374+
13661375
EXAMPLE
13671376
1368-
$ bf qnamaker:build --in {INPUT_FILE_OR_FOLDER} --subscriptionKey {SUBSCRIPTION_KEY} --botName {BOT_NAME}
1369-
--dialog
1377+
$ bf qnamaker:build --in {INPUT_FILE_OR_FOLDER} --subscriptionKey {SUBSCRIPTION_KEY} --botName {BOT_NAME}
13701378
```
13711379

13721380
_See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/build.ts)_
@@ -1402,20 +1410,20 @@ USAGE
14021410
$ bf qnamaker:cross-train
14031411
14041412
OPTIONS
1405-
-h, --help luis:cross-train help
1406-
-i, --in=in source lu and qna files folder
1413+
-f, --force [default: false] If --out flag is provided with the path to an existing file, overwrites that file
1414+
-h, --help qnamaker:cross-train command help
1415+
-i, --in=in Source lu and qna files folder
14071416
1408-
-o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained
1417+
-o, --out=out Output folder name. If not specified, the cross trained files will be wrote to cross-trained
14091418
folder under folder of current command
14101419
1411-
--config=config path to config file of mapping rules which is relative to folder specified by --in. If not
1412-
specified, it will read default config.json from the folder specified by --in
1420+
--config=config Path to config file of mapping rules
14131421
14141422
--intentName=intentName [default: _Interruption] Interruption intent name
14151423
1416-
--rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not
1417-
specified, cross-trian will automatically construct the config from file system based on root
1418-
dialog file
1424+
--rootDialog=rootDialog Root dialog file path.
1425+
1426+
--log [default: false] Writes out log messages to console
14191427
```
14201428

14211429
_See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/cross-train.ts)_

packages/luis/README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,27 +339,27 @@ USAGE
339339
$ bf luis:build
340340
341341
OPTIONS
342-
-f, --force If --out flag is provided, overwrites relevant dialog file
343-
-h, --help show CLI help
342+
-f, --force If --out flag is provided with the path to an existing file, overwrites that file
343+
-h, --help luis:build command help
344344
-i, --in=in Lu file or folder
345345
346-
-o, --out=out Output folder name to write out .dialog files. If not specified, application
347-
ids will be output to console
346+
-o, --out=out Output folder name to write out .dialog and settings files. If not specified, application
347+
setting will be output to console
348348
349349
--authoringKey=authoringKey LUIS authoring key
350350
351351
--botName=botName Bot name
352352
353353
--defaultCulture=defaultCulture Culture code for the content. Infer from .lu if available. Defaults to en-us
354354
355-
--deleteOldVersion Delete old version of LUIS application after building new one.
355+
--deleteOldVersion Deletes old version of LUIS application after building new one.
356356
357357
--dialog=dialog [default: multiLanguage] Dialog recognizer type [multiLanguage|crosstrained]
358358
359359
--fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only
360360
valid if --out is set
361361
362-
--log write out log messages to console
362+
--log Writes out log messages to console
363363
364364
--luConfig=luConfig Path to config for lu build which can contain switches for arguments
365365
@@ -372,12 +372,11 @@ OPTIONS
372372
373373
--schema=schema Defines $schema for generated .dialog files
374374
375-
--isStaging Publish luis application to staging slot if set. Default to production slot
375+
--isStaging Publishes luis application to staging slot if set. Default to production slot
376376
377377
EXAMPLE
378378
379-
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog
380-
multiLanguage
379+
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME}
381380
```
382381

383382
_See code: [src/commands/luis/build.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/build.ts)_
@@ -416,7 +415,8 @@ USAGE
416415
$ bf luis:cross-train
417416
418417
OPTIONS
419-
-h, --help Luis:cross-train help
418+
-f, --force [default: false] If --out flag is provided with the path to an existing file, overwrites that file
419+
-h, --help Luis:cross-train command help
420420
-i, --in=in Source lu and qna files folder
421421
422422
-o, --out=out Output folder name. If not specified, the cross trained files will be written to cross-trained
@@ -426,12 +426,9 @@ OPTIONS
426426
427427
--intentName=intentName [default: _Interruption] Interruption intent name
428428
429-
--rootDialog=rootDialog RootDialog file path. If --config not specified,
430-
cross-trian will automatically construct the config from file system based on root dialog file
431-
432-
-f, --force [default: false] If --out flag is provided with the path to an existing file, overwrites that file
429+
--rootDialog=rootDialog Root dialog file path
433430
434-
--log [default: false] Write out log messages to console
431+
--log [default: false] Writes out log messages to console
435432
```
436433

437434
_See code: [src/commands/luis/cross-train.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/cross-train.ts)_

packages/luis/src/commands/luis/build.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@ export default class LuisBuild extends Command {
2424
static description = 'Build lu files to train and publish luis applications'
2525

2626
static examples = [`
27-
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog multiLanguage
27+
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME}
2828
`]
2929

3030
static flags: flags.Input<any> = {
31-
help: flags.help({char: 'h'}),
31+
help: flags.help({char: 'h', description: 'luis:build command help'}),
3232
in: flags.string({char: 'i', description: 'Lu file or folder'}),
3333
authoringKey: flags.string({description: 'LUIS authoring key'}),
3434
botName: flags.string({description: 'Bot name'}),
3535
region: flags.string({description: 'LUIS authoring region [westus|westeurope|australiaeast]', default: 'westus'}),
36-
out: flags.string({char: 'o', description: 'Output folder name to write out .dialog files. If not specified, application ids will be output to console'}),
36+
out: flags.string({char: 'o', description: 'Output folder name to write out .dialog and settings files. If not specified, application setting will be output to console'}),
3737
defaultCulture: flags.string({description: 'Culture code for the content. Infer from .lu if available. Defaults to en-us'}),
3838
fallbackLocale: flags.string({description: 'Locale to be used at the fallback if no locale specific recognizer is found. Only valid if --out is set'}),
3939
suffix: flags.string({description: 'Environment name as a suffix identifier to include in LUIS app name. Defaults to current logged in user alias'}),
4040
dialog: flags.string({description: 'Dialog recognizer type [multiLanguage|crosstrained]', default: 'multiLanguage'}),
41-
force: flags.boolean({char: 'f', description: 'If --out flag is provided, overwrites relevant dialog file', default: false}),
41+
force: flags.boolean({char: 'f', description: 'If --out flag is provided with the path to an existing file, overwrites that file', default: false}),
4242
luConfig: flags.string({description: 'Path to config for lu build which can contain switches for arguments'}),
43-
deleteOldVersion: flags.boolean({description: 'Delete old version of LUIS application after building new one.'}),
44-
log: flags.boolean({description: 'Write out log messages to console', default: false}),
43+
deleteOldVersion: flags.boolean({description: 'Deletes old version of LUIS application after building new one.'}),
44+
log: flags.boolean({description: 'Writes out log messages to console', default: false}),
4545
endpoint: flags.string({description: 'Luis authoring endpoint for publishing'}),
4646
schema: flags.string({description: 'Defines $schema for generated .dialog files'}),
47-
isStaging: flags.boolean({description: 'Publish luis application to staging slot if set. Default to production slot', default: false})
47+
isStaging: flags.boolean({description: 'Publishes luis application to staging slot if set. Default to production slot', default: false})
4848
}
4949

5050
async run() {
@@ -162,8 +162,8 @@ export default class LuisBuild extends Command {
162162
this.log(`No changes to the .dialog files in ${outputFolder}\n`)
163163
}
164164
} else {
165-
this.log('The published application ids:')
166-
this.log(JSON.parse(dialogContents[dialogContents.length - 1].content).luis)
165+
this.log('The published application setting:')
166+
this.log(JSON.stringify(JSON.parse(dialogContents[dialogContents.length - 1].content).luis, null, 4))
167167
}
168168
} catch (error) {
169169
if (error instanceof exception) {

packages/luis/src/commands/luis/cross-train.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export default class LuisCrossTrain extends Command {
1313
static description = 'Lu and Qna cross train tool'
1414

1515
static flags: flags.Input<any> = {
16-
help: flags.help({char: 'h', description: 'Luis:cross-train help'}),
16+
help: flags.help({char: 'h', description: 'Luis:cross-train command help'}),
1717
in: flags.string({char: 'i', description: 'Source lu and qna files folder'}),
1818
out: flags.string({char: 'o', description: 'Output folder name. If not specified, the cross trained files will be written to cross-trained folder under folder of current command'}),
1919
config: flags.string({description: 'Path to config file of mapping rules'}),
2020
intentName: flags.string({description: 'Interruption intent name', default: '_Interruption'}),
21-
rootDialog: flags.string({description: 'RootDialog file path. If --config not specified, cross-trian will automatically construct the config from file system based on root dialog file'}),
21+
rootDialog: flags.string({description: 'Root dialog file path'}),
2222
force: flags.boolean({char: 'f', description: 'If --out flag is provided with the path to an existing file, overwrites that file', default: false}),
23-
log: flags.boolean({description: 'Write out log messages to console', default: false})
23+
log: flags.boolean({description: 'Writes out log messages to console', default: false})
2424
}
2525

2626
async run() {

0 commit comments

Comments
 (0)