[英]How to solve "There was a problem with the requested skill's response" in Alexa Developer Console
I'm trying to build a simple app for Alexa where user says the invocation name (voice control unity) and then say the utterance (temp world) described in custom intent (TempIntent) to get the output using buildSpeechletResponse ie(temp request).我正在尝试为 Alexa 构建一个简单的应用程序,其中用户说出调用名称(语音控制统一),然后说出自定义意图(TempIntent)中描述的话语(临时世界)以使用 buildSpeechletResponse ie(临时请求)获取输出。 But I'm getting "There was a problem with the requested skill's response" error in Test tab in Alexa Developer Console.
但是我在 Alexa 开发人员控制台的“测试”选项卡中收到“请求的技能响应有问题”错误。
I've already tried changing the intent name, invocation name, function name but nothing is working.我已经尝试更改意图名称、调用名称、函数名称,但没有任何效果。
//This is index.js file lambda function
function onLaunch(launchRequest, session, response)
{
var output = 'Welcome to Temp World';
var reprompt = 'Type temp world';
response(session.attributes,
buildSpeechletResponseWithoutCard(output, reprompt,false));
console.log("onLaunch requestId=" + launchRequest.requestId
+ ", sessionId=" + session.sessionId);
}
function onIntent(intent, session, response) {
console.log("onIntent requestId=" + intent.requestId
+ ", sessionId=" + session.sessionId);
var intent = intentRequest.intent,
intentName = intentRequest.intent.name;
if(intentName == 'TempIntent') {
handleTempRequest();
}
else {
throw "Invalid intent";
}
}
function handleTempRequest()
{
buildSpeechletResponse("", "welcome to temp world", "", true);
}
function buildSpeechletResponse(title, output, repromptText,
shouldEndSession) {
return {
outputSpeech: {
type: "PlainText",
text: output
},
card: {
type: "Simple",
title: title,
content: output
},
reprompt: {
outputSpeech: {
type: "PlainText",
text: repromptText
}
},
shouldEndSession: shouldEndSession
};
}
I expected the output to be "welcome to temp world" but the JSON output is null.我希望输出是“欢迎来到临时世界”,但 JSON 输出为空。
JSON Input is JSON 输入是
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.c78c093c-eb05-4eaa-8f23-16037059e61f",
"timestamp": "2019-05-09T12:23:34Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.