Skip to content

Commit

Permalink
[AutoPR] cognitiveservices/data-plane/LUIS/Runtime (Azure#1017)
Browse files Browse the repository at this point in the history
* Generated from 59e0c9edb7b7859abb45c76c118343b7998eb5c0 (Azure#1001)

Add dispatch child to LUIS Runtime response

* Regenerate @azure/cognitiveservices-luis-runtime package

* Regenerate @azure/cognitiveservices-luis-runtime package
  • Loading branch information
AutorestCI authored and kpajdzik committed Feb 8, 2019
1 parent 7b78b3a commit de1cbe9
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 115 deletions.
2 changes: 1 addition & 1 deletion packages/@azure/cognitiveservices-luis-runtime/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
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
Expand Down
8 changes: 4 additions & 4 deletions packages/@azure/cognitiveservices-luis-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for LUISRuntimeClient.

### How to Install

```
```bash
npm install @azure/cognitiveservices-luis-runtime
```

Expand All @@ -19,13 +19,13 @@ npm install @azure/cognitiveservices-luis-runtime

##### Install @azure/ms-rest-nodeauth

```
```bash
npm install @azure/ms-rest-nodeauth
```

##### Sample code

```ts
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { LUISRuntimeClient, LUISRuntimeModels, LUISRuntimeMappers } from "@azure/cognitiveservices-luis-runtime";
Expand Down Expand Up @@ -54,7 +54,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {

##### Install @azure/ms-rest-browserauth

```
```bash
npm install @azure/ms-rest-browserauth
```

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-runtime";
const packageVersion = "0.1.0";
const packageVersion = "1.2.0";

export class LUISRuntimeClientContext extends msRest.ServiceClient {
endpoint: string;
Expand Down
116 changes: 34 additions & 82 deletions packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,238 +1,189 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as msRest from "@azure/ms-rest-js";

import * as msRest from "@azure/ms-rest-js";

/**
* @interface
* An interface representing IntentModel.
* An intent detected from the utterance.
*
*/
export interface IntentModel {
/**
* @member {string} [intent] Name of the intent, as defined in LUIS.
* Name of the intent, as defined in LUIS.
*/
intent?: string;
/**
* @member {number} [score] Associated prediction score for the intent
* (float).
* Associated prediction score for the intent (float).
*/
score?: number;
}

/**
* @interface
* An interface representing EntityModel.
* An entity extracted from the utterance.
*
*/
export interface EntityModel {
/**
* @member {string} entity Name of the entity, as defined in LUIS.
* Name of the entity, as defined in LUIS.
*/
entity: string;
/**
* @member {string} type Type of the entity, as defined in LUIS.
* Type of the entity, as defined in LUIS.
*/
type: string;
/**
* @member {number} startIndex The position of the first character of the
* matched entity within the utterance.
* The position of the first character of the matched entity within the utterance.
*/
startIndex: number;
/**
* @member {number} endIndex The position of the last character of the
* matched entity within the utterance.
* The position of the last character of the matched entity within the utterance.
*/
endIndex: number;
/**
* @property Describes unknown properties. The value of an unknown property
* can be of "any" type.
* Describes unknown properties. The value of an unknown property can be of "any" type.
*/
[property: string]: any;
}

/**
* @interface
* An interface representing CompositeChildModel.
* Child entity in a LUIS Composite Entity.
*
*/
export interface CompositeChildModel {
/**
* @member {string} type Type of child entity.
* Type of child entity.
*/
type: string;
/**
* @member {string} value Value extracted by LUIS.
* Value extracted by LUIS.
*/
value: string;
}

/**
* @interface
* An interface representing CompositeEntityModel.
* LUIS Composite Entity.
*
*/
export interface CompositeEntityModel {
/**
* @member {string} parentType Type/name of parent entity.
* Type/name of parent entity.
*/
parentType: string;
/**
* @member {string} value Value for composite entity extracted by LUIS.
* Value for composite entity extracted by LUIS.
*/
value: string;
/**
* @member {CompositeChildModel[]} children Child entities.
* Child entities.
*/
children: CompositeChildModel[];
}

/**
* @interface
* An interface representing Sentiment.
* Sentiment of the input utterance.
*
*/
export interface Sentiment {
/**
* @member {string} [label] The polarity of the sentiment, can be positive,
* neutral or negative.
* The polarity of the sentiment, can be positive, neutral or negative.
*/
label?: string;
/**
* @member {number} [score] Score of the sentiment, ranges from 0 (most
* negative) to 1 (most positive).
* Score of the sentiment, ranges from 0 (most negative) to 1 (most positive).
*/
score?: number;
}

/**
* @interface
* An interface representing LuisResult.
* Prediction, based on the input query, containing intent(s) and entities.
*
*/
export interface LuisResult {
/**
* @member {string} [query] The input utterance that was analized.
* The input utterance that was analyzed.
*/
query?: string;
/**
* @member {string} [alteredQuery] The corrected utterance (when spell
* checking was enabled).
* The corrected utterance (when spell checking was enabled).
*/
alteredQuery?: string;
/**
* @member {IntentModel} [topScoringIntent]
*/
topScoringIntent?: IntentModel;
/**
* @member {IntentModel[]} [intents] All the intents (and their score) that
* were detected from utterance.
* All the intents (and their score) that were detected from utterance.
*/
intents?: IntentModel[];
/**
* @member {EntityModel[]} [entities] The entities extracted from the
* utterance.
* The entities extracted from the utterance.
*/
entities?: EntityModel[];
/**
* @member {CompositeEntityModel[]} [compositeEntities] The composite
* entities extracted from the utterance.
* The composite entities extracted from the utterance.
*/
compositeEntities?: CompositeEntityModel[];
/**
* @member {Sentiment} [sentimentAnalysis]
*/
sentimentAnalysis?: Sentiment;
connectedServiceResult?: LuisResult;
}

/**
* @interface
* An interface representing EntityWithScore.
* @extends EntityModel
*/
export interface EntityWithScore extends EntityModel {
/**
* @member {number} score Associated prediction score for the intent (float).
* Associated prediction score for the intent (float).
*/
score: number;
}

/**
* @interface
* An interface representing EntityWithResolution.
* @extends EntityModel
*/
export interface EntityWithResolution extends EntityModel {
/**
* @member {any} resolution Resolution values for pre-built LUIS entities.
* Resolution values for pre-built LUIS entities.
*/
resolution: any;
}

/**
* @interface
* An interface representing APIError.
* Error information returned by the API
*
*/
export interface APIError {
/**
* @member {string} [statusCode] HTTP Status code
* HTTP Status code
*/
statusCode?: string;
/**
* @member {string} [message] Cause of the error.
* Cause of the error.
*/
message?: string;
}

/**
* @interface
* An interface representing PredictionResolveOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface PredictionResolveOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {number} [timezoneOffset] The timezone offset for the location of
* the request.
* The timezone offset for the location of the request.
*/
timezoneOffset?: number;
/**
* @member {boolean} [verbose] If true, return all intents instead of just
* the top scoring intent.
* If true, return all intents instead of just the top scoring intent.
*/
verbose?: boolean;
/**
* @member {boolean} [staging] Use the staging endpoint slot.
* Use the staging endpoint slot.
*/
staging?: boolean;
/**
* @member {boolean} [spellCheck] Enable spell checking.
* Enable spell checking.
*/
spellCheck?: boolean;
/**
* @member {string} [bingSpellCheckSubscriptionKey] The subscription key to
* use when enabling bing spell check
* The subscription key to use when enabling bing spell check
*/
bingSpellCheckSubscriptionKey?: string;
/**
* @member {boolean} [log] Log query (default is true)
* Log query (default is true)
*/
log?: boolean;
}
Expand All @@ -249,6 +200,7 @@ export type PredictionResolveResponse = LuisResult & {
* The response body as text (string format)
*/
bodyAsText: string;

/**
* The response body as parsed JSON or XML
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
Expand Down Expand Up @@ -235,6 +233,13 @@ export const LuisResult: msRest.CompositeMapper = {
name: "Composite",
className: "Sentiment"
}
},
connectedServiceResult: {
serializedName: "connectedServiceResult",
type: {
name: "Composite",
className: "LuisResult"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
LuisResult,
IntentModel,
EntityModel,
CompositeEntityModel,
CompositeChildModel,
Sentiment,
APIError,
CompositeChildModel,
CompositeEntityModel,
EntityModel,
EntityWithResolution,
EntityWithScore,
EntityWithResolution
IntentModel,
LuisResult,
Sentiment
} from "../models/mappers";

Loading

0 comments on commit de1cbe9

Please sign in to comment.