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

[AutoPR cognitiveservices/data-plane/LUIS/Authoring/cognitiveservices/data-plane/LUIS/Runtime] Luis swagger fixes #4953

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 5 additions & 7 deletions lib/services/luis/authoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ uid: azure-cognitiveservices-luis-authoring
summary: *content

---
**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://www.npmjs.com/package/@azure/cognitiveservices-luis-authoring) which works on Node.js and browsers.**
**See https://aka.ms/azure-sdk-for-js-migration to learn more.**
**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 - LUISAuthoringClient

This project provides a Node.js package for accessing Azure. Right now it supports:
Expand All @@ -21,7 +20,7 @@ npm install azure-cognitiveservices-luis-authoring

### How to use

#### Authentication, client creation, and listPhraseLists features as an example.
#### Authentication, client creation, and listApplicationVersionPatternFeatures features as an example.

```javascript
const msRest = require("ms-rest");
Expand All @@ -30,12 +29,14 @@ const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
const client = new LUISAuthoringClient(creds, subscriptionId);
const azureRegion = "westus";
const azureCloud = "com";
const appId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a;
const versionId = "testversionId";
const skip = 1;
const take = 1;

client.features.listPhraseLists(appId, versionId, skip, take).then((result) => {
client.features.listApplicationVersionPatternFeatures(azureRegion, azureCloud, appId, versionId, skip, take).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -47,6 +48,3 @@ client.features.listPhraseLists(appId, versionId, skip, take).then((result) => {
### Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2Fluis%2Fauthoring%2FREADME.png)
6 changes: 1 addition & 5 deletions lib/services/luis/authoring/lib/lUISAuthoringClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export default class LUISAuthoringClient extends ServiceClient {
*
* @param {credentials} credentials - Subscription credentials which uniquely identify client subscription.
*
* @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
*
* @param {object} [options] - The parameter options
*
* @param {Array} [options.filters] - Filters to be added to the request pipeline
Expand All @@ -32,12 +30,10 @@ export default class LUISAuthoringClient extends ServiceClient {
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
*
*/
constructor(credentials: ServiceClientCredentials, endpoint: string, options?: ServiceClientOptions);
constructor(credentials: ServiceClientCredentials, options?: ServiceClientOptions);

credentials: ServiceClientCredentials;

endpoint: string;

// Operation groups
features: operations.Features;
examples: operations.Examples;
Expand Down
9 changes: 2 additions & 7 deletions lib/services/luis/authoring/lib/lUISAuthoringClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,23 @@ class LUISAuthoringClient extends ServiceClient {
/**
* Create a LUISAuthoringClient.
* @param {credentials} credentials - Subscription credentials which uniquely identify client subscription.
* @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
* @param {object} [options] - The parameter options
* @param {Array} [options.filters] - Filters to be added to the request pipeline
* @param {object} [options.requestOptions] - Options for the underlying request object
* {@link https://github.com/request/request#requestoptions-callback Options doc}
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
*/
constructor(credentials, endpoint, options) {
constructor(credentials, options) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (endpoint === null || endpoint === undefined) {
throw new Error('\'endpoint\' cannot be null.');
}

if (!options) options = {};

super(credentials, options);

this.baseUri = '{Endpoint}/luis/api/v2.0';
this.baseUri = 'http://{AzureRegion}.api.cognitive.microsoft.{AzureCloud}/luis/api/v2.0';
this.credentials = credentials;
this.endpoint = endpoint;

let packageInfo = this.getPackageJsonInfo(__dirname);
this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ class ApplicationInfoResponse {
* @property {uuid} [id] The ID (GUID) of the application.
* @property {string} [name] The name of the application.
* @property {string} [description] The description of the application.
* @property {string} [culture] The culture of the application. E.g.: en-us.
* @property {string} [culture] The culture of the application. For example,
* "en-us".
* @property {string} [usageScenario] Defines the scenario for the new
* application. Optional. E.g.: IoT.
* application. Optional. For example, IoT.
* @property {string} [domain] The domain for the new application. Optional.
* E.g.: Comics.
* For example, Comics.
* @property {number} [versionsCount] Amount of model versions within the
* application.
* @property {string} [createdDateTime] The version's creation timestamp.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
class ApplicationSettingUpdateObject {
/**
* Create a ApplicationSettingUpdateObject.
* @property {boolean} [publicProperty] Setting your application as public
* allows other people to use your application's endpoint using their own
* keys.
* @property {boolean} [isPublic] Setting your application as public allows
* other people to use your application's endpoint using their own keys.
*/
constructor() {
}
Expand All @@ -38,7 +37,7 @@ class ApplicationSettingUpdateObject {
name: 'Composite',
className: 'ApplicationSettingUpdateObject',
modelProperties: {
publicProperty: {
isPublic: {
required: false,
nullable: false,
serializedName: 'public',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ApplicationSettings {
* Create a ApplicationSettings.
* @property {uuid} id The application ID.
* @property {boolean} isPublic Setting your application as public allows
* other people to use your application's endpoint using their own keys.
* other people to use your application's endpoint using their own keys for
* billing purposes.
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
'use strict';

/**
* Defines the azure account information object.
* Defines the Azure account information object.
*
*/
class AzureAccountInfoObject {
/**
* Create a AzureAccountInfoObject.
* @property {string} azureSubscriptionId The id for the azure subscription.
* @property {string} resourceGroup The azure resource group name.
* @property {string} accountName The azure account name.
* @property {string} azureSubscriptionId The id for the Azure subscription.
* @property {string} resourceGroup The Azure resource group name.
* @property {string} accountName The Azure account name.
*/
constructor() {
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/luis/authoring/lib/models/batchLabelExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
'use strict';

/**
* Response when adding a batch of labeled examples.
* Response when adding a batch of labeled example utterances.
*
*/
class BatchLabelExample {
/**
* Create a BatchLabelExample.
* @property {object} [value]
* @property {string} [value.utteranceText] The sample's utterance.
* @property {string} [value.utteranceText] The example utterance.
* @property {number} [value.exampleId] The newly created sample ID.
* @property {boolean} [hasError]
* @property {object} [error]
Expand Down
6 changes: 3 additions & 3 deletions lib/services/luis/authoring/lib/models/closedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
'use strict';

/**
* Exported Model - A Closed List.
* Exported Model - A list entity.
*
*/
class ClosedList {
/**
* Create a ClosedList.
* @property {string} [name] Name of the closed list feature.
* @property {array} [subLists] Sublists for the feature.
* @property {string} [name] Name of the list entity.
* @property {array} [subLists] Sublists for the list entity.
* @property {array} [roles]
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* Closed List Entity Extractor.
* List Entity Extractor.
*
*/
class ClosedListEntityExtractor {
Expand All @@ -22,11 +22,11 @@ class ClosedListEntityExtractor {
* @property {number} [typeId] The type ID of the Entity Model.
* @property {string} readableType Possible values include: 'Entity
* Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity
* Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor',
* Extractor', 'Composite Entity Extractor', 'List Entity Extractor',
* 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity
* Extractor', 'Regex Entity Extractor'
* Extractor', 'Regular Expression Entity Extractor'
* @property {array} [roles]
* @property {array} [subLists] List of sub-lists.
* @property {array} [subLists] List of sublists.
*/
constructor() {
}
Expand All @@ -40,7 +40,7 @@ class ClosedListEntityExtractor {
mapper() {
return {
required: false,
serializedName: 'Closed List Entity Extractor',
serializedName: 'List Entity Extractor',
type: {
name: 'Composite',
className: 'ClosedListEntityExtractor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
'use strict';

/**
* Object model for creating a closed list.
* Object model for creating a list entity.
*
*/
class ClosedListModelCreateObject {
/**
* Create a ClosedListModelCreateObject.
* @property {array} [subLists] Sublists for the feature.
* @property {string} [name] Name of the closed list feature.
* @property {string} [name] Name of the list entity.
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* Object model for adding a batch of sublists to an existing closedlist.
* Object model for adding a batch of sublists to an existing list entity.
*
*/
class ClosedListModelPatchObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
'use strict';

/**
* Object model for updating a closed list.
* Object model for updating a list entity.
*
*/
class ClosedListModelUpdateObject {
/**
* Create a ClosedListModelUpdateObject.
* @property {array} [subLists] The new sublists for the feature.
* @property {string} [name] The new name of the closed list feature.
* @property {string} [name] The new name of the list entity.
*/
constructor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class CompositeEntityExtractor {
* @property {number} [typeId] The type ID of the Entity Model.
* @property {string} readableType Possible values include: 'Entity
* Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity
* Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor',
* Extractor', 'Composite Entity Extractor', 'List Entity Extractor',
* 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity
* Extractor', 'Regex Entity Extractor'
* Extractor', 'Regular Expression Entity Extractor'
* @property {array} [roles]
* @property {array} [children] List of child entities.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* A composite entity.
* A composite entity extractor.
*
*/
class CompositeEntityModel {
Expand Down
4 changes: 2 additions & 2 deletions lib/services/luis/authoring/lib/models/customPrebuiltModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class CustomPrebuiltModel {
* @property {number} [typeId] The type ID of the Entity Model.
* @property {string} readableType Possible values include: 'Entity
* Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity
* Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor',
* Extractor', 'Composite Entity Extractor', 'List Entity Extractor',
* 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity
* Extractor', 'Regex Entity Extractor'
* Extractor', 'Regular Expression Entity Extractor'
* @property {string} [customPrebuiltDomainName] The domain name.
* @property {string} [customPrebuiltModelName] The intent name or entity
* name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class EntitiesSuggestionExample {
/**
* Create a EntitiesSuggestionExample.
* @property {string} [text] The utterance. E.g.: what's the weather like in
* seattle?
* @property {string} [text] The utterance. For example, "What's the weather
* like in seattle?"
* @property {array} [tokenizedText] The utterance tokenized.
* @property {array} [intentPredictions] Predicted/suggested intents.
* @property {array} [entityPredictions] Predicted/suggested entities.
Expand Down
4 changes: 2 additions & 2 deletions lib/services/luis/authoring/lib/models/entityExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class EntityExtractor {
* @property {number} [typeId] The type ID of the Entity Model.
* @property {string} readableType Possible values include: 'Entity
* Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity
* Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor',
* Extractor', 'Composite Entity Extractor', 'List Entity Extractor',
* 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity
* Extractor', 'Regex Entity Extractor'
* Extractor', 'Regular Expression Entity Extractor'
* @property {array} [roles]
* @property {string} [customPrebuiltDomainName] The domain name.
* @property {string} [customPrebuiltModelName] The intent name or entity
Expand Down
8 changes: 4 additions & 4 deletions lib/services/luis/authoring/lib/models/exampleLabelObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
'use strict';

/**
* A labeled example.
* A labeled example utterance.
*
*/
class ExampleLabelObject {
/**
* Create a ExampleLabelObject.
* @property {string} [text] The sample's utterance.
* @property {string} [text] The example utterance.
* @property {array} [entityLabels] The identified entities within the
* utterance.
* example utterance.
* @property {string} [intentName] The identified intent representing the
* utterance.
* example utterance.
*/
constructor() {
}
Expand Down
2 changes: 1 addition & 1 deletion lib/services/luis/authoring/lib/models/explicitListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* Explicit list item
* Explicit (exception) list item
*
*/
class ExplicitListItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* Object model for creating an explicit list item.
* Object model for creating an explicit (exception) list item.
*
*/
class ExplicitListItemCreateObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

/**
* Model object for updating an explicit list item.
* Model object for updating an explicit (exception) list item.
*
*/
class ExplicitListItemUpdateObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class HierarchicalChildEntity extends models['ChildEntity'] {
* @property {number} [typeId] The type ID of the Entity Model.
* @property {string} [readableType] Possible values include: 'Entity
* Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity
* Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor',
* Extractor', 'Composite Entity Extractor', 'List Entity Extractor',
* 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity
* Extractor', 'Regex Entity Extractor'
* Extractor', 'Regular Expression Entity Extractor'
*/
constructor() {
super();
Expand Down
Loading