2

The bot is not presenting the follow-up prompt even though it is set up in the 'Response' section in the Intent. This is working if the 'ReturnParametersToClient' is selected as the Fulfillment option. When the fulfillment is changed to AWS Lambda function, it does not present the follow-up question anymore.

For example: If my user inputs

3x10

I have a Lambda function to do this calculation and return results in the JSON format Lex expects. Thus it displays

30

Then, it should present the follow-up question

Would you like me to do another calculation?

To which the user can respond

No

From what I understand, the 'Response' section in the Intent editor page is precisely where I should be able to configure the question 'Would you like me to do another calculation?' and another message (in the 'Wait for user reply' section if the user replies in the negative.

1 Answer 1

1

Yes, everything is working as it is meant to.

You can do one or the other.
Either (1) set up a response in the Lex Console when the intent is fulfilled.
Or (2) build your own response in Lambda when the intent is fulfilled.

Using a Lambda function gives you much more control over your bot and lets you respond with more dynamic and tailored messages.

So if you are switching to use Lambda, you will have to create that response yourself when fulfilling the intent. You may want to use confirmIntent for that type of yes/no question.

Check out Lambda-Lex Response Format (confirmIntent about half-way down the page)

ConfirmIntent — Informs Amazon Lex that the user is expected to give a yes or no answer to confirm or deny the current intent.

Sending that response as a confirmIntent would be something like this:

"dialogAction": {
    "type": "ConfirmIntent",
    "message": {
      "contentType": "PlainText",
      "content": "Would you like me to do another calculation?"
    },
    "intentName": "intent-name",
    "slots": {
       "slot-name": "value",
       "slot-name": "value",
       "slot-name": "value"  
   },
}

Your Lambda would then need to handle the answer to that question.
The user's answer will be returned to the same intent and confirmationStatus will be:
None - no confirmIntent used
Confirmed - user said 'yes' to the confirmIntent question
Denied - user said 'no' to the confirmIntent question

Check out the same link above near the top of the page for the format of the Lex to Lambda Input Event.


Just a tip:

You could instead just fulfill the intent with a close message and ask the user something like "How else may I help you?"

Then the user can ask another calculation immediately without having to say yes or no before each calculation question.

1
  • 1
    I confirmed with AWS support that submitting a follow-up message in a separate chat bubble after the fulfillment by Lambda is not supported by Lex. So this cannot be done on the Lex Test Bot section. But this feature can be incorporated by a UI. For example, the Lex web UI published by aws-samples supports multiple message bubbles.
    – JAO
    Jan 24, 2019 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.