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

Commit f984c19

Browse files
committed
Fixing SME comments
1 parent 5cb9d03 commit f984c19

File tree

22 files changed

+120
-105
lines changed

22 files changed

+120
-105
lines changed

packages/qnamaker/README.md

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ USAGE
5757
5858
OPTIONS
5959
-h, --help qnamaker:create:kb command help
60-
--in=in (required) The CreateKbDTO object to send in the body of the request.
60+
--in=in File path to the CreateKbDTO object to send in the body of the request.
6161
6262
--name=name Name of the kb you want to create. This will override the name of KB that might be
6363
present in the CreateKb DTO
6464
65+
--save Save the kbId in config.
66+
6567
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
6668
Management section for your Qna Maker cognitive service). Overrides the
67-
subscriptionkey value present in config
68-
69-
--wait Wait for the operation to complete.
69+
subscriptionkey value present in the config
7070
```
7171

7272
_See code: [src/commands/qnamaker/create/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/create/kb.ts)_
@@ -82,11 +82,13 @@ USAGE
8282
OPTIONS
8383
-h, --help qnamaker:delete:kb command help
8484
--force Do not prompt for confirmation, force the operation
85-
--kbId=kbId Knowledgebase id to be deleted
85+
86+
--kbId=kbId Knowledgebase id to be deleted. Overrides the knowledge base id present in the
87+
config
8688
8789
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
8890
Management section for your Qna Maker cognitive service). Overrides the
89-
subscriptionkey value present in config
91+
subscriptionkey value present in the config
9092
```
9193

9294
_See code: [src/commands/qnamaker/delete/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/delete/kb.ts)_
@@ -102,11 +104,13 @@ USAGE
102104
OPTIONS
103105
-h, --help qnamaker:export:kb command help
104106
--environment=environment (required) Specifies whether environment is Test or Prod.
105-
--kbId=kbId Knowledgebase id to be exported.
107+
108+
--kbId=kbId Knowledgebase id to be exported. Overrides the knowledge base id present in the
109+
config
106110
107111
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
108112
Management section for your Qna Maker cognitive service). Overrides the
109-
subscriptionkey value present in config
113+
subscriptionkey value present in the config
110114
```
111115

112116
_See code: [src/commands/qnamaker/export/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/export/kb.ts)_
@@ -139,7 +143,7 @@ OPTIONS
139143
140144
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
141145
Management section for your Qna Maker cognitive service). Overrides the
142-
subscriptionkey value present in config
146+
subscriptionkey value present in the config
143147
```
144148

145149
_See code: [src/commands/qnamaker/get/endpointsettings.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/get/endpointsettings.ts)_
@@ -154,11 +158,13 @@ USAGE
154158
155159
OPTIONS
156160
-h, --help qnamaker:get:kb command help
157-
--kbId=kbId (required) Knowledgebase id to get metadata.
161+
162+
--kbId=kbId Knowledgebase id to get metadata. Overrides the knowledge base id present in the
163+
config
158164
159165
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
160166
Management section for your Qna Maker cognitive service). Overrides the
161-
subscriptionkey value present in config
167+
subscriptionkey value present in the config
162168
```
163169

164170
_See code: [src/commands/qnamaker/get/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/get/kb.ts)_
@@ -177,14 +183,14 @@ OPTIONS
177183
178184
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
179185
Management section for your Qna Maker cognitive service). Overrides the
180-
subscriptionkey value present in config
186+
subscriptionkey value present in the config
181187
```
182188

183189
_See code: [src/commands/qnamaker/get/operationdetails.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/get/operationdetails.ts)_
184190

185191
## `bf qnamaker:init`
186192

187-
Initializes the .qnamakerrc file with settings.
193+
Initializes the config file with settings.
188194

189195
```
190196
USAGE
@@ -223,7 +229,7 @@ OPTIONS
223229
224230
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
225231
Management section for your Qna Maker cognitive service). Overrides the
226-
subscriptionkey value present in config
232+
subscriptionkey value present in the config
227233
```
228234

229235
_See code: [src/commands/qnamaker/list/alterations.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/list/alterations.ts)_
@@ -241,7 +247,7 @@ OPTIONS
241247
242248
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
243249
Management section for your Qna Maker cognitive service). Overrides the
244-
subscriptionkey value present in config
250+
subscriptionkey value present in the config
245251
```
246252

247253
_See code: [src/commands/qnamaker/list/endpointkeys.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/list/endpointkeys.ts)_
@@ -259,7 +265,7 @@ OPTIONS
259265
260266
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
261267
Management section for your Qna Maker cognitive service). Overrides the
262-
subscriptionkey value present in config
268+
subscriptionkey value present in the config
263269
```
264270

265271
_See code: [src/commands/qnamaker/list/kbs.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/list/kbs.ts)_
@@ -274,46 +280,44 @@ USAGE
274280
275281
OPTIONS
276282
-h, --help qnamaker:publish:kb command help
277-
--kbId=kbId Knowledgebase id to pubish.
283+
--kbId=kbId Knowledgebase id to pubish. Overrides the knowledge base id present in the config
278284
279285
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
280286
Management section for your Qna Maker cognitive service). Overrides the
281-
subscriptionkey value present in config
287+
subscriptionkey value present in the config
282288
```
283289

284290
_See code: [src/commands/qnamaker/publish/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/publish/kb.ts)_
285291

286292
## `bf qnamaker:query`
287293

288-
Query model for fetching the answer from Kb for a query
294+
Generate Answer for fetching the answer from Kb for a query
289295

290296
```
291297
USAGE
292298
$ bf qnamaker:query
293299
294300
OPTIONS
295-
-h, --help qnamaker:query command help
301+
-h, --help qnamaker:query command help
296302
297-
--endpointKey=endpointKey Specifies the endpoint key for your private QnA service.(from qnamaker.ai portal
298-
user settings page). Overrides the value present in config.
303+
--endpointKey=endpointKey Specifies the endpoint key for your private QnA service (From qnamaker.ai portal user
304+
settings page). Overrides the value present in config.
299305
300-
--hostname=hostname Specifies the url for your private QnA service. Overrides the value present in
301-
config.
306+
--hostname=hostname Specifies the url for your private QnA service. Overrides the value present in
307+
config.
302308
303-
--isTest Query against the test index.
309+
--kbId=kbId Specifies the active qnamaker knowledgebase id. Overrides the value present in the
310+
config
304311
305-
--kbId=kbId Specifies the active qnamaker knowledgebase id. Overrides the value present in the
306-
config
312+
--question=question (required) Query to get a prediction for.
307313
308-
--question=question (required) Query to get a prediction for.
314+
--scorethreshold=scorethreshold Specifies the confidence score threshold for the returned answer.
309315
310-
--scoreThreshold=scoreThreshold Query to get a prediction for.
316+
--strictfilters=strictfilters Path to json file {"strictfilters": MetadataDTO[]}
311317
312-
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
313-
Management section for your Qna Maker cognitive service). Overrides the
314-
subscriptionkey value present in config
318+
--test Query against the test index.
315319
316-
--top=top Query to get a prediction for.
320+
--top=top Specifies the number of matching results
317321
```
318322

319323
_See code: [src/commands/qnamaker/query.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/query.ts)_
@@ -328,11 +332,11 @@ USAGE
328332
329333
OPTIONS
330334
-h, --help qnamaker:refresh:endpoints command help
331-
--keyType=keyType (required) Type of Key.
335+
--keyType=keyType (required) Type of Key. (PrimaryKey/SecondaryKey)
332336
333337
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
334338
Management section for your Qna Maker cognitive service). Overrides the
335-
subscriptionkey value present in config
339+
subscriptionkey value present in the config
336340
```
337341

338342
_See code: [src/commands/qnamaker/refresh/endpointkeys.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/refresh/endpointkeys.ts)_
@@ -361,11 +365,11 @@ USAGE
361365
362366
OPTIONS
363367
-h, --help qnamaker:replace:alterations command help
364-
--in=in (required) The WordAlterationsDTO object to send in the body of the request
368+
--in=in File path to the WordAlterationsDTO object to send in the body of the request
365369
366370
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
367371
Management section for your Qna Maker cognitive service). Overrides the
368-
subscriptionkey value present in config
372+
subscriptionkey value present in the config
369373
```
370374

371375
_See code: [src/commands/qnamaker/replace/alterations.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/replace/alterations.ts)_
@@ -380,12 +384,12 @@ USAGE
380384
381385
OPTIONS
382386
-h, --help qnamaker:replace:kb command help
383-
--in=in (required) The ReplaceKbDTO object to send in the body of the request
384-
--kbId=kbId Knowledgebase id.
387+
--in=in File path to the ReplaceKbDTO object to send in the body of the request
388+
--kbId=kbId Knowledgebase id. Overrides the knowledge base id present in the config
385389
386390
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
387391
Management section for your Qna Maker cognitive service). Overrides the
388-
subscriptionkey value present in config
392+
subscriptionkey value present in the config
389393
```
390394

