获取“无效的Lambda响应:收到来自Lambda的错误响应:已处理”错误

Har*_*run 5 amazon-web-services node.js aws-lambda aws-lex

我收到错误:

An error has occurred: Invalid Lambda Response: Received error response from Lambda: Handled. 
Run Code Online (Sandbox Code Playgroud)

从我的lambda函数的lex中,我正在尝试https://github.com/awslabs/amz-ai-building-better-bots中的代码,

当尝试使用test事件时,Lambda函数将返回下面的预期输出,指示lex引发下一个插槽,但是lex抛出上述错误。

Lambda测试输出:

{
  "sessionAttributes": {},
  "dialogAction": {
    "type": "ElicitSlot",
    "intentName": "cafeOrderBeverageIntent",
    "slots": {
      "BeverageType": "mocha",
      "BeverageStrength": null,
      "Creamer": null,
      "BeverageSize": null,
      "BeverageTemp": null,
      "BeverageExtras": null
    },
    "slotToElicit": "BeverageSize"
  }
}
Run Code Online (Sandbox Code Playgroud)

查看lex开发人员指南,该响应具有输出格式的所有预期字段,

是否也应将“ fulfillmentState”与dialogaction elicitslot一起发送?目前尚未发送。

测试事件输入:

{
  "messageVersion": "1.0",
  "invocationSource": "DialogCodeHook",
  "userId": "test-1",
  "sessionAttributes": {},
  "bot": {
    "name": "CoffeeBot",
    "alias": null,
    "version": "$LATEST"
  },
  "outputDialogMode": "Text",
  "currentIntent": {
    "name": "cafeOrderBeverageIntent",
    "slots": {
      "BeverageType": "mocha",
      "BeverageStrength": null,
      "Creamer": null,
      "BeverageSize": null,
      "BeverageTemp": null,
      "BeverageExtras": null
    },
    "confirmationStatus": "None"
  }
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明