From a88e43fc19e0f99d0b866fd5581e0b1343f63054 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Wed, 24 Apr 2019 02:48:22 +0200 Subject: [PATCH 1/4] Add v3.0-preview APIs --- .../Runtime/preview/v3.0/LUIS-Runtime.json | 494 ++++++++++++++++++ ...tPredictionsFromEndpointViaGetRequest.json | 47 ++ ...PredictionsFromEndpointViaPostRequest.json | 76 +++ ...nPredictionsFromEndpointViaGetRequest.json | 49 ++ ...PredictionsFromEndpointViaPostRequest.json | 76 +++ .../data-plane/LUIS/Runtime/readme.go.md | 9 + .../data-plane/LUIS/Runtime/readme.md | 12 + 7 files changed, 763 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json create mode 100644 specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaGetRequest.json create mode 100644 specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json create mode 100644 specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaGetRequest.json create mode 100644 specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json 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 new file mode 100644 index 000000000000..a58611c3bab4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json @@ -0,0 +1,494 @@ +{ + "swagger": "2.0", + "info": { + "version": "3.0-preview", + "title": "LUIS Runtime Client" + }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/luis/v3.0-preview", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "securityDefinitions": { + "apiKeyHeader": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "security": [ + { + "apiKeyHeader": [] + } + ], + "paths": { + "/apps/{appId}/versions/{versionId}/predict": { + "get": { + "description": "Gets the predictions for an application version.", + "operationId": "Prediction_GetVersionPredictionsGET", + "parameters": [ + { + "$ref": "#/parameters/AppIdInPath" + }, + { + "$ref": "#/parameters/VersionIdInPath" + }, + { + "$ref": "#/parameters/Query" + }, + { + "$ref": "#/parameters/Verbose" + }, + { + "$ref": "#/parameters/ShowAllIntents" + }, + { + "$ref": "#/parameters/Log" + } + ], + "responses": { + "200": { + "description": "The prediction for the supplied query", + "schema": { + "$ref": "#/definitions/PredictionResponse" + } + }, + "default": { + "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" + } + } + }, + "post": { + "description": "Gets the predictions for an application version.", + "operationId": "Prediction_GetVersionPredictions", + "parameters": [ + { + "$ref": "#/parameters/AppIdInPath" + }, + { + "$ref": "#/parameters/VersionIdInPath" + }, + { + "$ref": "#/parameters/Verbose" + }, + { + "$ref": "#/parameters/ShowAllIntents" + }, + { + "$ref": "#/parameters/Log" + }, + { + "$ref": "#/parameters/PredictionRequest" + } + ], + "responses": { + "200": { + "description": "The prediction for the supplied query", + "schema": { + "$ref": "#/definitions/PredictionResponse" + } + }, + "default": { + "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" + } + } + } + }, + "/apps/{appId}/slots/{slotName}/predict": { + "get": { + "description": "Gets the predictions for an application slot.", + "operationId": "Prediction_GetSlotPredictionsGET", + "parameters": [ + { + "$ref": "#/parameters/AppIdInPath" + }, + { + "$ref": "#/parameters/SlotNameInPath" + }, + { + "$ref": "#/parameters/Query" + }, + { + "$ref": "#/parameters/Verbose" + }, + { + "$ref": "#/parameters/ShowAllIntents" + }, + { + "$ref": "#/parameters/Log" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "The prediction for the supplied query", + "schema": { + "$ref": "#/definitions/PredictionResponse" + } + }, + "default": { + "description": "unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-ms-examples": { + "Successful Get Slot Predictions From Endpoint Via Get request": { + "$ref": "./examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaGetRequest.json" + } + } + }, + "post": { + "description": "Gets the predictions for an application slot.", + "operationId": "Prediction_GetSlotPredictions", + "parameters": [ + { + "$ref": "#/parameters/AppIdInPath" + }, + { + "$ref": "#/parameters/SlotNameInPath" + }, + { + "$ref": "#/parameters/Verbose" + }, + { + "$ref": "#/parameters/ShowAllIntents" + }, + { + "$ref": "#/parameters/Log" + }, + { + "$ref": "#/parameters/PredictionRequest" + } + ], + "responses": { + "200": { + "description": "The prediction for the supplied query", + "schema": { + "$ref": "#/definitions/PredictionResponse" + } + }, + "default": { + "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" + } + } + } + } + }, + "definitions": { + "PredictionRequest": { + "type": "object", + "required": [ + "query" + ], + "properties": { + "query": { + "description": "The query to predict", + "type": "string" + }, + "options": { + "$ref": "#/definitions/RequestOptions" + }, + "externalEntities": { + "description": "The externally predicted entities for this request", + "type": "array", + "items": { + "$ref": "#/definitions/ExternalEntity" + } + }, + "dynamicEntities": { + "description": "The dynamically created list entities for this request", + "type": "array", + "items": { + "$ref": "#/definitions/DynamicEntity" + } + } + } + }, + "RequestOptions": { + "type": "object", + "properties": { + "timezoneOffset": { + "type": "string" + }, + "overridePredictions": { + "type": "boolean" + } + } + }, + "PredictionResponse": { + "type": "object", + "required": [ + "query", + "prediction" + ], + "properties": { + "query": { + "type": "string" + }, + "prediction": { + "$ref": "#/definitions/PredictionObject" + } + } + }, + "PredictionObject": { + "type": "object", + "required": [ + "normalizedQuery", + "topIntent", + "intents", + "entities" + ], + "properties": { + "normalizedQuery": { + "type": "string" + }, + "alteredQuery": { + "type": "string" + }, + "topIntent": { + "type": "string" + }, + "intents": { + "$ref": "#/definitions/IntentsObject" + }, + "entities": {}, + "sentiment": { + "$ref": "#/definitions/SentimentObject" + } + } + }, + "IntentsObject": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/IntentObject" + } + }, + "IntentObject": { + "type": "object", + "properties": { + "score": { + "type": "number" + }, + "childApp": { + "$ref": "#/definitions/PredictionObject" + } + } + }, + "SentimentObject": { + "type": "object", + "required": [ + "score" + ], + "properties": { + "score": { + "type": "number" + }, + "label": { + "type": "string" + } + } + }, + "ExternalEntity": { + "type": "object", + "required": [ + "entityName", + "startIndex", + "entityLength" + ], + "properties": { + "entityName": { + "type": "string" + }, + "startIndex": { + "type": "integer" + }, + "entityLength": { + "type": "integer" + }, + "resolution": {} + } + }, + "DynamicEntity": { + "type": "object", + "required": [ + "listEntityName", + "requestLists" + ], + "properties": { + "listEntityName": { + "type": "string" + }, + "requestLists": { + "type": "array", + "items": { + "$ref": "#/definitions/Sublist" + } + } + } + }, + "Sublist": { + "type": "object", + "required": [ + "name", + "canonicalForm", + "synonyms" + ], + "properties": { + "name": { + "type": "string" + }, + "canonicalForm": { + "type": "string" + }, + "synonyms": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Error": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "$ref": "#/definitions/ErrorBody" + } + } + }, + "ErrorBody": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + }, + "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": "showAllIntents", + "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 body", + "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).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaGetRequest.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaGetRequest.json new file mode 100644 index 000000000000..3105ad869ad5 --- /dev/null +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaGetRequest.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{Subscription Key}", + "appId": "{Application Id}", + "slotName": "{Slot Name}", + "query": "forward to frank 30 dollars through HSBC" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "forward to frank 30 dollars through HSBC", + "prediction": { + "normalizedQuery": "forward to frank 30 dollars through hsbc", + "topIntent": "give", + "intents": { + "give": { + "score": 0.943442 + } + }, + "entities": { + "frank": [ + "frank" + ], + "number": [ + 30 + ], + "money": [ + { + "unit": "Dollar", + "value": 30 + } + ], + "Bank": [ + "HSBC" + ] + }, + "sentiment": { + "label": "positive", + "score": 0.9163064 + } + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..74701ee11ae6 --- /dev/null +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{Subscription Key}", + "appId": "{Application Id}", + "slotName": "{Slot Name}", + "predictionRequest": { + "query": "forward to frank 30 dollars through HSBC", + "options": { + "timezoneOffset": "-8:00" + }, + "externalEntities": [ + { + "entityName": "Bank", + "startIndex": 36, + "entityLength": 4, + "resolution": { + "text": "International Bank" + } + } + ], + "dynamicLists": [ + { + "listEntityName": "Employees", + "requestLists": [ + { + "name": "Management", + "canonicalForm": "Frank", + "synonyms": [] + } + ] + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "forward to frank 30 dollars through HSBC", + "prediction": { + "normalizedQuery": "forward to frank 30 dollars through hsbc", + "topIntent": "give", + "intents": { + "give": { + "score": 0.943442 + } + }, + "entities": { + "Employees": [ + [ "frank" ] + ], + "number": [ + 30 + ], + "money": [ + { + "unit": "Dollar", + "value": 30 + } + ], + "Bank": [ + { + "text": "International Bank" + } + ] + }, + "sentiment": { + "label": "positive", + "score": 0.9163064 + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaGetRequest.json b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaGetRequest.json new file mode 100644 index 000000000000..2a930ca9fa8f --- /dev/null +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaGetRequest.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{Subscription Key}", + "appId": "{Application Id}", + "versionId": "{Version Id}", + "query": "forward to frank 30 dollars through HSBC" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "forward to frank 30 dollars through HSBC", + "prediction": { + "normalizedQuery": "forward to frank 30 dollars through hsbc", + "topIntent": "give", + "intents": { + "give": { + "score": 0.943442 + } + }, + "entities": { + "Employees": [ + [ "frank" ] + ], + "number": [ + 30 + ], + "money": [ + { + "unit": "Dollar", + "value": 30 + } + ], + "Bank": [ + { + "text": "International Bank" + } + ] + }, + "sentiment": { + "label": "positive", + "score": 0.9163064 + } + } + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 000000000000..1b0f38b1b0bd --- /dev/null +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/preview/v3.0/examples/prediction/SuccessfulGetVersionPredictionsFromEndpointViaPostRequest.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{Subscription Key}", + "appId": "{Application Id}", + "versionId": "{Version Id}", + "predictionRequest": { + "query": "forward to frank 30 dollars through HSBC", + "options": { + "timezoneOffset": "-8:00" + }, + "externalEntities": [ + { + "entityName": "Bank", + "startIndex": 36, + "entityLength": 4, + "resolution": { + "text": "International Bank" + } + } + ], + "dynamicLists": [ + { + "listEntityName": "Employees", + "requestLists": [ + { + "name": "Management", + "canonicalForm": "Frank", + "synonyms": [] + } + ] + } + ] + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "forward to frank 30 dollars through HSBC", + "prediction": { + "normalizedQuery": "forward to frank 30 dollars through hsbc", + "topIntent": "give", + "intents": { + "give": { + "score": 0.943442 + } + }, + "entities": { + "Employees": [ + [ "frank" ] + ], + "number": [ + 30 + ], + "money": [ + { + "unit": "Dollar", + "value": 30 + } + ], + "Bank": [ + { + "text": "International Bank" + } + ] + }, + "sentiment": { + "label": "positive", + "score": 0.9163064 + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md index 810dbbba0f0b..ca2fd7b2b082 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.go.md @@ -23,4 +23,13 @@ Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'runtime_3_0_preview' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v3.0-preview/luis/$(namespace) ``` \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md index 2ffe8859e39a..87a91eafcd7d 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md @@ -25,6 +25,18 @@ directive: remove-operation: Prediction_Resolve2 ``` +## Runtime 3.0-preview +These settings apply only when `--tag=runtime_3_0_preview` is specified on the command line. + +``` yaml $(tag) == 'runtime_3_0_preview' +input-file: preview/v3.0/LUIS-Runtime.json + +# remove the GET APIs from code-generation (since the POST and GET operations are functionally identical) +directive: + - remove-operation: Prediction_GetSlotPredictionsGET + - remove-operation: Prediction_GetVersionPredictionsGET +``` + --- # Code Generation From 3b6c95c26c08dc9d6ef54d2cb6835ded8f5e4bed Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 25 Apr 2019 22:48:50 +0200 Subject: [PATCH 2/4] Remove the timezoneoffset property --- .../data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json | 3 --- ...SuccessfulGetSlotPredictionsFromEndpointViaPostRequest.json | 3 --- ...cessfulGetVersionPredictionsFromEndpointViaPostRequest.json | 3 --- 3 files changed, 9 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 a58611c3bab4..ba5a7fb4d562 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 @@ -248,9 +248,6 @@ "RequestOptions": { "type": "object", "properties": { - "timezoneOffset": { - "type": "string" - }, "overridePredictions": { "type": "boolean" } 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 74701ee11ae6..09eb168e089c 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 @@ -6,9 +6,6 @@ "slotName": "{Slot Name}", "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", - "options": { - "timezoneOffset": "-8:00" - }, "externalEntities": [ { "entityName": "Bank", 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 1b0f38b1b0bd..0dea34b31feb 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 @@ -6,9 +6,6 @@ "versionId": "{Version Id}", "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", - "options": { - "timezoneOffset": "-8:00" - }, "externalEntities": [ { "entityName": "Bank", From f565584b48b42cb32bf9be66ab7f5f8778169b11 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 25 Apr 2019 23:46:37 +0200 Subject: [PATCH 3/4] Add the datetimeReference property --- .../data-plane/LUIS/Runtime/preview/v3.0/LUIS-Runtime.json | 4 ++++ ...uccessfulGetSlotPredictionsFromEndpointViaPostRequest.json | 3 +++ ...essfulGetVersionPredictionsFromEndpointViaPostRequest.json | 3 +++ 3 files changed, 10 insertions(+) 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 ba5a7fb4d562..eb87ad087ea7 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 @@ -248,6 +248,10 @@ "RequestOptions": { "type": "object", "properties": { + "datetimeReference": { + "type": "string", + "format": "date-time" + }, "overridePredictions": { "type": "boolean" } 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 09eb168e089c..d9fe1dca2d4f 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 @@ -6,6 +6,9 @@ "slotName": "{Slot Name}", "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", + "options": { + "datetimeReference": "2015-02-13T13:15:00" + }, "externalEntities": [ { "entityName": "Bank", 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 0dea34b31feb..4188b3e2345c 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 @@ -6,6 +6,9 @@ "versionId": "{Version Id}", "predictionRequest": { "query": "forward to frank 30 dollars through HSBC", + "options": { + "datetimeReference": "2015-02-13T13:15:00" + }, "externalEntities": [ { "entityName": "Bank", From 708409d928fe5997dda0acb005cd1d0fdff1c47b Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Sat, 27 Apr 2019 20:24:27 +0200 Subject: [PATCH 4/4] - Add description to the definitions and the APIs - Fix naming bugs (show-all-intents,dynamicLists) - Rename the definitions for consistency --- .../Runtime/preview/v3.0/LUIS-Runtime.json | 134 +++++++++++------- .../data-plane/LUIS/Runtime/readme.md | 4 +- 2 files changed, 87 insertions(+), 51 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 eb87ad087ea7..7b4aff08332b 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 @@ -29,7 +29,7 @@ "/apps/{appId}/versions/{versionId}/predict": { "get": { "description": "Gets the predictions for an application version.", - "operationId": "Prediction_GetVersionPredictionsGET", + "operationId": "Prediction_GetVersionPredictionGET", "parameters": [ { "$ref": "#/parameters/AppIdInPath" @@ -75,7 +75,7 @@ }, "post": { "description": "Gets the predictions for an application version.", - "operationId": "Prediction_GetVersionPredictions", + "operationId": "Prediction_GetVersionPrediction", "parameters": [ { "$ref": "#/parameters/AppIdInPath" @@ -123,7 +123,7 @@ "/apps/{appId}/slots/{slotName}/predict": { "get": { "description": "Gets the predictions for an application slot.", - "operationId": "Prediction_GetSlotPredictionsGET", + "operationId": "Prediction_GetSlotPredictionGET", "parameters": [ { "$ref": "#/parameters/AppIdInPath" @@ -169,7 +169,7 @@ }, "post": { "description": "Gets the predictions for an application slot.", - "operationId": "Prediction_GetSlotPredictions", + "operationId": "Prediction_GetSlotPrediction", "parameters": [ { "$ref": "#/parameters/AppIdInPath" @@ -218,6 +218,7 @@ "definitions": { "PredictionRequest": { "type": "object", + "description": "Represents the prediction request parameters.", "required": [ "query" ], @@ -227,7 +228,8 @@ "type": "string" }, "options": { - "$ref": "#/definitions/RequestOptions" + "description": "The custom options defined for this request.", + "$ref": "#/definitions/PredictionRequestOptions" }, "externalEntities": { "description": "The externally predicted entities for this request", @@ -236,44 +238,51 @@ "$ref": "#/definitions/ExternalEntity" } }, - "dynamicEntities": { + "dynamicLists": { "description": "The dynamically created list entities for this request", "type": "array", "items": { - "$ref": "#/definitions/DynamicEntity" + "$ref": "#/definitions/DynamicList" } } } }, - "RequestOptions": { + "PredictionRequestOptions": { "type": "object", + "description": "The custom options for the prediction request.", "properties": { "datetimeReference": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "The reference DateTime used for predicting datetime entities." }, "overridePredictions": { - "type": "boolean" + "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" ], "properties": { "query": { - "type": "string" + "type": "string", + "description": "The query used in the prediction." }, "prediction": { - "$ref": "#/definitions/PredictionObject" + "description": "The prediction of the requested query.", + "$ref": "#/definitions/Prediction" } } }, - "PredictionObject": { + "Prediction": { "type": "object", + "description": "Represents the prediction of a query.", "required": [ "normalizedQuery", "topIntent", @@ -282,56 +291,69 @@ ], "properties": { "normalizedQuery": { - "type": "string" + "type": "string", + "description": "The query after pre-processing and normalization." }, "alteredQuery": { - "type": "string" + "type": "string", + "description": "The query after spell checking. Only set if spell check was enabled and a spelling mistake was found." }, "topIntent": { - "type": "string" + "type": "string", + "description": "The name of the top scoring intent." }, "intents": { - "$ref": "#/definitions/IntentsObject" + "type": "object", + "description": "A dictionary representing the intents that fired.", + "additionalProperties": { + "$ref": "#/definitions/Intent" + } + }, + "entities": { + "type": "object", + "description": "The dictionary representing the entities that fired.", + "additionalProperties": {} }, - "entities": {}, "sentiment": { - "$ref": "#/definitions/SentimentObject" + "description": "The result of the sentiment analysis.", + "$ref": "#/definitions/Sentiment" } } }, - "IntentsObject": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/IntentObject" - } - }, - "IntentObject": { + "Intent": { "type": "object", + "description": "Represents an intent prediction.", "properties": { "score": { - "type": "number" + "type": "number", + "description": "The score of the fired intent." }, "childApp": { - "$ref": "#/definitions/PredictionObject" + "description": "The prediction of the dispatched application.", + "$ref": "#/definitions/Prediction" } } }, - "SentimentObject": { + "Sentiment": { "type": "object", + "description": "The result of the sentiment analaysis.", "required": [ "score" ], "properties": { "score": { - "type": "number" + "type": "number", + "description": "The sentiment score of the query." }, "label": { - "type": "string" + "type": "string", + "description": "The label of the sentiment analysis result." } } }, "ExternalEntity": { "type": "object", + "description": "Defines a user perdicted entity that extends an already existing one.", "required": [ "entityName", "startIndex", @@ -339,51 +361,61 @@ ], "properties": { "entityName": { - "type": "string" + "type": "string", + "description": "The name of the entity to extend." }, "startIndex": { - "type": "integer" + "type": "integer", + "description": "The start character index of the predicted entity." }, "entityLength": { - "type": "integer" + "type": "integer", + "description": "The length of the predicted entity." }, - "resolution": {} + "resolution": { + "description": "A user supplied custom resolution to return as the entity's prediction." + } } }, - "DynamicEntity": { + "DynamicList": { "type": "object", + "description": "Defines an extension for a list entity.", "required": [ "listEntityName", "requestLists" ], "properties": { "listEntityName": { - "type": "string" + "type": "string", + "description": "The name of the list entity to extend." }, "requestLists": { "type": "array", + "description": "The lists to append on the extended list entity.", "items": { - "$ref": "#/definitions/Sublist" + "$ref": "#/definitions/RequestList" } } } }, - "Sublist": { + "RequestList": { "type": "object", + "description": "Defines a sub-list to append to an existing list entity.", "required": [ - "name", - "canonicalForm", - "synonyms" + "canonicalForm" ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the sub-list." }, "canonicalForm": { - "type": "string" + "type": "string", + "description": "The canonical form of the sub-list." }, "synonyms": { "type": "array", + "description": "The synonyms of the canonical form.", "items": { "type": "string" } @@ -392,6 +424,7 @@ }, "Error": { "type": "object", + "description": "Represents the error that occurred.", "required": [ "error" ], @@ -403,16 +436,19 @@ }, "ErrorBody": { "type": "object", + "description": "Represents the definition of the error that occurred.", "required": [ "code", "message" ], "properties": { "code": { - "type": "string" + "type": "string", + "description": "The error code." }, "message": { - "type": "string" + "type": "string", + "description": "The error message." } } } @@ -446,7 +482,7 @@ "Query": { "name": "query", "in": "query", - "description": "The query to predict", + "description": "The query to predict.", "required": true, "type": "string", "x-ms-parameter-location": "method" @@ -459,7 +495,7 @@ "x-ms-parameter-location": "method" }, "ShowAllIntents": { - "name": "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", @@ -475,7 +511,7 @@ "PredictionRequest": { "name": "predictionRequest", "in": "body", - "description": "The prediction request body", + "description": "The prediction request parameters.", "required": true, "schema": { "$ref": "#/definitions/PredictionRequest" diff --git a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md index 87a91eafcd7d..4e421b6bea24 100644 --- a/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md +++ b/specification/cognitiveservices/data-plane/LUIS/Runtime/readme.md @@ -33,8 +33,8 @@ input-file: preview/v3.0/LUIS-Runtime.json # remove the GET APIs from code-generation (since the POST and GET operations are functionally identical) directive: - - remove-operation: Prediction_GetSlotPredictionsGET - - remove-operation: Prediction_GetVersionPredictionsGET + - remove-operation: Prediction_GetSlotPredictionGET + - remove-operation: Prediction_GetVersionPredictionGET ``` ---