391395
_See code: [src/commands/qnamaker/replace/kb.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/replace/kb.ts)_
@@ -407,7 +411,7 @@ OPTIONS
407411
--hostname=hostname Specifies the url for your private QnA service. Overrides the value present in
408412
config.
409413
410-
--in=in (required) The FeedbackRecordDTO object to send in the body of the request.
414+
--in=in File path to the FeedbackRecordDTO object to send in the body of the request.
411415
412416
--kbId=kbId Specifies the active qnamaker knowledgebase id. Overrides the value present in the
413417
config
@@ -431,9 +435,9 @@ OPTIONS
431435
-h, --help qnamaker:update:endpointsettings command help
432436
--activelearning Enable active learning. Disables if flag not set
433437
434-
--subscriptionKey=subscriptionKey Specifies the qnamaker subscription key/access keys (found on the Cognitive
435-
Services Azure portal page under "access keys"). Overrides the .qnamakerrc value
436-
and the QNAMAKER_SUBSCRIPTION_KEY environment variable.
438+
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
439+
Management section for your Qna Maker cognitive service). Overrides the
440+
subscriptionkey value present in the config
437441
```
438442

439443
_See code: [src/commands/qnamaker/update/endpointsettings.ts](https://github.com/microsoft/botframework-cli/blob/v1.0.0/src/commands/qnamaker/update/endpointsettings.ts)_
@@ -448,12 +452,15 @@ USAGE
448452
449453
OPTIONS
450454
-h, --help qnamaker:update:kb command help
451-
--in=in (required) The UpdateKbOperationDTO object to send in the body of the request.
452-
--kbId=kbId Knowledgebase id.
455+
456+
--in=in The file path to the UpdateKbOperationDTO object to send in the body of the
457+
request.
458+
459+
--kbId=kbId Knowledgebase id. Overrides the knowledge base id present in the config
453460
454461
--subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource
455462
Management section for your Qna Maker cognitive service). Overrides the
456-
subscriptionkey value present in config
463+
subscriptionkey value present in the config
457464
458465
--wait Wait for the operation to complete.
459466
```

packages/qnamaker/src/commands/qnamaker/create/kb.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export default class QnamakerCreateKb extends Command {
1919
in: flags.string({description: 'File path to the CreateKbDTO object to send in the body of the request.'}),
2020
name: flags.string({description: 'Name of the kb you want to create. This will override the name of KB that might be present in the CreateKb DTO'}),
2121
save: flags.boolean({description: 'Save the kbId in config.'}),
22-
quiet: flags.boolean({description: 'Save the kbId in config.'}),
23-
subscriptionKey: flags.string({description: 'Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in config'}),
22+
subscriptionKey: flags.string({description: 'Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in the config'}),
2423
help: flags.help({char: 'h', description: 'qnamaker:create:kb command help'}),
2524
}
2625

@@ -37,12 +36,11 @@ export default class QnamakerCreateKb extends Command {
3736
input.requestBody.name = flags.name
3837
}
3938

40-
if (!input.requestBody.name && flags.quiet) {
39+
if (!input.requestBody.name) {
4140
let answer = readlineSync.question('What would you like to name your new knowledgebase?')
4241
if (answer && answer.length > 0) {
4342
input.requestBody.name = answer.trim()
4443
}
45-
4644
}
4745
// hack to map incorrect export property from expected import. Export uses qnaDocuments, create/update/replace qnaList :(
4846
if (input.requestBody.qnaDocuments && !input.requestBody.qnaList) {
@@ -58,8 +56,8 @@ export default class QnamakerCreateKb extends Command {
5856

5957
result = await qnaconfig.waitForOperationSucceeded(input.config, result)
6058

59+
let kbId = result.resourceLocation.split('/')[2]
6160
if (flags.save) {
62-
let kbId = result.resourceLocation.split('/')[2]
6361
input.config.kbId = kbId
6462
await this.updateKbId(input.config)
6563
let userConfig: any = {}
@@ -73,7 +71,7 @@ export default class QnamakerCreateKb extends Command {
7371
userConfig.qnamaker = input.config
7472
await fs.writeJson(path.join(this.config.configDir, 'config.json'), userConfig, {spaces: 2})
7573
} else {
76-
this.log(JSON.stringify(result, null, 2))
74+
this.log('Knowledge Base id: ' + kbId)
7775
}
7876
}
7977

packages/qnamaker/src/commands/qnamaker/delete/kb.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default class QnamakerDeleteKb extends Command {
1111
static description = 'Delete a knowledgebase by id'
1212

1313
static flags: flags.Input<any> = {
14-
kbId: flags.string({description: 'Knowledgebase id to be deleted'}),
15-
subscriptionKey: flags.string({description: 'Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in config'}),
14+
kbId: flags.string({description: 'Knowledgebase id to be deleted. Overrides the knowledge base id present in the config'}),
15+
subscriptionKey: flags.string({description: 'Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in the config'}),
1616
force: flags.boolean({description: 'Do not prompt for confirmation, force the operation '}),
1717
help: flags.help({char: 'h', description: 'qnamaker:delete:kb command help'}),
1818
}
@@ -24,8 +24,8 @@ export default class QnamakerDeleteKb extends Command {
2424
if (!flags.force) {
2525
let kbResult = await new Knowledgebase().getKnowledgebaseDetails(input.config)
2626
let kb = await JSON.parse(await kbResult.text())
27-
let answer = await cli.prompt(`Are you sure you would like to delete ${kb.name} [${kb.id}]? [no] `, {default: 'no'})
28-
if (answer.trim()[0] === 'n') {
27+
let answer = await cli.confirm(`Are you sure you would like to delete ${kb.name} [${kb.id}]? (y/n)`)
28+
if (!answer) {
2929
this.log('operation canceled')
3030
return
3131
}
@@ -36,5 +36,7 @@ export default class QnamakerDeleteKb extends Command {
3636
if (result.error) {
3737
throw new CLIError(JSON.stringify(result.error, null, 4))
3838
}
39+
40+
this.log('Success')
3941
}
4042
}

0 commit comments

Comments
 (0)