-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
analyzeconversations.json
560 lines (560 loc) · 16.6 KB
/
analyzeconversations.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
{
"swagger": "2.0",
"info": {
"title": "Microsoft Cognitive Language Service - Analyze Conversations",
"description": "This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversation, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.\n\n In some cases, this API needs to forward requests and responses between the caller and an upstream service.",
"version": "2021-11-01-preview"
},
"securityDefinitions": {
"apim_key": {
"type": "apiKey",
"description": "An APIM subscription key.",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
}
},
"security": [
{
"apim_key": []
}
],
"x-ms-parameterized-host": {
"hostTemplate": "{Endpoint}/language",
"useSchemePrefix": false,
"parameters": [
{
"$ref": "common.json#/parameters/Endpoint"
}
]
},
"paths": {
"/:analyze-conversations": {
"post": {
"operationId": "ConversationAnalysis_AnalyzeConversation",
"description": "Analyzes the input conversation utterance.",
"parameters": [
{
"$ref": "common.json#/parameters/ProjectNameQueryParameter"
},
{
"$ref": "common.json#/parameters/DeploymentNameQueryParameter"
},
{
"$ref": "#/parameters/ConversationAnalysisOptions"
},
{
"$ref": "common.json#/parameters/ApiVersionParameter"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "The conversation analysis response.",
"schema": {
"$ref": "#/definitions/AnalyzeConversationResult"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "common.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Arbitration result": {
"$ref": "./examples/conversations/Orchestrator_arbitration.json"
},
"Conversation project result": {
"$ref": "./examples/conversations/Conversation_project.json"
},
"Orchestrator direct target result": {
"$ref": "./examples/conversations/Orchestrator_direct_target.json"
}
}
}
}
},
"definitions": {
"ConversationAnalysisOptions": {
"type": "object",
"description": "The request body.",
"required": [
"query"
],
"properties": {
"query": {
"description": "The conversation utterance to be analyzed.",
"type": "string"
},
"directTarget": {
"type": "string",
"description": "The name of the target project this request is sending to directly."
},
"language": {
"type": "string",
"description": "The language to use in this request. This will be the language setting when communicating with all other target projects."
},
"verbose": {
"type": "boolean",
"description": "If true, the service will return more detailed information in the response."
},
"isLoggingEnabled": {
"description": "If true, the query will be kept by the service for customers to further review, to improve the model quality.",
"type": "boolean"
},
"parameters": {
"type": "object",
"description": "A dictionary representing the input for each target project.",
"additionalProperties": {
"$ref": "#/definitions/AnalysisParameters"
}
}
}
},
"AnalysisParameters": {
"type": "object",
"description": "This is the parameter set of either the Orchestration project itself or one of the target services.",
"required": [
"targetKind"
],
"discriminator": "targetKind",
"properties": {
"targetKind": {
"type": "string",
"description": "The type of a target service.",
"enum": [
"luis",
"conversation",
"question_answering",
"non_linked"
],
"x-ms-enum": {
"name": "targetKind",
"modelAsString": true
}
},
"apiVersion": {
"type": "string",
"description": "The API version to use when call a specific target service."
}
}
},
"NoneLinkedTargetIntentResult": {
"type": "object",
"description": "A wrap up of non-linked intent response.",
"x-ms-discriminator-value": "non_linked",
"allOf": [
{
"$ref": "#/definitions/TargetIntentResult"
}
],
"properties": {
"result": {
"type": "object",
"$ref": "#/definitions/ConversationResult",
"description": "The actual response from a Conversation project.",
"x-nullable": true
}
}
},
"LUISParameters": {
"description": "This is a set of request parameters for LUIS Generally Available projects.",
"x-ms-discriminator-value": "luis",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/AnalysisParameters"
}
],
"properties": {
"query": {
"type": "string",
"maxLength": 500,
"description": "The utterance to predict."
},
"callingOptions": {
"type": "object",
"description": "This customizes how the service calls LUIS Generally Available projects.",
"$ref": "#/definitions/LUISCallingOptions"
}
},
"additionalProperties": true
},
"LUISCallingOptions": {
"description": "This customizes how the service calls LUIS Generally Available projects.",
"type": "object",
"properties": {
"verbose": {
"description": "Enable verbose response.",
"type": "boolean"
},
"log": {
"description": "Save log to add in training utterances later.",
"type": "boolean"
},
"show-all-intents": {
"description": "Set true to show all intents.",
"type": "boolean"
},
"timezoneOffset": {
"type": "number",
"description": "The timezone offset for the location of the request."
},
"spellCheck": {
"type": "boolean",
"description": "Enable spell checking."
},
"bing-spell-check-subscription-key": {
"description": "The subscription key to use when enabling Bing spell check",
"type": "string"
}
}
},
"ConversationParameters": {
"type": "object",
"description": "This is a set of request parameters for Customized Conversation projects.",
"x-ms-discriminator-value": "conversation",
"allOf": [
{
"$ref": "#/definitions/AnalysisParameters"
}
],
"properties": {
"callingOptions": {
"type": "object",
"$ref": "#/definitions/ConversationCallingOptions"
}
}
},
"ConversationCallingOptions": {
"type": "object",
"description": "The option to set to call a Conversation project.",
"properties": {
"language": {
"description": "The language of the query.",
"type": "string"
},
"verbose": {
"description": "If true, the service will return more detailed information.",
"type": "boolean"
},
"isLoggingEnabled": {
"description": "If true, the query will be saved for customers to further review in authoring, to improve the model quality.",
"type": "boolean"
}
}
},
"QuestionAnsweringParameters": {
"type": "object",
"description": "This is a set of request parameters for Question Answering knowledge bases.",
"x-ms-discriminator-value": "question_answering",
"allOf": [
{
"$ref": "#/definitions/AnalysisParameters"
}
],
"properties": {
"callingOptions": {
"type": "object",
"description": "The options sent to a Question Answering KB."
}
}
},
"AnalyzeConversationResult": {
"type": "object",
"description": "Represents a conversation analysis response.",
"required": [
"query",
"prediction"
],
"properties": {
"query": {
"type": "string",
"description": "The conversation utterance given by the caller."
},
"detectedLanguage": {
"type": "string",
"description": "The system detected language for the query."
},
"prediction": {
"description": "The prediction result of a conversation project.",
"$ref": "#/definitions/BasePrediction"
}
}
},
"BasePrediction": {
"type": "object",
"description": "This is the base class of prediction",
"required": [
"projectKind"
],
"discriminator": "projectKind",
"properties": {
"projectKind": {
"type": "string",
"description": "The type of the project.",
"enum": [
"conversation",
"workflow"
],
"x-ms-enum": {
"name": "projectKind",
"modelAsString": true
}
},
"topIntent": {
"type": "string",
"description": "The intent with the highest score."
}
}
},
"OrchestratorPrediction": {
"type": "object",
"description": "This represents the prediction result of an Orchestrator project.",
"x-ms-discriminator-value": "workflow",
"required": [
"intents"
],
"allOf": [
{
"$ref": "#/definitions/BasePrediction"
}
],
"properties": {
"intents": {
"description": "A dictionary that contains all intents. A key is an intent name and a value is its confidence score and target type. The top intent's value also contains the actual response from the target project.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/TargetIntentResult"
}
}
}
},
"TargetIntentResult": {
"type": "object",
"description": "This is the base class of an intent prediction",
"discriminator": "targetKind",
"required": [
"confidenceScore",
"targetKind"
],
"properties": {
"targetKind": {
"type": "string",
"description": "This discriminator property specifies the type of the target project that returns the response.",
"enum": [
"luis",
"conversation",
"question_answering"
],
"x-ms-enum": {
"name": "targetKind",
"modelAsString": true
}
},
"apiVersion": {
"type": "string",
"description": "The API version used to call a target service."
},
"confidenceScore": {
"type": "number",
"format": "double",
"x-ms-client-name": "confidence",
"description": "The prediction score and it ranges from 0.0 to 1.0.",
"minimum": 0,
"maximum": 1
}
}
},
"ConversationTargetIntentResult": {
"type": "object",
"description": "A wrap up of Conversation project response.",
"x-ms-discriminator-value": "conversation",
"allOf": [
{
"$ref": "#/definitions/TargetIntentResult"
}
],
"properties": {
"result": {
"type": "object",
"$ref": "#/definitions/ConversationResult",
"description": "The actual response from a Conversation project.",
"x-nullable": true
}
}
},
"ConversationResult": {
"type": "object",
"description": "The response returned by a Conversation project.",
"required": [
"query",
"prediction"
],
"properties": {
"query": {
"description": "The same query given in request.",
"type": "string"
},
"detectedLanguage": {
"description": "The detected language from the query.",
"type": "string"
},
"prediction": {
"description": "The predicted result for the query.",
"$ref": "#/definitions/ConversationPrediction"
}
}
},
"ConversationPrediction": {
"type": "object",
"description": "Represents the prediction section of a Conversation project.",
"x-ms-discriminator-value": "conversation",
"required": [
"intents",
"entities"
],
"allOf": [
{
"$ref": "#/definitions/BasePrediction"
}
],
"properties": {
"intents": {
"description": "The intent classification results.",
"type": "array",
"items": {
"$ref": "#/definitions/ConversationIntent"
}
},
"entities": {
"description": "The entity extraction results.",
"type": "array",
"items": {
"$ref": "#/definitions/ConversationEntity"
}
}
}
},
"ConversationIntent": {
"type": "object",
"description": "The intent classification result of a Conversation project.",
"required": [
"category",
"confidenceScore"
],
"properties": {
"category": {
"description": "A predicted class.",
"type": "string"
},
"confidenceScore": {
"format": "float",
"x-ms-client-name": "confidence",
"description": "The confidence score of the class from 0.0 to 1.0.",
"type": "number",
"minimum": 0,
"maximum": 1
}
}
},
"ConversationEntity": {
"type": "object",
"description": "The entity extraction result of a Conversation project.",
"required": [
"category",
"text",
"offset",
"length",
"confidenceScore"
],
"properties": {
"category": {
"description": "The entity category.",
"type": "string"
},
"text": {
"description": "The predicted entity text.",
"type": "string"
},
"offset": {
"format": "int32",
"description": "The starting index of this entity in the query.",
"type": "integer"
},
"length": {
"format": "int32",
"description": "The length of the text.",
"type": "integer"
},
"confidenceScore": {
"format": "float",
"x-ms-client-name": "confidence",
"description": "The entity confidence score.",
"type": "number"
},
"listKeys": {
"type": "array",
"description": "List of keys.",
"items": {
"type": "string"
}
}
}
},
"LUISTargetIntentResult": {
"type": "object",
"description": "It is a wrap up of LUIS Generally Available response.",
"x-ms-discriminator-value": "luis",
"allOf": [
{
"$ref": "#/definitions/TargetIntentResult"
}
],
"properties": {
"result": {
"type": "object",
"description": "The actual response from a LUIS Generally Available application.",
"x-nullable": true
}
}
},
"QuestionAnsweringTargetIntentResult": {
"type": "object",
"description": "It is a wrap up a Question Answering KB response.",
"x-ms-discriminator-value": "question_answering",
"allOf": [
{
"$ref": "#/definitions/TargetIntentResult"
}
],
"properties": {
"result": {
"type": "object",
"$ref": "../2021-07-15-preview/questionanswering.json#/definitions/KnowledgeBaseAnswers",
"description": "The generated answer by a Question Answering KB.",
"x-nullable": true
}
}
}
},
"parameters": {
"ConversationAnalysisOptions": {
"name": "ConversationAnalysisOptions",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ConversationAnalysisOptions"
},
"x-nullable": true,
"description": "Post body of the request.",
"x-ms-parameter-location": "method"
}
}
}