3-p*_*utt 6 azure-application-insights botframework azure-qna-maker kql
我们正在使用连接到Azure 机器人服务的QnA Maker。在知识库 (KB) 中,我们为每个问题添加了一个跟进提示:This did NOT answer my question
这意味着如果提供了错误的响应,最终用户可以指出,对话历史将如下所示:
我们要做的是重播对话历史,以便我们可以看到:
我们打开了Application Insights,因此我们可以通过以下查询从日志中看到这两个问题:
traces
| project timestamp,
itemId,
question = customDimensions.Question,
answer = customDimensions.Answer
| order by timestamp
Run Code Online (Sandbox Code Playgroud)
这将返回这两行:
但是,我们正在尝试找到可以关联这两个记录的唯一对话 ID 或会话 ID。请注意,itemId非常相似,但不完全相同:
53be8c14-702c-11ea-8c41-11c1c266dc55
53be8c13-702c-11ea-8c41-11c1c266dc55Run Code Online (Sandbox Code Playgroud)
一种解决方法是仅使用 的前 7 位数字itemID并基于该部分匹配进行连接,如下所示:
traces
| where customDimensions.Question contains "This did NOT answer my question"
| project itemId,
SessionID = extract("^[a-z0-9]{7}", 0, itemId),
timestamp
| join (
traces
| extend question = tostring(customDimensions['Question'])
| extend answer = tostring(customDimensions['Answer'])
| where message contains "GenerateAnswer"
and question !contains "This did NOT answer my question"
| project itemId,
SessionID = extract("^[a-z0-9]{7}",0,itemId),
question,
answer,
timestamp
) on SessionID
| project question, answer, SessionID, timestamp //, itemId, itemId1
| order by timestamp desc, SessionID
Run Code Online (Sandbox Code Playgroud)
但是我们不确定该值是否可靠地仅相差第 8 位,因此希望使用不那么脆弱的 ID
| 归档时间: |
|
| 查看次数: |
345 次 |
| 最近记录: |