question

TecoMeAlexa avatar image
TecoMeAlexa asked

Query missing data from Alexa intent

Dear support,
I am developing an Alexa skill with AWS lambda backend, I encountered the following scenario:
if the user triggers an intent and there was some missing info to make the request, what is the proper way to handle such a case?

Note: I don't want to use Alexa slot filling, because it varies according to the user.

My tries: I let lambda respond with a question and create another intent to be triggered when the user answer (as a hidden intent).
I want also to know how in the certification process will they treat such a hidden intent.

regards,

alexa skills
10 |5000

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

1 Answer

Andy Whitworth avatar image
Andy Whitworth answered

It's not clear what your use-case it, please supply an example interation showing us your issue.

e.g.


User: Alexa open <skill name>

Alexa: <what does the skill respond with?>

User: <how does the user invoke the intent you're mentioning and what user specific data should be supplied>


4 comments
10 |5000

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

TecoMeAlexa avatar image TecoMeAlexa commented ·

For Example without any missing data
User: Alexa open <skill name>
Alexa: <welcome message>
User: turn bedroom spot on // [light] intent
Alexa: ok, turning bedroom spot on.

For example with some missing data
User: Alexa open <skill name>
Alexa: <welcome message>
User: turn spot on // [light] intent
Alexa: which room?
User: bedroom // [addInfo] intent
Alexa: ok, turning bedroom spot on.


1) will the certification team have any problem with [addInfo] intent?
2) is this the proper implementation for like this case? if we don't want to use slot filling.

0 Likes 0 ·
Andy Whitworth avatar image Andy Whitworth TecoMeAlexa commented ·
OK, how many variables are there ? Is it just the room name ? Or can the device name change too i.e. is it just "spot light" or could it be another device type ?

And, why are you not considering slots ? You can use DynamicEntities to dynamically set valid slot options within the skill execution, so for a given user you could set the valid list of room names / device names.

If you don't do that and go with the additional intent approach then your addInfo intent would need to be protected such that it can't get invoked out of context e.g.

User: Alexa, open <skill name>

Alexa: <welcome message>

User: bedroom

Alexa: ????

So you would need to introduce some state session variable in your code to keep track of the current skill state. When you're expecting the user to provide more information then you set the state to "MORE_INFO_REQUIRED" or similar. Then the canHandle() function of your addInfo intent would include the clause "&& state == "MORE_INFO_REQUIRED" to only invoke the intent when it is expected. If you don't do this then you will fail certification and also it could confuse the user if it were triggered out of context anyway.




1 Like 1 ·
TecoMeAlexa avatar image TecoMeAlexa Andy Whitworth commented ·

Thank you for your help,

Unfortunately, not one variable may in some cases be three.


Can you please explain which parameter in the JSON response is for the state? to set it as you said. this would be more flexible if got it correctly.

0 Likes 0 ·
Show more comments