I'm using the AWS ASK SDK for Node.js V2 to build an Alexa skill, and I'm wondering if it's possible to programmatically generate or update 'Alexa Prompt' for the 'Intent confirmation'.
The challenge is that we are running a search for a price, and the goal is to inject the price into the 'Intent confirmation' message, before asking for it.
I was thinking of trying to 'reprompt' the user, and force the reprompt after I have a price, but this feels dirty:
module.exports = {
canHandle(handlerInput) {
return (
handlerInput.requestEnvelope.request.type === 'IntentRequest' &&
handlerInput.requestEnvelope.request.intent.name ===
'HelloWorldIntent'
);
},
async handle(handlerInput) {
let speechText;
let repromptText;
//perform web request to get price
//then dynamically update the intent confirmation response prompt to include price,
//before asking intent confirmation prompt?
return handlerInput.responseBuilder
.speak(speechText)
.getResponse();
}
}
The documentation is lacking to say the least.