Hi all, I am fairly new here so I hope its not a stupid question:
I wanted to personalize my form action (that works just as intended) to output different utterances based on one of the required slots and also change on of the slots in the process. I put it into the submit function of the form, but it just gets ignored. This is the submit part:
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, based on emotion slot
emo = tracker.get_slot("emotion")
if emo in ["anger", "disgust"]:
msg1 = "outter_confirm_order_angry"
else: msg1 = "utter_confirm_order"
# add the right "article" in front of location
place = tracker.get_slot("LOCATION")
myList = ["my", "our"]
if any(x in place for x in myList):
place = place.replace("our", "your" )
place = place.replace("my", "your")
else:
place = "the "+place
SlotSet("LOCATION", place)
dispatcher.utter_message(template = msg1)
return []
Any help is greatly appreciated! To be clear, I get the Output “utter_confirm_order” even when the emotion is “angry” and the “LOCATION” remains unchanged.