Skip to content
Open
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
Expand Up @@ -2,7 +2,7 @@
"name": "@azure/cognitiveservices-luis-authoring",
"author": "Microsoft Corporation",
"description": "LUISAuthoringClient Library with typescript type definitions for node.js and browser.",
"version": "4.0.0-preview.2",
"version": "4.0.0-preview.3",
"dependencies": {
"@azure/ms-rest-js": "^2.0.4",
"tslib": "^1.10.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import * as msRest from "@azure/ms-rest-js";

const packageName = "@azure/cognitiveservices-luis-authoring";
const packageVersion = "4.0.0-preview.2";
const packageVersion = "4.0.0-preview.3";

export class LUISAuthoringClientContext extends msRest.ServiceClient {
endpoint: string;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ describe("Import Tests", () => {
usageScenario: "IoT"
});
let app = JSON.parse(data);
const newVersion = await client.versions.importV2App(importV2Version.body, app, { appName: "Test Import V2 Version LUIS App" });
var newVersionApp = await client.apps.get(newVersion.body);
const newVersion = await client.versions.importV2App(importV2Version.body, app);
var newVersionApp = await client.apps.get(importV2Version.body);

chai.expect(newVersionApp).to.exist;
chai.expect(newVersionApp.versionsCount).equal(2);

await delay(1000);
var deleteRespose = await client.apps.deleteMethod(importV2Version.body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BaseTest } from "../baseTest";
import { LUISAuthoringClient } from "../../src/lUISAuthoringClient";
import { AppsAddResponse } from "../../src/models";

const trainedAppID = "4a696805-d784-4040-a0ba-043cc831b779";
const trainedAppID = BaseTest.GlobalAppId;
let testingApp: AppsAddResponse;

describe("Apps Module Functionality Tests", () => {
Expand Down Expand Up @@ -272,7 +272,7 @@ describe("Apps Module Functionality Tests", () => {
await BaseTest.useClientFor(async (client: LUISAuthoringClient) => {
let resultsUS = await client.apps.listAvailableCustomPrebuiltDomainsForCulture("en-us");
let resultsCN = await client.apps.listAvailableCustomPrebuiltDomainsForCulture("zh-cn");

for (let resultUS of resultsUS) {
chai.expect(BaseTest.doesListContain(resultsCN, "description", resultUS.description)).to.be.false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,50 @@ describe("Example Module Functionality Tests", () => {
});
});

it("should add example with nested children", async () => {
await BaseTest.useClientFor(async (client: LUISAuthoringClient) => {
const appId = await client.apps.add({
name: "Examples Test App",
description: "New LUIS App",
culture: "en-us",
domain: "Comics",
usageScenario: "IoT"
});
await client.model.addIntent(appId.body, "0.1", { name: "WeatherInPlace" });
await client.model.addEntity(appId.body, "0.1", {
name: "Place",
children:[{
name: "City"
},
{
name: "Country"
}
]});
let example = {
text: "whats the weather in buenos aires, argentina?",
intentName: "WeatherInPlace",
entityLabels: [{
entityName: "Place",
startCharIndex: 21,
endCharIndex: 43,
children: [{
entityName: "City",
startCharIndex: 21,
endCharIndex: 32
},
{
entityName: "Country",
startCharIndex: 35,
endCharIndex: 43
}]
}]
};
const result = await client.examples.add(appId.body, "0.1", example, {enableNestedChildren: true});
await client.apps.deleteMethod(appId.body);
chai.expect(result.utteranceText).to.eql(example.text)
});
});

it("should add examples in batch", async () => {
await BaseTest.useClientFor(async (client: LUISAuthoringClient) => {
const appId = await client.apps.add({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,22 @@ describe("Features Module Functionality", () => {
var versionId = "0.2";
var features = await client.features.list(appId.body, versionId);
await client.apps.deleteMethod(appId.body);
chai.expect(features.patternFeatures.length > 0).to.be.true;
chai.expect(features.phraselistFeatures.length > 0).to.be.true;
});
});
});

it('should add required feature', async () => {
await BaseTest.useClientFor(async (client: LUISAuthoringClient) => {
var entityId = await client.model.addEntity(BaseTest.GlobalAppId, BaseTest.GlobalVersionId, {name: "flat entity"});
var featureEntityId = await client.model.addEntity(BaseTest.GlobalAppId, BaseTest.GlobalVersionId, {name: "feature entity"});
client.features.addEntityFeature(BaseTest.GlobalAppId, BaseTest.GlobalVersionId, entityId.body, {
modelName: "feature entity",
isRequired: true
})
var features = await client.features.list(BaseTest.GlobalAppId, BaseTest.GlobalVersionId);
await client.model.deleteEntity(BaseTest.GlobalAppId, BaseTest.GlobalVersionId, entityId.body);
await client.model.deleteEntity(BaseTest.GlobalAppId, BaseTest.GlobalVersionId, featureEntityId.body);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Import Tests", () => {
if (err) {
throw err;
}
let importLuApplication = await client.apps.importLuFromat(app);
let importLuApplication = await client.apps.importLuFormat(app);
var testApp = await client.apps.get(importLuApplication.body);

chai.expect(testApp).to.exist;
Expand Down
Loading