Hi Team,
Greetings!!
Slot validation is not working for me . I am not able to trigger the wrong_utterance for a particular slot. I have referred the various slot examples using form bot and sara bot looks like everything in place. Getting the below error instead.
Failed to extract slot {slot_name} with action requestform
Can someone please pitched into that.
Below is my python code.
I have pasted only for one slot as of now.
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”""
return {
"domain": self.from_entity(entity="domain", intent="inform"),
}
def validate_domain( self, value: Text, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any], ) -> Optional[Text]: “”“Validate domain value.”""
if value.upper() in ['SALES','FINANCE','TECH']:
# 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}
Can you please provide me some examples wherein slot validation has been configured with Rasa X.