有没有办法在Dialogflow中检索对话历史记录? [英] Is there a way to retrieve the conversation history in Dialogflow?

查看:100
本文介绍了有没有办法在Dialogflow中检索对话历史记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以获取用户和代理之间的完整对话.与我通过单击历史记录标签获得的内容非常相似,但是是以编程方式进行的.关键是将用户和代理之间的交互保存为文本.

Is there a way to obtain the full conversation between the user and agent. Pretty much similar to what I get by clicking the history tag but programmatically. The point is to save the interaction between user and agent as text.

谢谢高级玩家!

推荐答案

没有API可直接从Dialogflow检索历史记录.但是您可以做的就是启用日志记录.

There's no API to retrieve the history from Dialogflow directly. But what you can do is enable logging.

Agent Settings > General > Log Settings > Log interactions to Google Cloud

所有交互都将登录到Google Stackdriver,该API具有一个API,您可以在其中检索所有日志以及聊天记录.

And all the interactions will be logged into Google Stackdriver, which has an API where you will be able to retrieve all the logs, and hence the chat history.

https://cloud.google.com/logging/docs/reference/v2/rest/

这是将日志存储在Stackdriver中的方式

This is how the logs are stored in Stackdriver

{
  insertId: "19ignahfzlu2o7"
  labels: {
    protocol: "V2BETA1"
    request_id: "3033c2e3-7cab-4a00-b2b7-207be8d22366"
    type: "dialogflow_request"
  }
  logName: "projects/dialogflowproject-ca57b/logs/dialogflow_agent"
  receiveTimestamp: "2019-03-27T12:44:42.547531753Z"
  resource: {
    labels: {
      project_id: "dialogflowproject-ca57b"
    }
    type: "global"
  }
  severity: "INFO"
  textPayload: "Dialogflow gRPC Request : session: projects / dialogflowproject - ca57b / agent / sessions / 53 d451c1 - 40 f5 - c00e - cbbd - 178e ff32b971 "
  query_params {
    time_zone: "America/Buenos_Aires"
  }
  query_input {
    text {
      text: "hi"
      language_code: "en"
    }
  }
  "  
  timestamp: "2019-03-27T12:44:42.420Z"
  trace: "53d451c1-40f5-c00e-cbbd-178eff32b971"
}

然后您可以从那里检索会话,并建立整个聊天记录.

You can then retrieve the session from there, and build the whole chat history.

另一种选择是,如果消息首先通过您的服务器进行交互,则在交互发生时将其保存到数据库中,这可能不是您的情况.

The other alternative is to save the interactions to a database when they are happening if the messages goes through your server first, which may not be your case.

这篇关于有没有办法在Dialogflow中检索对话历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