Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Generated from 59e0c9edb7b7859abb45c76c118343b7998eb5c0 (#4594)
Browse files Browse the repository at this point in the history
Add dispatch child to LUIS Runtime response
  • Loading branch information
AutorestCI authored Jan 29, 2019
1 parent 51b83fc commit 17efb39
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 75 deletions.
42 changes: 21 additions & 21 deletions lib/services/luis/runtime/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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.
104 changes: 52 additions & 52 deletions lib/services/luis/runtime/README.md
Original file line number Diff line number Diff line change
@@ -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 = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
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 = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
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)
3 changes: 2 additions & 1 deletion lib/services/luis/runtime/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export interface Sentiment {
*/
export interface LuisResult {
/**
* The input utterance that was analized.
* The input utterance that was analyzed.
*/
query?: string;
/**
Expand All @@ -120,6 +120,7 @@ export interface LuisResult {
*/
compositeEntities?: CompositeEntityModel[];
sentimentAnalysis?: Sentiment;
connectedServiceResult?: LuisResult;
}

export interface EntityWithScore extends EntityModel {
Expand Down
11 changes: 10 additions & 1 deletion lib/services/luis/runtime/lib/models/luisResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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() {
}
Expand Down Expand Up @@ -139,6 +140,14 @@ class LuisResult {
name: 'Composite',
className: 'Sentiment'
}
},
connectedServiceResult: {
required: false,
serializedName: 'connectedServiceResult',
type: {
name: 'Composite',
className: 'LuisResult'
}
}
}
}
Expand Down

0 comments on commit 17efb39

Please sign in to comment.