2.6.2 • Published 5 years ago

luis-apis-mooncake v2.6.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

LUIS

this is not official version.but it can support deploy luis to mooncacke.

npm version

The LUIS APIs tool allows communication with the LUIS endpoints via command line. You can also use this as a node module via an import.

Any endpoint listed in the documentation for the LUIS Programmatic APIs v2.0 is available using the CLI.

Language Understanding (LUIS.ai) allows your application to understand what a person wants in their own words. LUIS uses machine learning to allow developers to build applications that can receive user input in natural language and extract meaning from it.

Installation

Make sure you have Node.js >=8.5 and npm installed on your machine, then use:

npm install -g luis-apis

Configuration

A configuration object is required to provide the endpoint base path, app ID, version ID and the authoring key to each outbound call. There are 3 ways to provide this information to the CLI: 1. As a .luisrc file in the cwd. The json format for the .luisrc file is:

{
  "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "authoringKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "versionId": "x.x.xx",
  "region": "xxxxxxx"
}

The CLI has a utility command that walks through the creation of this file: luis init, or it can be created manually.

  1. As arguments to the CLI: luis <verb> <resource> --appId <string> --versionId <string> --authoringKey <string> --region <string>

  2. As environment variables: LUIS_APP_ID, LUIS_VERSION_ID, LUIS_AUTHORING_KEY, LUIS_REGION

You need a LUIS account to get an authoring key. Refer to Keys in LUIS for more information. If you have already built a LUIS application and would like to work on it using the LUIS CLI, you can determine the appId, versionId by following instructions in this Readme. See Publishing regions for help with authoring regions.

The CLI will first look for these named configuration variables in the arguments list, then inside the .luisrc file, then fallback to the environment variables.

Securing Your Access Key

To better secure your access key, it's recommended to omit the key from the .luisrc file and instead pass it in with the --authoringKey argument or store it as the LUIS_AUTHORING_KEY environment variable. If security is not a concern for your particular case, all configuration items can be stored in the .luisrc for convenience.

Overriding Configurations

Since configuration items can be passed as arguments to the cli, using arguments to specify the configuration will override the .luisrc and any environment variables that may have been specified.

CLI Usage

Basic usage: luis <action> <resource> <args...>

