Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

Kevin M avatar image
Kevin M asked

Asking a question and getting a variable word length response?

Hello all! This question is likely something that's been asked before, but going through the documentation I haven't seen anything. Basically, I'm wondering if there is a "proper" way or a best practice to answer a simple question such as (for example): Alexa/MyApp: "What is your name?" User: "Kevin" Alexa/MyApp: "Hello, Kevin!" As I understand, any "input" into your app should map to an intent. And the way the Amazon middleware figures out what intent to send your application it needs to use your sample utterances to map the request to the intent and pull out the variable words. But I don't know the best way to ask a question and get a simple response without requiring the user to speak extra words. For example, I could have the user say "My name is Kevin" - and have "My name is {kevin | Name}" but I'd like to not require this. I realize this would put some of the responsibility on me to figure out what the User is saying. I.e. I need to know in the state of my application that I asked a question, and what the question was, because if I just get the word "Kevin" then I have no idea to do with it unless I remember I just asked for their name. That's fine. The same is true for things like, Alexa/MyApp: "Would you like me to email you?" User: "Yes" Yes, being a single word. Or, Alexa/MyApp: "Pick a number 1 through 10" User: "5" Any tips or hints on this? Is this just not yet possible? Thanks, and sorry if this is a duplicate question or is covered somewhere in the docs (I imagine it must be, I just haven't found anything!)
alexa skills 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.

Greg Crawford avatar image
Greg Crawford answered
According to the AppKit Voice Design - Best Practices documentation ( https://developer.amazon.com/public/solutions/devices/echo/alexa-app-kit/docs/alexa-appkit-voice-design-best-practices) it should be possible. Have you tried utterance patterns which only contain a slot? For example: MyIntent {name|Name}
10 |5000

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

Kevin M avatar image
Kevin M answered
I actually have not! It didn't seem to conform to any of the examples they gave, but I suppose I probably should have. Thanks for the tip! Have you tried this and/or gotten it to work? Thanks again!
10 |5000

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

Nick Gardner avatar image
Nick Gardner answered
Hi, I've tried using single word utterance patters successfully, and I haven't encountered any particular issues with it. Let us know if you get it working or have any other questions. Thanks, Nick
10 |5000

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