Alexa技能失败LAMBDA-请求的技能响应出现问题

时间:2018-09-01 21:22:51

标签: alexa alexa-skills-kit

我正在使用alexa技能,并且不断收到“请求的技能的响应存在问题”。

这是我的基本Lambda技能

"use strict";

// Include the Alexa SDK
var Alexa = require("alexa-sdk");

// The handlers object tells Alexa how to handle various actions
var handlers = {
    
    "LaunchRequest": function () {
      this.emit(":tell", "Launching HelloWorld"); 
    },
    "WelcomeIntent": function () {
      this.emit(":tell", "Welcome Intent calling");
    }
};


// This is the function that AWS Lambda calls every time Alexa uses your skill.
exports.handler = function(event, context, callback) {

    var alexa = Alexa.handler(event, context);

  
    alexa.registerHandlers(handlers);
    alexa.execute();
};

这是测试的日志

{
	"version": "1.0",
	"session": {
		"new": true,
		"sessionId": "amzn1.echo-api.session.4e78e426-cc1f-41ac-a820-34969b5b4a84",
		"application": {
			"applicationId": "amzn1.ask.skill.750c0348-2471-4f06-801d-c87b3765b3c5"
		},
		"user": ...
	},
	"context": {
		"System": {
			"application": {
				"applicationId": ...
			},
			"user": ...,
			"device": ...,
			"apiEndpoint": "https://api.amazonalexa.com",
			"apiAccessToken": ...
		}
	},
	"request": {
		"type": "LaunchRequest",
		"requestId": "amzn1.echo-api.request.da1c2415-5f32-405e-8642-690f67285561",
		"timestamp": "2018-09-01T21:13:32Z",
		"locale": "en-US",
		"shouldLinkResultBeReturned": false
	}
}

我错过了任何设置吗?我只做内联编码。

1 个答案:

答案 0 :(得分:0)

改为使用ask-sdk。最新的v2具有不同的SDK实现,因此会更好地为将来提供支持。

按照此处的步骤进行操作。设置完成后,您可以根据需要创建和修改意图处理程序:

https://ask-sdk-for-nodejs.readthedocs.io/en/latest/Setting-Up-The-ASK-SDK.html#installing-standard-ask-sdk-distribution