swagger: "2.0"
schemes:
  - https
host: azure.local
info:
  title: LUIS Runtime Client
  version: "3.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/v3.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}/slots/{slotName}/predict":
    get:
      description: Gets the predictions for an application slot.
      operationId: Prediction_GetSlotPredictionGET
      parameters:
        - description: The application ID.
          format: uuid
          in: path
          name: appId
          required: true
          type: string
        - description: The application slot name.
          in: path
          name: slotName
          required: true
          type: string
        - description: The query to predict.
          in: query
          name: query
          required: true
          type: string
        - description: Indicates whether to get extra metadata for the entities predictions or not.
          in: query
          name: verbose
          type: boolean
        - description: Indicates whether to return all the intents in the response or just the top intent.
          in: query
          name: show-all-intents
          type: boolean
        - description: Indicates whether to log the endpoint query or not.
          in: query
          name: log
          type: boolean
      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:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{Subscription Key}"
            appId: "{Application Id}"
            query: forward to frank 30 dollars through HSBC
            slotName: "{Slot Name}"
          responses:
            "200":
              body:
                prediction:
                  entities:
                    Bank:
                      - HSBC
                    frank:
                      - frank
                    money:
                      - units: Dollar
                        value: 30
                    number:
                      - 30
                  intents:
                    give:
                      score: 0.943442
                  sentiment:
                    label: positive
                    score: 0.9163064
                  topIntent: give
                query: forward to frank 30 dollars through HSBC
              headers: {}
    post:
      consumes:
        - application/json
      description: Gets the predictions for an application slot.
      operationId: Prediction_GetSlotPrediction
      parameters:
        - description: The application ID.
          format: uuid
          in: path
          name: appId
          required: true
          type: string
        - description: The application slot name.
          in: path
          name: slotName
          required: true
          type: string
        - description: Indicates whether to get extra metadata for the entities predictions or not.
          in: query
          name: verbose
          type: boolean
        - description: Indicates whether to return all the intents in the response or just the top intent.
          in: query
          name: show-all-intents
          type: boolean
        - description: Indicates whether to log the endpoint query or not.
          in: query
          name: log
          type: boolean
        - description: The prediction request parameters.
          in: body
          name: predictionRequest
          required: true
          schema:
            $ref: "#/definitions/PredictionRequest"
      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 Post request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{Subscription Key}"
            appId: "{Application Id}"
            predictionRequest:
              dynamicLists:
                - listEntityName: Employees
                  requestLists:
                    - canonicalForm: Frank
                      name: Management
                      synonyms: []
              externalEntities:
                - entityLength: 4
                  entityName: Bank
                  resolution:
                    text: International Bank
                  startIndex: 36
              options:
                datetimeReference: 2015-02-13T13:15:00.000Z
              query: forward to frank 30 dollars through HSBC
            slotName: "{Slot Name}"
          responses:
            "200":
              body:
                prediction:
                  entities:
                    Bank:
                      - text: International Bank
                    Employees:
                      - - frank
                    money:
                      - units: Dollar
                        value: 30
                    number:
                      - 30
                  intents:
                    give:
                      score: 0.943442
                  sentiment:
                    label: positive
                    score: 0.9163064
                  topIntent: give
                query: forward to frank 30 dollars through HSBC
              headers: {}
  "/apps/{appId}/versions/{versionId}/predict":
    get:
      description: Gets the predictions for an application version.
      operationId: Prediction_GetVersionPredictionGET
      parameters:
        - description: The application ID.
          format: uuid
          in: path
          name: appId
          required: true
          type: string
        - description: The application version ID.
          in: path
          name: versionId
          required: true
          type: string
        - description: The query to predict.
          in: query
          name: query
          required: true
          type: string
        - description: Indicates whether to get extra metadata for the entities predictions or not.
          in: query
          name: verbose
          type: boolean
        - description: Indicates whether to return all the intents in the response or just the top intent.
          in: query
          name: show-all-intents
          type: boolean
        - description: Indicates whether to log the endpoint query or not.
          in: query
          name: log
          type: boolean
      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 Version Predictions From Endpoint Via Get request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{Subscription Key}"
            appId: "{Application Id}"
            query: forward to frank 30 dollars through HSBC
            versionId: "{Version Id}"
          responses:
            "200":
              body:
                prediction:
                  entities:
                    Bank:
                      - text: International Bank
                    Employees:
                      - - frank
                    money:
                      - units: Dollar
                        value: 30
                    number:
                      - 30
                  intents:
                    give:
                      score: 0.943442
                  sentiment:
                    label: positive
                    score: 0.9163064
                  topIntent: give
                query: forward to frank 30 dollars through HSBC
              headers: {}
    post:
      consumes:
        - application/json
      description: Gets the predictions for an application version.
      operationId: Prediction_GetVersionPrediction
      parameters:
        - description: The application ID.
          format: uuid
          in: path
          name: appId
          required: true
          type: string
        - description: The application version ID.
          in: path
          name: versionId
          required: true
          type: string
        - description: Indicates whether to get extra metadata for the entities predictions or not.
          in: query
          name: verbose
          type: boolean
        - description: Indicates whether to return all the intents in the response or just the top intent.
          in: query
          name: show-all-intents
          type: boolean
        - description: Indicates whether to log the endpoint query or not.
          in: query
          name: log
          type: boolean
        - description: The prediction request parameters.
          in: body
          name: predictionRequest
          required: true
          schema:
            $ref: "#/definitions/PredictionRequest"
      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 Version Predictions From Endpoint Via Post request:
          parameters:
            Endpoint: "{Endpoint}"
            Ocp-Apim-Subscription-Key: "{Subscription Key}"
            appId: "{Application Id}"
            predictionRequest:
              dynamicLists:
                - listEntityName: Employees
                  requestLists:
                    - canonicalForm: Frank
                      name: Management
                      synonyms: []
              externalEntities:
                - entityLength: 4
                  entityName: Bank
                  resolution:
                    text: International Bank
                  startIndex: 36
              options:
                datetimeReference: 2015-02-13T13:15:00.000Z
              query: forward to frank 30 dollars through HSBC
            versionId: "{Version Id}"
          responses:
            "200":
              body:
                prediction:
                  entities:
                    Bank:
                      - text: International Bank
                    Employees:
                      - - frank
                    money:
                      - units: Dollar
                        value: 30
                    number:
                      - 30
                  intents:
                    give:
                      score: 0.943442
                  sentiment:
                    label: positive
                    score: 0.9163064
                  topIntent: give
                query: forward to frank 30 dollars through HSBC
              headers: {}
