Why does this specific webhook response (passed by DialogFlow back to Google Assistant)
{
"fulfillmentMessages" : [ {
"payload" : {
"google" : {
"richResponse" : {
"items" : [ {
"simpleResponse" : {
"textToSpeech" : "And are you male or female?"
}
} ]
},
"expectUserResponse" : true
}
},
"text" : {
"text" : [ "And are you male or female?" ]
}
}, {
"quickReplies" : {
"quickReplies" : [ "Male", "Female" ]
}
} ],
"fulfillmentText" : "And are you male or female?",
"outputContexts" : [ ... ]
}
Error as:
"MalformedResponse: Failed to parse Dialogflow response into AppResponse because of empty speech response"
In the case of Google Assistant, the responses are not part of
fulfillmentMessages
but are in apayload
object which should be located at the top level of your response.Note that
quickReplies
andtext
are valid for Dialogflow fulfillment messages but not for Google Assistant too. Instead, you should usesimpleResponse
andsuggestions
fields and put them in the response.So, for example here is a response for Google Assistant which is made of suggestion chips and a simple response:
For Dialogflow fulfillment messages (in the Dialogflow console for example), it would have been something like that:
Hope that helps.