3
votes

I have been working on a AWS Lex Bot with multiple Intents. Currently I am having an issue where Slots with the Slot Type AMAZON.AlphaNumberic only accepts numbers.

When I type in a word like, "Test" it does not continue on to the next Slot, but when typing in a number like "1" it goes to the next Slot.

I am not sure why this is happening, but it has only started doing this a few days ago.

What I have tried: Changing the Slot Type to AMAZON.NUMBER, rebuilding the Bot and testing with Number and it continues on to the next Slot. Changing the Slot Type back to AMAZON.AlphaNumeric and rebuilding. Error still occurs.

Edit: I realized now that when the first slot type is AMAZON.AlphaNumeric, it only accepts Numbers, but the second slot being of type AMAZON.AlphaNumeric it takes values of string and string with numbers.

Conversation

Slot Types

1
It looks like this new Alphanumeric slotType is meant for mixed strings such as flight numbers aws.amazon.com/about-aws/whats-new/2020/02/… So instead of testing a letter string of "test", also test a mixed string like "a1b2c3" to see if that gets accepted. My suspicion is that it is not meant as a catch-all slotType, but basically AMAZON.NUMBER which also accepts letters WITH numbers.Jay A. Little

1 Answers

2
votes

Don't use the AMAZON.AlphaNumeric slot to capture any input entered by the user. The behavior you observe now, might change when your bot complexity increases with more slots and intents, since you can't predict how the bot is being trained in the back-end.

The AMAZON.AlphaNumeric slot should be used to pick up a combination made up of letters and numbers (without spaces). It is better if you can define a regular expression for the input to be expected and then expand the slot to validate the values. If your strings contain only numbers or letters, define a regex as explained in the documentation.

Since it seems like you're trying to pick up a street address, it would be better to use the AMAZON.StreetAddress built in slot type.