gpt4 book ai didi

botframework - 在QnA Maker的App Insights中寻找唯一的 "Conversation ID"

转载 作者:行者123 更新时间:2023-12-03 15:03:09 24 4
gpt4 key购买 nike

我们正在使用QnA Maker附加的Azure Bot Service。在知识库(KB)中,我们为每个表示This did NOT answer my question的问题添加了Follow up Prompt:

Knowledge Base > Follow Up Prompt

这意味着如果提供了错误的响应,则最终用户可以指出这一点,并且对话历史记录将如下所示:

Example Conversation

我们正在尝试做的是重播对话历史记录,这样我们就可以看到:

  • 原始用户提示
  • 原始答案
  • 后续跟进问题/答案

  • 我们打开了 Application Insights,因此我们可以通过以下查询从日志中看到这两个问题:
    traces
    | project timestamp,
    itemId,
    question = customDimensions.Question,
    answer = customDimensions.Answer
    | order by timestamp

    这将返回这两行:

    App Insights Logs

    但是,我们正在尝试找到可以关联这两个记录的唯一对话ID或 session ID。请注意, itemId非常相似,但不完全相同:
    53be8c14-702c-11ea-8c41-11c1c266dc55
    53be8c13-702c-11ea-8c41-11c1c266dc55

    是否有可用于加入这两个事件的唯一键?

    一种解决方法是仅使用 itemID的前7位数字,然后根据该部分匹配进行加入,如下所示:
    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

    但是我们不确定该值将可靠地仅相差8位数字,因此希望使用ID较不脆弱的ID

    最佳答案

    我最近通过积极学习实现了QnA制造商BOT。

    该示例位于here

    这与您要实现的目标非常相似。

    enter image description here

    关于botframework - 在QnA Maker的App Insights中寻找唯一的 "Conversation ID",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60880867/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com