If your skill takes time to prepare a full response to the user request, you can send progressive responses to keep the user engaged. A progressive response is Speech Synthesis Markup Language (SSML) content, including text-to-speech and short audio, that Alexa plays to the user while waiting for the full skill response.
To send a progressive response, call the Progressive Response REST API to send the content to Alexa.
When to send progressive responsesYou can use progressive responses to accomplish the following goals:
For example, a skill to look up and book taxi rides might take a few seconds to access an external API to reserve a ride. Instead of remaining silent during the external interaction, your skill can return the following message to let the user know that the skill is working on the request.
User: Alexa, ask Ride Hailer to book a ride to the airport. (Normal IntentRequest
sent to the Ride Hailer skill.)
Additional back-and-forth to collect all the information needed to fulfill this intent.
Alexa: OK, please wait while I look up details for your ride⦠(Progressive response while the skill prepares the full response.)
Alexa: OK, I've reserved your ride. It should arrive at your home in thirty minutes. (Normal response to the IntentRequest
)
You can send progressive responses from the context of a current LaunchRequest
or IntentRequest
. You can't send progressive responses from any other request types, such as AudioPlayer
requests.
Important: Progressive responses don't change the overall time allowed for a response. When a user invokes a skill, the skill has approximately eight seconds to return a full response. The skill must finish processing any progressive responses as well as the full response within this time.
Steps to send a progressive responseTo send a progressive response, complete the following steps:
LaunchRequest
or IntentRequest
. context.System.apiAccessToken
and request.requestId
to construct a valid Progressive Response API request.Send directive
API with the content that you want Alexa to speak. <speak>
tags.Progressive responses are only played on the device if they arrive before the Alexa service receives the full response from the skill. For the best user experience, your skill should wait until the progressive response completes before you send the full response. The Progressive Response API returns an HTTP 204 No Content
status code after the progressive response is ready to play on the device.
You can embed short recorded audio within a progressive response with the SSML <audio>
tag. The audio can't be longer than 30 seconds, which is shorter than the normal audio length allowed in the <audio>
tag. For additional MP3 requirements, see <audio>
.
For optimal performance, Amazon recommends that you host your MP3 files for SSML responses in close proximity to where your skill is hosted. For example, if the Lambda function for your skill is hosted in the US West (Oregon) region, you will get better performance if you upload your MP3s to a US West (Oregon) S3 bucket.
In addition to using S3 for hosting, Amazon recommends that you use a content delivery network (CDN) such as AWS CloudFront for hosting media assets to prevent throttling under high load.
Last updated: May 29, 2024
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4