def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: name = tracker.get_slot("person") contact = get_closest_contact(name) contact_name = contact["name"] contact_email = contact["email"] message = "Mail {} to {}".format(contact_name, contact_email) dispatcher.utter_message(message) return []
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: name = tracker.get_slot("person") contact = get_closest_contact(name) contact_name = contact["name"] time = tracker.get_slot("time") meeting_time = str(analyze_timestring(time)) add_meeting(contact_name, meeting_time) confirmation_message = "Dodano spotkanie z {} na datę {}".format( name, meeting_time) dispatcher.utter_message(confirmation_message) return [SlotSet("person", contact_name), SlotSet("time", meeting_time)]