In my python webhook, I am returning JSON response as-
{
"speech":"Speak this",
"ssml": <speak><audio src="[link to a mp3 file]"></audio></speak>,
"displayText": "Expected text",
"contextOut": [],
"source": ""
}
However, what I get in DialogFlow from "Show JSON" is-
"fulfillment": {
"speech": "Speak this",
"source": "",
"displayText": "Expected text",
"messages": [
{
"type": 0,
"speech": "Speak this"
}
]
}
Here, the response got no SSML key. Also, if I remove the "speech" key from my program, I get this error in Google assistant test app, MalformedResponse expected_inputs[0].input_prompt.rich_initial_prompt.items[0].simple_response: 'text_to_speech' or 'ssml' must be set.
Please help!
ANSWER
"speech":'<speak><audio src="[link to a mp3 file]"></audio></speak>'
Did the trick