Saying additional utterances during a form

How can I get my chatbot to utter additional utterances depending on the conditional form logic. So if a given slot has a certain value during the form interaction it will speak an additional utterance.

So in this example:

def required_slots(tracker) -> List[Text]:
   """A list of required slots that the form has to fill"""

   if tracker.get_slot('cuisine') == 'greek':
     return ["cuisine", "num_people", "outdoor_seating",
             "preferences", "feedback"]
     return ["cuisine", "num_people",
             "preferences", "feedback"]

I want to make it so that if the cuisine slot value also equals chinese, it should utter an additional message saying something like “I love Chinese food too”

How about doing that in a validation function?

yeah that sounds like a good idea, haven’t tried that. Thanks mate

1 Like