In the validate function, if I set the REQUESTED_SLOT to none, the template utter_ask_{slot_name} and the dispatched message will both be displayed. For example,
for slot, value in slot_values.items():
if slot == 'product_environment':
if 'office' in slot_values['product_environment'].lower():
dispatcher.utter_message("Apologies, I can only assist you with home products. "
"Would you like me to help you find one?")
slot_values[slot] = None
in my domain i have
utter_ask_product_environment: - 'Do you need it for your home or office?'
Now the issue here is that if the user says “office”, the output will be:
Apologies, I can only assist you with home products. Would you like me to help you find one?
Do you need it for your home or office?
full example:
user: i would like to purchase a desk
Bot: Do you need it for your home or office?
user: office
Bot: Apologies, I can only assist you with home products. Would you like me to help you find one?
Bot: Do you need it for your home or office?
But i only need the response to be
Apologies, I can only assist you with home products. Would you like me to help you find one?
Update:
So I played around with the formbot demo, this seems to be the normal behavior, although it makes the bot sound less ‘natural’.
As a workaround, i did the following: 1- defined a new slot (I named it ‘wrong_num_of_ppl’ - line 37 in the image below) in the domain and set its ‘initial_value’ 2- this passed this slot to the utter_ask_{requested_slot} template, line 45 in the image. 3- in validate, I changed the value if validation fails, (when user inserts a negative number)
I was expecting the following behavior: if the user provides a negative value for the number of people, the bot should only ask the user to input a correct value
However, this did not work! For some reason changing the value of the slot ‘wrong_num_of_ppl’ was not reflected on the uttered template
Any suggestions?