botbuilder-dialogs
Version:
A dialog stack based conversation manager for Microsoft BotBuilder.
65 lines (64 loc) • 3.5 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Activity, BotTelemetryClient, RecognizerResult } from 'botbuilder-core';
import { Configurable } from './configurable';
import { DialogContext } from './dialogContext';
export interface RecognizerConfiguration {
id?: string;
telemetryClient?: BotTelemetryClient;
}
/**
* Recognizer base class.
*/
export declare class Recognizer extends Configurable implements RecognizerConfiguration {
/**
* Recognizers unique ID.
*/
id: string;
/**
* The telemetry client for logging events.
* Default this to the NullTelemetryClient, which does nothing.
*/
telemetryClient: BotTelemetryClient;
/**
* To recognize intents and entities in a users utterance.
*
* @param {DialogContext} _dialogContext Dialog Context.
* @param {Partial<Activity>} _activity Activity.
* @param {Record<string, string>} _telemetryProperties Additional properties to be logged to telemetry with event.
* @param {Record<string, number>} _telemetryMetrics Additional metrics to be logged to telemetry with event.
*/
recognize(_dialogContext: DialogContext, _activity: Partial<Activity>, _telemetryProperties?: Record<string, string>, _telemetryMetrics?: Record<string, number>): Promise<RecognizerResult>;
/**
* Creates choose intent result in the case that there are conflicting or ambiguous signals from the recognizers.
*
* @param {Record<string, RecognizerResult>} recognizerResults A group of recognizer results.
* @returns {RecognizerResult} Recognizer result which is ChooseIntent.
*/
protected createChooseIntentResult(recognizerResults: Record<string, RecognizerResult>): RecognizerResult;
/**
* Uses the RecognizerResult to create a list of properties to be included when tracking the result in telemetry.
*
* @param {RecognizerResult} recognizerResult Recognizer Result.
* @param {Record<string, string>} telemetryProperties A list of properties to append or override the properties created using the RecognizerResult.
* @param {DialogContext} _dialogContext Dialog Context.
* @returns {Record<string, string>} A collection of properties that can be included when calling the TrackEvent method on the TelemetryClient.
*/
protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record<string, string>, _dialogContext?: DialogContext): Record<string, string>;
protected stringifyAdditionalPropertiesOfRecognizerResult(recognizerResult: RecognizerResult): string;
/**
* Tracks an event with the event name provided using the TelemetryClient attaching the properties/metrics.
*
* @param {DialogContext} dialogContext Dialog context.
* @param {string} eventName The name of the event to track.
* @param {Record<string, string>} telemetryProperties The properties to be included as part of the event tracking.
* @param {Record<string, number>} telemetryMetrics The metrics to be included as part of the event tracking.
*/
protected trackRecognizerResult(dialogContext: DialogContext, eventName: string, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): void;
}
//# sourceMappingURL=recognizer.d.ts.map