-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CognitiveServices] LUIS Runtime API Spec #2051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
ed96a5c
da83d01
84c120e
aa673f0
8a945c6
cefe9b4
c3ea0c8
8663698
5d0af83
bb87a56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Cognitive Services LUIS SDKs | ||
|
|
||
| > see https://aka.ms/autorest | ||
|
|
||
| Configuration for generating LUIS Runtime SDK. | ||
|
|
||
| ``` yaml | ||
| tag: runtime_2_0 | ||
| add-credentials: true | ||
| openapi-type: data-plane | ||
| ``` | ||
|
|
||
| The current release for the Runtime Endpoint is `runtime_2_0`. | ||
|
|
||
| # Releases | ||
|
|
||
| ## Runtime 2.0 | ||
| These settings apply only when `--tag=runtime_2_0` is specified on the command line. | ||
|
|
||
| ``` yaml $(tag) == 'runtime_2_0' | ||
| input-file: v2.0/LUIS-Runtime.json | ||
| ``` | ||
|
|
||
| ### Runtime 2.0 - CSharp Settings | ||
| These settings apply only when `--csharp` is specified on the command line. | ||
| ``` yaml $(csharp) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And, let's change this (uses new feature!) csharp:
override-client-name: LuisRuntimeAPI
sync-methods: None
license-header: MICROSOFT_MIT_NO_VERSION
azure-arm: false
namespace: Microsoft.Azure.CognitiveServices.Language.LUIS
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Language/LUIS-Runtime/Generated
clear-output-folder: true
# csharp has support for modelAsExtensible now; replace modelAsString with that.
directive:
from: swagger-document
where: $..['x-ms-enum']
transform: >
if( $['modelAsString'] ) {
$['modelAsExtensible'] = true;
$['modelAsString'] = false;
}
|
||
| csharp: | ||
| override-client-name: LuisRuntimeAPI | ||
| sync-methods: None | ||
| license-header: MICROSOFT_MIT_NO_VERSION | ||
| azure-arm: false | ||
| namespace: Microsoft.Azure.CognitiveServices.Language.LUIS | ||
| output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Language/LUIS-Runtime/Generated | ||
| clear-output-folder: true | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,338 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "title": "LUIS Endpoint API", | ||
| "version": "v2.0" | ||
| }, | ||
| "x-ms-parameterized-host": { | ||
| "hostTemplate": "{AzureRegion}.api.cognitive.microsoft.com", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../Common/ExtendedRegions.json#/parameters/AzureRegion" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For GA, what is the region list that should be included?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If neither of these fit LUIS' profile, feel free to create your own AzureRegion definitions within the spec.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, still awaiting confirmation.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pcostantini when you've got confirmation, ping and we can merge this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @fearthecowboy , |
||
| } | ||
| ] | ||
| }, | ||
| "basePath": "/luis/v2.0/apps", | ||
| "schemes": [ | ||
| "https" | ||
| ], | ||
| "securityDefinitions": { | ||
| "apiKeyHeader": { | ||
| "type": "apiKey", | ||
| "name": "Ocp-Apim-Subscription-Key", | ||
| "in": "header" | ||
| } | ||
| }, | ||
| "security": [ | ||
| { | ||
| "apiKeyHeader": [] | ||
| } | ||
| ], | ||
| "paths": { | ||
| "/{appId}": { | ||
| "get": { | ||
| "description": "Gets the published endpoint predictions for the given query.", | ||
| "operationId": "Prediction_GetPredictionsFromEndpointViaGet", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use The format should be Ideally, something like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to Predictions_Resolve |
||
| "parameters": [ | ||
| { | ||
| "name": "appId", | ||
| "in": "path", | ||
| "type": "string", | ||
| "required": true, | ||
| "description": "Format - guid. The application ID." | ||
| }, | ||
| { | ||
| "name": "q", | ||
| "in": "query", | ||
| "description": "The query to predict.", | ||
| "required": true, | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "timezoneOffset", | ||
| "in": "query", | ||
| "description": "The timezone offset for the location of the request.", | ||
| "type": "number" | ||
| }, | ||
| { | ||
| "name": "verbose", | ||
| "in": "query", | ||
| "description": "If true will return all intents instead of just the topscoring intent.", | ||
| "type": "boolean" | ||
| }, | ||
| { | ||
| "name": "spellCheck", | ||
| "in": "query", | ||
| "description": "Enable spell checking.", | ||
| "type": "boolean" | ||
| }, | ||
| { | ||
| "name": "staging", | ||
| "in": "query", | ||
| "description": "Use staging endpoint.", | ||
| "type": "boolean" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "A JSON object containing the predictions.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't describe the payload in terms of encoding or transport, (ie, remove
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated along with entity's description and their attributes |
||
| "schema": { | ||
| "$ref": "#/definitions/LuisResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response.", | ||
| "schema": { | ||
| "$ref": "#/definitions/APIError" | ||
| } | ||
| } | ||
| }, | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "x-ms-examples": { | ||
| "Successful Get Predictions From Endpoint Via Get request": { | ||
| "$ref": "./examples/prediction/SuccessfulGetPredictionsFromEndpointViaGetRequest.json" | ||
| } | ||
| } | ||
| }, | ||
| "post": { | ||
| "description": "Gets the published endpoint prediction for the given long query.", | ||
| "operationId": "Prediction_GetPredictionsFromEndpointViaPost", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any fundamental differences between using the again this should be If there are fundamental differences between
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ACK. The API allows using GET or POST, but the end-result is the same and the parameters constraints are the same too. |
||
| "parameters": [ | ||
| { | ||
| "name": "appId", | ||
| "in": "path", | ||
| "type": "string", | ||
| "required": true, | ||
| "description": "Format - guid. The application ID." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the application ID used for?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added description for the Luis Application ID |
||
| }, | ||
| { | ||
| "name": "q", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the "x-ms-client-name":"query",in so the parameter name is |
||
| "in": "body", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/Q" | ||
| }, | ||
| "description": "The query to predict." | ||
| }, | ||
| { | ||
| "name": "timezoneOffset", | ||
| "in": "query", | ||
| "description": "The timezone offset for the location of the request.", | ||
| "type": "number" | ||
| }, | ||
| { | ||
| "name": "verbose", | ||
| "in": "query", | ||
| "description": "If true will return all intents instead of just the topscoring intent.", | ||
| "type": "boolean" | ||
| }, | ||
| { | ||
| "name": "spellCheck", | ||
| "in": "query", | ||
| "description": "Enable spell checking.", | ||
| "type": "boolean" | ||
| }, | ||
| { | ||
| "name": "staging", | ||
| "in": "query", | ||
| "description": "Use staging endpoint.", | ||
| "type": "boolean" | ||
| } | ||
| ], | ||
| "consumes": [ | ||
| "application/json" | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "A JSON object containing the prediction.", | ||
| "schema": { | ||
| "$ref": "#/definitions/LuisResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response.", | ||
| "schema": { | ||
| "$ref": "#/definitions/APIError" | ||
| } | ||
| } | ||
| }, | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "x-ms-examples":{ | ||
| "Successful Get Predictions From Endpoint Via Post request": { | ||
| "$ref": "./examples/prediction/SuccessfulGetPredictionsFromEndpointViaPostRequest.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "Q": { | ||
| "type": "string", | ||
| "example": "\"forward to frank 30 dollars through HSBC\"" | ||
| }, | ||
| "LuisResult": { | ||
| "type": "object", | ||
| "properties": { | ||
| "query": { | ||
| "type": "string", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added description to all parameters and attributes |
||
| "x-nullable": true | ||
| }, | ||
| "topScoringIntent": { | ||
| "$ref": "#/definitions/IntentModel", | ||
| "x-nullable": true | ||
| }, | ||
| "intents": { | ||
| "type": "array", | ||
| "x-nullable": true, | ||
| "items": { | ||
| "$ref": "#/definitions/IntentModel" | ||
| } | ||
| }, | ||
| "entities": { | ||
| "type": "array", | ||
| "x-nullable": true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason you're explicitly marking things That affects code-generation in some specific ways, but shouldn't be used so liberally without a definite reason. Most of what you've marked here would be nullable anyway.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed all x-nullable: true |
||
| "items": { | ||
| "$ref": "#/definitions/EntityModel" | ||
| } | ||
| }, | ||
| "compositeEntities": { | ||
| "type": "array", | ||
| "x-nullable": true, | ||
| "description": "The composite entities extracted from the utterance.", | ||
| "items": { | ||
| "$ref": "#/definitions/CompositeEntityModel" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "CompositeEntityModel": { | ||
| "description": "LUIS Composite Entity.", | ||
| "type": "object", | ||
| "properties": { | ||
| "parentType": { | ||
| "type": "string", | ||
| "description": "Type/name of parent entity." | ||
| }, | ||
| "value": { | ||
| "type": "string", | ||
| "description": "Value for composite entity extracted by LUIS." | ||
| }, | ||
| "children": { | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/CompositeChildModel" | ||
| } | ||
| } | ||
| }, | ||
| "required": [ | ||
| "parentType", | ||
| "value", | ||
| "children" | ||
| ] | ||
| }, | ||
| "CompositeChildModel": { | ||
| "description": "Child entity in LUIS composite entity.", | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "description": "Type of child entity." | ||
| }, | ||
| "value": { | ||
| "type": "string", | ||
| "description": "Value extracted by LUIS." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "type", | ||
| "value" | ||
| ] | ||
| }, | ||
| "IntentModel": { | ||
| "description": "Intent returned from LUIS.", | ||
| "type": "object", | ||
| "properties": { | ||
| "intent": { | ||
| "type": "string" | ||
| }, | ||
| "score": { | ||
| "type": "number" | ||
| } | ||
| } | ||
| }, | ||
| "EntityModel": { | ||
| "description": "Entity returned from LUIS.", | ||
| "type": "object", | ||
| "properties":{ | ||
| "entity": { | ||
| "type": "string" | ||
| }, | ||
| "type": { | ||
| "type": "string" | ||
| }, | ||
| "startIndex": { | ||
| "type": "number" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be a good idea to have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added description with their meaning. These values change based on the input. They represent a match within the input query |
||
| }, | ||
| "endIndex": { | ||
| "type": "number" | ||
| } | ||
| }, | ||
| "additionalProperties": { | ||
| "type": "object" | ||
| }, | ||
| "required": [ "entity", "type", "startIndex", "endIndex" ] | ||
| }, | ||
| "EntityWithScore": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/EntityModel" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "score": { | ||
| "type": "number" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "score" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "EntityWithResolution": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/EntityModel" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "resolution": { | ||
| "type": "object" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "resolution" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "APIError": { | ||
| "type": "object", | ||
| "description": "Error information returned by the API", | ||
| "properties": { | ||
| "statusCode": { | ||
| "type": "string" | ||
| }, | ||
| "message": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this section to this:
It will suppress
Resolve2from getting code generation