diff --git a/lib/services/luis/runtime/LICENSE.txt b/lib/services/luis/runtime/LICENSE.txt index a70e8cf660..8f3d856145 100644 --- a/lib/services/luis/runtime/LICENSE.txt +++ b/lib/services/luis/runtime/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/luis/runtime/README.md b/lib/services/luis/runtime/README.md index 2473836229..74a0ef4da0 100644 --- a/lib/services/luis/runtime/README.md +++ b/lib/services/luis/runtime/README.md @@ -1,52 +1,52 @@ ---- -uid: azure-cognitiveservices-luis-runtime -summary: *content - ---- -**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** -## Microsoft Azure SDK for Node.js - LUISRuntimeClient - -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -### Features - - -### How to Install - -```bash -npm install azure-cognitiveservices-luis-runtime -``` - -### How to use - -#### Authentication, client creation, and resolve prediction as an example. - -```javascript -const msRest = require("ms-rest"); -const LUISRuntimeClient = require("azure-cognitiveservices-luis-runtime"); -const token = ""; -const creds = new msRest.TokenCredentials(token); -const subscriptionId = ""; -const client = new LUISRuntimeClient(creds, subscriptionId); -const appId = "testappId"; -const query = "testquery"; -const timezoneOffset = 1.01; -const verbose = true; -const staging = true; -const spellCheck = true; -const bingSpellCheckSubscriptionKey = "testbingSpellCheckSubscriptionKey"; -const log = true; - -client.prediction.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); -``` - -### Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-cognitiveservices-luis-runtime +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - LUISRuntimeClient + +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-cognitiveservices-luis-runtime +``` + +### How to use + +#### Authentication, client creation, and resolve prediction as an example. + +```javascript +const msRest = require("ms-rest"); +const LUISRuntimeClient = require("azure-cognitiveservices-luis-runtime"); +const token = ""; +const creds = new msRest.TokenCredentials(token); +const subscriptionId = ""; +const client = new LUISRuntimeClient(creds, subscriptionId); +const appId = "testappId"; +const query = "testquery"; +const timezoneOffset = 1.01; +const verbose = true; +const staging = true; +const spellCheck = true; +const bingSpellCheckSubscriptionKey = "testbingSpellCheckSubscriptionKey"; +const log = true; + +client.prediction.resolve(appId, query, timezoneOffset, verbose, staging, spellCheck, bingSpellCheckSubscriptionKey, log).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); +``` + +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/luis/runtime/lib/models/index.d.ts b/lib/services/luis/runtime/lib/models/index.d.ts index a306378c2a..a8f051d5b8 100644 --- a/lib/services/luis/runtime/lib/models/index.d.ts +++ b/lib/services/luis/runtime/lib/models/index.d.ts @@ -99,7 +99,7 @@ export interface Sentiment { */ export interface LuisResult { /** - * The input utterance that was analized. + * The input utterance that was analyzed. */ query?: string; /** @@ -120,6 +120,7 @@ export interface LuisResult { */ compositeEntities?: CompositeEntityModel[]; sentimentAnalysis?: Sentiment; + connectedServiceResult?: LuisResult; } export interface EntityWithScore extends EntityModel { diff --git a/lib/services/luis/runtime/lib/models/luisResult.js b/lib/services/luis/runtime/lib/models/luisResult.js index 0b0e9ae011..8010ddf7b3 100644 --- a/lib/services/luis/runtime/lib/models/luisResult.js +++ b/lib/services/luis/runtime/lib/models/luisResult.js @@ -17,7 +17,7 @@ class LuisResult { /** * Create a LuisResult. - * @property {string} [query] The input utterance that was analized. + * @property {string} [query] The input utterance that was analyzed. * @property {string} [alteredQuery] The corrected utterance (when spell * checking was enabled). * @property {object} [topScoringIntent] @@ -35,6 +35,7 @@ class LuisResult { * sentiment, can be positive, neutral or negative. * @property {number} [sentimentAnalysis.score] Score of the sentiment, * ranges from 0 (most negative) to 1 (most positive). + * @property {object} [connectedServiceResult] */ constructor() { } @@ -139,6 +140,14 @@ class LuisResult { name: 'Composite', className: 'Sentiment' } + }, + connectedServiceResult: { + required: false, + serializedName: 'connectedServiceResult', + type: { + name: 'Composite', + className: 'LuisResult' + } } } }