/** * @module botbuilder-dialogs-adaptive */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { ArrayExpression, BoolExpression, Expression, IntExpression, NumberExpression, ObjectExpression, StringExpression } from 'adaptive-expressions'; import { RecognizerResult, Activity } from 'botbuilder-core'; import { Converter, ConverterFactory, DialogContext, Recognizer, RecognizerConfiguration } from 'botbuilder-dialogs'; import { QnAMaker, QnAMakerClient } from './qnaMaker'; import { JoinOperator, QnAMakerMetadata, QnARequestContext } from './qnamaker-interfaces'; export interface QnAMakerRecognizerConfiguration extends RecognizerConfiguration { knowledgeBaseId?: string | Expression | StringExpression; hostname?: string | Expression | StringExpression; endpointKey?: string | Expression | StringExpression; top?: number | string | Expression | IntExpression; threshold?: number | string | Expression | NumberExpression; isTest?: boolean; rankerType?: string | Expression | StringExpression; strictFiltersJoinOperator?: JoinOperator; includeDialogNameInMetadata?: boolean | string | Expression | BoolExpression; metadata?: QnAMakerMetadata[] | string | Expression | ArrayExpression; context?: QnARequestContext | string | Expression | ObjectExpression; qnaId?: number | string | Expression | IntExpression; logPersonalInformation?: boolean | string | Expression | BoolExpression; } /** * A recognizer which uses QnAMaker KB to recognize intents. */ export declare class QnAMakerRecognizer extends Recognizer implements QnAMakerRecognizerConfiguration { static $kind: string; static readonly qnaMatchIntent = "QnAMatch"; /** * Knowledgebase id of your QnA maker knowledgebase. */ knowledgeBaseId: StringExpression; /** * Host name of the QnA maker knowledgebase. */ hostname: StringExpression; /** * Endpoint key for the QnA service. */ endpointKey: StringExpression; /** * Number of results you want. */ top: IntExpression; /** * Threshold for the results. */ threshold: NumberExpression; /** * A value indicating whether to call test or prod environment of knowledgebase. */ isTest: boolean; /** * Desired RankerType. */ rankerType: StringExpression; /** * A value used for Join operation of Metadata. */ strictFiltersJoinOperator: JoinOperator; /** * Whether to include the dialog name metadata for QnA context. */ includeDialogNameInMetadata: BoolExpression; /** * An expression to evaluate to set additional metadata name value pairs. */ metadata: ArrayExpression; /** * An expression to evaluate to set the context. */ context: ObjectExpression; /** * An expression to evaluate to set QnAId parameter. */ qnaId: IntExpression; /** * The flag to indicate if personal information should be logged in telemetry. */ logPersonalInformation: BoolExpression; /** * @param property Properties that extend QnAMakerRecognizerConfiguration. * @returns The expression converter. */ getConverter(property: keyof QnAMakerRecognizerConfiguration): Converter | ConverterFactory; /** * Initializes a new instance of `QnAMakerRecognizer`. * * @param {string} hostname Hostname of QnAMaker KB. * @param {string} knowledgeBaseId Id of QnAMaker KB. * @param {string} endpointKey Endpoint key of QnAMaker KB. */ constructor(hostname?: string, knowledgeBaseId?: string, endpointKey?: string); /** * Gets results of the call to QnA maker KB. * * @param {DialogContext} dc Context object containing information for a single turn of coversation with a user. * @param {Activity} activity The incoming activity received from the user. The text value is used as the query to QnA Maker. * @param {object} telemetryProperties Additional properties to be logged to telemetry. * @param {object} telemetryMetrics Additional metrics to be logged to telemetry. * @returns {Promise} A promise resolving to the recognizer result */ recognize(dc: DialogContext, activity: Activity, telemetryProperties?: { [key: string]: string; }, telemetryMetrics?: { [key: string]: number; }): Promise; /** * Gets an instance of `QnAMaker`. * * @deprecated Instead, favor using [QnAMakerRecognizer.getQnAMakerClient()](#getQnAMakerClient) to get instance of QnAMakerClient. * @param {DialogContext} dc The dialog context used to access state. * @returns {QnAMaker} A qna maker instance */ protected getQnAMaker(dc: DialogContext): QnAMaker; /** * Gets an instance of [QnAMakerClient](xref:botbuilder-ai.QnAMakerClient) * * @param {DialogContext} dc The dialog context used to access state. * @returns {QnAMakerClient} An instance of QnAMakerClient. */ protected getQnAMakerClient(dc: DialogContext): QnAMakerClient; /** * Uses the recognizer result to create a collection of properties to be included when tracking the result in telemetry. * * @param {RecognizerResult} recognizerResult The result of the intent recognized by the recognizer. * @param {Record} telemetryProperties A list of properties created using the RecognizerResult. * @param {DialogContext} dc The DialogContext. * @returns {Record} A collection of properties that can be used when calling the trackEvent method on the telemetry client. */ protected fillRecognizerResultTelemetryProperties(recognizerResult: RecognizerResult, telemetryProperties: Record, dc: DialogContext): Record; private getLogPersonalInformation; } //# sourceMappingURL=qnaMakerRecognizer.d.ts.map