definitions:
  DynamicList:
    description: Defines an extension for a list entity.
    properties:
      listEntityName:
        description: The name of the list entity to extend.
        type: string
      requestLists:
        description: The lists to append on the extended list entity.
        items:
          $ref: "#/definitions/RequestList"
        type: array
    required:
      - listEntityName
      - requestLists
    type: object
  Error:
    description: Represents the error that occurred.
    properties:
      error:
        $ref: "#/definitions/ErrorBody"
    required:
      - error
    type: object
  ErrorBody:
    description: Represents the definition of the error that occurred.
    properties:
      code:
        description: The error code.
        type: string
      message:
        description: The error message.
        type: string
    required:
      - code
      - message
    type: object
  ExternalEntity:
    description: Defines a user predicted entity that extends an already existing one.
    properties:
      entityLength:
        description: The length of the predicted entity.
        format: int32
        type: integer
      entityName:
        description: The name of the entity to extend.
        type: string
      resolution:
        description: A user supplied custom resolution to return as the entity's prediction.
      score:
        description: A user supplied score to return as the entity's prediction score.
        format: float
        type: number
      startIndex:
        description: The start character index of the predicted entity.
        format: int32
        type: integer
    required:
      - entityName
      - startIndex
      - entityLength
    type: object
  Intent:
    description: Represents an intent prediction.
    properties:
      childApp:
        $ref: "#/definitions/Prediction"
        description: The prediction of the dispatched application.
      score:
        description: The score of the fired intent.
        format: float
        type: number
    type: object
  Prediction:
    description: Represents the prediction of a query.
    properties:
      alteredQuery:
        description: The query after spell checking. Only set if spell check was enabled and a spelling mistake was found.
        type: string
      entities:
        additionalProperties: {}
        description: A dictionary representing the entities that fired.
        type: object
      intents:
        additionalProperties:
          $ref: "#/definitions/Intent"
        description: A dictionary representing the intents that fired.
        type: object
      sentiment:
        $ref: "#/definitions/Sentiment"
        description: The result of the sentiment analysis.
      topIntent:
        description: The name of the top scoring intent.
        type: string
    required:
      - topIntent
      - intents
      - entities
    type: object
  PredictionRequest:
    description: Represents the prediction request parameters.
    properties:
      dynamicLists:
        description: The dynamically created list entities for this request.
        items:
          $ref: "#/definitions/DynamicList"
        type: array
      externalEntities:
        description: The externally predicted entities for this request.
        items:
          $ref: "#/definitions/ExternalEntity"
        type: array
      options:
        $ref: "#/definitions/PredictionRequestOptions"
        description: The custom options defined for this request.
      query:
        description: The query to predict.
        type: string
    required:
      - query
    type: object
  PredictionRequestOptions:
    description: The custom options for the prediction request.
    properties:
      datetimeReference:
        description: The reference DateTime used for predicting datetime entities.
        format: date-time
        type: string
      preferExternalEntities:
        description: Whether to make the external entities resolution override the predictions if an overlap occurs.
        type: boolean
    type: object
  PredictionResponse:
    description: Represents the prediction response.
    properties:
      prediction:
        $ref: "#/definitions/Prediction"
        description: The prediction of the requested query.
      query:
        description: The query used in the prediction.
        type: string
    required:
      - query
      - prediction
    type: object
  RequestList:
    description: Defines a sub-list to append to an existing list entity.
    properties:
      canonicalForm:
        description: The canonical form of the sub-list.
        type: string
      name:
        description: The name of the sub-list.
        type: string
      synonyms:
        description: The synonyms of the canonical form.
        items:
          type: string
        type: array
    required:
      - canonicalForm
    type: object
  Sentiment:
    description: The result of the sentiment analysis.
    properties:
      label:
        description: The label of the sentiment analysis result.
        type: string
      score:
        description: The sentiment score of the query.
        format: float
        type: number
    required:
      - score
    type: object
x-ms-parameterized-host:
  hostTemplate: "{Endpoint}/luis/prediction/v3.0"
  parameters:
    - $ref: "#/parameters/Endpoint"
  useSchemePrefix: false
