Skip to content

Conversation

@garypretty
Copy link
Contributor

@garypretty garypretty commented Apr 9, 2020

  • Adds UseTelemetry extension method for DiaogManager which adds IBotTelemetryClient to turn state for use by adaptive recognizers.
  • Adaptive recognizers will now use the IBotTelemetryClient on the turn state unless the TelemetryClient property on the recognizer has been set.
  • Adds LogPersonalInformation property to QnAMaker dialogs and LUIS / QnA adaptive recognizers. Adaptive LUIS / QnA will look in settings.telemetry.logPersonalInformation by default.
  • Ensures QnAMaker client is always passed a TelemetryClient if set, along with the LogPersonalInformation flag (Fixes QnAMakerDialog should create QnAMaker with more parameters #3472)
  • LUIS Adaptive recognizer: Ensure telemetry properties passed in can override default properties

@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.

Tom Laird-McConnell and others added 9 commits March 10, 2020 12:46
…3539) (#3542)

* fix lack of a generic typed method for posting activities to skills

* remove duplicated code

Co-authored-by: Swagat Mishra <swagatm@microsoft.com>

Co-authored-by: swagat mishra <swagatmishra2007@gmail.com>
Co-authored-by: Swagat Mishra <swagatm@microsoft.com>
#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
@garypretty garypretty requested a review from tomlm April 9, 2020 15:44
/// The flag to indicate in personal information should be logged in telemetry.
/// </value>
[JsonProperty("logPersonalInformation")]
public BoolExpression LogPersonalInformation { get; set; } = "=settings.telemetry.logPersonalInformation";
Copy link
Contributor

@vishwacsena vishwacsena Apr 10, 2020

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)
{
Copy link
Contributor

@tomlm tomlm Apr 15, 2020

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.

Copy link
Contributor Author

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 ->

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
tomlm previously requested changes Apr 15, 2020
Copy link
Contributor

@tomlm tomlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link
Contributor

@gabog gabog left a 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

@garypretty
Copy link
Contributor Author

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.

@garypretty garypretty dismissed tomlm’s stale review April 16, 2020 13:11

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QnAMakerDialog should create QnAMaker with more parameters

10 participants