I am creating an action for Google assistant getting some data from a REST API. The action launch a http request then parse the response to create the resulting action speech, all this processing is done using a Promise to perform it asynchronously. As a result, there is a certain amount of time before the user get the action response.
Is there a way to first tell a acknowledgement sentence like "ok, I am searching" then as soon as the http answer is processed to complete the action with a second sentence ?
Below is the skeleton of the asynchronous intent:
app.intent('IntentName', (conv, {params}) => {
// ==> Provide here an acknowledgement to the user <==
// return a promise to handle this intent asynchronously
return new Promise(function (resolve, reject) {
http.get(httpOptions, function (resp) {
processing...
conv.close(strSpeech);
});
});
});