Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
{
"swagger": "2.0",
"info": {
"title": "LUIS Endpoint API",
"version": "1.0"
},
"x-ms-parameterized-host": {
"hostTemplate": "{AzureRegion}.api.cognitive.microsoft.com",
"parameters": [
{
"name": "AzureRegion",
"description": "Supported Azure regions for Cognitive Services endpoints",
"x-ms-parameter-location": "client",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true,
"x-nullable": "false",
"x-ms-enum": {
"name": "AzureRegions",
"modelAsString": false
},
"enum": [
"westus",
"westeurope"
]
}
]
},
"basePath": "/luis/v2.0/apps",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/{appId}": {
"get": {
"description": "Gets the published endpoint predictions for the given query",
"operationId": "v2.0 Response - Get predictions from endpoint",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operationID should be of a form similar to https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/Face/v1.0/Face.json#L31
The string before the underscore "_" groups the operations in a class named that way (in code generation)
Something like "Predictions_Get"
The name is used for the generated method name.

"parameters": [
{
"name": "appId",
"in": "path",
"description": "Format - guid. The application ID",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to end each description with "."

"required": true,
"type": "string"
},
{
"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",
"examples": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could look into using x-ms-examples - https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/x-ms-examples.md#why-x-ms-examples
It allows multiple examples and you can put the example in a separate file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"application/json": {
"query": "forward to frank 30 dollars through HSBC",
"topScoringIntent": {
"intent": "give",
"score": 0.3964121
},
"entities": [
{
"entity": "30",
"type": "builtin.number",
"startIndex": 17,
"endIndex": 18,
"resolution": {
"value": "30"
}
},
{
"entity": "frank",
"type": "frank",
"startIndex": 11,
"endIndex": 15,
"score": 0.935219169
},
{
"entity": "30 dollars",
"type": "builtin.currency",
"startIndex": 17,
"endIndex": 26,
"resolution": {
"unit": "Dollar",
"value": "30"
}
},
{
"entity": "hsbc",
"type": "Bank",
"startIndex": 36,
"endIndex": 39,
"resolution": {
"values": [
"BankeName"
]
}
}
]
}
}
}
},
"produces": [
"application/json"
]
},
"post": {
"description": "Gets the published endpoint prediction for the given long query",
"operationId": "v2.0 Response - Get predictions from endpoint (post)",
"parameters": [
{
"name": "appId",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in": "path",
"description": "Format - guid. The application ID",
"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"
},
{
"name": "q",
"in": "body",
"schema": {
"$ref": "#/definitions/Q"
},
"description": "The query to predict"
}
],
"consumes": [
"application/json"
],
"responses": {
"200": {
"description": "A JSON object containing the prediction",
"examples": {
"application/json": {
"query": "forward to frank 30 dollars through HSBC",
"topScoringIntent": {
"intent": "give",
"score": 0.3964121
},
"entities": [
{
"entity": "30",
"type": "builtin.number",
"startIndex": 17,
"endIndex": 18,
"resolution": {
"value": "30"
}
},
{
"entity": "frank",
"type": "frank",
"startIndex": 11,
"endIndex": 15,
"score": 0.935219169
},
{
"entity": "30 dollars",
"type": "builtin.currency",
"startIndex": 17,
"endIndex": 26,
"resolution": {
"unit": "Dollar",
"value": "30"
}
},
{
"entity": "hsbc",
"type": "Bank",
"startIndex": 36,
"endIndex": 39,
"resolution": {
"values": [
"BankeName"
]
}
}
]
}
}
}
},
"produces": [
"application/json"
]
}
}
},
"definitions": {
"Q": {
"type": "string",
"example": "\"forward to frank 30 dollars through HSBC\""
}
}
}
Loading