ITelemetryQnAMaker.GetAnswersAsync Method

Definition

Generates an answer from the knowledge base.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.AI.QnA.QueryResult[]> GetAnswersAsync (Microsoft.Bot.Builder.ITurnContext turnContext, Microsoft.Bot.Builder.AI.QnA.QnAMakerOptions options, System.Collections.Generic.Dictionary<string,string> telemetryProperties, System.Collections.Generic.Dictionary<string,double> telemetryMetrics = default);
abstract member GetAnswersAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Builder.AI.QnA.QnAMakerOptions * System.Collections.Generic.Dictionary<string, string> * System.Collections.Generic.Dictionary<string, double> -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.AI.QnA.QueryResult[]>
Public Function GetAnswersAsync (turnContext As ITurnContext, options As QnAMakerOptions, telemetryProperties As Dictionary(Of String, String), Optional telemetryMetrics As Dictionary(Of String, Double) = Nothing) As Task(Of QueryResult())

Parameters

turnContext
ITurnContext

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
Dictionary<String,String>

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

telemetryMetrics
Dictionary<String,Double>

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

Returns

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

Applies to