简体   繁体   English

如何解决 Alexa 开发人员控制台中“请求的技能响应存在问题”

[英]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."
   }
  }

Image showing Alexa conversation显示 Alexa 对话的图像

  1. Check the version of node.js you are using.检查您使用的 node.js 版本。
  2. In the lambda function click on the test tab and test every intent, there you will find the problem.在 lambda 函数中,单击测试选项卡并测试每个意图,您会在那里找到问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试执行 Alexa 技能,但她说请求的技能响应有问题 - I'm trying to do a Alexa Skill, but she says There was a problem with the requested Skill's response Alexa Skill:是否可以让 Alexa 从 Alexa Developer Console - Alexa Hosted 播放 .mp3? - Alexa Skill: is it possible to have Alexa play a .mp3 from Alexa Developer Console - Alexa Hosted? 返回响应后的响应的Alexa技能问题 - Alexa skill problem with response after response is already returned 如何在Alexa Skill应用程序中捕获用户答复/响应? - How to catch user reply / response in an Alexa Skill app? Alexa:选择国家/地区时请求的技能错误 - Alexa: Requested skill error when selecting country 如何在浏览器上打开alexa skill? - How to open alexa skill on browser? 在开发人员控制台中进行测试时,为什么我的Alexa技能测试显示正确的lambda输出但给出错误消息? - Why does my Alexa skill test shows correct lambda output but gives an error message when tested in the developer console? 如何在 Alexa Developer Console 上使用节点模块? - How do I use node modules on the Alexa Developer Console? Alexa Skill 使用 S3 Select 数据 - Alexa Skill using S3 Select data 如何在alexa技能javascript中解析XML - how to parse XML in alexa skill javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM