【发布时间】:2021-11-12 09:35:05
【问题描述】:
我正在尝试使用 QnAMaker 的 Application Insights 登录 Azure 门户。我注意到每个表中与 customEvents 字段关联的所有数据都是空的:
这是我在 Azure 的查询编辑器中使用的查询,位于 Application Insight 的日志中:
requests |project
ActivityId = customDimensions.activityId,
ActivityType = customDimensions.activityType,
ChannelId = customDimensions.channelId ,
ConversationId = session_Id ,
ReplyActivityId = customDimensions.replyActivityId ,
FromId = customDimensions.fromId ,
Locale = customDimensions.locale ,
RecipientId = customDimensions.recipientId,
Speak = customDimensions.speak ,
Text = customDimensions.text,
EventName = name,
Time = timestamp,
Date = timestamp,
DialogInstanceId = customDimensions.InstanceId,
DialogId = customDimensions.DialogId ,
DialogStepName = customDimensions.StepName,
Luis_ApplicationId = customDimensions.applicationId,
Luis_Intent = customDimensions.intent,
Luis_IntentScore = customDimensions.intentScore,
Luis_Entities = customDimensions.entities,
Luis_Question = customDimensions.question,
Luis_SentimentLabel = customDimensions.sentimentLabel,
Luis_SentimentScore = customDimensions.sentimentScore,
QnA_KnowledgeBaseId = customDimensions.knowledgeBaseId,
QnA_Answer = customDimensions.answer,
QnA_ArticleFound = customDimensions.articleFound,
QnA_OriginalQuestion = customDimensions.originalQuestion,
QnA_Question = customDimensions.question,
QnA_QuestionId = customDimensions.questionId,
QnA_Score = customDimensions.score,
QnA_UserName = customDimensions.username,
User_City = client_City,
User_State = client_StateOrProvince,
User_Country = client_CountryOrRegion,
Feedback_Value = customDimensions.Feedback,
Feedback_Comment = customDimensions.Comment,
Feedback_Tag = customDimensions.Tag
所有 customDimensions.____ 数据均为空。如何调整我的 QnAMaker 代码来记录这些数据?
这里是 QnAMaker 被实例化的地方:
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.AI.QnA;
using Microsoft.Extensions.Configuration;
using System.Net.Http;
namespace Microsoft.BotBuilderSamples
{
public class BotServices : IBotServices
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly IBotTelemetryClient _telemetryClient;
public BotServices(IConfiguration configuration, IBotTelemetryClient telemetryClient, IHttpClientFactory httpClientFactory)
{
_httpClientFactory = httpClientFactory;
_telemetryClient = telemetryClient;
var httpClient = _httpClientFactory.CreateClient();
QnAMakerService = new QnAMaker(new QnAMakerEndpoint
{
KnowledgeBaseId = configuration["QnAKnowledgebaseId"],
EndpointKey = configuration["QnAAuthKey"],
Host = GetHostname(configuration["QnAEndpointHostName"])
},
null,
httpClient,
_telemetryClient);
}
public QnAMaker QnAMakerService { get; private set; }
private static string GetHostname(string hostname)
{
if (!hostname.StartsWith("https://"))
{
hostname = string.Concat("https://", hostname);
}
if (!hostname.EndsWith("/qnamaker") && !hostname.Contains("/v5.0"))
{
hostname = string.Concat(hostname, "/qnamaker");
}
return hostname;
}
}
}
this 是我遵循的教程。
【问题讨论】:
-
在QnAMaker中使用
customDimensions可以参考Schema of Bot Analytics Instrumentation。
标签: azure-application-insights qnamaker