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

Commit a9cdfed

Browse files
Adding lg and dialog to CLI core (#753)
* update package.json (#750) * Adding Dialog to CLI core Co-authored-by: Vishwac Sena Kannan <[email protected]>
1 parent fc69d67 commit a9cdfed

File tree

9 files changed

+525
-166
lines changed

9 files changed

+525
-166
lines changed

packages/cli/README.md

Lines changed: 324 additions & 9 deletions
Large diffs are not rendered by default.

packages/cli/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
"@microsoft/bf-cli-config",
3232
"@microsoft/bf-qnamaker",
3333
"@microsoft/bf-luis-cli",
34-
"@microsoft/bf-cli-plugins"
34+
"@microsoft/bf-cli-plugins",
35+
"@microsoft/bf-lg-cli",
36+
"@microsoft/bf-dialog"
3537
],
3638
"hooks": {
3739
"init": "./lib/hooks/init/inithook"
@@ -59,6 +61,8 @@
5961
"@microsoft/bf-luis-cli": "1.0.0",
6062
"@microsoft/bf-qnamaker": "1.0.0",
6163
"@microsoft/bf-cli-plugins": "1.0.0",
64+
"@microsoft/bf-lg-cli": "1.0.0",
65+
"@microsoft/bf-dialog": "1.0.0",
6266
"@oclif/command": "~1.5.19",
6367
"@oclif/config": "~1.13.3",
6468
"@oclif/errors": "~1.2.2",

packages/config/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ This package is intended for Microsoft use only and should be consumed through @
88

99
# Commands
1010
<!-- commands -->
11-
- [@microsoft/bf-cli-config](#microsoftbf-cli-config)
12-
- [Commands](#commands)
13-
- [`bf config`](#bf-config)
14-
- [`bf config:set`](#bf-configset)
15-
- [`bf config:set:luis`](#bf-configsetluis)
16-
- [`bf config:set:qnamaker`](#bf-configsetqnamaker)
17-
- [`bf config:set:telemetry`](#bf-configsettelemetry)
18-
- [`bf config:show`](#bf-configshow)
19-
- [`bf config:show:luis`](#bf-configshowluis)
20-
- [`bf config:show:qnamaker`](#bf-configshowqnamaker)
21-
- [`bf config:show:telemetry`](#bf-configshowtelemetry)
11+
* [`bf config`](#bf-config)
12+
* [`bf config:set`](#bf-configset)
13+
* [`bf config:set:luis`](#bf-configsetluis)
14+
* [`bf config:set:qnamaker`](#bf-configsetqnamaker)
15+
* [`bf config:set:telemetry`](#bf-configsettelemetry)
16+
* [`bf config:show`](#bf-configshow)
17+
* [`bf config:show:luis`](#bf-configshowluis)
18+
* [`bf config:show:qnamaker`](#bf-configshowqnamaker)
19+
* [`bf config:show:telemetry`](#bf-configshowtelemetry)
2220

2321
## `bf config`
2422

@@ -68,8 +66,8 @@ OPTIONS
6866
6967
EXAMPLE
7068
71-
$ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID}
72-
--endpoint {ENDPOINT}
69+
$ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY}
70+
--versionId {VERSION_ID} --endpoint {ENDPOINT}
7371
```
7472

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

packages/dialog/README.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,9 @@ This package is intended for Microsoft use only and should be consumed through @
1010

1111
# Commands
1212
<!-- commands -->
13-
- [@microsoft/bf-dialog](#microsoftbf-dialog)
14-
- [Commands](#commands)
15-
- [`bf `](#bf)
16-
- [`bf dialog`](#bf-dialog)
17-
- [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns)
18-
- [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns)
19-
20-
## `bf `
21-
22-
The dialog commands allow you to work with dialog schema.
23-
24-
```
25-
USAGE
26-
$ bf
27-
28-
OPTIONS
29-
-h, --help show CLI help
30-
```
31-
32-
_See code: [src/commands/index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/index.ts)_
13+
* [`bf dialog`](#bf-dialog)
14+
* [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns)
15+
* [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns)
3316

3417
## `bf dialog`
3518

@@ -80,8 +63,8 @@ ARGUMENTS
8063
PATTERNS Any number of glob regex patterns to match .dialog files.
8164
8265
OPTIONS
83-
-h, --help show CLI help
84-
--verbose Show verbose output
66+
-h, --help show CLI help
67+
-v, --verbose Show verbose output
8568
```
8669

8770
_See code: [src/commands/dialog/verify.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/verify.ts)_

packages/dialog/src/commands/index.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/dialog/src/library/schemaMerger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ export default class SchemaMerger {
817817
if (val.$schema && path) {
818818
return true
819819
}
820-
if (val.properties && !path?.endsWith('properties')) {
820+
if (val.properties && (!path || !path.endsWith('properties'))) {
821821
for (let propName in val.properties) {
822822
verifyProperty(val.properties[propName], pathName(path, propName))
823823
}

packages/luis/README.md

Lines changed: 112 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,32 @@ This package is intended for Microsoft use only and should be consumed through @
1919

2020
# Commands
2121
<!-- commands -->
22-
- [@microsoft/bf-luis-cli](#microsoftbf-luis-cli)
23-
- [Relevant docs](#relevant-docs)
24-
- [Commands](#commands)
25-
- [`bf luis`](#bf-luis)
26-
- [`bf luis:application:create`](#bf-luisapplicationcreate)
27-
- [`bf luis:application:delete`](#bf-luisapplicationdelete)
28-
- [`bf luis:application:import`](#bf-luisapplicationimport)
29-
- [`bf luis:application:list`](#bf-luisapplicationlist)
30-
- [`bf luis:application:publish`](#bf-luisapplicationpublish)
31-
- [`bf luis:application:query`](#bf-luisapplicationquery)
32-
- [`bf luis:application:rename`](#bf-luisapplicationrename)
33-
- [`bf luis:application:show`](#bf-luisapplicationshow)
34-
- [`bf luis:build`](#bf-luisbuild)
35-
- [`bf luis:convert`](#bf-luisconvert)
36-
- [`bf luis:cross-train`](#bf-luiscross-train)
37-
- [`bf luis:endpoints:list`](#bf-luisendpointslist)
38-
- [`bf luis:test`](#bf-luistest)
39-
- [`bf luis:generate:cs`](#bf-luisgeneratecs)
40-
- [`bf luis:generate:ts`](#bf-luisgeneratets)
41-
- [`bf luis:train:run`](#bf-luistrainrun)
42-
- [`bf luis:train:show`](#bf-luistrainshow)
43-
- [`bf luis:translate`](#bf-luistranslate)
44-
- [`bf luis:version:clone`](#bf-luisversionclone)
45-
- [`bf luis:version:delete`](#bf-luisversiondelete)
46-
- [`bf luis:version:export`](#bf-luisversionexport)
47-
- [`bf luis:version:import`](#bf-luisversionimport)
48-
- [`bf luis:version:list`](#bf-luisversionlist)
49-
- [`bf luis:version:rename`](#bf-luisversionrename)
22+
* [`bf luis`](#bf-luis)
23+
* [`bf luis:application:assignazureaccount`](#bf-luisapplicationassignazureaccount)
24+
* [`bf luis:application:create`](#bf-luisapplicationcreate)
25+
* [`bf luis:application:delete`](#bf-luisapplicationdelete)
26+
* [`bf luis:application:import`](#bf-luisapplicationimport)
27+
* [`bf luis:application:list`](#bf-luisapplicationlist)
28+
* [`bf luis:application:publish`](#bf-luisapplicationpublish)
29+
* [`bf luis:application:query`](#bf-luisapplicationquery)
30+
* [`bf luis:application:rename`](#bf-luisapplicationrename)
31+
* [`bf luis:application:show`](#bf-luisapplicationshow)
32+
* [`bf luis:build`](#bf-luisbuild)
33+
* [`bf luis:convert`](#bf-luisconvert)
34+
* [`bf luis:cross-train`](#bf-luiscross-train)
35+
* [`bf luis:endpoints:list`](#bf-luisendpointslist)
36+
* [`bf luis:generate:cs`](#bf-luisgeneratecs)
37+
* [`bf luis:generate:ts`](#bf-luisgeneratets)
38+
* [`bf luis:test`](#bf-luistest)
39+
* [`bf luis:train:run`](#bf-luistrainrun)
40+
* [`bf luis:train:show`](#bf-luistrainshow)
41+
* [`bf luis:translate`](#bf-luistranslate)
42+
* [`bf luis:version:clone`](#bf-luisversionclone)
43+
* [`bf luis:version:delete`](#bf-luisversiondelete)
44+
* [`bf luis:version:export`](#bf-luisversionexport)
45+
* [`bf luis:version:import`](#bf-luisversionimport)
46+
* [`bf luis:version:list`](#bf-luisversionlist)
47+
* [`bf luis:version:rename`](#bf-luisversionrename)
5048

5149
## `bf luis`
5250

@@ -62,6 +60,36 @@ OPTIONS
6260

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

63+
## `bf luis:application:assignazureaccount`
64+
65+
Assign a LUIS azure accounts to an application
66+
67+
```
68+
USAGE
69+
$ bf luis:application:assignazureaccount
70+
71+
OPTIONS
72+
-h, --help show CLI help
73+
--accountName=accountName (required) Account name
74+
--appId=appId (required) LUIS application Id (defaults to config:LUIS:appId)
75+
76+
--armToken=armToken (required) The bearer authorization header to use; containing the user`s
77+
ARM token used to validate azure accounts information
78+
79+
--azureSubscriptionId=azureSubscriptionId (required) Azure Subscription Id
80+
81+
--endpoint=endpoint LUIS endpoint hostname
82+
83+
--json Display output as JSON
84+
85+
--resourceGroup=resourceGroup (required) Resource Group
86+
87+
--subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key (default:
88+
config:LUIS:subscriptionKey)
89+
```
90+
91+
_See code: [src/commands/luis/application/assignazureaccount.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/application/assignazureaccount.ts)_
92+
6593
## `bf luis:application:create`
6694

6795
Creates a new LUIS application
@@ -311,38 +339,40 @@ USAGE
311339
$ bf luis:build
312340
313341
OPTIONS
314-
-f, --force If --dialog flag is provided, overwirtes relevant dialog file
342+
-f, --force If --dialog flag is provided, overwrites relevant dialog file
315343
-h, --help show CLI help
316344
-i, --in=in Lu file or folder
317345
318346
-o, --out=out Output file or folder name. If not specified, current directory will be used as
319347
output
320348
321-
--authoringKey=authoringKey (required) LUIS authoring key
349+
--authoringKey=authoringKey LUIS authoring key
322350
323351
--botName=botName Bot name
324352
325353
--defaultCulture=defaultCulture Culture code for the content. Infer from .lu if available. Defaults to en-us
326354
327-
--deleteOldVersion Delete old version of LUIS application after building new one.
328-
329-
--dialog [default: multiLanguage]Write out .dialog files whose recognizer type [multiLanguage|crosstrained] is specified by --dialog
355+
--deleteOldVersion Delete old version of LUIS application after building new one.
356+
357+
--dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type
358+
[multiLanguage|crosstrained] is specified by --dialog
330359
331360
--fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only
332361
valid if --dialog is set
333362
334363
--log write out log messages to console
335364
336-
--luConfig=luConfig Path to config for lu build
365+
--luConfig=luConfig Path to config for lu build which can contain switches for arguments
337366
338367
--region=region [default: westus] LUIS authoring region [westus|westeurope|australiaeast]
339368
340369
--suffix=suffix Environment name as a suffix identifier to include in LUIS app name. Defaults to
341-
current logged in useralias
370+
current logged in user alias
342371
343372
EXAMPLE
344373
345-
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog multiLanguage
374+
$ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog
375+
multiLanguage
346376
```
347377

348378
_See code: [src/commands/luis/build.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/build.ts)_
@@ -381,14 +411,23 @@ USAGE
381411
$ bf luis:cross-train
382412
383413
OPTIONS
384-
-h, --help cross-train command help
385-
-i, --in source lu and qna files folder
386-
-o, --out output folder name. If not specified, the cross trained files will be wrote to cross-trained folder under folder of current command
387-
--config path to config file of mapping rules which is relative to folder specified by --in. If not specified, it will read default config.json from the folder specified by --in
388-
--intentName Interruption intent name. Default: _Interruption
414+
-h, --help luis:cross-train help
415+
-i, --in=in source lu and qna files folder
416+
417+
-o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained
418+
folder under folder of current command
419+
420+
--config=config path to config file of mapping rules which is relative to folder specified by --in. If not
421+
specified, it will read default config.json from the folder specified by --in
422+
423+
--intentName=intentName [default: _Interruption] Interruption intent name
424+
425+
--rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not
426+
specified, cross-trian will automatically construct the config from file system based on root
427+
dialog file
389428
```
390429

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

393432
## `bf luis:endpoints:list`
394433

@@ -420,33 +459,6 @@ EXAMPLE
420459

421460
_See code: [src/commands/luis/endpoints/list.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/endpoints/list.ts)_
422461

423-
## `bf luis:test`
424-
425-
Test a .lu file or LUIS application JSON model against a published LUIS model
426-
427-
```
428-
USAGE
429-
$ bf luis:test
430-
431-
OPTIONS
432-
-a, --appId=appId (required) LUIS application Id
433-
-h, --help luis:test help
434-
-i, --in=in Source .lu file or LUIS application JSON model for testing
435-
-o, --out=out Output file or folder name. If not specified stdout will be used as output
436-
-s, --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key
437-
--allowIntentsCount=allowIntentsCount [default: 1] Top-scoring intent or top n Intent with score to show in the result
438-
--endpoint=endpoint [default: https://westus.api.cognitive.microsoft.com] LUIS endpoint hostname
439-
--force If --out flag is provided with the path to an existing file, overwrites that file
440-
--intentOnly Only test intent
441-
--staging Presence of flag targets the staging app, if no flag passed defaults to production
442-
443-
EXAMPLE
444-
445-
$ bf luis:test -i {TESTDATA.lu} -o {RESULT.lu} --endpoint {ENDPOINT} --subscriptionKey {SUBSCRIPTION_KEY} --appId {APP_ID}
446-
```
447-
448-
_See code: [src/commands/luis/test.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/test.ts)_
449-
450462
## `bf luis:generate:cs`
451463

452464
Generate:cs generates a strongly typed C# source code from an exported (json) LUIS model.
@@ -483,6 +495,37 @@ OPTIONS
483495

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

498+
## `bf luis:test`
499+
500+
Test a .lu file or LUIS application JSON model against a published LUIS model
501+
502+
```
503+
USAGE
504+
$ bf luis:test
505+
506+
OPTIONS
507+
-a, --appId=appId (required) LUIS application Id
508+
-h, --help luis:test help
509+
-i, --in=in Source .lu file or LUIS application JSON model for testing
510+
-o, --out=out Output file or folder name. If not specified stdout will be used as output
511+
-s, --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key
512+
513+
--allowIntentsCount=allowIntentsCount [default: 1] Top-scoring intent or top n Intent with score to show in the
514+
result
515+
516+
--endpoint=endpoint [default: https://westus.api.cognitive.microsoft.com] LUIS endpoint hostname
517+
518+
--force If --out flag is provided with the path to an existing file, overwrites that
519+
file
520+
521+
--intentOnly Only test intent
522+
523+
--staging Presence of flag targets the staging app, if no flag passed defaults to
524+
production
525+
```
526+
527+
_See code: [src/commands/luis/test.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/test.ts)_
528+
486529
## `bf luis:train:run`
487530

488531
Issues asynchronous training request for LUIS application

0 commit comments

Comments
 (0)