嗨,我正在尝试使用请求从 Alexa 请求后端获得响应。我在这些示例中使用 Python:https ://github.com/alexa/skill-sample-python-fact 。但是我的后端是 NodeJS。
来自我的 Lambda:
URL = 'https://alexa-app-nikko.herokuapp.com/alexa'
def get_post_response():
r = requests.get(URL)
speech_output = str(r.text)
return response(speech_response(speech_output, True))
在我的后端,它被路由到 /alexa:
router.get('/', function(request, response) {
//console.log('Logged from Alexa.');
response.send('Hello World, Alexa!');
});
我在 Lambda 上对其进行了测试,并在以下结果中正常工作:
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Hello World, Alexa!"
},
"shouldEndSession": true
}
}
但是,我null从 Alexa 获得了有关技能输出或此响应的信息:
"There was a problem with the requested skill's response"
我如何从开发人员控制台进行调试,因为 Lambda 似乎很好。