Search code examples
amazon-web-serviceschatbotamazon-lex

Why aren't the prompt doing the work it's supposed to achieve?


Working on a chatbot on Lex amazon, and have set Date,Time, location parameters i have set the prompt to ask when they're not supplied according to the slot type.

When i give a wrong or bad date values like sughdfusf or ice cream or such it asks for the value again , same with time but it isn't the case with location as it takes completely random values not defined in the slot type AMAZON.US_CITY .How can i fix it and why is it occurring?


Solution

  • Lex is thinking that sughdfusf is a city name, so it is allocating this to AMAZON.US_CITY. You can either report this issue to amazon team and wait for them to fix it or you can use below workaround.

    1. Untick the required checkbox from the slot
    2. In the Lambda function, in DialogCodeHook, use some third party api to validate the city name
    3. Return ElicitSlot in case validation failed

    Hope it helps, let me know if you have further doubts.