แก้ไข

แชร์ผ่าน


SDK, REST, and CLI developer resources for Language Understanding (LUIS)

Important

LUIS will be retired on October 1st 2025 and starting April 1st 2023 you will not be able to create new LUIS resources. We recommend migrating your LUIS applications to conversational language understanding to benefit from continued product support and multilingual capabilities.

SDKs, REST APIs, CLI, help you develop Language Understanding (LUIS) apps in your programming language. Manage your Azure resources and LUIS predictions.

Azure resource management

Use the Azure AI services management layer to create, edit, list, and delete the Language Understanding or Azure AI services resource.

Find reference documentation based on the tool:

Language Understanding authoring and prediction requests

The Language Understanding service is accessed from an Azure resource you need to create. There are two resources:

  • Use the authoring resource for training to create, edit, train, and publish.
  • Use the prediction for runtime to send user's text and receive a prediction.

Use Azure AI services sample code to learn and use the most common tasks.

REST specifications

The LUIS REST specifications, along with all Azure REST specifications, are publicly available on GitHub.

REST APIs

Both authoring and prediction endpoint APIS are available from REST APIs:

Type Version
Authoring V2
preview V3
Prediction V2
V3

REST Endpoints

LUIS currently has 2 types of endpoints:

  • authoring on the training endpoint
  • query prediction on the runtime endpoint.
Purpose URL
V2 Authoring on training endpoint https://{your-resource-name}.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appID}/
V3 Authoring on training endpoint https://{your-resource-name}.api.cognitive.microsoft.com/luis/authoring/v3.0-preview/apps/{appID}/
V2 Prediction - all predictions on runtime endpoint https://{your-resource-name}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q={q}[&timezoneOffset][&verbose][&spellCheck][&staging][&bing-spell-check-subscription-key][&log]
V3 Prediction - versions prediction on runtime endpoint https://{your-resource-name}.api.cognitive.microsoft.com/luis/prediction/v3.0/apps/{appId}/versions/{versionId}/predict?query={query}[&verbose][&log][&show-all-intents]
V3 Prediction - slot prediction on runtime endpoint https://{your-resource-name}.api.cognitive.microsoft.com/luis/prediction/v3.0/apps/{appId}/slots/{slotName}/predict?query={query}[&verbose][&log][&show-all-intents]

The following table explains the parameters, denoted with curly braces {}, in the previous table.

Parameter Purpose
your-resource-name Azure resource name
q or query utterance text sent from client application such as chat bot
version 10 character version name
slot production or staging

REST query string parameters

V3 API query string parameters include:

Query parameter LUIS portal name Type Version Default Purpose
log Save logs boolean V2 & V3 false Store query in log file. Default value is false.
query - string V3 only No default - it is required in the GET request In V2, the utterance to be predicted is in the q parameter.

In V3, the functionality is passed in the query parameter.
show-all-intents Include scores for all intents boolean V3 only false Return all intents with the corresponding score in the prediction.intents object. Intents are returned as objects in a parent intents object. This allows programmatic access without needing to find the intent in an array: prediction.intents.give. In V2, these were returned in an array.
verbose Include more entities details boolean V2 & V3 false In V2, when set to true, all predicted intents were returned. If you need all predicted intents, use the V3 param of show-all-intents.

In V3, this parameter only provides entity metadata details of entity prediction.
timezoneOffset - string V2 - Timezone applied to datetimeV2 entities.
datetimeReference - string V3 - Timezone applied to datetimeV2 entities. Replaces timezoneOffset from V2.

App schema

The app schema is imported and exported in a .json or .lu format.

Language-based SDKs

Language Reference documentation Package Quickstarts
C# Authoring
Prediction
NuGet authoring
NuGet prediction
Authoring
Query prediction
Go Authoring and prediction SDK
Java Authoring and prediction Maven authoring
Maven prediction
JavaScript Authoring
Prediction
NPM authoring
NPM prediction
Authoring
Prediction
Python Authoring and prediction Pip Authoring
Prediction

Containers

Language Understanding (LUIS) provides a container to provide on-premises and contained versions of your app.

Export and import formats

Language Understanding provides the ability to manage your app and its models in a JSON format, the .LU (LUDown) format, and a compressed package for the Language Understanding container.

Importing and exporting these formats is available from the APIs and from the LUIS portal. The portal provides import and export as part of the Apps list and Versions list.

Workshops

Continuous integration tools

Bot Framework tools

The bot framework is available as an SDK in a variety of languages and as a service using Azure AI Bot Service.

Bot framework provides several tools to help with Language Understanding, including:

  • Bot Framework emulator - a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK
  • Bot Framework Composer - an integrated development tool for developers and multi-disciplinary teams to build bots and conversational experiences with the Microsoft Bot Framework
  • Bot Framework Samples - in #C, JavaScript, TypeScript, and Python

Next steps