# Tracker [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#tracker "Permalink to this headline")

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](https://legacy-docs-v1.rasa.com/1.10.4/core/domains/#session-config).

## _class_`rasa.core.trackers.``DialogueStateTracker`( _sender_id_, _slots_, _max_event_history=None_, _sender_source=None_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker "Permalink to this definition")  
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`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.applied_events "Permalink to this definition")  
Returns all actions that should be applied - w/o reverted events.

**Return type**  
`List`[`Event`]

### `as_dialogue`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.as_dialogue "Permalink to this definition")  
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 type**  
`Dialogue`

### `change_form_to`( _form_name_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.change_form_to "Permalink to this definition")  
Activate or deactivate a form

**Return type**  
`None`

### `clear_followup_action`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.clear_followup_action "Permalink to this definition")  
Clears follow up action when it was executed.

**Return type**  
`None`

### `copy`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.copy "Permalink to this definition")  
Creates a duplicate of this tracker

**Return type**  
[`DialogueStateTracker`](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker "rasa.core.trackers.DialogueStateTracker")

### `current_slot_values`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.current_slot_values "Permalink to this definition")  
Return the currently set values of the slots

**Return type**  
`Dict`[`str`, `Any`]

### `current_state`( _event_verbosity=<EventVerbosity.NONE: 1>_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.current_state "Permalink to this definition")  
Return the current tracker state as an object.

**Return type**  
`Dict`[`str`, `Any`]

### `events_after_latest_restart`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.events_after_latest_restart "Permalink to this definition")  
Return a list of events after the most recent restart.

**Return type**  
`List`[`Event`]

### `export_stories`( _e2e=False_, _include_source=False_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.export_stories "Permalink to this definition")  
Dump the tracker as a story in the Rasa Core story format.

Returns the dumped tracker as a string.

**Return type**  
`str`

### `export_stories_to_file`( _export_path='debug.md'_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.export_stories_to_file "Permalink to this definition")  
Dump the tracker as a story to a file.

**Return type**  
`None`

### _classmethod_`from_dict`( _sender_id_, _events_as_dict_, _slots=None_, _max_event_history=None_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.from_dict "Permalink to this definition")  
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.

### `generate_all_prior_trackers`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.generate_all_prior_trackers "Permalink to this definition")  
Returns a generator of the previous trackers of this tracker.

The resulting array is representing the trackers before each action.

**Return type**  
`Generator`[ [`DialogueStateTracker`](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker "rasa.core.trackers.DialogueStateTracker"), `None`, `None`]

### `get_last_event_for`( _event_type_, _action_names_to_exclude=None_, _skip=0_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.get_last_event_for "Permalink to this definition")  
Gets the last event of a given type which was actually applied.

**Parameters**  
- **event_type** – The type of event you want to find.
- **action_names_to_exclude** – Events of type ActionExecuted which should be excluded from the results. Can be used to skip action_listen events.
- **skip** – Skips n possible results before return an event.

**Returns**  
event which matched the query or None if no event matched.

**Return type**  
`Optional`[`Event`]

### `get_latest_entity_values`( _entity_type_, _entity_role=None_, _entity_group=None_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.get_latest_entity_values "Permalink to this definition")  
Get entity values found for the passed entity type and optional role and group in latest message.

If you are only interested in the first entity of a given type use next(tracker.get_latest_entity_values(“my_entity_name”), None). If no entity is found None is the default result.

**Parameters**  
- **entity_type** – the entity type of interest
- **entity_role** – optional entity role of interest
- **entity_group** – optional entity group of interest

**Returns**  
Entity values.

**Return type**  
`Iterator`[`str`]

### `get_latest_input_channel`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.get_latest_input_channel "Permalink to this definition")  
Get the name of the input_channel of the latest UserUttered event

**Return type**  
`Optional`[`str`]

### `get_slot`( _key_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.get_slot "Permalink to this definition")  
Retrieves the value of a slot.

**Return type**  
`Optional`[`Any`]

### `idx_after_latest_restart`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.idx_after_latest_restart "Permalink to this definition")  
Return the idx of the most recent restart in the list of events.

If the conversation has not been restarted, `0` is returned.

**Return type**  
`int`

### `init_copy`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.init_copy "Permalink to this definition")  
Creates a new state tracker with the same initial values.

### `is_paused`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.is_paused "Permalink to this definition")  
State whether the tracker is currently paused.

**Return type**  
`bool`

### `last_executed_action_has`( _name_, _skip=0_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.last_executed_action_has "Permalink to this definition")  
Returns whether last ActionExecuted event had a specific name.

**Parameters**  
- **name** – Name of the event which should be matched.
- **skip** – Skips n possible results in between.

**Returns**  
True if last executed action had name name, otherwise False.

**Return type**  
`bool`

### `past_states`( _domain_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.past_states "Permalink to this definition")  
Generate the past states of this tracker based on the history.

**Return type**  
`deque`

### `recreate_from_dialogue`( _dialogue_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.recreate_from_dialogue "Permalink to this definition")  
Use a serialised Dialogue to update the trackers state.

This uses the state as is persisted in a `TrackerStore`. If the tracker is blank before calling this method, the final state will be identical to the tracker from which the dialogue was created.

**Return type**  
`None`

### `reject_action`( _action_name_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.reject_action "Permalink to this definition")  
Notify active form that it was rejected

**Return type**  
`None`

### `replay_events`() [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.replay_events "Permalink to this definition")  
Update the tracker based on a list of events.

**Return type**  
`None`

### `set_form_validation`( _validate_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.set_form_validation "Permalink to this definition")  
Toggle form validation

**Return type**  
`None`

### `set_latest_action_name`( _action_name_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.set_latest_action_name "Permalink to this definition")  
Set latest action name and reset form validation and rejection parameters

**Return type**  
`None`

### `travel_back_in_time`( _target_time_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.travel_back_in_time "Permalink to this definition")  
Creates a new tracker with a state at a specific timestamp.

A new tracker will be created and all events previous to the passed time stamp will be replayed. Events that occur exactly at the target time will be included.

### `trigger_followup_action`( _action_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.trigger_followup_action "Permalink to this definition")  
Triggers another action following the execution of the current.

**Return type**  
`None`

### `update`( _event_, _domain=None_) [¶](https://legacy-docs-v1.rasa.com/1.10.4/api/tracker/#rasa.core.trackers.DialogueStateTracker.update "Permalink to this definition")  
Modify the state of the tracker according to an `Event`.

**Return type**  
`None`

👋 I can help you get started with Rasa and answer your technical questions.
