I want to make a simple quote bot which needs to know about addresses and dimensions. Currently I have hacked one together with a python state machine and rasa NLU for the intent stuff, though the nature of the data means most of the entities are better extracted by hand.
For example, an opening sentence might be "i want to send 4 boxes from A postcodeA to B postcodeB they're 3 by 3 by 3m each". These addresses need to be validated, which may involve a back and forth (did you mean this postcode, or maybe that state? This isn't a valid match, please choose from this list, etc...).
Additionally, the order of the validation might be weird. For example, one could have a suburb, postcode, and is_valid slot. There are several possibilities: they could enter a valid S + P, just S, an invalid S alone, a valid S and P which are individually valid but not a match, etc. In some cases I want to defer validation to make use of other information, for example if an invalid suburb was given but a valid postcode, i would use the postcode to inform suggestions for the correct suburb. However, if an invalid suburb was given but no postcode, there is no point asking for a postcode because i would want to get a valid suburb first. In this way having a slot ordering of 'suburb', 'postcode', 'is_valid' doesn't quite cut it as far as i can tell.
I suppose the validation call for suburb and postcode can just have their own set of switch statements which look at the other slots which may have been filled at the same time? Seems a bit chicken and egg, as would need to wait for validation of those as well, and may end up requiring calling Lambda's from within Lambda's. For example, if the validation fails, the bot asks for more info, but the validation of that info may require a different process/lambda than the original input
It could also be they don't include any details about the object, in which case it needs to be prompted for later after the address stuff is all sorted out. For example, if they fail to include info about dimensions i want to ask 'what're the dimensions' and allow them to either include just measurements or weights and quantities as well - this i understand as standard slot filling.
So my question is: how difficult/reasonable is it to have validation calls in Lambdas actually lead to side-paths in the conversation? Previously i had done something like this in a slot-filling setting by having 'is_valid' slots all over the place (especially if I don't want to simply throw an 'isn't valid' error and robotically re-ask the original question'). Is there a better way?
Also, how would one manage 'interrupt' intents? That is, a set of intents which would trigger 'do you want to go restart?' kind of questions, which will return to the original state if the user replies 'no', and, ideally, if they say yes can return to a specific point in the conversation (which i imagine would be achieved by just resetting appropriate slots to empty)
Also, not wedded to the idea of Amazon Lex, any of the pre-canned cases which reduce amount of boiler plate code are good too.
Apologies for word vomit.