In Details: Example: user:- asks About Cricket News. Alexa:- Reads about the new. If users says come again or replay user: Come again. Alexa: Must read it again what it spoke earlier.
How to handle this situation using webhooks.
Thanks in advance.
In Details: Example: user:- asks About Cricket News. Alexa:- Reads about the new. If users says come again or replay user: Come again. Alexa: Must read it again what it spoke earlier.
How to handle this situation using webhooks.
Thanks in advance.
You can make use of sessionAttributes
to keep track of the last response that Alexa spoke. Whenever you return a response just store the speech and re-prompt in sessionAttributes
and whenever a ComeAgainIntent
is triggered, take the value from the sessionAttributes
and respond accordingly.
Ex:
...
"sessionAttributes": {
"lastResponse": {
"speech": "This was my last speech",
"reprompt": "This was my lst reprompt"
}
}
...
Every time before building the response store the response as lastSpeech in session attributes and write a comeAgainIntent or use amazon.REPEAT intent to repeat the response by getting lastSpeech from session attributes.