2

I'm building a bot using Dialogflow CX and I would like to get the entire transcript, particularly the text messages that the user responded when a particular intent is triggered.

I'm using a Node.js server to communicate with the bot from a React application.

Mohan Raj
  • 41
  • 5

2 Answers2

1

One way is to Pass data to Dialogflow cx bot platform using webhook fulfillment and store it in the format you want.

Another way is to connect with any third-party tools that support Dialogflow integrations. There's a chat transcript feature that will send the entire transcript to the email that you want.

Please refer to this doc for more details and the setup.

Samir1810
  • 389
  • 1
  • 10
0

if I understand that correctly, you try to get the conversation between bot and user. For that you should use a Webhook-Integration, that sends a request message to your Webhook. In your Webhook you can feel free to save the json request or edit it. For example in python:

import json

def cx_debug_json(request):

  request_json = request.get_json()
  
  with open("conversation", 'w') as json_file:
    json.dump(request_json, json_file)

Your file than should have a json format with different specifications. If you just want the specific text strings, you have to edit the request_json. For example to delete specific paramaters:

if "fulfillmentResponse" in request_json.keys():
    response_json["fulfillment_response"] = request_json["fulfillmentResponse"]
if "pageInfo" in request_json.keys():
    response_json["page_info"] = request_json["pageInfo"]
if "payload" in request_json.keys():
    response_json["payload"] = request_json["payload"]
if "sessionInfo" in request_json.keys():
    response_json["session_info"] = request_json["sessionInfo"]
    if "parameters" in response_json["session_info"].keys():
        if target_parameter in response_json["session_info"]["parameters"].keys():
            response_json["session_info"]["parameters"][target_parameter] = None

Now you need to figure out the key names of the text strings (simple debug the incoming request from the webhook) and then editing or extract them as you like.

Raspi
  • 1
  • 3