0
votes

Long story short...

  1. I started a simple skill from Facts blueprint "space facts"

  2. Created a const ->

    const WELCOME_MESSAGE = "Welcome! You want a space fact?";

  3. And separated LaunchRequest from IntentRequest (so, user can say "open space facts" or say "open space facts and say a fact")

    'LaunchRequest': function () {
    this.emit(':ask', WELCOME_MESSAGE); }
    'IntentRequest': function () {
    this.emit('GetNewFactIntent'); }
    

*Now if I start the skill only by saying "start space skills"... I receive the welcome message and "shouldEndSession": false as expected,

BUT if I say "exit" at this moment, I'll receive:

"There was a problem with the requested skill's response"

My JSON INPUT shows the expected "SessionEndedRequest"

    "request": {
    "type": "SessionEndedRequest",
    "requestId": "amzn1.echo-api.request.c6ea8178-3cdb-4119-ae73-e8ea86ebba6d",
    "timestamp": "2018-09-25T01:14:05Z",
    "locale": "en-US",
    "reason": "USER_INITIATED"
}

But I get a "null" JSON OUTPUT..

-I've done some research and found this https://github.com/alexa/skill-sample-nodejs-fact/issues/3

-I also tried an "Unhandled" like this... but still no luck

    'Unhandled': function () {
    this.emit('AMAZON.StopIntent');  },

Because of this, my skill got rejected today, so I would like to fix it and upload it again.

1
I am not sure what is happening, but ':ask' event has to have two parameters. First one is prompt, second one is reprompt. I see that you provided only one. This might be the issue. From documentation: this.emit(':ask', speechOutput, repromptSpeech);R. Vait

1 Answers

3
votes

Hello again and thank you for your time!

After re-reading the certification feedback I got by email, the problem was
"not returning StopIntent after saying “stop”" instead of saying "exit"

Also from what I now understand, the words "stop", "cancel", "exit" and "quit" have their own predefined functions, from which:

-when user says "stop", it should address to "StopIntent"

-when user says "cancel", it should address to "CancelIntent"

-after saying "exit" or "quit", it should USER_INITIATED force close with "SessionEndedRequest" and get no answer.

Therefore, these words should not be included on the sample utterances inside StopIntent, CancelIntent, HelpIntent or NavigateHomeIntent. Also, if any of the previous statements doesn't work, then you can't pass the certification.

After some analysis, my problem was not inside Lambda, but from my skill utterances. The cause of the problem was the addition of the words "exit" and "stop" inside the StopIntent AND CancelIntent.

From what I tested, there is no difference if you include or not the word "stop" inside StopIntent, but it causes interefence and there's no answer if you include the word inside StopIntent AND CancelIntent.

Now I re-submitted my skill and hopefully it will get uploaded soon. I'm writing this here in case any newbie as me gets stuck in the same situation. Thanks again and happy coding!