0
votes

I have a lambda function that executes successfully with an intent called GetEvent that returns a specific string. I've created one utterance for this intent for testing purposes (one that is simple and doesn't require any of the optional slots for invoking the skill), but when using the service simulator to test the lambda function with this utterance for GetEvent I'm met with a lambda response that says "The response is invalid". Here is what the interaction model looks like:

#Intent Schema

   {
   "intents": [
     {
       "intent": "GetVessel",
       "slots": [
         {
           "name": "boat",
           "type": "LIST_OF_VESSELS"
         },
         {
           "name": "location",
           "type": "LIST_OF_LOCATIONS"
         },
         {
           "name": "date",
           "type": "AMAZON.DATE"
         },
         {
           "name": "event",
           "type": "LIST_OF_EVENTS"
         }
       ]
     },
     {
       "intent": "GetLocation",
       "slots": [
         {
           "name": "event",
           "type": "LIST_OF_EVENTS"
         },
         {
           "name": "date",
           "type": "AMAZON.DATE"
         },
         {
           "name": "boat",
           "type": "LIST_OF_VESSELS"
         },
         {
           "name": "location",
           "type": "LIST_OF_LOCATIONS"
         }
       ]
     },
     {
       "intent": "GetEvent",
       "slots": [
         {
           "name": "event",
           "type": "LIST_OF_EVENTS"
         },
         {
           "name": "location",
           "type": "LIST_OF_LOCATIONS"
         }
       ]
     }
   ]    
}

With the appropriate custom skill type syntax and,

#First test Utterances
GetVessel what are the properties of {boat}

GetLocation where did {event} occur

GetEvent get me my query

When giving Alexa the utterance get me my query the lambda response should output the string as it did in the execution. I'm not sure why this isn't the case; this is my first project with the Alexa Skills Kit, so I am pretty new. Is there something I'm not understanding with how the lambda function, the intent schema and the utterances are all pieced together?

UPDATE: Thanks to some help from AWSSupport, I've narrowed the issue down to the area in the json request where new session is flagged as true. For the utterance to work this must be set to false (this works when inputting the json request manually, and this is also the case during the lambda execution). Why is this the case? Does Alexa really care about whether or not it is a new session during invocation? I've cross-posted this to the Amazon Developer Forums as well a couple of days ago, but have yet to get a response from someone.

1
First, a question. Did you type in "ask <skill name> to get me my query" to the service simulator? It isn't well documented, but you can't just type in the utterance. You need to invoke it like you would with the echo. (Minus the "Alexa" bit.) - Joseph Jaquinta
@JosephJaquinta didn't know that (not intuitive at all! But I've found that AWS could improve on their documentation), but I just tried Kirby get me my query & ask Kirby to get me my query and it still produced the same response. - Lame-Ov2.0
I asked because I'm not seeing anything obviously wrong with your data. So... 1) try "open Kirby" and see if that issues a launch request. If it does, and you handle it without error, then try "get me my query" in the same session. 2) Reduce your interaction model to just the GetEvent intent with no slots, and just the one utterance. See if that works for "ask Kirby to get me my query". If it does, add stuff back in one step at a time until it breaks. - Joseph Jaquinta
@JosephJaquinta Tried both methods and neither seems to have worked. I'm tempted to email AWSSupport, but I'm not sure how helpful they'd be - Lame-Ov2.0
If "Open Kirby" does not create a launch request, then there is a problem in your code, not your interaction model. Double check what you do for a launch request and your lambda logs and see where the error is. - Joseph Jaquinta

1 Answers

0
votes

This may or may not have changed -- the last time I used the service simulator (about two weeks ago at the time of writing) it had a pretty severe bug which would lead to requests being mapped to your first / wrong intent, regardless of actual simulated speech input. So even if you typed in something random like wafaaefgae it simply tries to map that to the first intent you have defined, providing no slots to said intent which may lead to unexpected results.

Your issue could very well be related to this, triggering the same unexpected / buggy behavior because you aren't using any slots in your sample utterance

Before spending more time debugging this, I'd recommend trying the Intent using an actual echo or alternatively https://echosim.io/ -- interaction via actual speech works as expected, unlike the 'simulator'