简体   繁体   English

如何使用 stackdriver 从对话流中检索对话数据?

[英]How do I retrieve conversation's data from dialogflow using stackdriver?

I am a creating voice bot using dialogflow were an user can report an incident.我是一个使用对话流创建语音机器人的用户可以报告事件。 The goal here is:这里的目标是:

1 - User talk to the bot and respond to several questions. 1 - 用户与机器人交谈并回答几个问题。

2 - I get the conversation history with questions and answers. 2 - 我通过问题和答案获取对话历史记录。

3 - I organize the data in an excel sheet. 3 - 我在 Excel 表中组织数据。

4 - Use data to create incidents on another system. 4 - 使用数据在另一个系统上创建事件。

I am stuck on step 2.我被困在第 2 步。

I was able to get some conversations on stackdriver, but not all the conversations were there and the way they are shown is really hard to put in a spreadsheet as question and answers.我能够在 stackdriver 上获得一些对话,但并非所有对话都在那里,而且它们的显示方式真的很难作为问题和答案放入电子表格中。

I will need something like this:我需要这样的东西:

Question: "What happened?"问题:“怎么了?” Answer: "bla bla bla"答案:“bla bla bla”

Question: "Where it happened?"问题:“它发生在哪里?” Answer: "Another bla bla bla"答案:“另一个bla bla bla”

Please, any help is appreciated.请,任何帮助表示赞赏。

You could use the entries.list method from the Stackdriver REST API.您可以使用 Stackdriver REST API 中的 entries.list 方法。 https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list

Remind to first activate "Log interactions to Google Cloud" in your Dialogflow console agent's settings page.提醒您首先在 Dialogflow 控制台代理的设置页面中激活“将交互记录到 Google Cloud”。
Then just call the API (in this example, with a curl command):然后只需调用 API(在本例中,使用 curl 命令):

curl -X POST \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
-H "Content-Type: application/json" "https://logging.googleapis.com/v2/entries:list" \
--data "{'resourceNames':['projects/YOUR_AGENT_PROJECT'], \
'filter':'logName=projects/YOUR_AGENT_PROJECT/logs/dialogflow_agent'}"


You could also use a gcloud command like:您还可以使用 gcloud 命令,例如:

gcloud logging read "logName=projects/YOUR_AGENT_PROJECT/logs/dialogflow_agent"


From there, you can easily filter and process the results.从那里,您可以轻松过滤和处理结果。

You can't use Stackdriver and DialogFlow in that way.您不能以这种方式使用 Stackdriver 和 DialogFlow。 In your intent you have to enable webhook call and in the fullfilment process and store the dialog wherever you need.在您的意图中,您必须启用 webhook 调用并在 fullfilment 过程中并将对话框存储在您需要的任何位置。 After that retrieve the information.之后检索信息。 Check this link to get more information about save an retrieve information across invocations, also check Actions on Google查看此链接以获取有关跨调用保存检索信息的更多信息,还可以查看Actions on Google

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Stackdriver检查GCE实例的正常运行时间? - How do I check the uptime of a GCE instance using Stackdriver? Dialogflow 对话/来自 Webhook 的响应恢复 - Dialogflow conversation / Response recovery from Webhook 如何使用 PHP 从 Google Cloud SQL 连接和检索数据? - How do I connect and retrieve data from Google Cloud SQL using PHP? 对话流 CX | 如何让机器人发起对话? - Dialogflow CX | How to let the bot initiate the conversation? 如何使用Java客户端库将已分类和分组的日志发送到Stackdriver? - How do I send categorized and grouped logs into Stackdriver using the Java Client Library? 如何在 python 中设置 stackdriver 日志条目的严重性? - How do I set the severity of a stackdriver log entry in python? 如何在Stackdriver Logging上禁用来自k8s_cluster的日志? - How to disable logs from k8s_cluster on Stackdriver Logging? 如何将移动设备添加到我的StackDriver个人资料中? - How do I add my mobile device to my StackDriver profile? 如何找出来自 dialogflow 的响应的来源? - How do I find out where the response from dialogflow comes from? 如何从gcloud工具中检索App Engine应用程序的源代码? - How do I retrieve my App Engine app's source code from the `gcloud` tool?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM