1

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.

2 - I get the conversation history with questions and answers.

3 - I organize the data in an excel sheet.

4 - Use data to create incidents on another system.

I am stuck on step 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.

I will need something like this:

Question: "What happened?" Answer: "bla bla bla"

Question: "Where it happened?" Answer: "Another bla bla bla"

Please, any help is appreciated.

EdmarJr
  • 11
  • 2

2 Answers2

1

You could use the entries.list method from the Stackdriver REST API. 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.
Then just call the API (in this example, with a curl command):

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 logging read "logName=projects/YOUR_AGENT_PROJECT/logs/dialogflow_agent"


From there, you can easily filter and process the results.

Ksign
  • 779
  • 5
  • 11
0

You can't use Stackdriver and DialogFlow in that way. In your intent you have to enable webhook call and in the fullfilment process and store the dialog wherever you need. After that retrieve the information. Check this link to get more information about save an retrieve information across invocations, also check Actions on Google

David C
  • 365
  • 2
  • 8
  • Thanks for your comment. Actually, these links you shared will help me to save the conversation for the user, as a cookie. However, what I would like to do is save the history of all conversations in a file or a data base. In a way that it will be easy to access. Can you help me with this? – EdmarJr Sep 18 '19 at 17:29
  • In this case instead to save it in a cookie you have to manage the way to save on another backend a file, a database, etc, depends on you write the code to do that. Maybe if you have the data on a cookie you can send it to a webservice that capture the headers (cookie). – David C Sep 19 '19 at 14:12