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

Adding custom payload removes fulfillmentText from response #209

Open
vanessaholland opened this issue Jan 12, 2019 · 3 comments
Open

Adding custom payload removes fulfillmentText from response #209

vanessaholland opened this issue Jan 12, 2019 · 3 comments

Comments

@vanessaholland
Copy link

Leaving out the payload results in only the unspecified platform message in the fulfillmentMessages (which is correct) and a fulfillmentText attribute.

{
  "fulfillmentMessages":[
     {"platform":"PLATFORM_UNSPECIFIED","text":{"text":["Hi!"]},"message":"text"}
  ],
  "fulfillmentText":"Hi!",
  "webhookPayload":null
}

good.

But when a payload is added it causes all the platform messages to be in the fulfillmentMessages instead of just the PLATFORM_UNSPECIFIED, and wipes out the fulfillmentText attribute

{
  "fulfillmentMessages": [
      {"platform":"ACTIONS_ON_GOOGLE","simpleResponses":{"simpleResponses":[{"textToSpeech":"Hi! ","ssml":"","displayText":""}]},"message":"simpleResponses"},
      {"platform":"ACTIONS_ON_GOOGLE","suggestions":{"suggestions":[{"title":"test"},{"title":"ing"},{"title":"this"}]},"message":"suggestions"},
      {"platform":"PLATFORM_UNSPECIFIED","text":{"text":["Hi!"]},"message":"text"},
      {"platform":"SLACK","quickReplies":{"quickReplies":["test","ing","this"],"title":""},"message":"quickReplies"}
  ],
  "fulfillmentText":"",
  "webhookPayload":{"fields":{"null":{"listValue":{"values":[{"stringValue":"test","kind":"stringValue"},{"stringValue":"ing","kind":"stringValue"},{"stringValue":"this","kind":"stringValue"}]},"kind":"listValue"}}}
}

bad.

is there a way around this? i've tried adding the text and webhookPayload to the agent both individually and as an array
i've even tried setting the agent.consoleMessages to null in the webhook.
No luck

@MARCoTheRobot
Copy link

Since there hasn't been any activity on this post for the past few months, I don't know if this is still an issue for you, but my advice is check the version you are running of the dialogflow-fulfillment library. I was having the same issue with adding a custom payload on an unspecified platform and tried following jdpowell's solution from #177 without success, but it said it needed a certain commit and up in order to work. I'm using the inline editor built into Dialogflow, and under package.json I saw that the version specified by default was an older release than the most current one. Changing it to reflect the latest release (^0.6.0) fixed this issue. Additionally, be sure to set the option {sendAsMessage:true} when you create a new Payload.

@satishp962
Copy link

Check this.. I got a fix for this. #248

@gabriel-soga-movile
Copy link

upgrading to version 0.6.1 solved for me

fgodino pushed a commit to fgodino/dialogflow-fulfill-ts that referenced this issue Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants