From f01704e86240c01af3917ae9bf1eacaa3653f1a4 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Sat, 15 Jun 2019 02:43:22 +0200 Subject: [PATCH 1/5] Update LUIS Runtime swagger to an auto generated version --- .../Runtime/preview/v3.0/LUIS-Runtime.json | 492 ++++++++++-------- 1 file changed, 265 insertions(+), 227 deletions(-) diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json index df09eeccfb82..e4a30010f127 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json @@ -1,8 +1,8 @@ { "swagger": "2.0", "info": { - "version": "3.0-preview", - "title": "LUIS Runtime Client" + "title": "LUIS Runtime Client", + "version": "3.0-preview" }, "x-ms-parameterized-host": { "hostTemplate": "{Endpoint}/luis/v3.0-preview", @@ -30,43 +30,65 @@ "get": { "description": "Gets the predictions for an application version.", "operationId": "Prediction_GetVersionPredictionGET", + "produces": [ + "application/json" + ], "parameters": [ { - "$ref": "#/parameters/AppIdInPath" + "in": "path", + "name": "appId", + "description": "The application ID.", + "required": true, + "type": "string", + "format": "uuid" }, { - "$ref": "#/parameters/VersionIdInPath" + "in": "path", + "name": "versionId", + "description": "The application version ID.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Query" + "in": "query", + "name": "query", + "description": "The query to predict.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Verbose" + "in": "query", + "name": "verbose", + "description": "Indicates whether to get extra metadata for the entities predictions or not.", + "type": "boolean" }, { - "$ref": "#/parameters/ShowAllIntents" + "in": "query", + "name": "show-all-intents", + "description": "Indicates whether to return all the intents in the response or just the top intent.", + "type": "boolean" }, { - "$ref": "#/parameters/Log" + "in": "query", + "name": "log", + "description": "Indicates whether to log the endpoint query or not.", + "type": "boolean" } ], "responses": { "200": { - "description": "The prediction for the supplied query", + "description": "The prediction for the supplied query.", "schema": { "$ref": "#/definitions/PredictionResponse" } }, "default": { - "description": "unexpected error", + "description": "Unexpected error.", "schema": { "$ref": "#/definitions/Error" } } }, - "produces": [ - "application/json" - ], "x-ms-examples": { "Successful Get Version Predictions From Endpoint Via Get request": { "$ref": "./examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaGetRequest.json" @@ -76,43 +98,70 @@ "post": { "description": "Gets the predictions for an application version.", "operationId": "Prediction_GetVersionPrediction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "parameters": [ { - "$ref": "#/parameters/AppIdInPath" + "in": "path", + "name": "appId", + "description": "The application ID.", + "required": true, + "type": "string", + "format": "uuid" }, { - "$ref": "#/parameters/VersionIdInPath" + "in": "path", + "name": "versionId", + "description": "The application version ID.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Verbose" + "in": "query", + "name": "verbose", + "description": "Indicates whether to get extra metadata for the entities predictions or not.", + "type": "boolean" }, { - "$ref": "#/parameters/ShowAllIntents" + "in": "query", + "name": "show-all-intents", + "description": "Indicates whether to return all the intents in the response or just the top intent.", + "type": "boolean" }, { - "$ref": "#/parameters/Log" + "in": "query", + "name": "log", + "description": "Indicates whether to log the endpoint query or not.", + "type": "boolean" }, { - "$ref": "#/parameters/PredictionRequest" + "in": "body", + "name": "predictionRequest", + "description": "The prediction request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/PredictionRequest" + } } ], "responses": { "200": { - "description": "The prediction for the supplied query", + "description": "The prediction for the supplied query.", "schema": { "$ref": "#/definitions/PredictionResponse" } }, "default": { - "description": "unexpected error", + "description": "Unexpected error.", "schema": { "$ref": "#/definitions/Error" } } }, - "produces": [ - "application/json" - ], "x-ms-examples": { "Successful Get Version Predictions From Endpoint Via Post request": { "$ref": "./examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json" @@ -124,38 +173,60 @@ "get": { "description": "Gets the predictions for an application slot.", "operationId": "Prediction_GetSlotPredictionGET", + "produces": [ + "application/json" + ], "parameters": [ { - "$ref": "#/parameters/AppIdInPath" + "in": "path", + "name": "appId", + "description": "The application ID.", + "required": true, + "type": "string", + "format": "uuid" }, { - "$ref": "#/parameters/SlotNameInPath" + "in": "path", + "name": "slotName", + "description": "The application slot name.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Query" + "in": "query", + "name": "query", + "description": "The query to predict.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Verbose" + "in": "query", + "name": "verbose", + "description": "Indicates whether to get extra metadata for the entities predictions or not.", + "type": "boolean" }, { - "$ref": "#/parameters/ShowAllIntents" + "in": "query", + "name": "show-all-intents", + "description": "Indicates whether to return all the intents in the response or just the top intent.", + "type": "boolean" }, { - "$ref": "#/parameters/Log" + "in": "query", + "name": "log", + "description": "Indicates whether to log the endpoint query or not.", + "type": "boolean" } ], - "produces": [ - "application/json" - ], "responses": { "200": { - "description": "The prediction for the supplied query", + "description": "The prediction for the supplied query.", "schema": { "$ref": "#/definitions/PredictionResponse" } }, "default": { - "description": "unexpected error", + "description": "Unexpected error.", "schema": { "$ref": "#/definitions/Error" } @@ -170,43 +241,70 @@ "post": { "description": "Gets the predictions for an application slot.", "operationId": "Prediction_GetSlotPrediction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "parameters": [ { - "$ref": "#/parameters/AppIdInPath" + "in": "path", + "name": "appId", + "description": "The application ID.", + "required": true, + "type": "string", + "format": "uuid" }, { - "$ref": "#/parameters/SlotNameInPath" + "in": "path", + "name": "slotName", + "description": "The application slot name.", + "required": true, + "type": "string" }, { - "$ref": "#/parameters/Verbose" + "in": "query", + "name": "verbose", + "description": "Indicates whether to get extra metadata for the entities predictions or not.", + "type": "boolean" }, { - "$ref": "#/parameters/ShowAllIntents" + "in": "query", + "name": "show-all-intents", + "description": "Indicates whether to return all the intents in the response or just the top intent.", + "type": "boolean" }, { - "$ref": "#/parameters/Log" + "in": "query", + "name": "log", + "description": "Indicates whether to log the endpoint query or not.", + "type": "boolean" }, { - "$ref": "#/parameters/PredictionRequest" + "in": "body", + "name": "predictionRequest", + "description": "The prediction request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/PredictionRequest" + } } ], "responses": { "200": { - "description": "The prediction for the supplied query", + "description": "The prediction for the supplied query.", "schema": { "$ref": "#/definitions/PredictionResponse" } }, "default": { - "description": "unexpected error", + "description": "Unexpected error.", "schema": { "$ref": "#/definitions/Error" } } }, - "produces": [ - "application/json" - ], "x-ms-examples": { "Successful Get Slot Predictions From Endpoint Via Post request": { "$ref": "./examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json" @@ -216,63 +314,17 @@ } }, "definitions": { - "PredictionRequest": { - "type": "object", - "description": "Represents the prediction request parameters.", - "required": [ - "query" - ], - "properties": { - "query": { - "description": "The query to predict", - "type": "string" - }, - "options": { - "description": "The custom options defined for this request.", - "$ref": "#/definitions/PredictionRequestOptions" - }, - "externalEntities": { - "description": "The externally predicted entities for this request", - "type": "array", - "items": { - "$ref": "#/definitions/ExternalEntity" - } - }, - "dynamicLists": { - "description": "The dynamically created list entities for this request", - "type": "array", - "items": { - "$ref": "#/definitions/DynamicList" - } - } - } - }, - "PredictionRequestOptions": { - "type": "object", - "description": "The custom options for the prediction request.", - "properties": { - "datetimeReference": { - "type": "string", - "format": "date-time", - "description": "The reference DateTime used for predicting datetime entities." - }, - "overridePredictions": { - "type": "boolean", - "description": "Whether to make the external entities resolution override the predictions if an overlap occurs." - } - } - }, "PredictionResponse": { - "type": "object", "description": "Represents the prediction response.", "required": [ "query", "prediction" ], + "type": "object", "properties": { "query": { - "type": "string", - "description": "The query used in the prediction." + "description": "The query used in the prediction.", + "type": "string" }, "prediction": { "description": "The prediction of the requested query.", @@ -281,7 +333,6 @@ } }, "Prediction": { - "type": "object", "description": "Represents the prediction of a query.", "required": [ "normalizedQuery", @@ -289,29 +340,30 @@ "intents", "entities" ], + "type": "object", "properties": { "normalizedQuery": { - "type": "string", - "description": "The query after pre-processing and normalization." + "description": "The query after pre-processing and normalization.", + "type": "string" }, "alteredQuery": { - "type": "string", - "description": "The query after spell checking. Only set if spell check was enabled and a spelling mistake was found." + "description": "The query after spell checking. Only set if spell check was enabled and a spelling mistake was found.", + "type": "string" }, "topIntent": { - "type": "string", - "description": "The name of the top scoring intent." + "description": "The name of the top scoring intent.", + "type": "string" }, "intents": { - "type": "object", "description": "A dictionary representing the intents that fired.", + "type": "object", "additionalProperties": { "$ref": "#/definitions/Intent" } }, "entities": { - "type": "object", "description": "The dictionary representing the entities that fired.", + "type": "object", "additionalProperties": {} }, "sentiment": { @@ -321,12 +373,13 @@ } }, "Intent": { - "type": "object", "description": "Represents an intent prediction.", + "type": "object", "properties": { "score": { - "type": "number", - "description": "The score of the fired intent." + "format": "float", + "description": "The score of the fired intent.", + "type": "number" }, "childApp": { "description": "The prediction of the dispatched application.", @@ -335,42 +388,121 @@ } }, "Sentiment": { - "type": "object", - "description": "The result of the sentiment analysis.", + "description": "The result of the sentiment analaysis.", "required": [ "score" ], + "type": "object", "properties": { + "label": { + "description": "The label of the sentiment analysis result.", + "type": "string" + }, "score": { - "type": "number", - "description": "The sentiment score of the query." + "format": "float", + "description": "The sentiment score of the query.", + "type": "number" + } + } + }, + "Error": { + "description": "Represents the error that occurred.", + "required": [ + "error" + ], + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorBody" + } + } + }, + "ErrorBody": { + "description": "Represents the definition of the error that occurred.", + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "description": "The error code.", + "type": "string" }, - "label": { - "type": "string", - "description": "The label of the sentiment analysis result." + "message": { + "description": "The error message.", + "type": "string" } } }, - "ExternalEntity": { + "PredictionRequest": { + "description": "Represents the prediction request parameters.", + "required": [ + "query" + ], "type": "object", - "description": "Defines a user predicted entity that extends an already existing one.", + "properties": { + "query": { + "description": "The query to predict.", + "type": "string" + }, + "options": { + "description": "The custom options defined for this request.", + "$ref": "#/definitions/PredictionRequestOptions" + }, + "externalEntities": { + "description": "The externally predicted entities for this request.", + "type": "array", + "items": { + "$ref": "#/definitions/ExternalEntity" + } + }, + "dynamicLists": { + "description": "The dynamically created list entities for this request.", + "type": "array", + "items": { + "$ref": "#/definitions/DynamicList" + } + } + } + }, + "PredictionRequestOptions": { + "description": "The custom options for the prediction request.", + "type": "object", + "properties": { + "datetimeReference": { + "format": "date-time", + "description": "The reference DateTime used for predicting datetime entities.", + "type": "string" + }, + "overridePredictions": { + "description": "Whether to make the external entities resolution override the predictions if an overlap occurs.", + "type": "boolean" + } + } + }, + "ExternalEntity": { + "description": "Defines a user perdicted entity that extends an already existing one.", "required": [ "entityName", "startIndex", "entityLength" ], + "type": "object", "properties": { "entityName": { - "type": "string", - "description": "The name of the entity to extend." + "description": "The name of the entity to extend.", + "type": "string" }, "startIndex": { - "type": "integer", - "description": "The start character index of the predicted entity." + "format": "int32", + "description": "The start character index of the predicted entity.", + "type": "integer" }, "entityLength": { - "type": "integer", - "description": "The length of the predicted entity." + "format": "int32", + "description": "The length of the predicted entity.", + "type": "integer" }, "resolution": { "description": "A user supplied custom resolution to return as the entity's prediction." @@ -378,20 +510,20 @@ } }, "DynamicList": { - "type": "object", "description": "Defines an extension for a list entity.", "required": [ "listEntityName", "requestLists" ], + "type": "object", "properties": { "listEntityName": { - "type": "string", - "description": "The name of the list entity to extend." + "description": "The name of the list entity to extend.", + "type": "string" }, "requestLists": { - "type": "array", "description": "The lists to append on the extended list entity.", + "type": "array", "items": { "$ref": "#/definitions/RequestList" } @@ -399,125 +531,31 @@ } }, "RequestList": { - "type": "object", "description": "Defines a sub-list to append to an existing list entity.", "required": [ "canonicalForm" ], + "type": "object", "properties": { "name": { - "type": "string", - "description": "The name of the sub-list." + "description": "The name of the sub-list.", + "type": "string" }, "canonicalForm": { - "type": "string", - "description": "The canonical form of the sub-list." + "description": "The canonical form of the sub-list.", + "type": "string" }, "synonyms": { - "type": "array", "description": "The synonyms of the canonical form.", + "type": "array", "items": { "type": "string" } } } - }, - "Error": { - "type": "object", - "description": "Represents the error that occurred.", - "required": [ - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/ErrorBody" - } - } - }, - "ErrorBody": { - "type": "object", - "description": "Represents the definition of the error that occurred.", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "The error code." - }, - "message": { - "type": "string", - "description": "The error message." - } - } } }, "parameters": { - "AppIdInPath": { - "name": "appId", - "in": "path", - "required": true, - "type": "string", - "format": "uuid", - "description": "The application ID.", - "x-ms-parameter-location": "method" - }, - "VersionIdInPath": { - "name": "versionId", - "in": "path", - "description": "The application version ID.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "SlotNameInPath": { - "name": "slotName", - "in": "path", - "description": "The application slot name.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "Query": { - "name": "query", - "in": "query", - "description": "The query to predict.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "Verbose": { - "name": "verbose", - "in": "query", - "description": "Indicates whether to get extra metadata for the entities predictions or not.", - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "ShowAllIntents": { - "name": "show-all-intents", - "in": "query", - "description": "Indicates whether to return all the intents in the response or just the top intent.", - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "Log": { - "name": "log", - "in": "query", - "description": "Indicates whether to log the endpoint query or not.", - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "PredictionRequest": { - "name": "predictionRequest", - "in": "body", - "description": "The prediction request parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/PredictionRequest" - }, - "x-ms-parameter-location": "method" - }, "Endpoint": { "name": "Endpoint", "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", @@ -528,4 +566,4 @@ "x-ms-skip-url-encoding": true } } -} +} \ No newline at end of file From e1347c3128ff83adf79a5e79e8f73e2181c8870d Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Sat, 15 Jun 2019 03:01:16 +0200 Subject: [PATCH 2/5] Update the datetime in the examples --- .../SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json | 2 +- ...ccessfulGetVersionPredictionsFromEndpointViaPostRequest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json index 0f1a054a3015..cc69253c04a0 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json @@ -7,7 +7,7 @@ "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", "options": { - "datetimeReference": "2015-02-13T13:15:00" + "datetimeReference": "2015-02-13T13:15:00.000Z" }, "externalEntities": [ { diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json index 1e7b109d2996..3ffa8f619d8c 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json @@ -7,7 +7,7 @@ "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", "options": { - "datetimeReference": "2015-02-13T13:15:00" + "datetimeReference": "2015-02-13T13:15:00.000Z" }, "externalEntities": [ { From cf51ae91c1776b88a38beb72bd18de852ade0233 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Sat, 15 Jun 2019 03:14:56 +0200 Subject: [PATCH 3/5] Fix typo --- .../data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json index e4a30010f127..50c171536568 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json @@ -388,7 +388,7 @@ } }, "Sentiment": { - "description": "The result of the sentiment analaysis.", + "description": "The result of the sentiment analysis.", "required": [ "score" ], @@ -482,7 +482,7 @@ } }, "ExternalEntity": { - "description": "Defines a user perdicted entity that extends an already existing one.", + "description": "Defines a user predicted entity that extends an already existing one.", "required": [ "entityName", "startIndex", From 25f46ce2d1f823fd29b5456c1cdc981f7d333ec7 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Sat, 15 Jun 2019 03:39:13 +0200 Subject: [PATCH 4/5] Stop generating v2.0 SDK for Go --- .../cognitiveservices/data-plane/LUIS/Runtime/readme.go.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md index 328ac1b1405d..89aaea879949 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md @@ -13,7 +13,6 @@ go: ``` yaml $(go) && $(multiapi) batch: - - tag: runtime_2_0 - tag: runtime_3_0_preview ``` From 3aa73f9f4b4ea552f8120e245cdb257c77f2eea3 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Fri, 28 Jun 2019 11:02:48 -0700 Subject: [PATCH 5/5] add runtime_2_0 back to Go SDK build --- .../cognitiveservices/data-plane/LUIS/Runtime/readme.go.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md index 89aaea879949..328ac1b1405d 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md @@ -13,6 +13,7 @@ go: ``` yaml $(go) && $(multiapi) batch: + - tag: runtime_2_0 - tag: runtime_3_0_preview ```