@azure/cognitiveservices-luis-authoring

中文文档
4.0.0-preview.3发布于 2020/05/20MITTypeScriptESM + CJS近 30 天下载 2747

LUISAuthoringClient Library with typescript type definitions for node.js and browser.

此软件包已被标记为弃用

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: https://learn.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/how-to/migrate-from-luis

原始使用文档
文档目录5 节
  1. An isomorphic javascript sdk for - LUISAuthoringClient
  2. Currently supported environments
  3. How to Install
  4. How to use
  5. Related projects

An isomorphic javascript sdk for - LUISAuthoringClient

This package contains an isomorphic SDK for LUISAuthoringClient.

Package versionLUIS Authoring API version
3.0.0/luis/api/v2.0
4.0.0-preview.3/luis/authoring/v3.0-preview

Currently supported environments

  • Node.js version 6.x.x or higher
  • Browser JavaScript

How to Install

npm install @azure/cognitiveservices-luis-authoring

How to use

nodejs - Authentication, client creation and listPhraseLists features as an example written in TypeScript.

Install @azure/ms-rest-azure-js
npm install @azure/ms-rest-azure-js
Sample code
import { CognitiveServicesCredentials } from "@azure/ms-rest-azure-js";
import { LUISAuthoringClient } from "@azure/cognitiveservices-luis-authoring";

let authoringKey = process.env["luis-authoring-key"];
const creds = new CognitiveServicesCredentials(authoringKey);

// check the following link to find your region
// https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-regions
const region = "<your-region>";
const client = new LUISAuthoringClient(
  creds,
  "https://" + region + ".api.cognitive.microsoft.com/"
);

const appId = "<your-app-id>"; // replace this with your appId.
const versionId = "0.1"; // replace with version of your luis application. Initial value will be 0.1

const skip = 1;
const take = 1;

client.features
  .listPhraseLists(appId, versionId, { skip, take })
  .then((result) => {
    console.log("The result is:");
    console.log(result);
  })
  .catch((err) => {
    console.error(err);
  });

browser - Authentication, client creation and listPhraseLists features as an example written in JavaScript.

Sample code
  • index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>@azure/cognitiveservices-luis-authoring sample</title>
    <script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
    <script src="node_modules/@azure/cognitiveservices-luis-authoring/dist/cognitiveservices-luis-authoring.js"></script>
    <script type="text/javascript">
      let authoringKey = process.env["luis-authoring-key"];
      const creds = new msRest.ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': authoringKey } });

      const region = "<your-region>";
      const client = new Azure.CognitiveservicesLuisAuthoring.LUISAuthoringClient(
        creds,
        "https://" + region + ".api.cognitive.microsoft.com/"
      );
      const appId = "<your-app-id>"; // replace this with your appId.
      const versionId = "0.1"; // replace with version of your luis application. Initial value will be 0.1
      const skip = 1;
      const take = 1;
      client.features
        .listPhraseLists(appId, versionId, { skip, take })
        .then((result) => {
          console.log("The result is:");
          console.log(result);
        })
        .catch((err) => {
          console.log("An error occurred:");
          console.error(err);
        });
    </script>
  </head>
  <body></body>
</html>

Impressions

版本与发布记录

@azure/cognitiveservices-luis-authoring 共发布 9 个版本,首次发布于 2018/11/15;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.0.0-preview.3latest2020/05/206 年前
4.0.0-preview.22020/04/146 年前
4.0.0-preview.12019/11/086 年前
3.0.12019/08/297 年前
3.0.02019/08/267 年前
2.1.02019/02/167 年前

关于 @azure/cognitiveservices-luis-authoring 的常见问题

@azure/cognitiveservices-luis-authoring 是什么?

LUISAuthoringClient Library with typescript type definitions for node.js and browser.注意:该包已被作者标记为弃用——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: https://learn.microsoft.com/azure/cognitive-services/language-service/conversational-language-understanding/how-to/migrate-from-luis

如何安装 @azure/cognitiveservices-luis-authoring?

在项目目录运行 npm install @azure/cognitiveservices-luis-authoring,或使用 pnpm add / yarn add / bun add。

@azure/cognitiveservices-luis-authoring 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@azure/cognitiveservices-luis-authoring 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@azure/cognitiveservices-luis-authoring 可以商用吗?

@azure/cognitiveservices-luis-authoring 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@azure/cognitiveservices-luis-authoring 的下载量有多少?

根据 npm 官方下载统计,@azure/cognitiveservices-luis-authoring 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,747 次,日均约 92 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@azure/cognitiveservices-luis-authoring 还在维护吗?

最新版本 4.0.0-preview.3 发布于 2020/05/20(6 年前);至今共发布 9 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/11/15。作者已将其标记为弃用,新项目建议寻找替代方案。