エラーが表示されます:
An error has occurred: Invalid Lambda Response: Received error response from Lambda: Handled.
ラムダ関数の lex から、https://github.com/awslabs/amz-ai-building-better-botsのコードを試しています。
test イベントで試行すると、Lambda 関数は次の期待される出力を返し、lex に次のスロットを引き出すように指示しますが、lex は上記のエラーをスローします。
ラムダ テストの出力:
{
"sessionAttributes": {},
"dialogAction": {
"type": "ElicitSlot",
"intentName": "cafeOrderBeverageIntent",
"slots": {
"BeverageType": "mocha",
"BeverageStrength": null,
"Creamer": null,
"BeverageSize": null,
"BeverageTemp": null,
"BeverageExtras": null
},
"slotToElicit": "BeverageSize"
}
}
lex 開発者ガイドを調べたところ、この応答には、出力形式に必要なすべてのフィールドが含まれています。
dialogaction elicitslot と一緒に「fulfillmentState」を送信する必要がありますか? 現在、これは送信されていません。
テスト イベント入力:
{
"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"
}
}