Redigera

Dela via


QnAMakerClient interface

Client to access a QnA Maker knowledge base.

Methods

callTrain(FeedbackRecords)

Send feedback to the knowledge base.

getAnswers(TurnContext, QnAMakerOptions, Record<string, string>, Record<string, number>)

Generates an answer from the knowledge base.

getAnswersRaw(TurnContext, QnAMakerOptions, Record<string, string>, Record<string, number>)

Generates an answer from the knowledge base.

getLowScoreVariation(QnAMakerResult[])

Filters the ambiguous question for active learning.

Method Details

callTrain(FeedbackRecords)

Send feedback to the knowledge base.

function callTrain(feedbackRecords: FeedbackRecords): Promise<void>

Parameters

feedbackRecords
FeedbackRecords

Feedback records.

Returns

Promise<void>

getAnswers(TurnContext, QnAMakerOptions, Record<string, string>, Record<string, number>)

Generates an answer from the knowledge base.

function getAnswers(turnContext: TurnContext, options?: QnAMakerOptions, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): Promise<QnAMakerResult[]>

Parameters

turnContext

TurnContext

The Turn Context that contains the user question to be queried against your knowledge base.

options
QnAMakerOptions

The options for the QnA Maker knowledge base. If null, constructor option is used for this instance.

telemetryProperties

Record<string, string>

Additional properties to be logged to telemetry with the QnaMessage event.

telemetryMetrics

Record<string, number>

Additional metrics to be logged to telemetry with the QnaMessage event.

Returns

Promise<QnAMakerResult[]>

A list of answers for the user query, sorted in decreasing order of ranking score.

getAnswersRaw(TurnContext, QnAMakerOptions, Record<string, string>, Record<string, number>)

Generates an answer from the knowledge base.

function getAnswersRaw(turnContext: TurnContext, options?: QnAMakerOptions, telemetryProperties?: Record<string, string>, telemetryMetrics?: Record<string, number>): Promise<QnAMakerResults>

Parameters

turnContext

TurnContext

The Turn Context that contains the user question to be queried against your knowledge base.

options
QnAMakerOptions

The options for the QnA Maker knowledge base. If null, constructor option is used for this instance.

telemetryProperties

Record<string, string>

Additional properties to be logged to telemetry with the QnaMessage event.

telemetryMetrics

Record<string, number>

Additional metrics to be logged to telemetry with the QnaMessage event.

Returns

Promise<QnAMakerResults>

A list of answers for the user query, sorted in decreasing order of ranking score.

getLowScoreVariation(QnAMakerResult[])

Filters the ambiguous question for active learning.

function getLowScoreVariation(queryResult: QnAMakerResult[]): QnAMakerResult[]

Parameters

queryResult

QnAMakerResult[]

User query output.

Returns

Filtered array of ambiguous question.