QnAMakerRecognizer class

A recognizer which uses QnAMaker KB to recognize intents.

Extends

Recognizer

Constructors

QnAMakerRecognizer(string, string, string)

Initializes a new instance of QnAMakerRecognizer.

Properties

$kind
context

An expression to evaluate to set the context.

endpointKey

Endpoint key for the QnA service.

hostname

Host name of the QnA maker knowledgebase.

includeDialogNameInMetadata

Whether to include the dialog name metadata for QnA context.

isTest

A value indicating whether to call test or prod environment of knowledgebase.

knowledgeBaseId

Knowledgebase id of your QnA maker knowledgebase.

logPersonalInformation

The flag to indicate if personal information should be logged in telemetry.

metadata

An expression to evaluate to set additional metadata name value pairs.

qnaId

An expression to evaluate to set QnAId parameter.

qnaMatchIntent
rankerType

Desired RankerType.

strictFiltersJoinOperator

A value used for Join operation of Metadata.

threshold

Threshold for the results.

top

Number of results you want.

Inherited Properties

id

Recognizers unique ID.

telemetryClient

The telemetry client for logging events. Default this to the NullTelemetryClient, which does nothing.

Methods

getConverter(Object)
recognize(DialogContext, Activity, [key: string]: string, [key: string]: number)

Gets results of the call to QnA maker KB.

Inherited Methods

configure(Record<string, unknown>)

Fluent method for configuring the object.

Constructor Details

QnAMakerRecognizer(string, string, string)

Initializes a new instance of QnAMakerRecognizer.

new QnAMakerRecognizer(hostname?: string, knowledgeBaseId?: string, endpointKey?: string)

Parameters

hostname

string

Hostname of QnAMaker KB.

knowledgeBaseId

string

Id of QnAMaker KB.

endpointKey

string

Endpoint key of QnAMaker KB.

Property Details

$kind

static $kind: string

Property Value

string

context

An expression to evaluate to set the context.

context: ObjectExpression<QnARequestContext>

Property Value

ObjectExpression<QnARequestContext>

endpointKey

Endpoint key for the QnA service.

endpointKey: StringExpression

Property Value

StringExpression

hostname

Host name of the QnA maker knowledgebase.

hostname: StringExpression

Property Value

StringExpression

includeDialogNameInMetadata

Whether to include the dialog name metadata for QnA context.

includeDialogNameInMetadata: BoolExpression

Property Value

BoolExpression

isTest

A value indicating whether to call test or prod environment of knowledgebase.

isTest: boolean

Property Value

boolean

knowledgeBaseId

Knowledgebase id of your QnA maker knowledgebase.

knowledgeBaseId: StringExpression

Property Value

StringExpression

logPersonalInformation

The flag to indicate if personal information should be logged in telemetry.

logPersonalInformation: BoolExpression

Property Value

BoolExpression

metadata

An expression to evaluate to set additional metadata name value pairs.

metadata: ArrayExpression<QnAMakerMetadata>

Property Value

ArrayExpression<QnAMakerMetadata>

qnaId

An expression to evaluate to set QnAId parameter.

qnaId: IntExpression

Property Value

IntExpression

qnaMatchIntent

static qnaMatchIntent: "QnAMatch" = "QnAMatch"

Property Value

"QnAMatch"

rankerType

Desired RankerType.

rankerType: StringExpression

Property Value

StringExpression

strictFiltersJoinOperator

A value used for Join operation of Metadata.

strictFiltersJoinOperator: JoinOperator

Property Value

threshold

Threshold for the results.

threshold: NumberExpression

Property Value

NumberExpression

top

Number of results you want.

top: IntExpression

Property Value

IntExpression

Inherited Property Details

id

Recognizers unique ID.

id: string

Property Value

string

Inherited From Recognizer.id

telemetryClient

The telemetry client for logging events. Default this to the NullTelemetryClient, which does nothing.

telemetryClient: BotTelemetryClient

Property Value

BotTelemetryClient

Inherited From Recognizer.telemetryClient

Method Details

getConverter(Object)

function getConverter(property: Object): Converter | ConverterFactory

Parameters

property

Object

Properties that extend QnAMakerRecognizerConfiguration.

Returns

Converter | ConverterFactory

The expression converter.

recognize(DialogContext, Activity, [key: string]: string, [key: string]: number)

Gets results of the call to QnA maker KB.

function recognize(dc: DialogContext, activity: Activity, telemetryProperties?: [key: string]: string, telemetryMetrics?: [key: string]: number): Promise<RecognizerResult>

Parameters

dc

DialogContext

Context object containing information for a single turn of coversation with a user.

activity

Activity

The incoming activity received from the user. The text value is used as the query to QnA Maker.

telemetryProperties

[key: string]: string

Additional properties to be logged to telemetry.

telemetryMetrics

[key: string]: number

Additional metrics to be logged to telemetry.

Returns

Promise<RecognizerResult>

A promise resolving to the recognizer result

Inherited Method Details

configure(Record<string, unknown>)

Fluent method for configuring the object.

function configure(config: Record<string, unknown>): this

Parameters

config

Record<string, unknown>

Configuration settings to apply.

Returns

this

The Configurable after the operation is complete.

Inherited From Configurable.configure