rasa.shared.core.trackers

You are viewing documentation for our open source project which is maintained by the community. If you want to get started building assistants with Rasa please check out our latest documentation here.

TrackerActiveLoop Objects #

@import dataclasses

@dataclasses.dataclass class TrackerActiveLoop(): # Dataclass for DialogueStateTracker.active_loop.

EventVerbosity Objects #

class EventVerbosity(Enum): # Filter on which events to include in tracker dumps.

AnySlotDict Objects #

class AnySlotDict(dict): """ A slot dictionary that pretends every slot exists, by creating slots on demand. This only uses the generic slot type! This means certain functionality wont work, e.g. properly featurizing the slot. """

DialogueStateTracker Objects #

class DialogueStateTracker(): # Maintains the state of a conversation.

@classmethod def from_dict(cls, sender_id: Text, events_as_dict: List[Dict[Text, Any]], slots: Optional[Iterable[Slot]] = None, max_event_history: Optional[int] = None) -> "DialogueStateTracker": # Create a tracker from dump. # The dump should be an array of dumped events. When restoring # the tracker, these events will be replayed to recreate the state. pass

@classmethod def from_events(cls, sender_id: Text, evts: List[Event], slots: Optional[Iterable[Slot]] = None, max_event_history: Optional[int] = None, sender_source: Optional[Text] = None, domain: Optional[Domain] = None) -> "DialogueStateTracker": # Creates tracker from existing events. # Arguments: # - sender_id - The ID of the conversation. # - evts - Existing events which should be applied to the new tracker. pass

def init(self, sender_id: Text, slots: Optional[Iterable[Slot]], max_event_history: Optional[int] = None, sender_source: Optional[Text] = None, is_rule_tracker: bool = False) -> None: # Initialize the tracker. pass

def current_state(self, event_verbosity: EventVerbosity = EventVerbosity.NONE) -> Dict[Text, Any]: # Returns the current tracker state as an object. pass

def current_slot_values(self) -> Dict[Text, Any]: # Return the currently set values of the slots. pass

def get_slot(self, key: Text) -> Optional[Any]: # Retrieves the value of a slot. pass

def get_latest_entity_values(self, entity_type: Text, entity_role: Optional[Text] = None, entity_group: Optional[Text] = None) -> Iterator[Text]: # Get entity values found for the passed entity type and optional role and group in latest message. pass

def is_paused(self) -> bool: # State whether the tracker is currently paused. pass

def events_after_latest_restart(self) -> List[Event]: # Return a list of events after the most recent restart. pass

TrackerEventDiffEngine Objects #

class TrackerEventDiffEngine():

@staticmethod def event_difference(original: DialogueStateTracker, tracker: DialogueStateTracker) -> List[Event]: # Returns all events from the new tracker which are not present in the original tracker. pass

def get_active_loop_name(state: State) -> Optional[Text]: # Get the name of current active loop. pass

def is_prev_action_listen_in_state(state: State) -> bool: # Check if action_listen is the previous executed action. pass

def get_trackers_for_conversation_sessions(tracker: DialogueStateTracker) -> List[DialogueStateTracker]: # Generate trackers for tracker that are split by conversation sessions. pass