Hi…i am new to rasa. I am trying to create a chatbot with rasa. I am using many forms and as well as slots. i m looking to add these slots in my action file. but it looks like they have changed the whole format for slots and forms. So, I have two question:
- Does I have to declare the slots name in the domain file even if i declare them in forms something like this:
slots: name: auto_fill: false type: any
because if i never do this it gives the warning :
Tried to set non existent slot ‘name’. Make sure you added all your slots to your domain file.
- how to validate those slots in actions.py file as i have many forms and slots, i tried this :
class ValidateDemoForm(FormValidationAction):
def name(self) -> Text:
return "validate_buy_form"
@staticmethod
def name_of_slot() -> List[Text]:
"""Database of supported cuisines"""
return ["slot1","slot2", "slot3", "slot4","slot5",
"slot6", "slot7","slot8","slot9"]
def validate_slot(
self,
value: Any,
diapatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
if value.lower() in self.name_of_slot:
return {"slot1": value,"slot2": value,"slot3": value,"slot4": value,"slot5": value,"slot6": value,"slot7": value, "slot8": value,"slot9": value}
but it is not working well as rasa run actions gives the warning:
Skipping validation for name
: there is no validation method specified.
can someone tell me how to validate them? @rctatman @Emma @Ghostvv @Juste @akelad please answer this question.