Having issue while sending lambda response to Lex v2. Error : "Invalid Lambda Response: Can not construct instance of IntentResponse"

0

I am trying to create a bot in lex v2 console using c# .net function. All are done, in the integration part we have the following error in lex v2 chat window.

we are using custom models for Request and Response. Is there any AWS DLL for this? like LexEvent & LexResponse in lex v1

Invalid Lambda Response: Received invalid response from Lambda: Can not construct instance of IntentResponse, problem: The validated object is null at [Source: {"Jsonvalue"}; line: 1, column: 561]

Response we trying to return is,

{ "SessionId":"125512899102434", "SessionState": { "ActiveContexts":[], "SessionAttributes":{}, "DialogAction": { "SlotToElicit":"Patientid", "Type":"ElicitSlot" }, "Intent": { "ConfirmationState":"None", "Name":"ScheduleAppointment", "Slots": { "MobileNumber":null, "Department":null, "FirstName":null, "Patientid":null, "Time":null, "LastName":null, "Gender":null, "Doctor":null, "UserType":null, "Date":null, "Age":null, "Location":null }, "State":"InProgress" } }, "Messages": [ { "ContentType":"PlainText", "Content":"Please provide your Patient ID" } ] }

Please help us to resolve this issue and move forward. thanks, Mohan

已提問 2 年前檢視次數 3164 次
1 個回答
0

Hi Mohan,

Thanks for reaching out. Amazon Lex V2 expects a response from your Lambda function in the following format: https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html#lambda-response-format

Please note that response JSON keys are case sensitive.

Thanks,

AWS
已回答 2 年前
  • Hi, I have a similar scenario and I'm getting the same error from my Lambda function...were you able to find a solution? Thank you in advance

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南