does anyone have a working example on optional slot filling preferably using FormAction?.
Edit:
For example, required_slots = [‘account_number’, ‘transaction_id’, ‘confirm_account_number’ , ‘confirm_transaction_id’,‘date_of_transaction’ ]
but i need account_number or transaction_id along with date_of_transaction to respond. depending on available slot (account_number or transaction_id), confirm_account_number or confirm_transaction_id are also optional.
Thank you for the quick response. But this is an example of FormAction with mandatory slots [‘lat’, ‘long’]. I think my question is not clear, I’m looking for a FormAction or Action which can handle slots optionally.
For example,
required_slots = [‘account_number’, ‘transaction_id’, ‘confirm_account_number’ , ‘confirm_transaction_id’,‘date_of_transaction’ ]
but i need account_number or transaction_id along with date_of_transaction to respond. depending on available slot (account_number or transaction_id), confirm_account_number or confirm_transaction_id are also optional.
Hi, sorry to miss that, maybe you can try to use the validate function? You can make some logical process there,
def validate_transaction_id(self, value, dispatcher, tracker, domain):
if tracker.get_slot('account_number') != None:
return {"account_number": ""}
#or you need to validate the value again then return it
return {"account_number": value}