-
Notifications
You must be signed in to change notification settings - Fork 492
Fixes for QnA / Recognizer Adaptive telemetry #3715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
#3543) * Added check to only cancel dialogs in RunAsync when EoC comes from a parent bot (root or skill). * Applied URI prefix to caller ID as per OBI spec https://github.com/microsoft/botframework-obi/blob/master/protocols/botframework-activity/botframework-activity.md#bot-calling-skill (cherry picked from commit 3730963)
…3571) [OAuth]do not set signInLink to empty when OAuthAppCredentials is set
| /// The flag to indicate in personal information should be logged in telemetry. | ||
| /// </value> | ||
| [JsonProperty("logPersonalInformation")] | ||
| public BoolExpression LogPersonalInformation { get; set; } = "=settings.telemetry.logPersonalInformation"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the new property, we need an update to the component schema file as well as re-gen the sdk.schema.
|
|
||
| protected virtual Dictionary<string, string> FillRecognizerResultTelemetryProperties(RecognizerResult recognizerResult, Dictionary<string, string> telemetryProperties, ITurnContext turnContext = null) | ||
| protected virtual Dictionary<string, string> FillRecognizerResultTelemetryProperties(RecognizerResult recognizerResult, Dictionary<string, string> telemetryProperties, DialogContext dialogContext = null) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this shipped in 4.8? I would think this is a breaking change to change this signature.
I doubt you need the DC, you just sneed the ITurnContext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was. I had misunderstood the way the expression value worked, which means that the current implementation doesn't get the right application ID, so I think I do need the dialog context unless there is another way to get the value ->
botbuilder-dotnet/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/LUIS/LuisAdaptiveRecognizer.cs
Lines 140 to 156 in 0c85976
| protected override Dictionary<string, string> FillRecognizerResultTelemetryProperties(RecognizerResult recognizerResult, Dictionary<string, string> telemetryProperties, DialogContext dc) | |
| { | |
| var (logPersonalInfo, error) = this.LogPersonalInformation.TryGetValue(dc.State); | |
| var (applicationId, error2) = this.ApplicationId.TryGetValue(dc.State); | |
| var topTwoIntents = (recognizerResult.Intents.Count > 0) ? recognizerResult.Intents.OrderByDescending(x => x.Value.Score).Take(2).ToArray() : null; | |
| // Add the intent score and conversation id properties | |
| var properties = new Dictionary<string, string>() | |
| { | |
| { LuisTelemetryConstants.ApplicationIdProperty, applicationId }, | |
| { LuisTelemetryConstants.IntentProperty, topTwoIntents?[0].Key ?? string.Empty }, | |
| { LuisTelemetryConstants.IntentScoreProperty, topTwoIntents?[0].Value.Score?.ToString("N2") ?? "0.00" }, | |
| { LuisTelemetryConstants.Intent2Property, (topTwoIntents?.Count() > 1) ? topTwoIntents?[1].Key ?? string.Empty : string.Empty }, | |
| { LuisTelemetryConstants.IntentScore2Property, (topTwoIntents?.Count() > 1) ? topTwoIntents?[1].Value.Score?.ToString("N2") ?? "0.00" : "0.00" }, | |
| { LuisTelemetryConstants.FromIdProperty, dc.Context.Activity.From.Id }, | |
| }; |
If I do need DialogContext, given that adaptive isn't GA yet and we have not documented any of the telemetry bits yet, I think this is an acceptable change for us to make here. Thoughts?
tomlm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
gabog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed with the SDK team
|
Based on the review from the SDK team, we have decided that given the method with the altered signature is only currently used by the Adaptive recognizers, and is essentially only used internally, we will make the change. |
Based on the review from the SDK team, we have decided that given the method with the altered signature is only currently used by the Adaptive recognizers, and is essentially only used internally, we will make the change.
@cwhitten @vishwacsena Once these changes have been approved, I can raise an issue for composer to detail the changes needed in the runtime for telemetry.