if value.upper() in ['SALES','FINANCE','ADMIN']:
# validation succeeded, set the value of the "domain" slot to value
return {"domain": value}
else:
dispatcher.utter_template("utter_wrong_domain", tracker)
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"domain": None}
Please guide me if I have to modify my function to validate.
@Ghostvv, Thanks for your response. Please have a look at my slot mappings once.
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
“”“A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked”""
what do I do with that? how do I know whether they are correct, it depends on your use case and what do you want to achieve. Please debug the nature of the problem, for example you can add additional print statements in your code to track what is happening
if parse(value) :
return {"start_date": value}
def validate_end_date(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
if parse(value) and value > start_date(value):
return {"end_date": value}
i need to set validation like " end_date should be bigger than the start_date "
issue:: i dont have an idea how to call start_date value to end_date function or wat keyword should i use to call start_date value to end_date function …
can anyone help me out !!!
you can use tracker.get_slot("start_date") to extract the value in the slot start_date, please the docs for details on how to use tracker in custom action: Actions