QnAMaker.GetAnswersAsync Method

Definition

Overloads

GetAnswersAsync(ITurnContext, QnAMakerOptions, Dictionary<String,String>, Dictionary<String,Double>)

Generates an answer from the knowledge base.

GetAnswersAsync(ITurnContext, QnAMakerOptions)

Generates an answer from the knowledge base.

GetAnswersAsync(ITurnContext, QnAMakerOptions, Dictionary<String,String>, Dictionary<String,Double>)

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[]>
override this.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.

Implements

Applies to

GetAnswersAsync(ITurnContext, QnAMakerOptions)

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 = default);
member this.GetAnswersAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Builder.AI.QnA.QnAMakerOptions -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.AI.QnA.QueryResult[]>
Public Function GetAnswersAsync (turnContext As ITurnContext, Optional options As QnAMakerOptions = 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.

Returns

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

Applies to