Tracker
Tracker
Trackers maintain the state of a dialogue between the assistant and the user in the form of conversation sessions. To learn more about how to configure the session behavior, check out the docs on Session configuration.
class rasa.core.trackers.DialogueStateTracker(sender_id, slots, max_event_history=None, sender_source=None)
Maintains the state of a conversation.
The field max_event_history will only give you these last events, it can be set in the tracker_store.
applied_events()
Returns all actions that should be applied - w/o reverted events.
Return typeList[Event]
as_dialogue()
Return a Dialogue object containing all of the turns.
This can be serialised and later used to recover the state of this tracker exactly.
Return typeDialogue
change_form_to(form_name)
Activate or deactivate a form.
Return typeNone
clear_followup_action()
Clears follow up action when it was executed.
Return typeNone
copy()
Creates a duplicate of this tracker.
Return typeDialogueStateTracker
current_slot_values()
Return the currently set values of the slots.
Return typeDict[str, Any]
current_state(event_verbosity=<EventVerbosity.NONE: 1>)
Return the current tracker state as an object.
Return typeDict[str, Any]
events_after_latest_restart()
Return a list of events after the most recent restart.
Return typeList[Event]
export_stories(e2e=False, include_source=False)
Dump the tracker as a story in the Rasa Core story format.
Returns the dumped tracker as a string.
Return typestr
export_stories_to_file(export_path='debug.md')
Dump the tracker as a story to a file.
Return typeNone
classmethod from_dict(sender_id, events_as_dict, slots=None, max_event_history=None)
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.
Return typeDialogueStateTracker
generate_all_prior_trackers()
Returns a generator of the previous trackers of this tracker.
The resulting array is representing the trackers before each action.
Return typeGenerator[DialogueStateTracker, None, None]
Additional methods
get_last_event_for(event_type, action_names_to_exclude=None, skip=0)get_latest_entity_values(entity_type, entity_role=None, entity_group=None)get_latest_input_channel()get_slot(key)idx_after_latest_restart()init_copy()is_paused()last_executed_action_has(name, skip=0)past_states(domain)recreate_from_dialogue(dialogue)reject_action(action_name)replay_events()set_form_validation(validate)set_latest_action_name(action_name)travel_back_in_time(target_time)trigger_followup_action(action)update(event, domain=None)