You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
2. Inside the project folder run 'npm run build'
7
7
3. Inside the packages folder(https://github.com/microsoft/botframework-cli/tree/master/packages) run 'npx oclif plugin <plugin-name>'
8
8
4. Follow the wizard and set the prompts:
9
-
9
+
10
10
? npm package: @microsoft/bf-<plugin-name>
11
11
? description: <Plugin brief description>
12
12
? author: Microsoft
@@ -19,32 +19,32 @@
19
19
? Use tslint (linter for TypeScript): Y
20
20
? Use mocha (testing framework): Y
21
21
? Add CI service config (Press <space> to select, <a> to toggle all, <i> to invert selection): select any
22
-
22
+
23
23
4. Go to the folder created by the previous command and add @microsoft/bf-cli-command as a dependency in your package.json file
24
-
24
+
25
25
"dependencies": {
26
26
...,
27
27
"@microsoft/bf-cli-command": "1.0.0",
28
28
...
29
29
}
30
-
30
+
31
31
5. At the root level(https://github.com/microsoft/botframework-cli) run 'npm run build' to bootstrap the packages
32
32
33
33
## Steps to create a new command
34
34
1. Inside the plugin folder run 'npx oclif command <command-name>'.
35
35
a. To add a subcommand use a colon separated format as follows:
36
36
<command-name:subcommand-name>
37
37
2. Replace the import 'import {Command, flags} from '@oclif/command' line inside the newly created command with '@microsoft/bf-cli-command'
38
-
38
+
39
39
- import {Command, flags} from '@oclif/command'
40
40
+ import {Command, flags} from '@microsoft/bf-cli-command'
41
-
41
+
42
42
3. Add the typing to the flags property like this if needed:
43
-
43
+
44
44
static flags: flags.Input<any> = {
45
45
help: flags.help({description: 'Display help'}),
46
46
}
47
-
47
+
48
48
4. Implement the run method
49
49
50
50
## General Guidelines
@@ -89,7 +89,7 @@ Use the following verbs for standard commands
89
89
* Commands and options are case SenSiTive, specified in lower case. *bf cmd:subcmd*.
90
90
* Multi word options are lowcase, nohyphen, multiwords. Multi word commands are forbidden.
91
91
* Prefer flags to args
92
-
* Commands shall follow the *bf \[noun\]\[verb\]\[noun\]* form for example *bf qnamaker:create:kb*.
92
+
* Commands shall follow the *bf \[noun\]\[noun\]\[verb\]* form for example *bf qnamaker:create:kb*.
93
93
* FLags with specific units:
94
94
* In general, DO NOT put units in Flag names. ALWAYS put the expected units in the help text. Example: --durationinminutes should simply be --duration. This prevents the need to add more arguments later if more units are supported.
95
95
* Consider allowing a syntax that will let the user specify units. For example, even if the service requires a value in minutes, consider accepting 1h or 60m. It is fine to assume a default (i.e. 60 = 60 minutes).
@@ -234,16 +237,20 @@ Roles in .lu file format can be explicitly or implicity defined.
234
237
Explicit definition follow the following notation - @ \<entityType> \<entityName> [hasRole[s]] role1, role2, ...
235
238
```markdown
236
239
> # ml entity definition with roles
240
+
237
241
@ ml name role1, role2
238
242
239
243
> this is the same as
244
+
240
245
@ ml name hasRoles role1, role2
241
246
242
247
> this is also the same as
248
+
243
249
@ ml name
244
250
@ name hasRoles role1, role2
245
251
246
252
> Also same as
253
+
247
254
@ ml name
248
255
@ name hasRole role1
249
256
@ name hasRole role2
@@ -258,6 +265,7 @@ Implicit definition: You can refer to roles directly in patterns as well as in l
258
265
- {userName=vishwac} is my name
259
266
260
267
> This definition is same as including an explicit defintion for userName with 'lastName', 'firstName' as roles
268
+
261
269
> @ ml userName hasRoles lastName, firstName
262
270
```
263
271
@@ -273,8 +281,9 @@ In patterns, you can use roles using the {\<entityName\>:\<roleName\>} notation.
273
281
You can define multiple roles for an entity in patterns and the parser will do rest!
274
282
275
283
```markdown
276
-
# BookFlight
277
284
> roles can be specified for list entity types as well - in this case fromCity and toCity are added as roles to the 'city' list entity defined further below
285
+
286
+
# BookFlight
278
287
- book flight from {city:fromCity} to {city:toCity}
279
288
- [can you] get me a flight from {city:fromCity} to {city:toCity}
280
289
- get me a flight to {city:toCity}
@@ -331,7 +340,7 @@ Here's an example of a phrase list definition:
331
340
@ phraseList Want
332
341
@ phraseList Want =
333
342
- require, need, desire, know
334
-
```
343
+
335
344
336
345
> You can also break up the phrase list values into an actual list
337
346
@@ -341,6 +350,7 @@ Here's an example of a phrase list definition:
341
350
- desire
342
351
- know
343
352
```
353
+
344
354
By default synonyms are set to be **not interchangeable** (matches with the portal experience). You can optionally set the synonyms to be **interchangeable** as part of the definition. Here's an example:
345
355
346
356
```markdown
@@ -355,26 +365,33 @@ Here's how you add a feature to a ml entity or an intent - with `usesFeature`.
@@ -393,21 +410,25 @@ Here's how you define phrase list as a feature to another model
393
410
394
411
```markdown
395
412
> phrase list definition
413
+
396
414
@ phraseList PLCity(interchangeable) =
397
415
- seattle
398
416
- space needle
399
417
- SEATAC
400
418
- SEA
401
419
402
420
> phrase list as feature to intent (also applicable to entities)
421
+
403
422
@ intent getUserProfileIntent usesFeature PLCity
404
423
405
424
> phrase list as a feature to an ml entity.
425
+
406
426
@ ml myCity usesFeature PLCity
407
427
408
428
@ regex regexZipcode = /[0-9]{5}/
409
429
410
430
> phrase list as feature to n-depth entity with phrase list as a feature
431
+
411
432
@ ml address fromAddress, toAddress
412
433
@ address =
413
434
- @ number 'door number'
@@ -474,16 +495,20 @@ Here's an example of those references:
474
495
475
496
```markdown
476
497
> You can include references to other .lu files
498
+
477
499
[All LU files](./all.lu)
478
500
479
501
> References to other files can have wildcards in them
502
+
480
503
[en-us](./en-us/*)
481
504
482
505
> References to other lu files can include sub-folders as well.
483
506
> /** indicates to the parser to recursively look for .lu files in all subfolders as well.
507
+
484
508
[all LU files](../**)
485
509
486
510
> You can include deep references to intents defined in a .lu file in utterances
511
+
487
512
# None
488
513
- [None uttearnces](./all.lu#Help)
489
514
@@ -500,12 +525,14 @@ Here's an example of those references:
500
525
> - [all.lu](./all.lu#*utterancesAndPatterns*)
501
526
502
527
> You can include wild cards with deep references to QnA maker questions defined in a .qna file in utterances
528
+
503
529
# None
504
530
- [QnA questions](./*#?)
505
531
506
532
> With the above statement, the parser will parse **all** .lu files under ./, extract out all questions from QnA pairs in those files and add them under 'None' intent as defined in this file.
507
533
508
534
> You can include deep references to QnA maker questions defined in a .qna file in utterances
0 commit comments