CommandDescription
CompositeEntityRole
luis add CompositeEntityRoleCreate an composite entity role for an entity in the application.
luis delete CompositeEntityRoleDelete a CompositeEntityRole.
luis get CompositeEntityRole --cEntityId <string> --roleId <string>Get a CompositeEntityRole information.
luis update CompositeEntityRole --in entityRoleUpdateObject.json --cEntityId <string> --roleId <string>Update a CompositeEntityRole.
CustomPrebuiltEntityRole
luis delete CustomPrebuiltEntityRole --entityId <string> --roleId <string>Delete an entity role.
luis get CustomPrebuiltEntityRole --entityId <string> --roleId <string>Get one entity role for a given entity.
luis update CustomPrebuiltEntityRole --in entityRoleUpdateObject.json --entityId <string> --roleId <string>Update an entity role for a given entity.
Application
luis add app --in applicationCreateObject.jsonCreate a new LUIS app.
luis delete application --appId <string>Delete an application.
luis get application --appId <string>Get the application info.
luis import application --in jSONApp.json --appName <string>Import an application to LUIS. Application structure should be included in in the request body.
luis update application --in applicationUpdateObject.json --appId <string>Update the name or description of the application.
Applications
luis list apps --skip <integer> --take <integer>List all of the user applications.
Assistants
luis list assistantsGet the endpoint URLs for the pre-built Cortana applications.
ClosedList
luis add closedlist --in closedListModelCreateObject.jsonAdd a closed list model to the application.
luis delete closedlist --clEntityId <string>Delete a closed list model from the application.
luis get closedlist --clEntityId <string>Get information of a closed list model.
luis update closedlist --in closedListModelPatchObject.json --clEntityId <string>Add a batch of sublists to an existing closed list.
luis update closedlist --in closedListModelUpdateObject.json --clEntityId <string>Update the closed list model.
ClosedListEntityRole
luis add closedListEntityRole --in entityRoleCreateObject.json --entityId <string>Create an entity role for an entity in the application.
luis delete closedListEntityRole --entityId <string> --roleId <string>Delete an entity role.
luis get closedListEntityRole --entityId <string> --roleId <string>Get all entity roles for a given entity.
luis update closedListEntityRoleUpdate an entity role for a given entity.
ClosedListEntityRoles
luis list closedListEntityRoles --entityId <string>Get all entity roles for a given entity.
ClosedLists
luis list closedlists --skip <integer> --take <integer>Get information about the closed list models.
CompositeEntities
luis list compositeEntities --skip <integer> --take <integer>Get information about the composite entity models.
CompositeEntity
luis add compositeEntityAdd a composite entity extractor to the application.
luis delete compositeentity --cEntityId <string>Delete a composite entity extractor from the application.
luis get compositeEntity --cEntityId <string>Get information about the composite entity model.
luis update compositeEntity --in compositeModelUpdateObject.json --cEntityId <string>Update the composite entity extractor.
CompositeEntityChild
luis add compositeEntityChild --in compositeChildModelCreateObject.json --cEntityId <string>Create a single child in an existing composite entity model.
luis delete compositeEntityChildDelete a composite entity extractor child from the application.
Cultures
luis list culturesGet the supported application cultures.
CustomPrebuiltDomain
luis add customprebuiltdomain --in prebuiltDomainCreateObject.jsonAdd a prebuilt domain along with its models as a new application.
luis add customprebuiltdomain --in prebuiltDomainObject.jsonAdd a customizable prebuilt domain along with all of its models to this application.
luis delete customPrebuiltDomain --domainName <string>Delete a prebuilt domain's models from the application.
luis get customprebuiltdomain --culture <string>Get all the available custom prebuilt domains for a specific culture.
CustomPrebuiltDomains
luis list customprebuiltdomainsGet all the available custom prebuilt domains for all cultures.
CustomPrebuiltEntities
luis get customPrebuiltEntitiesGet all custom prebuilt entities information of this application.
CustomPrebuiltEntity
luis add customPrebuiltEntity --in prebuiltDomainModelCreateObject.jsonAdd a custom prebuilt entity model to the application.
CustomPrebuiltEntityRole
luis add CustomPrebuiltEntityRole --in entityRoleCreateObject.json --entityId <string>Add a new CustomPrebuiltEntityRole.
CustomPrebuiltEntityRoles
luis list CustomPrebuiltEntityRoles --entityId <string>Get all entity roles for a given entity.
CustomPrebuiltIntent
luis add customprebuiltintent --in prebuiltDomainModelCreateObject.jsonAdd a custom prebuilt intent model to the application.
CustomPrebuiltIntents
luis list customPrebuiltIntentsGet custom prebuilt intents information of this application.
CustomPrebuiltModels
luis list customPrebuiltModelsGet all custom prebuilt models information of this application.
Domains
luis list domainsGet the available application domains.
Endpoints
luis list endpoints --appId <string>Return the available endpoint deployment regions and URLs.
Entities
luis list entities --skip <integer> --take <integer>Get information about the entity models.
luis suggest entities --entityId <string> --take <integer>Get suggestion examples that would improve the accuracy of the entity model.
Entity
luis add entity --in modelCreateObject.jsonAdd an entity extractor to the application.
luis delete entity --entityId <string>Delete an entity extractor from the application.
luis get entity --entityId <string>Get information about the entity model.
luis update entity --in modelUpdateObject.json --entityId <string>Update the name of an entity extractor.
EntityRole
luis add entityRole --in entityRoleCreateObject.json --entityId <string>Create an entity role for an entity in the application.
luis delete entityRoleDelete an entity role.
luis get EntityRoleGet all entity roles for a given entity.
luis update entityRole --in entityRoleUpdateObject.json --entityId <string> --roleId <string>Update an entity role for a given entity.
EntityRoles
luis list entityRolesGet all entity roles for a given entity.
Example
luis add example --in exampleLabelObject.jsonAdd a labeled example to the application.
luis delete example --exampleId <integer>Delete the labeled example with the specified ID.
Examples
luis add examples --in exampleLabelObjectArray.jsonAdd a batch of labeled examples to the application.
luis list examples --skip <integer> --take <integer>Return examples to be reviewed.
ExplicitListItem
luis add explicitListItemAdd a new item to the explicit list for the Pattern.Any entity.
luis delete explicitlistitem --entityId <string> --itemId <integer>Delete the explicit list item from the Pattern.any explicit list.
luis get explicitlistitem --entityId <string> --itemId <integer>Get the explicit list of the pattern.any entity.
luis update explicitlistitem --in item.json --entityId <string> --itemId <integer>Update an explicit list item for a Pattern.Any entity.
ExplicitListItems
luis get explicitListItems --entityId <string>Get the explicit list of the pattern.any entity.
Features
luis list features --skip <integer> --take <integer>Get all the extraction features for the specified application version.
HierarchicalEntities
luis list hierarchicalEntities --skip <integer> --take <integer>Get information about the hierarchical entity models.
HierarchicalEntity
luis add hierarchicalEntity --in hierarchicalModelCreateObject.jsonAdd a hierarchical entity extractor to the application version.
luis delete hierarchicalEntity --hEntityId <string>Delete a hierarchical entity extractor from the application version.
luis get hierarchicalEntity --hEntityId <string>Get information about the hierarchical entity model.
luis update hierarchicalEntity --in hierarchicalModelUpdateObject.json --hEntityId <string>Update the name and children of a hierarchical entity model.
HierarchicalEntityChild
luis delete hierarchicalEntityChild --hEntityId <string> --hChildId <string>Delete a hierarchical entity extractor child from the application.
luis get hierarchicalEntityChildGet information about the hierarchical entity child model.
luis hierarchicalEntityChild <string>Create a single child in an existing hierarchical entity model.
luis update hierarchicalEntityChild --in hierarchicalChildModelUpdateObject.json --hEntityId <string> --hChildId <string>Rename a single child in an existing hierarchical entity model.
HierarchicalEntityRole
luis add hierarchicalEntityRole --in entityRoleCreateObject.json --hEntityId <string>Add a hierarchical entity role.
luis delete hierarchicalEntityRole --hEntityId <string> --roleId <string>Delete an entity role.
luis get hierarchicalEntityRole --hEntityId <string> --roleId <string>Get all entity roles for a given entity.
luis update hierarchicalEntityRole --in entityRoleUpdateObject.json --hEntityId <string> --roleId <string>Update an entity role for a given entity.
HierarchicalEntityRoles
luis list hierarchicalEntityRoles --hEntityId <string>Get all hierarchical entity roles for a given entity.
Intent
luis add intent --in intentCreateObject.jsonAdd an intent classifier to the application.
luis delete intent --intentId <string> --deleteUtterances <boolean>Delete an intent classifier from the application.
luis get intent --intentId <string>Get information about the intent model.
luis update intent --in modelUpdateObject.json --intentId <string>Update the name of an intent classifier.
IntentPatterns
luis list intentPatterns --intentId <string> --skip <integer> --take <integer>Return patterns for the specific intent.
Intents
luis list intents --skip <integer> --take <integer>Get information about the intent models.
luis suggest intents --intentId <string> --take <integer>Suggest examples that would improve the accuracy of the intent model.
Models
luis list models --skip <integer> --take <integer>Get information about the application version models.
CompositeEntityRoles
luis list CompositeEntityRoles --cEntityId <string>Get all entity roles for a given entity.
Pattern
luis add pattern --in extractorCreateObject.jsonAdd patterns.
luis add pattern --in pattern.jsonAdd one pattern to the specified application.
luis add pattern --in patterns.jsonAdd a batch of patterns to the specified application.
luis delete pattern --entityId <string>Delete the pattern with the specified ID.
luis delete pattern --patternId <string>Delete the pattern with the specified ID.
luis get pattern --entityId <string>Get information about the pattern with the specified ID.
luis update pattern --in pattern.json --patternId <string>Update a pattern.
luis update pattern --in patternAnyUpdateObject.json --entityId <string>Update a pettern.
PatternEntityRole
luis add patternEntityRoleCreate an entity role for an entity in the application.
luis delete patternEntityRole --entityId <string> --roleId <string>Delete an entity role.
luis get patternEntityRole --entityId <string> --roleId <string>Get all entity roles for a given entity.
luis update patternEntityRole --in entityRoleUpdateObject.json --entityId <string> --roleId <string>Update an entity role for a given entity.
PatternEntityRoles
luis get patternEntityRolesGet all entity roles for a given entity.
Patterns
luis delete patterns --in patternIds.jsonDeletes the patterns with the specified IDs.
luis update patterns --in patterns.jsonUpdate patterns.
Permissions
luis add permissions --in userToAdd.jsonAdd a user to the allowed list of users to access this LUIS application. Users are added using their email addresses.
luis delete permissions --in userToDelete.jsonRemove a user from the allowed list of users to access this LUIS application. Users are removed using their email addresses.
luis list permissionsGet the list of user emails that have permissions to access your application.
luis update permissions --in collaborators.jsonReplace the current users access list with the one sent in the body. If an empty list is sent, all access to other users will be removed.
PhraseList
luis add phraselists --in phraselistCreateObject.jsonCreate a new phraselist feature.
luis delete phraselist --phraselistId <integer>Delete a phraselist feature.
luis get phraselist --phraselistId <integer>Get phraselist feature info.
luis update phraselist --in phraselistUpdateObject.json --phraselistId <integer>Update the phrases, the state and the name of the phraselist feature.
PhraseLists
luis list phraselists --skip <integer> --take <integer>Get all the phraselist features.
Prebuilt
luis add prebuilt --in prebuiltExtractorNames.jsonAdd a list of prebuilt entity extractors to the application.
luis delete prebuilt --prebuiltId <string>Delete a prebuilt entity extractor from the application.
luis get prebuilt --prebuiltId <string>Get information about the prebuilt entity model.
PrebuiltEntities
luis list prebuiltEntitiesGet all the available pre-built entity extractors for the application.
PrebuiltEntityRole
luis add prebuiltEntityRole --in entityRoleCreateObject.json --entityId <string>Create an entity role for an entity in the application.
luis delete prebuiltEntityRole --entityId <string> --roleId <string>Delete an entity role.
luis get prebuiltEntityRole --entityId <string> --roleId <string>Get all entity roles for a given entity.
luis update prebuiltEntityRole --in entityRoleUpdateObject.json --entityId <string> --roleId <string>Update an entity role for a given entity.
PrebuiltEntityRoles
luis list rebuiltEntityRoles --entityId <string>Get all entity roles for a given entity.
Prebuilts
luis list prebuilts --skip <integer> --take <integer>Get information about the pre-built entity models.
Querylogs
luis list querylogs --appId <string>Get the query logs of the past month for the application.
RegexEntities
luis list regexentities --skip <integer> --take <integer>List all regex entity roles for a given entity.
RegexEntity
luis add regexEntity --in regexEntityExtractorCreateObj.jsonAdd a regex entity model to the application version.
luis delete regexentity --regexEntityId <string>Delete a RegExEntity.
luis get regexentity --regexEntityId <string>Get a RegExEntity record.
luis update regexEntity --in regexEntityUpdateObject.json --regexEntityId <string>Update a RegExEntity.
RegexEntityRole
luis add regexentityrole --in entityRoleCreateObject.json --entityId <string>Create a RegexEntityRole for an entity in the application.
luis delete regexEntityRole --entityId <string> --roleId <string>Delete a RegExEntityRole.
luis get regexentityRoleGet a RegExEntityRole.
luis update regexEntityRole --in entityRoleUpdateObject.json --entityId <string> --roleId <string>Update a RegExEntityRole.
RegexEntityRoles
luis list regexentityroles --entityId <string>List RegExEntityRoles.
Settings
luis get settings --appId <string>Get the application settings.
luis update settings --in applicationSettingUpdateObject.json --appId <string>Update the application settings.
Status
luis get statusGets the training status of all models (intents and entities) for the specified LUIS app. You must call the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app ID. "versionId" specifies the version number of the LUIS app. For example, "0.1".
Sublist
luis add sublistAdd a list to an existing closed list.
luis delete sublist --clEntityId <string> --subListId <integer>Delete a sublist of a specific closed list model.
luis update sublist --in wordListBaseUpdateObject.json --clEntityId <string> --subListId <integer>Update one of the closed list's sublists.
UnlabeledUtterance
luis delete unlabeledutterance --in body.json --appId <string> --versionId <string>Delete an unlabelled utterance.
UsageScenarios
luis list usagescenariosGet the application available usage scenarios.
Version
luis clone version --in versionCloneObject.json --appId <string> --versionId <string>Create a new version using the current snapshot of the selected application version.
luis delete version --appId <string> --versionId <string>Delete an application version.
luis export version --appId <string> --versionId <string>Export a LUIS application in JSON format.
luis get version --appId <string> --versionId <string>Get the version info.
luis import versionImport a new version into a LUIS application.
luis publish version --appId <string> --versionId <version> --staging <true or false>Pu