Alexa Simulator keeps returning "Audio only response" with empty I/O skill json when I try to invoke my Hindi(In) skill.
Here is my json file :
{ "interactionModel": { "languageModel": { "invocationName": "कबीर के दोहे", "intents": [ { "name": "AMAZON.CancelIntent", "samples": [] }, { "name": "AMAZON.HelpIntent", "samples": [] }, { "name": "AMAZON.StopIntent", "samples": [] }, { "name": "AMAZON.NavigateHomeIntent", "samples": [] }, { "name": "GetNewFactIntent", "slots": [], "samples": [ "मुझे एक कबीर का दोहा बताओ", "मुझे एक कबीर का दोहा सुनाओ", "कबीर के दोहे", "कबीर का दोहा", "मुझे एक कबीर का दोहा दो" ] } ], "types": [] } } }
And here is my index.js file :
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2). // Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management, // session persistence, api calls, and more. const Alexa = require('ask-sdk-core'); const data = [ 'बुरा जो देखन मैं चला, बुरा न मिलिया कोय,जो दिल खोजा आपना, मुझसे बुरा न कोय।', ' पोथी पढ़ि पढ़ि जग मुआ, पंडित भया न कोय,ढाई आखर प्रेम का, पढ़े सो पंडित होय।', 'माला फेरत जुग भया, फिरा न मन का फेर,कर का मनका डार दे, मन का मनका फेर।', 'अति का भला न बोलना, अति की भली न चूप,अति का भला न बरसना, अति की भली न धूप।', 'हिन्दू कहें मोहि राम पियारा, तुर्क कहें रहमाना,आपस में दोउ लड़ी-लड़ी मुए, मरम न कोउ जाना।', 'तन को जोगी सब करें, मन को बिरला कोई।सब सिद्धि सहजे पाइए, जे मन जोगी होइ।', 'रात गंवाई सोय के, दिवस गंवाया खाय ,हीरा जन्म अमोल सा, कोड़ी बदले जाय ॥' ]; const GET_FACT_MESSAGE = "यह रहा आपका दोहा : "; const LaunchRequestHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; }, handle(handlerInput) { const speechText = 'नमस्ते, कबीर के दोहे में आपका स्वागत है, आप कबीर के दोहे पूछ ससकते है'; return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .getResponse(); } }; const GetNewFactIntentHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'GetNewFactIntent'; }, handle(handlerInput) { const factArr = data; const factIndex = Math.floor(Math.random() * factArr.length); const randomFact = factArr[factIndex]; const speechOutput = GET_FACT_MESSAGE + randomFact; const speechText = speechOutput; return handlerInput.responseBuilder .speak(speechText) //.reprompt('add a reprompt if you want to keep the session open for the user to respond') .getResponse(); } }; const HelpIntentHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent'; }, handle(handlerInput) { const speechText = ' आप मुझे नया दोहा सुनाओ बोल सकते हैं या फिर exit भी बोल सकते हैं... आप क्या करना चाहेंगे? ' ; const reprompt = 'मैं आपकी किस प्रकार से सहायता कर सकती हूँ? '; return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .getResponse(); } }; const CancelAndStopIntentHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'IntentRequest' && (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent' || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent'); }, handle(handlerInput) { const speechText = 'धन्यवाद, फिर मिलते हैं'; return handlerInput.responseBuilder .speak(speechText) .getResponse(); } }; const SessionEndedRequestHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest'; }, handle(handlerInput) { // Any cleanup logic goes here. return handlerInput.responseBuilder.getResponse(); } }; // The intent reflector is used for interaction model testing and debugging. // It will simply repeat the intent the user said. You can create custom handlers // for your intents by defining them above, then also adding them to the request // handler chain below. const IntentReflectorHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'IntentRequest'; }, handle(handlerInput) { const intentName = handlerInput.requestEnvelope.request.intent.name; const speechText = `You just triggered ${intentName}`; return handlerInput.responseBuilder .speak(speechText) //.reprompt('add a reprompt if you want to keep the session open for the user to respond') .getResponse(); } }; // Generic error handling to capture any syntax or routing errors. If you receive an error // stating the request handler chain is not found, you have not implemented a handler for // the intent being invoked or included it in the skill builder below. const ErrorHandler = { canHandle() { return true; }, handle(handlerInput, error) { console.log(`~~~~ Error handled: ${error.message}`); const speechText = ` सॉरी, मैं वो समज नहीं पायी. क्या आप repeat कर सकते हैं? `; return handlerInput.responseBuilder .speak(speechText) .reprompt(speechText) .getResponse(); } }; // This handler acts as the entry point for your skill, routing all request and response // payloads to the handlers above. Make sure any new handlers or interceptors you've // defined are included below. The order matters - they're processed top to bottom. exports.handler = Alexa.SkillBuilders.custom() .addRequestHandlers( LaunchRequestHandler, GetNewFactIntentHandler, HelpIntentHandler, CancelAndStopIntentHandler, SessionEndedRequestHandler, IntentReflectorHandler) // make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers .addErrorHandlers( ErrorHandler) .lambda();
I try to invoke skill by saying " open कबीर के दोहे " but simulator returns "<Audio only response> " and below gets printed in Device logs :
[14:02:22:271] - Event: Text.TextMessage [14:02:23:387] - Directive: SpeechSynthesizer.Speak [14:02:23:397] - Directive: SpeechRecognizer.RequestProcessingCompleted [14:02:23:542] - Event: SpeechSynthesizer.SpeechStarted [14:02:23:577] - Directive: SkillDebugger.CaptureDebuggingInfo [14:02:25:166] - Event: SpeechSynthesizer.SpeechFinished
And this is in SkillDebugger.CaptureDebuggingInfo :
{ "header": { "namespace": "SkillDebugger", "name": "CaptureDebuggingInfo", "messageId": "905feb70-1ed1-4903-a420-582db7208ca5" }, "payload": { "skillId": null, "timestamp": "2019-09-10T08:32:23.003Z", "dialogRequestId": "c256f7cc-36a0-4be3-9655-b9ca9b383949", "skillRequestId": null, "type": "ConsideredIntents", "content": { "intents": [ { "name": "<IntentForDifferentSkill>", "confirmationStatus": null, "slots": null }, { "name": "<LaunchRequest>", "confirmationStatus": null, "slots": null }, { "name": "<IntentForDifferentSkill>", "confirmationStatus": null, "slots": null }, { "name": "<IntentForDifferentSkill>", "confirmationStatus": null, "slots": null } ] } } }