Skip to content

Invalid Lambda Response: Received invalid response from Lambda: Cannot construct instance of `IntentResponse`

0

I have added a lambda fulfillment function to my lexv2 bot. the fulfillment function gets the response for the user query from the AWS Qna bot depending on which intent does the user query belong to in the lex v2 bot. But, I'm getting an error like this: "message": "Invalid Lambda Response: Received invalid response from Lambda: Cannot construct instance of IntentResponse, problem: The response from the Lambda function has an empty content field for one of the messages. Your Lambda function should make sure that it always returns a valid content field for a message. at [Source: (String)"

asked 2 years ago163 views

1 Answer
0

Kindly review the Lambda response format in the documentation below and make sure that the response from your Lambda function adheres to these. https://docs.aws.amazon.com/lexv2/latest/dg/lambda-response-format.html

Few other things you can check are:

  • Verify that your Lambda function is creating a valid IntentResponse object.
  • Ensure that each message in the response has a non-empty content field.
  • Implement error handling in your lambda and return error message to Lex
  • Test the Lambda function independently
AWS

answered 2 years ago

AWS
EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.