dialogflow / dialogflow-fulfillment-nodejs

Dialogflow agent fulfillment library supporting v1&v2, 8 platforms, and text, card, image, suggestion, custom responses
Apache License 2.0
598 stars 281 forks source link

Can't use ssml -- Error: string required by Text constructor #159

Open LukeJanissen opened 6 years ago

LukeJanissen commented 6 years ago

I'm receiving the following error, whenever Im using SSML in my Dialogflow output (V2):

Error: string required by Text constructor. at new Text (/text-response.js:48:13)

aradwyr commented 6 years ago

@LukeJanissen Can you provide your code and more information?

LukeJanissen commented 6 years ago

@sarahdwyer Of course! Whenever I'm using SSML code in the audio output section of the Google Assistant response in Dialogflow, my webhook returns the error I mentioned above. This happens at the moment I'm declaring new WebhookClient({request: request, response: response}) (not even calling it). I already stripped my entire code, so the only thing it would do is send a exact copy of the request back. This works as long as I'm not declaring new WebhookClient, but I will need the SDK to add certain functionality to my webhook.

aradwyr commented 6 years ago

@LukeJanissen Do you have text-to-speech functionality and beta features enabled from settings?

mattcarrollcode commented 5 years ago

Please provide the code throwing the error

ivanchuk commented 5 years ago

I have the same issue, the error happends without my code, just when new WebhookClient({request: request, response: response}) is invoked (first line of webhook fulfillment. What can I do?

dhAlcojor commented 5 years ago

I'm having the same problem. According to Firebase logs the problem is nowhere in my code image

ivanchuk commented 5 years ago

Solved! The problem start in Dialogflow. Go to your intent and remove Google Assistant responses you've configured. I don't know why but the Google Assistant payloads and v2 agent are incompatibles right now.

If you remove it, payload will fix the issue and Webhook constructor works fine!