0
votes

My skill times out with an error, "There was a problem with the requested skill's response."

enter image description here

I'm trying to end the session silently if the user does not say anything on both initial prompt and reprompt.

Currently, if the user says nothing the first time, it kicks off the reprompt.

If they say nothing after the reprompt, Alexa says the error message: "There was a problem with the requested skill's response."

enter image description here

Lambda function:

'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = undefined; 

const handlers = {
    'LaunchRequest': function () {
        const launchMsg = "How can I help you?";
        const reprompt = "You can say, give me the weather.";

        this.response.speak( launchMsg )
            .listen( reprompt );
            // errors out here on .listen if no input
        this.emit(':responseReady');
    },
    'WeatherIntent': function () {
        this.response.speak( 'It is 100 degrees Kelvin' )
        this.emit(':responseReady');  
    }
}

exports.handler = function (event, context, callback) {
    const alexa = Alexa.handler(event, context);
    alexa.APP_ID = APP_ID;
    alexa.resources = languageStrings;
    alexa.registerHandlers(handlers);
    alexa.execute();
};

Failed attempts:

// this.response.speak( launchMsg ).listen( reprompt, function(){this.emit('SessionEndedRequest')} );
// this.response.speak( launchMsg ).listen( reprompt, this.emit('SessionEndedRequest') );

// this.response.speak( launchMsg ).listen( reprompt, this.response.shouldEndSession(true) );
// this.response.shouldEndSession(true).speak( launchMsg ).listen( reprompt );
// this.response..speak( launchMsg ).listen( reprompt ).shouldEndSession(true);
// this.response.speak( 'goodbye' ).listen( reprompt ).speak( launchMsg );
// this.response.speak( launchMsg ).listen( reprompt ).speak( 'goodbye' );
// this.response.speak( launchMsg ).listen( reprompt, this.emit(":tell", "goodbye") );
// this.response.speak( launchMsg ).listen( reprompt).speak('goodbye');
// this.response.speak( launchMsg ).listen( reprompt, true );
// this.response.speak.listen( reprompt, false );
// this.response.speak.listen( true, reprompt );
// this.response.speak.listen( false, reprompt );

// this.emit(':responseReady', function(){this.emit('SessionEndedRequest')});
// this.emit(':responseReady', this.emit('SessionEndedRequest') );
// this.emit(':responseReady', this.response.shouldEndSession(true));
// this.emit(':responseReady', function(){this.response.shouldEndSession(true)} );
1
Do you have any logs from your code? If you're running in Lambda, could you include the cloud watch logs from your function?Seafish
Did you get this resolved? I'm experiencing the same issue.Cole
Nope.... Still trying. Still crying.curtybear
Have you tried handling the SessionEndedRequest ? developer.amazon.com/docs/custom-skills/…Maggie Concannon

1 Answers

0
votes

Just add SessionEndedRequest to your handlers object.

'SessionEndedRequest': function() {
        console.log("No response from user.");
 }

And please note your skill cannot return a response to SessionEndedRequest.

Reference from Alexa Skills Kit Docs