///
import { EventEmitter } from 'events';
export declare namespace LuisApi {
interface AppInfoGET {
id: string;
name: string;
description: string;
culture: string;
}
interface IntentGET {
id: string;
name: string;
typeId: number;
readableType: string;
}
interface IntentPOST {
name: string;
}
interface IntentDELETE {
id: string;
}
interface EntityGET {
id: string;
name: string;
typeId: number;
readableType: string;
}
interface EntityPOST {
name: string;
}
interface EntityDELETE {
id: string;
}
interface PhraseListGET {
id: number;
name: string;
isActive: boolean;
isExchangeable: boolean;
phrases: string;
}
interface PhraseListPOST {
name: string;
phrases: string;
isExchangeable: boolean;
}
interface PhraseListDELETE {
id: string;
}
interface EntityLabelExampleGET {
entityName: string;
startTokenIndex: number;
endTokenIndex: number;
}
interface EntityLabelExamplePOST {
entityName: string;
startCharIndex: number;
endCharIndex: number;
}
interface IntentPrediction {
name: string;
score: number;
}
interface EntityPrediction {
entityName: string;
startIndex: number;
endIndex: number;
phrase: string;
}
interface ExampleGET {
id: number;
text: string;
tokenizedText: string[];
intentLabel: string;
entityLabels: EntityLabelExampleGET[];
intentPredictions: IntentPrediction[];
entityPredictions: EntityPrediction[];
}
interface ExamplePOST {
text: string;
intentName: string;
entityLabels: EntityLabelExamplePOST[];
}
interface ExampleDELETE {
id: number;
}
interface RecognizedIntent {
intent: string;
score: number;
}
interface RecognizedEntity {
entity: string;
type: string;
startIndex: number;
endIndex: number;
score: number;
}
interface RecognitionResult {
query: string;
topScoringIntent: RecognizedIntent;
intents: RecognizedIntent[];
entities: RecognizedEntity[];
}
enum TrainingStatuses {
Success = 0,
Fail = 1,
UpToDate = 2,
InProgress = 3,
}
interface ModelTrainingStatus {
modelId: string;
status: TrainingStatuses;
exampleCount: number;
failureReason?: string;
}
type TrainingStatus = ModelTrainingStatus[];
interface PublishResult {
endpointUrl: string;
subscriptionKey: string;
endpointRegion: string;
isStaging: boolean;
}
}
export interface LuisApiClientConfig {
baseUrl?: string;
applicationId: string;
subscriptionKey: string;
requestsPerSecond?: number;
timeout?: number;
}
export declare class LuisApiClient extends EventEmitter {
private config;
private readonly serviceReq;
private readonly provisionReq;
private readonly promiseThrottle;
constructor(config: LuisApiClientConfig);
private retryRequest(opts, expectedStatusCode);
private throttler(fn, appVersion, items);
private serializer(fn, appVersion, items);
recognizeSentence(sentence: string): Promise;
recognizeSentences(queries: string[]): Promise;
getApp(): Promise;
getIntents(appVersion: string): Promise;
createIntent(appVersion: string, intent: LuisApi.IntentPOST): Promise;
createIntents(appVersion: string, intents: LuisApi.IntentPOST[]): Promise;
deleteIntent(appVersion: string, intent: LuisApi.IntentDELETE): Promise;
deleteIntents(appVersion: string, intents: LuisApi.IntentDELETE[]): Promise;
getEntities(appVersion: string): Promise;
createEntity(appVersion: string, entity: LuisApi.EntityPOST): Promise;
createEntities(appVersion: string, entities: LuisApi.EntityPOST[]): Promise;
deleteEntity(appVersion: string, entity: LuisApi.EntityDELETE): Promise;
deleteEntities(appVersion: string, entities: LuisApi.EntityDELETE[]): Promise;
getPhraseLists(appVersion: string): Promise;
createPhraseList(appVersion: string, phraseList: LuisApi.PhraseListPOST): Promise;
createPhraseLists(appVersion: string, phraseLists: LuisApi.PhraseListPOST[]): Promise;
deletePhraseList(appVersion: string, phraseList: LuisApi.PhraseListDELETE): Promise;
deletePhraseLists(appVersion: string, phraseLists: LuisApi.PhraseListDELETE[]): Promise;
getExamples(appVersion: string, skip: number, count: number): Promise;
getAllExamples(appVersion: string): Promise;
createExamples(appVersion: string, examples: LuisApi.ExamplePOST[]): Promise<{}[]>;
deleteExample(appVersion: string, example: LuisApi.ExampleDELETE): Promise;
deleteExamples(appVersion: string, examples: LuisApi.ExampleDELETE[]): Promise;
private convertTrainingStatus(apiTrainingStatus);
startTraining(appVersion: string): Promise;
getTrainingStatus(appVersion: string): Promise;
publish(appVersion: string, region?: string, isStaging?: boolean): Promise;
export(appVersion: string): Promise;
}