Skip to content

Commit 6d7653f

Browse files
rokulkaheaths
andauthored
[QuestionAnswering] Move stable version from feature branch to main (Azure#16510)
* move stable to main * fix validation failures * update operationIds * update model names * Rename properties with x-ms-client-name * Properly declare ShortAnswerOptions.enable as constant true After Azure/autorest#4184, modelAsString: false must be added * Fix linting error Co-authored-by: Heath Stewart <heaths@microsoft.com>
1 parent da8f07c commit 6d7653f

27 files changed

+3482
-2
lines changed

specification/cognitiveservices/data-plane/Language/readme.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ This is the AutoRest configuration file the Cognitive Services Language SDK.
66
77
## Releases
88

9-
The current preview release is 2021-07-15-preview
9+
The current stable release of QuestionAnswering is 2021-10-01 and preview release of Luis Deepstack is 2021-07-15-preview
10+
11+
12+
```yaml
13+
tag: release_2021_10_01
14+
add-credentials: true
15+
clear-output-folder: true
16+
openapi-type: data-plane
17+
```
1018
1119
```yaml
1220
tag: release_2021_07_15_preview
@@ -21,6 +29,20 @@ add-credentials: true
2129
clear-output-folder: true
2230
```
2331
32+
### Release 2021-10-01
33+
34+
These settings apply only when `--tag=release_2021_10_01` is specified on the command line.
35+
36+
``` yaml $(tag) == 'release_2021_10_01'
37+
input-file:
38+
- stable/2021-10-01/questionanswering.json
39+
- stable/2021-10-01/questionanswering-authoring.json
40+
title:
41+
Microsoft Cognitive Language Service
42+
modelerfour:
43+
lenient-model-deduplication: true
44+
```
45+
2446
### Release 2021-07-15-preview
2547

2648
These settings apply only when `--tag=release_2021_07_15_preview` is specified on the command line.
@@ -57,6 +79,5 @@ This is not used by Autorest itself.
5779
``` yaml $(swagger-to-sdk)
5880
swagger-to-sdk:
5981
- repo: azure-sdk-for-net
60-
- repo: azure-sdk-for-net-track2
6182
- repo: azure-sdk-for-python
6283
```
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Microsoft Cognitive Language Service",
5+
"description": "The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview\">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a>.",
6+
"version": "2021-10-01"
7+
},
8+
"paths": {},
9+
"definitions": {
10+
"ErrorResponse": {
11+
"type": "object",
12+
"description": "Error response.",
13+
"additionalProperties": false,
14+
"properties": {
15+
"error": {
16+
"description": "The error object.",
17+
"$ref": "#/definitions/Error"
18+
}
19+
}
20+
},
21+
"Error": {
22+
"type": "object",
23+
"description": "The error object.",
24+
"additionalProperties": false,
25+
"required": [
26+
"code",
27+
"message"
28+
],
29+
"properties": {
30+
"code": {
31+
"description": "One of a server-defined set of error codes.",
32+
"$ref": "#/definitions/ErrorCode"
33+
},
34+
"message": {
35+
"type": "string",
36+
"description": "A human-readable representation of the error."
37+
},
38+
"target": {
39+
"type": "string",
40+
"description": "The target of the error."
41+
},
42+
"details": {
43+
"type": "array",
44+
"description": "An array of details about specific errors that led to this reported error.",
45+
"items": {
46+
"$ref": "#/definitions/Error"
47+
}
48+
},
49+
"innererror": {
50+
"description": "An object containing more specific information than the current object about the error.",
51+
"$ref": "#/definitions/InnerErrorModel"
52+
}
53+
}
54+
},
55+
"InnerErrorModel": {
56+
"type": "object",
57+
"description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.",
58+
"additionalProperties": false,
59+
"required": [
60+
"code",
61+
"message"
62+
],
63+
"properties": {
64+
"code": {
65+
"description": "One of a server-defined set of error codes.",
66+
"$ref": "#/definitions/InnerErrorCode"
67+
},
68+
"message": {
69+
"type": "string",
70+
"description": "Error message."
71+
},
72+
"details": {
73+
"type": "object",
74+
"additionalProperties": {
75+
"type": "string"
76+
},
77+
"description": "Error details."
78+
},
79+
"target": {
80+
"type": "string",
81+
"description": "Error target."
82+
},
83+
"innererror": {
84+
"description": "An object containing more specific information than the current object about the error.",
85+
"$ref": "#/definitions/InnerErrorModel"
86+
}
87+
}
88+
},
89+
"ErrorCode": {
90+
"type": "string",
91+
"description": "Human-readable error code.",
92+
"x-ms-enum": {
93+
"name": "ErrorCode",
94+
"modelAsString": true
95+
},
96+
"enum": [
97+
"InvalidRequest",
98+
"InvalidArgument",
99+
"Unauthorized",
100+
"Forbidden",
101+
"NotFound",
102+
"ProjectNotFound",
103+
"OperationNotFound",
104+
"AzureCognitiveSearchNotFound",
105+
"AzureCognitiveSearchIndexNotFound",
106+
"TooManyRequests",
107+
"AzureCognitiveSearchThrottling",
108+
"AzureCognitiveSearchIndexLimitReached",
109+
"InternalServerError",
110+
"ServiceUnavailable"
111+
]
112+
},
113+
"InnerErrorCode": {
114+
"type": "string",
115+
"description": "Human-readable error code.",
116+
"x-ms-enum": {
117+
"name": "InnerErrorCode",
118+
"modelAsString": true
119+
},
120+
"enum": [
121+
"InvalidRequest",
122+
"InvalidParameterValue",
123+
"KnowledgeBaseNotFound",
124+
"AzureCognitiveSearchNotFound",
125+
"AzureCognitiveSearchThrottling",
126+
"ExtractionFailure"
127+
]
128+
},
129+
"Language": {
130+
"type": "string",
131+
"description": "Language of the text records. This is BCP-47 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc. If not set, use \"en\" for English as default."
132+
},
133+
"StringIndexType": {
134+
"type": "string",
135+
"description": "Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.",
136+
"default": "TextElements_v8",
137+
"enum": [
138+
"TextElements_v8",
139+
"UnicodeCodePoint",
140+
"Utf16CodeUnit"
141+
],
142+
"x-ms-enum": {
143+
"name": "StringIndexType",
144+
"modelAsString": true,
145+
"values": [
146+
{
147+
"value": "TextElements_v8",
148+
"description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo."
149+
},
150+
{
151+
"value": "UnicodeCodePoint",
152+
"description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python."
153+
},
154+
{
155+
"value": "Utf16CodeUnit",
156+
"description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript."
157+
}
158+
]
159+
}
160+
}
161+
},
162+
"parameters": {
163+
"Endpoint": {
164+
"name": "Endpoint",
165+
"description": "Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).",
166+
"x-ms-parameter-location": "client",
167+
"required": true,
168+
"type": "string",
169+
"in": "path",
170+
"x-ms-skip-url-encoding": true
171+
},
172+
"ProjectNameQueryParameter": {
173+
"name": "projectName",
174+
"in": "query",
175+
"required": true,
176+
"type": "string",
177+
"description": "The name of the project to use.",
178+
"x-ms-parameter-location": "method"
179+
},
180+
"ProjectNamePathParameter": {
181+
"name": "projectName",
182+
"in": "path",
183+
"required": true,
184+
"type": "string",
185+
"maxLength": 100,
186+
"description": "The name of the project to use.",
187+
"x-ms-parameter-location": "method"
188+
},
189+
"DeploymentNameQueryParameter": {
190+
"name": "deploymentName",
191+
"in": "query",
192+
"required": true,
193+
"type": "string",
194+
"description": "The name of the specific deployment of the project to use.",
195+
"x-ms-parameter-location": "method"
196+
},
197+
"DeploymentNamePathParameter": {
198+
"name": "deploymentName",
199+
"in": "path",
200+
"required": true,
201+
"type": "string",
202+
"description": "The name of the specific deployment of the project to use.",
203+
"x-ms-parameter-location": "method"
204+
},
205+
"ApiVersionParameter": {
206+
"name": "api-version",
207+
"in": "query",
208+
"required": true,
209+
"type": "string",
210+
"description": "Client API version."
211+
},
212+
"TopParameter": {
213+
"name": "top",
214+
"in": "query",
215+
"description": "The maximum number of resources to return from the collection.",
216+
"type": "integer",
217+
"format": "int32",
218+
"x-ms-parameter-location": "method"
219+
},
220+
"SkipParameter": {
221+
"name": "skip",
222+
"in": "query",
223+
"description": "An offset into the collection of the first resource to be returned.",
224+
"type": "integer",
225+
"format": "int32",
226+
"x-ms-parameter-location": "method"
227+
},
228+
"MaxPageSizeParameter": {
229+
"name": "maxpagesize",
230+
"in": "query",
231+
"description": "The maximum number of resources to include in a single response.",
232+
"type": "integer",
233+
"format": "int32",
234+
"x-ms-parameter-location": "method"
235+
}
236+
}
237+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"parameters": {
3+
"Endpoint": "{Endpoint}",
4+
"Ocp-Apim-Subscription-Key": "{API key}",
5+
"Content-Type": "application/json",
6+
"api-version": "2021-10-01",
7+
"projectName": "proj1",
8+
"deploymentName": "production",
9+
"knowledgeBaseQueryOptions": {
10+
"question": "how long it takes to charge surface?",
11+
"top": 3,
12+
"userId": "sd53lsY=",
13+
"confidenceScoreThreshold": 0.20,
14+
"context": {
15+
"previousQnaId": 9,
16+
"previousUserQuery": "Where are QnA Maker quickstarts?"
17+
},
18+
"rankerType": "Default",
19+
"filters": {
20+
"metadataFilter": {
21+
"metadata": [
22+
{
23+
"key": "category",
24+
"value": "api"
25+
},
26+
{
27+
"key": "editorial",
28+
"value": "chitchat"
29+
}
30+
],
31+
"logicalOperation": "AND"
32+
},
33+
"sourceFilter": [
34+
"filename1.pdf",
35+
"https://www.wikipedia.org/microsoft"
36+
],
37+
"logicalOperation": "AND"
38+
},
39+
"answerSpanRequest": {
40+
"enable": true,
41+
"confidenceScoreThreshold": 0.20,
42+
"topAnswersWithSpan": 1
43+
},
44+
"includeUnstructuredSources": true
45+
}
46+
},
47+
"responses": {
48+
"200": {
49+
"headers": {},
50+
"body": {
51+
"answers": [
52+
{
53+
"questions": [
54+
"Power and charging"
55+
],
56+
"answer": "Power and charging**\n\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you’re using your Surface for power-intensive activities like gaming or video streaming while you’re charging it.\n\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.",
57+
"confidenceScore": 0.65,
58+
"id": 20,
59+
"source": "surface-pro-4-user-guide-EN.pdf",
60+
"metadata": {
61+
"category": "api",
62+
"editorial": "chitchat"
63+
},
64+
"dialog": {
65+
"isContextOnly": false,
66+
"prompts": [
67+
{
68+
"displayOrder": 1,
69+
"qnaId": 23,
70+
"displayText": "prompt1"
71+
},
72+
{
73+
"displayOrder": 2,
74+
"qnaId": 36,
75+
"displayText": "prompt2"
76+
}
77+
]
78+
},
79+
"answerSpan": {
80+
"text": "two to four hours",
81+
"confidenceScore": 0.30,
82+
"offset": 33,
83+
"length": 50
84+
}
85+
},
86+
{
87+
"questions": [
88+
"Charge your Surface Pro 4"
89+
],
90+
"answer": "**Charge your Surface Pro 4**\n\n1. Connect the two parts of the power cord.\n\n2. Connect the power cord securely to the charging port.\n\n3. Plug the power supply into an electrical outlet.",
91+
"confidenceScore": 0.32,
92+
"id": 13,
93+
"source": "surface-pro-4-user-guide-EN.pdf"
94+
}
95+
]
96+
}
97+
}
98+
}
99+
}

0 commit comments

Comments
 (0)