ConfirmIntent does not change intent slots with additional user input

0

I have an app that gets a roadway and direction of travel from a user. I then send a ConfirmIntent response asking to confirm that this is the information they want. If a user says 'I want I-235 soutbound' it prompts them to confirm. The Lex documentation states:

For example, Amazon Lex wants user confirmation before fulfilling an intent. Instead of a simple "yes" or "no" response, a user might respond with additional information. For example, "yes, but make it a thick crust pizza" or "no, I want to order a drink." Amazon Lex can process such additional information (in these examples, update the crust type slot or change the intent from OrderPizza to OrderDrink).

However if I try providing different information like 'yes, but northbound', or 'I-235 northbound' it does not switch the slot values to the newly provided ones. Is the documentation just wrong, or has someone gotten this to work?

Here is an example of the ConfirmIntent I send back.

"dialogAction": {
        "type": "ConfirmIntent",
        "message": {
            "contentType": "SSML",
            "content": "<speak>Please confirm you want reports on <say-as interpret-as='address'>I-235</say-as>, going south</speak>"
        },
        "intentName": "RouteIdAndDirectionIntent",
        "slots": {
            "routeId": "235",
            "cityName": null,
            "disambiguatedRouteName": null,
            "routeDirection": "SB",
            "routeType": null,
            "countyName": null
        }
    }
asked a year ago297 views
1 Answer
1

Hello,

Greetings for the day!

From the case notes I understand that you are sending the "confirmintent" dialog action and based on the response, updating the slot values or changing the intent.

Please correct me if I misunderstood or missed anything related to your query.

In order to address your concren I would like to add that if you are trying to change the intent, then, you can have an utterance in the other intent (where you are trying to change) as {slot}. This will trigger the other intent only if the slot-type value of the slot matches the value entered by client.

However, if we talk about updating the slot value in the same intent, then, it is difficult to do it because the Lex has already reached confirmation intent. You can either do it through Lambda code or can have some kind of conditional branching that will trigger the slot into changing its value. Alternatively, you can add utterances to their slot or have such slot-type values (custom slot-types) so that when that particular word is entered, it triggers the slot within the intent.

Moving forward, the documentation is correct. Amazon Lex can process additional information provided by the user in a ConfirmIntent response. However, there are a few things to keep in mind:

  • The additional information must be relevant to the intent that is being confirmed. For example, if the intent is to order a pizza, the additional information could be the type of crust or the size of the pizza.
  • The additional information must be in a format that Amazon Lex can understand. For example, if the intent is to get directions, the additional information could be the name of the destination or the route number.

In this case, the additional information that you are providing is not relevant to the intent that is being confirmed. The intent is to get reports on I-235, and the additional information that you are providing is the direction of travel. Amazon Lex does not understand this information, so it does not update the slot values.

To fix this, you need to make sure that the additional information that you are providing is relevant to the intent that is being confirmed. In this case, you could ask the user to confirm the route number or the direction of travel. For example:

"dialogAction": { "type": "ConfirmIntent", "message": { "contentType": "SSML", "content": "<speak>Please confirm you want reports on <say-as interpret-as='address'>I-235</say-as>, going <say-as interpret-as='direction'>south</say-as>.</speak>" }, "intentName": "RouteIdAndDirectionIntent", "slots": { "routeId": "235", "cityName": null, "disambiguatedRouteName": null, "routeDirection": "SB", "routeType": null, "countyName": null } }

This will prompt the user to confirm the route number and the direction of travel. If the user confirms, Amazon Lex will update the slot values and fulfill the intent. If the user denies, Amazon Lex will not update the slot values and will continue the conversation.

Lastly, If the response still does not clear your query I encourage you to reach out to Support engineering via a case and export and attach the lex bot to the case for replication purpose.

I hope the above information helps.

Have a great day ahead and stay safe!

AWS
SUPPORT ENGINEER
answered a year ago
  • The information I am supplying is relevant to the current intent. I am trying to change the value of the 'routeDirection' slot. This: 'In this case, the additional information that you are providing is not relevant to the intent that is being confirmed. The intent is to get reports on I-235, and the additional information that you are providing is the direction of travel. Amazon Lex does not understand this information, so it does not update the slot values.' is flat out wrong. The additional information I am supplying is relevant to the intent, it is a slot that can be captured by this intent and an utterance I am using is one that is recognized by the intent to populate the slots initially. The example from the documentation 'yes, but make it a thick crust pizza" ' is exactly what I am trying to do, and the documentation says that Lex can handle this kind of thing.

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.

Guidelines for Answering Questions