我正在尝试使用Node.js v2 sdk实现Alexa.Speaker接口。
在测试时,我总是得到输出:There was a problem with the requested skill's response
以及CloudWatch日志中的此错误:
{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.bf854d70-70c1-4e7f-b2b0-76c4574244a5",
"timestamp": "2018-10-22T16:58:12Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
这是我的代码。
return handlerInput.responseBuilder
.addDirective({
type: 'Alexa.Speaker',
name: 'SetVolume',
payload: {
volume: volume,
},
token: 'correlationToken',
})
.getResponse();
我之前已经以这种方式实现了Connections.SendRequest接口,所以我不确定Alexa.Speaker的问题/不同之处。