The Amazon Lex chatbot framework offers to use custom slot types. However, the mechanism is to provide an array of values that will be validated. But I want a custom validator that e.g. checks if the input is in a database.
Ideally, I want to develop an AWS lambda hook that receives the input parameter and then executes some program that returns the either well-formated slot type or gives an error if the input was not valid. Anyone an idea?
AWS exposes an API to dynamically create slot types, and updating the LEX bot. (see: http://docs.aws.amazon.com/lex/latest/dg/API_PutSlotType.html, and http://docs.aws.amazon.com/lex/latest/dg/API_CreateSlotTypeVersion.html)
In theory you could dynamically change this list when your data base has an update (may run into rate limiting issues though.)
However it does not appear that custom slot types limit valid responses like you think they do: http://docs.aws.amazon.com/lex/latest/dg/gl-guidelines.html
Specifically this bit:
In other words, it appears to not be a enumeration list that is enforced.
Another example of the docs saying this: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/migrating-to-the-improved-built-in-and-custom-slot-types#literal
So even if you did dynamically create this custom slot type, it would only make the input somewhat lean in the direction of your predetermined options. Not restrict it to them.