May 2020
Intermediate to advanced
404 pages
10h 52m
English
Once we have the text version of the user's speech-based query, we will send it to the Dialogflow agent, as shown:
function goDialogFlow(text){ $.ajax({ type: "POST", url: "https://XXXXXXXX.gateway.dialogflow.cloud.ushakov.co", contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify({ "session": "test", "queryInput": { "text": { "text": text, "languageCode": "en" } } }), success: function(data) { var res = data.queryResult.fulfillmentText; speechSynthesis.speak(new SpeechSynthesisUtterance(res)); }, error: function() { console.log("Internal Server Error"); } }); }
You'll observe that when the API call succeeds, we use the SpeechSynthesis API to speak out the ...
Read now
Unlock full access