{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "azure.local",
  "info": {
    "title": "LUIS Runtime Client",
    "version": "2.0",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/LUIS/Runtime/stable/v2.0/LUIS-Runtime.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "cognitiveservices-LUIS-Runtime",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "apiKeyHeader": {
      "in": "header",
      "name": "Ocp-Apim-Subscription-Key",
      "type": "apiKey"
    }
  },
  "security": [
    {
      "apiKeyHeader": []
    }
  ],
  "parameters": {
    "Endpoint": {
      "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
      "in": "path",
      "name": "Endpoint",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "client",
      "x-ms-skip-url-encoding": true
    }
  },
  "paths": {
    "/apps/{appId}": {
      "get": {
        "description": "Gets predictions for a given utterance, in the form of intents and entities. The current maximum query size is 500 characters.",
        "operationId": "Prediction_Resolve2",
        "parameters": [
          {
            "description": "The LUIS application ID (guid).",
            "format": "uuid",
            "in": "path",
            "name": "appId",
            "required": true,
            "type": "string"
          },
          {
            "description": "The utterance to predict.",
            "in": "query",
            "maxLength": 500,
            "name": "q",
            "required": true,
            "type": "string",
            "x-ms-client-name": "query"
          },
          {
            "description": "The timezone offset for the location of the request.",
            "in": "query",
            "name": "timezoneOffset",
            "type": "number"
          },
          {
            "description": "If true, return all intents instead of just the top scoring intent.",
            "in": "query",
            "name": "verbose",
            "type": "boolean"
          },
          {
            "description": "Use the staging endpoint slot.",
            "in": "query",
            "name": "staging",
            "type": "boolean"
          },
          {
            "description": "Enable spell checking.",
            "in": "query",
            "name": "spellCheck",
            "type": "boolean"
          },
          {
            "description": "The subscription key to use when enabling Bing spell check",
            "in": "query",
            "name": "bing-spell-check-subscription-key",
            "type": "string"
          },
          {
            "description": "Log query (default is true)",
            "in": "query",
            "name": "log",
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "Prediction, based on the input query, containing intent(s) and entities.",
            "schema": {
              "$ref": "#/definitions/LuisResult"
            }
          },
          "default": {
            "description": "Error response.",
            "schema": {
              "$ref": "#/definitions/APIError"
            }
          }
        },
        "x-ms-examples": {
          "Successful Get Predictions From Endpoint Via Get request": {
            "parameters": {
              "Endpoint": "{Endpoint}",
              "Ocp-Apim-Subscription-Key": "{Subscription Key}",
              "appId": "{Application Id}",
              "q": "forward to frank 30 dollars through HSBC"
            },
            "responses": {
              "200": {
                "body": {
                  "entities": [
                    {
                      "endIndex": 18,
                      "entity": "30",
                      "resolution": {
                        "value": "30"
                      },
                      "startIndex": 17,
                      "type": "builtin.number"
                    },
                    {
                      "endIndex": 15,
                      "entity": "frank",
                      "score": 0.935219169,
                      "startIndex": 11,
                      "type": "frank"
                    },
                    {
                      "endIndex": 26,
                      "entity": "30 dollars",
                      "resolution": {
                        "unit": "Dollar",
                        "value": "30"
                      },
                      "startIndex": 17,
                      "type": "builtin.currency"
                    },
                    {
                      "endIndex": 39,
                      "entity": "hsbc",
                      "resolution": {
                        "values": [
                          "BankeName"
                        ]
                      },
                      "startIndex": 36,
                      "type": "Bank"
                    }
                  ],
                  "query": "forward to frank 30 dollars through HSBC",
                  "sentimentAnalysis": {
                    "label": "positive",
                    "score": 0.9163064
                  },
                  "topScoringIntent": {
                    "intent": "give",
                    "score": 0.3964121
                  }
                },
                "headers": {}
              }
            }
          }
        }
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Gets predictions for a given utterance, in the form of intents and entities. The current maximum query size is 500 characters.",
        "operationId": "Prediction_Resolve",
        "parameters": [
          {
            "description": "The LUIS application ID (Guid).",
            "format": "uuid",
            "in": "path",
            "name": "appId",
            "required": true,
            "type": "string"
          },
          {
            "description": "The utterance to predict.",
            "in": "body",
            "name": "q",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Q"
            },
            "x-ms-client-name": "query"
          },
          {
            "description": "The timezone offset for the location of the request.",
            "in": "query",
            "name": "timezoneOffset",
            "type": "number"
          },
          {
            "description": "If true, return all intents instead of just the top scoring intent.",
            "in": "query",
            "name": "verbose",
            "type": "boolean"
          },
          {
            "description": "Use the staging endpoint slot.",
            "in": "query",
            "name": "staging",
            "type": "boolean"
          },
          {
            "description": "Enable spell checking.",
            "in": "query",
            "name": "spellCheck",
            "type": "boolean"
          },
          {
            "description": "The subscription key to use when enabling Bing spell check",
            "in": "query",
            "name": "bing-spell-check-subscription-key",
            "type": "string"
          },
          {
            "description": "Log query (default is true)",
            "in": "query",
            "name": "log",
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "Prediction, based on the input query, containing intent(s) and entities.",
            "schema": {
              "$ref": "#/definitions/LuisResult"
            }
          },
          "default": {
            "description": "Error response.",
            "schema": {
              "$ref": "#/definitions/APIError"
            }
          }
        },
        "x-ms-examples": {
          "Successful Get Predictions From Endpoint Via Post request": {
            "parameters": {
              "Endpoint": "{Endpoint}",
              "Ocp-Apim-Subscription-Key": "{Subscription Key}",
              "appId": "{Application Id}",
              "q": "forward to frank 30 dollars through HSBC"
            },
            "responses": {
              "200": {
                "body": {
                  "entities": [
                    {
                      "endIndex": 18,
                      "entity": "30",
                      "resolution": {
                        "value": "30"
                      },
                      "startIndex": 17,
                      "type": "builtin.number"
                    },
                    {
                      "endIndex": 15,
                      "entity": "frank",
                      "score": 0.935219169,
                      "startIndex": 11,
                      "type": "frank"
                    },
                    {
                      "endIndex": 26,
                      "entity": "30 dollars",
                      "resolution": {
                        "unit": "Dollar",
                        "value": "30"
                      },
                      "startIndex": 17,
                      "type": "builtin.currency"
                    },
                    {
                      "endIndex": 39,
                      "entity": "hsbc",
                      "resolution": {
                        "values": [
                          "BankeName"
                        ]
                      },
                      "startIndex": 36,
                      "type": "Bank"
                    }
                  ],
                  "query": "forward to frank 30 dollars through HSBC",
                  "sentimentAnalysis": {
                    "label": "positive",
                    "score": 0.9163064
                  },
                  "topScoringIntent": {
                    "intent": "give",
                    "score": 0.3964121
                  }
                },
                "headers": {}
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "APIError": {
      "description": "Error information returned by the API",
      "properties": {
        "message": {
          "description": "Cause of the error.",
          "type": "string"
        },
        "statusCode": {
          "description": "HTTP Status code",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CompositeChildModel": {
      "description": "Child entity in a LUIS Composite Entity.",
      "properties": {
        "type": {
          "description": "Type of child entity.",
          "type": "string"
        },
        "value": {
          "description": "Value extracted by LUIS.",
          "type": "string"
        }
      },
      "required": [
        "type",
        "value"
      ],
      "type": "object"
    },
    "CompositeEntityModel": {
      "description": "LUIS Composite Entity.",
      "properties": {
        "children": {
          "description": "Child entities.",
          "items": {
            "$ref": "#/definitions/CompositeChildModel"
          },
          "type": "array"
        },
        "parentType": {
          "description": "Type/name of parent entity.",
          "type": "string"
        },
        "value": {
          "description": "Value for composite entity extracted by LUIS.",
          "type": "string"
        }
      },
      "required": [
        "parentType",
        "value",
        "children"
      ],
      "type": "object"
    },
    "EntityModel": {
      "additionalProperties": {
        "description": "List of additional properties. For example, score and resolution values for pre-built LUIS entities.",
        "type": "object"
      },
      "description": "An entity extracted from the utterance.",
      "properties": {
        "endIndex": {
          "description": "The position of the last character of the matched entity within the utterance.",
          "type": "integer"
        },
        "entity": {
          "description": "Name of the entity, as defined in LUIS.",
          "type": "string"
        },
        "startIndex": {
          "description": "The position of the first character of the matched entity within the utterance.",
          "type": "integer"
        },
        "type": {
          "description": "Type of the entity, as defined in LUIS.",
          "type": "string"
        }
      },
      "required": [
        "entity",
        "type",
        "startIndex",
        "endIndex"
      ],
      "type": "object"
    },
    "EntityWithResolution": {
      "allOf": [
        {
          "$ref": "#/definitions/EntityModel"
        },
        {
          "properties": {
            "resolution": {
              "description": "Resolution values for pre-built LUIS entities.",
              "type": "object"
            }
          },
          "required": [
            "resolution"
          ],
          "type": "object"
        }
      ]
    },
    "EntityWithScore": {
      "allOf": [
        {
          "$ref": "#/definitions/EntityModel"
        },
        {
          "properties": {
            "score": {
              "description": "Associated prediction score for the intent (float).",
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            }
          },
          "required": [
            "score"
          ],
          "type": "object"
        }
      ]
    },
    "IntentModel": {
      "description": "An intent detected from the utterance.",
      "properties": {
        "intent": {
          "description": "Name of the intent, as defined in LUIS.",
          "type": "string"
        },
        "score": {
          "description": "Associated prediction score for the intent (float).",
          "maximum": 1,
          "minimum": 0,
          "type": "number"
        }
      },
      "type": "object"
    },
    "LuisResult": {
      "description": "Prediction, based on the input query, containing intent(s) and entities.",
      "properties": {
        "alteredQuery": {
          "description": "The corrected utterance (when spell checking was enabled).",
          "type": "string"
        },
        "compositeEntities": {
          "description": "The composite entities extracted from the utterance.",
          "items": {
            "$ref": "#/definitions/CompositeEntityModel"
          },
          "type": "array"
        },
        "connectedServiceResult": {
          "$ref": "#/definitions/LuisResult"
        },
        "entities": {
          "description": "The entities extracted from the utterance.",
          "items": {
            "$ref": "#/definitions/EntityModel"
          },
          "type": "array"
        },
        "intents": {
          "description": "All the intents (and their score) that were detected from utterance.",
          "items": {
            "$ref": "#/definitions/IntentModel"
          },
          "type": "array"
        },
        "query": {
          "description": "The input utterance that was analyzed.",
          "type": "string"
        },
        "sentimentAnalysis": {
          "$ref": "#/definitions/Sentiment"
        },
        "topScoringIntent": {
          "$ref": "#/definitions/IntentModel"
        }
      },
      "type": "object"
    },
    "Q": {
      "description": "The utterance to predict.",
      "example": "\"forward to frank 30 dollars through HSBC\"",
      "maxLength": 500,
      "type": "string"
    },
    "Sentiment": {
      "description": "Sentiment of the input utterance.",
      "properties": {
        "label": {
          "description": "The polarity of the sentiment, can be positive, neutral or negative.",
          "type": "string"
        },
        "score": {
          "description": "Score of the sentiment, ranges from 0 (most negative) to 1 (most positive).",
          "type": "number"
        }
      },
      "type": "object"
    }
  },
  "x-ms-parameterized-host": {
    "hostTemplate": "{Endpoint}/luis/v2.0",
    "parameters": [
      {
        "$ref": "#/parameters/Endpoint"
      }
    ],
    "useSchemePrefix": false
  }
}