GenerateAnswerUtils class
Generate Answer api utils class.
Constructors
Generate |
Creates new Generate answer utils. |
Properties
http |
Methods
emit |
Emits a trace event detailing a QnA Maker call and its results. |
query |
Called internally to query the QnA Maker service. |
query |
Called internally to query the QnA Maker service. |
validate |
Validate qna maker options |
Constructor Details
GenerateAnswerUtils(QnAMakerOptions, QnAMakerEndpoint)
Creates new Generate answer utils.
new GenerateAnswerUtils(_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
httpRequestUtils
Method Details
emitTraceInfo(TurnContext, QnAMakerResult[], QnAMakerOptions)
Emits a trace event detailing a QnA Maker 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
Answers returned by QnA Maker.
- queryOptions
- QnAMakerOptions
(Optional) The options for the QnA Maker knowledge base. If null, constructor option is used for this instance.
Returns
Promise<any>
a promise representing the async operation
queryQnaService(QnAMakerEndpoint, string, QnAMakerOptions)
Called internally to query the QnA Maker service.
function queryQnaService(endpoint: QnAMakerEndpoint, question: string, options?: QnAMakerOptions): Promise<QnAMakerResult[]>
Parameters
- endpoint
- QnAMakerEndpoint
The endpoint of the knowledge base to query.
- 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<QnAMakerResult[]>
a promise that resolves to the query results. .
queryQnaServiceRaw(QnAMakerEndpoint, string, QnAMakerOptions)
Called internally to query the QnA Maker service.
function queryQnaServiceRaw(endpoint: QnAMakerEndpoint, question: string, options?: QnAMakerOptions): Promise<QnAMakerResults>
Parameters
- endpoint
- QnAMakerEndpoint
The endpoint of the knowledge base to query.
- 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 QnA Maker knowledge base. If null, constructor option is used for this instance.