[英]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.