LanguageServiceUtils class

Utilities for using Query Knowledge Base and Add Active Learning feedback APIs of language service.

Constructors

LanguageServiceUtils(QnAMakerOptions, QnAMakerEndpoint)

Creates new Language Service utils.

Properties

endpoint
httpRequestUtils

Methods

addFeedback(FeedbackRecords)

Adds feedback to the knowledge base.

emitTraceInfo(TurnContext, QnAMakerResult[], QnAMakerOptions)

Emits a trace event detailing a Custom Question Answering call and its results.

queryKnowledgebaseRaw(string, QnAMakerOptions)

Called to query the Language service.

validateOptions(QnAMakerOptions)

Validate qna maker options

Constructor Details

LanguageServiceUtils(QnAMakerOptions, QnAMakerEndpoint)

Creates new Language Service utils.

new LanguageServiceUtils(_options: QnAMakerOptions, endpoint: QnAMakerEndpoint)

Parameters

_options
QnAMakerOptions

Settings used to configure the instance.

endpoint
QnAMakerEndpoint

The endpoint of the knowledge base to query.

Property Details

endpoint

endpoint: QnAMakerEndpoint

Property Value

httpRequestUtils

httpRequestUtils: HttpRequestUtils

Property Value

Method Details

addFeedback(FeedbackRecords)

Adds feedback to the knowledge base.

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

Parameters

feedbackRecords
FeedbackRecords

A list of Feedback Records for Active Learning.

Returns

Promise<void>

A promise representing the async operation.

emitTraceInfo(TurnContext, QnAMakerResult[], QnAMakerOptions)

Emits a trace event detailing a Custom Question Answering call and its results.

function emitTraceInfo(turnContext: TurnContext, answers: QnAMakerResult[], queryOptions?: QnAMakerOptions): Promise<any>

Parameters

turnContext

TurnContext

Turn Context for the current turn of conversation with the user.

answers

QnAMakerResult[]

Answers returned by Language Service.

queryOptions
QnAMakerOptions

(Optional) The options for the Custom Question Answering knowledge base. If null, constructor option is used for this instance.

Returns

Promise<any>

a promise representing the async operation

queryKnowledgebaseRaw(string, QnAMakerOptions)

Called to query the Language service.

function queryKnowledgebaseRaw(question: string, options?: QnAMakerOptions): Promise<QnAMakerResults>

Parameters

question

string

Question which need to be queried.

options
QnAMakerOptions

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

Returns

Promise<QnAMakerResults>

a promise that resolves to the raw query results

validateOptions(QnAMakerOptions)

Validate qna maker options

function validateOptions(options: QnAMakerOptions)

Parameters

options
QnAMakerOptions

The options for the Custom Question Answering knowledge base. If null, constructor option is used for this instance.