Share via


QnAMaker.FillQnAEventAsync Method

Definition

Fills the event properties and metrics for the QnaMessage event for telemetry. These properties are logged when the QnA GetAnswers method is called.

protected System.Threading.Tasks.Task<(System.Collections.Generic.Dictionary<string,string> Properties, System.Collections.Generic.Dictionary<string,double> Metrics)> FillQnAEventAsync (Microsoft.Bot.Builder.AI.QnA.QueryResult[] queryResults, Microsoft.Bot.Builder.ITurnContext turnContext, System.Collections.Generic.Dictionary<string,string> telemetryProperties = default, System.Collections.Generic.Dictionary<string,double> telemetryMetrics = default, System.Threading.CancellationToken cancellationToken = default);
member this.FillQnAEventAsync : Microsoft.Bot.Builder.AI.QnA.QueryResult[] * Microsoft.Bot.Builder.ITurnContext * System.Collections.Generic.Dictionary<string, string> * System.Collections.Generic.Dictionary<string, double> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<ValueTuple<System.Collections.Generic.Dictionary<string, string>, System.Collections.Generic.Dictionary<string, double>>>
Protected Function FillQnAEventAsync (queryResults As QueryResult(), turnContext As ITurnContext, Optional telemetryProperties As Dictionary(Of String, String) = Nothing, Optional telemetryMetrics As Dictionary(Of String, Double) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ValueTuple(Of Dictionary(Of String, String), Dictionary(Of String, Double)))

Parameters

queryResults
QueryResult[]

QnA service results.

turnContext
ITurnContext

Context object containing information for a single turn of conversation with a user.

telemetryProperties
Dictionary<String,String>

Properties to add/override for the event.

telemetryMetrics
Dictionary<String,Double>

Metrics to add/override for the event.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A tuple of Properties and Metrics that will be sent to the IBotTelemetryClient.TrackEvent method for the QnAMessage event. The properties and metrics returned the standard properties logged with any properties passed from the GetAnswersAsync method.

Applies to