Thanks Saurabh for your reply, am new to rasa and have seen form.py script but cant understand the flow. am using the below methods somehow manually we are asking the values to fill the slots.
kindly guide me where can call next_slot method here and used for my db values.
def name(self)->Text:
return “vendor_profile_form”
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["vCode","region","siteCode"]
def slot_mappings(self
) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"vCode": [self.from_entity(entity="vCode"), self.from_text()],
"region": [self.from_entity(entity="region"), self.from_text()],
"siteCode": [self.from_entity(entity="siteCode"), self.from_text()],
}
# USED FOR DOCS: do not rename without updating in docs
def validate_vCode(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate cuisine value."""
value=re.findall('\d+', str(tracker.get_slot('vCode')))
value=''.join(value)
if value:
print("vCode",value)
# validation succeeded, set the value of the "cuisine" slot to value
return {"vCode": value}
else:
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"vCode": None}
def validate_region(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate cuisine value."""
if value:
# validation succeeded, set the value of the "cuisine" slot to value
return {"region": value}
else:
# dispatcher.utter_template("utter_wrong_bu", tracker)
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"region": None}
def validate_siteCode(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate cuisine value."""
if value:
# validation succeeded, set the value of the "cuisine" slot to value
return {"siteCode": value}
else:
# dispatcher.utter_template("utter_wrong_bu", tracker)
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"siteCode": None}
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]: