Throw warnings for exceeding known platform limitations
See original GitHub issueNot sure if this belongs here or in alexa-app-server.
I spent the last three and a half weeks discovering/troubleshooting the 24k response size limit. Could warnings be thrown in the console so developers would have some clue that the same code will fail on an Alexa device?
Response Format
This section documents the format of the response that your service returns. The service for an Alexa skill must send its response in JSON format.
Note the following size limitations for the response:
- The
outputSpeech
response cannot exceed 8000 characters. - All of the text included in a
card
cannot exceed 8000 characters. This includes thetitle
,content
,text
, and image URLs. - An image URL (
smallImageUrl
orlargeImageUrl
) cannot exceed 2000 characters. - The
token
included in anaudioItem.stream
for theAudioPlayer.Play
directive cannot exceed 1024 characters. - The
url
included in anaudioItem.stream
for theAudioPlayer.Play
directive cannot exceed 8000 characters. - The total size of your response cannot exceed 24 kilobytes.
If your response exceeds these limits, the Alexa service returns an error.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Compiler Warnings by compiler version | Microsoft Learn
This option only suppresses warnings, not new error messages. Don't suppress all new warnings permanently! We recommend you always compile at ...
Read more >Warning Options (Using the GNU Compiler Collection (GCC))
3.8 Options to Request or Suppress Warnings. Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky ......
Read more >Runtime warnings and convergence problems - Stan
Here we walk through the types of warnings and hints to help you diagnose and resolve underlying modelling problems.
Read more >Error Messages in Maps Static API - Google Developers
The Maps Static API may issue an error or warning when something goes wrong. ... such an error condition is when the application...
Read more >LaTeX/Errors and Warnings - Wikibooks
It may also display warnings for less serious conditions. Don't panic if you see error messages: it is very common to mistype or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll add another related case. Only certain characters are allowed to be spoken within SSML responses, and if invalid characters are passed it errors the response. I’ve run into a number of times when pulling data from other APIs that include user input.
As a (very) rough illustration, I’ve been using the following RegEx/JavaScript blacklist to filter out some bad characters. It might be worth it to automatically clean the SSML code to make sure it will be valid, perhaps with a good whitelist.
It would likely be optional or a secondary function such as
.validatedSay()
, given there are a variety of ways to either substitute or remove the text. Would maybe be best as an add-on library even.Example:
text = (text || '').replace(/[^\w\s/<>.,-"']/gi, '').replace('&', 'and').replace('=', 'equals').replace('@', 'at');
I’ll take a stab. I created the fork and now it looks like I have some tuts to catch up on writing tests, but this seems like a good spot for me to get started. Thanks for the link.