After completing the form filling , I want to fill the same form with new values. then How to reset all slots in a Form.
You can reset the slots in the submit
function of the form. The submit
function is called when the form is completed. If your form has, for example, the following requested slots, ["cuisine", "num_people", "outdoor_seating"]
, you can, for example, reset the slots by doing
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""
# utter submit template
dispatcher.utter_template("utter_submit", tracker)
return [
SlotSet("cuisine", None),
SlotSet("num_people", None),
SlotSet("outdoor_seating", None)
]
Does this help?