I'm working on an Alexa skill and have decided to declare a slot for one of the intents as AMAZON.SearchQuery type, which allows free-form speech. If the speaker leaves out that slot, my lambda code elicits the slot, so at that point I'm waiting for a response that I can grab and use to search through data.
If the user says "stop" at that point (or "cancel"), "stop" becomes my search query. What's the best practice for dealing with that kind of dialog? Is there an "Alexa way" to handle it or do I have to do it in my lambda?
You would need to handle that in your skill, as a potential input to the intent that you are using the AMAZON.SearchQuery
slot with.
Deciding exactly how to deal with it is up to you but you should think about the experience that would be least confusing to the user.
You can choose to stop the skill if you get a stop
or cancel
utterance as the value for that slot, or if you think it might be possible the user is actually searching for stop
or cancel
then perhaps introduce one more confirmation: "Would you like to search for stop
?"