Aashay1
(Aashay)
1
Hi All ,
I want to display the slots filled by user in form actions and ask confirmations before submitting the form ,
for example
utter_confirm_leave_applications:
- text: Your {leave_type} from {from_date} till {to_date} is correct ?
of deny restart the form
thank you
k1m
(Kim)
2
Hi @Aashay1
Add one more slot to your form(and domain). You can name it to something like confirmMyFormName
.
your utter_ask_confirmMyFormName
text should be “Your {leave_type} from {from_date} till {to_date} is correct ?”
Then you validate the slot (if users intent is not affirm it will restart the form):
def validate_confirmMyFormName(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate slot value."""
intent = tracker.latest_message['intent'].get('name')
if intent == 'affirm'
return {"confirmMyFormName": value}
else:
return [SlotSet('leave_type', None), SlotSet('from_date', None), SlotSet('to_date', None), SlotSet('confirmMyFormName', None)]
Aashay1
(Aashay)
3
Hey @k1m,
Thankz for the reply , I’ll surely try out this option
Aashay1
(Aashay)
4
hi @k1m,
"Failed to extract slot confirm_apply_leave with action apply_leave_form "
i am getting this error
thank you
k1m
(Kim)
5
Try this slot mapping:
def slot_mappings(self):
# type: () -> Dict[Text: Union[Dict, List[Dict]]]
return {"confirm_apply_leave": [self.from_text()]
}
Aashay1
(Aashay)
6
yes its working fine not thak you ,