Exemplo n.º 1
0
 def run(self, dispatcher: CollectingDispatcher, tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     try:
         message = sql_query(tracker.sender_id)
         message = str(message)
         dispatcher.utter_message(text=message)
     except:
         message = dispatcher.utter_message(template="utter_sorry")
         dispatcher.utter_message(message)
     save_data(tracker.sender_id, (tracker.latest_message)['text'], message)
     return []
Exemplo n.º 2
0
 def run(self, dispatcher: CollectingDispatcher, tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     try:
         print(tracker.sender_id)
         message = "There are total of {} properties in this LSGD".format(
             population())
         dispatcher.utter_message(text=message)
     except:
         message = dispatcher.utter_message(template="utter_sorry")
         dispatcher.utter_message(message)
     save_data(tracker.sender_id, (tracker.latest_message)['text'], message)
     return []
Exemplo n.º 3
0
 def run(self, dispatcher: CollectingDispatcher, tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     try:
         feat = eval(next(tracker.get_latest_entity_values("feature"),
                          None))
         flag = eval(next(tracker.get_latest_entity_values("flag"), None))
         message = property_count(feat, flag)
         dispatcher.utter_message(text=message)
     except:
         message = dispatcher.utter_message(template="utter_sorry")
         dispatcher.utter_message(message)
     save_data(tracker.sender_id, (tracker.latest_message)['text'], message)
     return []
Exemplo n.º 4
0
 def run(self, dispatcher: CollectingDispatcher, tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     try:
         feat = eval(next(tracker.get_latest_entity_values("feature"),
                          None))
         cat = eval(next(tracker.get_latest_entity_values("category"),
                         None))
         result = CatProperties(feat, cat)
         message = "There are total of {} {} properties in this LSGD".format(
             result, cat.lower())
         dispatcher.utter_message(text=message)
     except:
         message = dispatcher.utter_message(template="utter_sorry")
         dispatcher.utter_message(message)
     save_data(tracker.sender_id, (tracker.latest_message)['text'], message)
     return []