東西是我的AMAZON.StopIntent搞砸了。無論我放在那裏(我已經嘗試了每個教程中的所有內容),每當它被調用時,我都會得到「請求的技能響應出現問題」,Alexa應用程序將錯誤顯示爲「speechletresponse不能爲空」。我的項目是JSON格式,而不是Java格式。問題與空的speechletResponse(Alexa)
如果有人能幫忙,我會非常感激!
謝謝!
如這裏要求就是被髮送到LAMBDA
{
"session": {
"sessionId": "SessionId.XXXXX",
"application": {
"applicationId": "amzn1.ask.skill.XXXXXXX"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.XXXXXXX"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.XXXXXX",
"locale": "en-US",
"timestamp": "2017-01-18T22:38:53Z",
"intent": {
"name": "AMAZON.StopIntent",
"slots": {}
}
},
"version": "1.0"
}
而這裏的培訓相關代碼:
var handlers = {
'LaunchRequest': function() {
this.emit('AMAZON.HelpIntent');
},
'GetNewDogThoughtIntent': function() {
this.emit('GetDogThought');
},
'GetNewCatThoughtIntent': function() {
this.emit('GetCatThought');
},
'GetDogThought': function() {
var dogthoughtIndex = Math.floor(Math.random() * DOGTHOUGHTS.length);
var randomDogThought = DOGTHOUGHTS[dogthoughtIndex];
// Create speech output
var speechOutput = "Your dog is thinking, " + randomDogThought;
this.emit(':tellWithCard', speechOutput, "Your dog was thinking... ", randomDogThought);
},
'GetCatThought': function() {
var catthoughtIndex = Math.floor(Math.random() * CATTHOUGHTS.length);
var randomCatThought = CATTHOUGHTS[catthoughtIndex];
// Create speech output
var speechOutput = "Your cat is thinking, " + randomCatThought;
this.emit(':tellWithCard', speechOutput, "Your cat was thinking... ", randomCatThought);
},
'AMAZON.HelpIntent': function() {
var speechOutput = "You can ask me for what your cat or dog is thinking, or you can say exit... Right now I can only provide thoughts for one cat or dog at a time... What can I help you with?";
var reprompt = "What can I help you with? Make sure to say if your pet is a cat or dog when you ask!";
this.emit(':ask', speechOutput, reprompt);
},
'SessionEndedRequest': function (sessionEndedRequest, session) {
},
"AMAZON.StopIntent": function (shouldEndSession) {
}
嗨!謝謝 - 但這些建議仍然無法正常工作 - 仍然收到無效響應。我所有的其他意圖都可以正常工作,它只是AMAZON.StopIntent。 – Branch
您能顯示您發送的回覆嗎? –
已更新,謝謝。 – Branch