【发布时间】:2018-09-03 18:35:19
【问题描述】:
我正在使用 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
}
}
我错过了什么设置吗?我只是在做内联编码。
【问题讨论】:
-
放一个日志,请分享生成的响应JSON,特别是当你得到这个错误时。
-
我根本没有得到 JSON 输出。可能缺少什么?