Beispiel #1
0
 def run(self, dispatcher: CollectingDispatcher, tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
     total = get_state_data('Total')
     output = f"The  number of active cases in India are {total['active']}\n"
     output += f'This data was last updated on {total["lastupdatedtime"]}\n'
     dispatcher.utter_message(output)
     return []
Beispiel #2
0
    def submit(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
        # Run the form to output details to user
        validated = tracker.get_slot('validated')
        if validated:
            dispatcher.utter_message(template='utter_finding_info')
            state = tracker.get_slot('state')
            current_intent = tracker.get_slot('status')
            state_status = get_state_data(state)
            output = self.__prepare_message(state_status, current_intent)
            dispatcher.utter_message(text=output)
        else:
            dispatcher.utter_message(template='utter_apologies')

        return [SlotSet('state', None), SlotSet('validated', None), SlotSet('status', None)]