Hi Team, i am struggling how to set extras slot value for form validation, i have extras slot name “rephrase”, want to set value for this slit my overall idea, i only want validate 2 times, after that it will stop asking form value again, please help me
def validate_tech_keyword(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate tech_keyword value."""
rephrase = tracker.get_slot('rephrase')
print("rephrase status " + str(rephrase))
print(response.text)
if response.text == "[]":
if(rephrase == "askForRephrase"):
dispatcher.utter_button_message("Sorry! cannot find anything related to your request.", buttons)
else:
# validation failed, set this slot to None, meaning the # user will be asked for the slot again
dispatcher.utter_message("Sorry! We cannot find anything related to your request. Can you type a different keyword instead ?")
return [SlotSet("rephrase", "askForRephrase"),{"tech_keyword": None}]
else:
# validation succeeded, set the value of the "cuisine" slot to value
return {"tech_keyword": value}