botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
63 lines (62 loc) • 2.91 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Activity, RecognizerResult } from 'botbuilder';
import { Converter, ConverterFactory, DialogContext, Recognizer, RecognizerConfiguration } from 'botbuilder-dialogs';
import { AdaptiveRecognizer } from './adaptiveRecognizer';
export interface CrossTrainedRecognizerSetConfiguration extends RecognizerConfiguration {
recognizers?: string[] | Recognizer[];
}
/**
* Recognizer for selecting between cross trained recognizers.
*/
export declare class CrossTrainedRecognizerSet extends AdaptiveRecognizer implements CrossTrainedRecognizerSetConfiguration {
static $kind: string;
/**
* Gets or sets the input recognizers.
*/
recognizers: Recognizer[];
/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
getConverter(property: keyof CrossTrainedRecognizerSetConfiguration): Converter | ConverterFactory;
/**
* To recognize intents and entities in a users utterance.
*
* @param {DialogContext} dialogContext The dialog context.
* @param {Activity} activity The activity.
* @param {object} telemetryProperties Optional. Additional properties to be logged to telemetry with the recognizer result event.
* @param {object} telemetryMetrics Optional. Additional metrics to be logged to telemetry with the recognizer result event.
* @returns {Promise<RecognizerResult>} Promise of the intent recognized by the recognizer in the form of a RecognizerResult.
*/
recognize(dialogContext: DialogContext, activity: Activity, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>;
/**
* Process a list of raw results from recognizers.
* If there is consensus among the cross trained recognizers, the recognizerResult structure from
* the consensus recognizer is returned.
*
* @param {RecognizerResult[]} results A list of recognizer results to be processed.
* @returns {RecognizerResult} The the result cross-trained by the multiple results of the cross-training recognizers.
*/
private processResults;
/**
* Check if an intent is triggering redirects.
*
* @param {string} intent The intent.
* @returns {boolean} Boolean result of whether or not an intent begins with the `DeferToRecognizer_` prefix.
*/
private isRedirect;
/**
* Extracts the redirect ID from an intent.
*
* @param {string} intent Intent string contains redirect id.
* @returns {string} The redirect ID.
*/
private getRedirectId;
}
//# sourceMappingURL=crossTrainedRecognizerSet.d.ts.map