Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Add fulfillmentText to json when requestSource is null and a text message is found in responseMessages #336

Open
cchardeau opened this issue Apr 13, 2021 · 0 comments · May be fixed by #337

Comments

@cchardeau
Copy link

Expected Behavior

When requestSource is null and one text message "bot fulfillment text" is found in multiple responseMessages, we should add fulfillmentText: "bot fulfillment text" property to json.

This fix could be useful when you are using fulfillment with Dialogflow ES. It allows to avoid confusion between real and default bot response in Dialogflow ES history.

Example

Raw interaction log

{
  ...
  "fulfillmentMessages": [
    {
      "payload": {
        "barge-in": false
      }
    },
    {
      "text": {
        "text": [
          "bot fulfillment text"
        ]
      }
    }
  ],
  "fulfillmentText": "bot fulfillment text", // <= HERE
  "webhookStatus": {
    "webhookStatus": {
      "message": "Webhook execution successful"
    },
    "webhookUsed": true
  }
  ...
}

Dialogflow ES history

Use case

The bot says: bot fulfillment text
In history, Dialogflow administrator could read: bot fulfillment text
Dialogflow administrator is happy 🙂

Actual Behavior

Currently, a difference could exist between heard bot response and history bot reponse.

Example

Raw interaction log

{
  ...
  "fulfillmentMessages": [
    {
      "payload": {
        "barge-in": false
      }
    },
    {
      "text": {
        "text": [
          "bot fulfillment text"
        ]
      }
    }
  ],
  "webhookStatus": {
    "webhookStatus": {
      "message": "Webhook execution successful"
    },
    "webhookUsed": true
  }
  ...
}

fulfillmentText property is not present in response because responseMessages contains two elements : one text message and one payload message.

Dialogflow ES history

Use case

The bot says: bot fulfillment text
In history, Dialogflow administrator could read: bot default text
A difference exists between what we could read in Dialogflow ES history and what user heard.
Dialogflow administrator is not happy 🙁

Steps to Reproduce the Problem

  • Create a Dialogflow ES agent
  • Set default response "bot default response" for one intent (TestIntent)
  • Enable fulfillment for this intent (TestIntent)
  • In fulfillment:
    • Add agent.add(new Payload("PLATFORM_UNSPECIFIED", { "barge-in": false }, { rawPayload: true, sendAsMessage: true }))
    • Add agent.add("bot fulfillment response")
  • Trigger TestIntent by playing with bot
  • Check issue in "History" tab of Dialogflow ES agent

Specifications

  • Version: 0.6.2
  • Platform: Dialogflow ES
  • Agent version: V2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant