【问题标题】:Alexa skills failure LAMBDA - There was a problem with the requested skill's responseAlexa 技能失败 LAMBDA - 请求的技能响应有问题
【发布时间】: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 输出。可能缺少什么?

标签: alexa alexa-skills-kit


【解决方案1】:

请改用ask-sdk。最新的 v2 有不同的 SDK 实现,将更好地支持未来。

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

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

【讨论】:

  • 感谢您的回复@Akshay。好像您发送的说明是用于上传 zip 文件。我想做的只是内联编码。我确实将它替换为 ask-sdk 和 ask-sdk-core 并跳过 zip 上传 - 它没有用。
猜你喜欢
  • 2020-07-23
  • 2019-11-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多