question

gavincheng avatar image
gavincheng asked

Can Alexa voice service return text in the response?

Is it possible to return the recognized speech or the json file in the AVS response? Or from my customized Alexa skill kit? Thanks!
alexa voice service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ronswaine avatar image
ronswaine answered
While you're waiting for a nice solution, you could always just watch the echo.amazon.com feed or do your own call (once authenticated) to: https://pitangui.amazon.com/api/cards?limit=1 And parse it for the text of what Alexa heard / how it responded.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

elstryan@Amazon avatar image
elstryan@Amazon answered
Hello, Thank you for your interest in AVS! For the skills kit I believe that what you are looking for is the AMAZON.LITERAL see https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface Message was edited by: elstryan@Amazon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

gavincheng avatar image
gavincheng answered
My intention is to get back the natural language parsing result (the json block sent from AVS to skill kit) back from AVS. Is it possible?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

elstryan@Amazon avatar image
elstryan@Amazon answered
Hi Gavin, Unfortunately the parsed speech is only available in your skill, in the AVS API when considering speech we only stream audio back and forth between the device and the cloud. If you really wanted to get the text back to your AVS device you would have to forward this parsed result information from your skill to your AVS device. Ex: if you are hosting your skill on lambda you would have to send the info (perhaps the AMAZON.LITERAL) from lambda to your AVS device. Alternatively you can put the logic of handling the end-users utterance in your skill and forward events to your AVS device from your skill service. Ex: I assume what you really is to take some kind of action on your device based on what the user speaks. You could craft your skill such that when the user says "Ask YOURCUSTOMSKILL to BLAH my device", then you will receive an intent for this in your skill service and you can then send an event to your device (have a web server on your device) that will perform the desired action.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

gavincheng avatar image
gavincheng answered
Thanks for your prompt answer! How can our skill know which device the request is sent from? When our device client sends request to AVS, can we set some identity information (like session id or device id) and then pass that onto our skill kit?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

elstryan@Amazon avatar image
elstryan@Amazon answered
Thats a really good question! You can look at account linking ( https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system). This would allow you to associate an Alexa user with a profile in another service and you would use that other service to keep a mapping between AVS devices and users. We realize that this is really heavyweight but as I said before the AVS api is for streaming audio back and forth and responding to directives defined by Alexa (play music, etc).
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sandhya avatar image
Sandhya answered

Hi,

"If you really wanted to get the text back to your AVS device you would have to forward this parsed result information from your skill to your AVS device. " -

I am currently using a lambda function for my skill. I would like to get the text/JSON response on my client device. How can I do that? Need help.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.