rasa/core/trackers.py
def current_state(self,
                      event_verbosity: EventVerbosity = EventVerbosity.NONE
                      ) -> Dict[Text, Any]:
        """Return the current tracker state as an object."""

        if event_verbosity == EventVerbosity.ALL:
            evts = [e.as_dict() for e in self.events]
        elif event_verbosity == EventVerbosity.AFTER_RESTART:
            evts = [e.as_dict() for e in self.events_after_latest_restart()]
        elif event_verbosity == EventVerbosity.APPLIED:
            evts = [e.as_dict() for e in self.applied_events()]
        else:
            evts = None

        latest_event_time = None
        if len(self.events) > 0:
            latest_event_time = self.events[-1].timestamp

        return {
            "sender_id": self.sender_id,
            "slots": self.current_slot_values(),
            "latest_message": self.latest_message.parse_data,
            "latest_event_time": latest_event_time,
            "followup_action": self.followup_action,
            "paused": self.is_paused(),
            "events": evts,
            "latest_input_channel": self.get_latest_input_channel(),
            "active_form": self.active_form,
            "latest_action_name": self.latest_action_name
        }
Return the current tracker state as an object.
Return the current tracker state as an object.
Return the current tracker state as an object .
def current_state(self,
                      event_verbosity: EventVerbosity = EventVerbosity.NONE
                      ) -> Dict[Text, Any]:
        if event_verbosity == EventVerbosity.ALL:
            evts = [e.as_dict() for e in self.events]
        elif event_verbosity == EventVerbosity.AFTER_RESTART:
            evts = [e.as_dict() for e in self.events_after_latest_restart()]
        elif event_verbosity == EventVerbosity.APPLIED:
            evts = [e.as_dict() for e in self.applied_events()]
        else:
            evts = None
        latest_event_time = None
        if len(self.events) > 0:
            latest_event_time = self.events[-1].timestamp
        return {
            "sender_id": self.sender_id,
            "slots": self.current_slot_values(),
            "latest_message": self.latest_message.parse_data,
            "latest_event_time": latest_event_time,
            "followup_action": self.followup_action,
            "paused": self.is_paused(),
            "events": evts,
            "latest_input_channel": self.get_latest_input_channel(),
            "active_form": self.active_form,
            "latest_action_name": self.latest_action_name
        }
def current_state ( self , event_verbosity : EventVerbosity = EventVerbosity . NONE ) -> Dict [ Text , Any ] : if event_verbosity == EventVerbosity . ALL : evts = [ e . as_dict ( ) for e in self . events ] elif event_verbosity == EventVerbosity . AFTER_RESTART : evts = [ e . as_dict ( ) for e in self . events_after_latest_restart ( ) ] elif event_verbosity == EventVerbosity . APPLIED : evts = [ e . as_dict ( ) for e in self . applied_events ( ) ] else : evts = None latest_event_time = None if len ( self . events ) > 0 : latest_event_time = self . events [ - 1 ] . timestamp return { "sender_id" : self . sender_id , "slots" : self . current_slot_values ( ) , "latest_message" : self . latest_message . parse_data , "latest_event_time" : latest_event_time , "followup_action" : self . followup_action , "paused" : self . is_paused ( ) , "events" : evts , "latest_input_channel" : self . get_latest_input_channel ( ) , "active_form" : self . active_form , "latest_action_name" : self . latest_action_name }
Return the current tracker state as an object.
Return the current tracker state as an object .
"""Return the current tracker state as an object."""
self
event_verbosity
EventVerbosity