QnAMakerRecognizer class
A recognizer which uses QnAMaker KB to recognize intents.
- Extends
-
Recognizer
Qn |
Initializes a new instance of |
$kind | |
context | An expression to evaluate to set the context. |
endpoint |
Endpoint key for the QnA service. |
hostname | Host name of the QnA maker knowledgebase. |
include |
Whether to include the dialog name metadata for QnA context. |
is |
A value indicating whether to call test or prod environment of knowledgebase. |
knowledge |
Knowledgebase id of your QnA maker knowledgebase. |
log |
The flag to indicate if personal information should be logged in telemetry. |
metadata | An expression to evaluate to set additional metadata name value pairs. |
qna |
An expression to evaluate to set QnAId parameter. |
qna |
|
ranker |
Desired RankerType. |
strict |
A value used for Join operation of Metadata. |
threshold | Threshold for the results. |
top | Number of results you want. |
id | Recognizers unique ID. |
telemetry |
The telemetry client for logging events. Default this to the NullTelemetryClient, which does nothing. |
get |
|
recognize(Dialog |
Gets results of the call to QnA maker KB. |
configure(Record<string, unknown>) | Fluent method for configuring the object. |
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.
static $kind: string
Property Value
string
An expression to evaluate to set the context.
context: ObjectExpression<QnARequestContext>
Property Value
ObjectExpression<QnARequestContext>
Endpoint key for the QnA service.
endpointKey: StringExpression
Property Value
StringExpression
Host name of the QnA maker knowledgebase.
hostname: StringExpression
Property Value
StringExpression
Whether to include the dialog name metadata for QnA context.
includeDialogNameInMetadata: BoolExpression
Property Value
BoolExpression
A value indicating whether to call test or prod environment of knowledgebase.
isTest: boolean
Property Value
boolean
Knowledgebase id of your QnA maker knowledgebase.
knowledgeBaseId: StringExpression
Property Value
StringExpression
The flag to indicate if personal information should be logged in telemetry.
logPersonalInformation: BoolExpression
Property Value
BoolExpression
An expression to evaluate to set additional metadata name value pairs.
metadata: ArrayExpression<QnAMakerMetadata>
Property Value
ArrayExpression<QnAMakerMetadata>
An expression to evaluate to set QnAId parameter.
qnaId: IntExpression
Property Value
IntExpression
static qnaMatchIntent: "QnAMatch" = "QnAMatch"
Property Value
"QnAMatch"
Desired RankerType.
rankerType: StringExpression
Property Value
StringExpression
A value used for Join operation of Metadata.
strictFiltersJoinOperator: JoinOperator
Property Value
Threshold for the results.
threshold: NumberExpression
Property Value
NumberExpression
Number of results you want.
top: IntExpression
Property Value
IntExpression
Recognizers unique ID.
id: string
Property Value
string
Inherited From Recognizer.id
The telemetry client for logging events. Default this to the NullTelemetryClient, which does nothing.
telemetryClient: BotTelemetryClient
Property Value
BotTelemetryClient
Inherited From Recognizer.telemetryClient
function getConverter(property: Object): Converter | ConverterFactory
Parameters
- property
-
Object
Properties that extend QnAMakerRecognizerConfiguration.
Returns
Converter | ConverterFactory
The expression converter.
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
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