6

我收到错误:

An error has occurred: Invalid Lambda Response: Received error response from Lambda: Handled. 

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

使用测试事件尝试的 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"
  }
}

查看 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"
  }
}

在此处输入图像描述

4

0 回答 0