This is documentation for Rasa & Rasa Pro Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
Filter on which events to include in tracker dumps.
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.
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
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.
Creates tracker from existing events.
sender_id- The ID of the conversation.
evts- Existing events which should be applied to the new tracker.
slots- Slots which can be set.
max_event_history- Maximum number of events which should be stored.
sender_source- File source of the messages.
domain- The current model domain.
Instantiated tracker with its state updated according to the given events.
Initialize the tracker.
A set of events can be stored externally, and we will run through all of them to get the current state. The tracker will represent all the information we captured while processing messages of the dialogue.
Returns the current tracker state as an object.
Convert State dict into a hashable format FrozenState.
state- The state which should be converted
hashable form of the state of type
Generates the past states of this tracker based on the history.
domain- The Domain.
Truedo not include the initial values of slots.
ignore_rule_only_turns- If True ignore dialogue turns that are present only in rules.
rule_only_data- Slots and loops, which only occur in rules but not in stories.
A list of states
Set the currently active loop.
loop_name- The name of loop which should be marked as active.
Interrupt loop and mark that we entered an unhappy path in the conversation.
Trueif the loop was run after an unhappy path.
Notify active loop that it was rejected
Sets latest action name or text.
Resets loop validation and rejection parameters.
action- Serialized action event.
Return the currently set values of the slots
Retrieves the value of a slot.
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
If no entity is found
None is the default result.
entity_type- the entity type of interest
entity_role- optional entity role of interest
entity_group- optional entity group of interest
Get the name of the input_channel of the latest UserUttered event
State whether the tracker is currently paused.
Return the idx of the most recent restart in the list of events.
If the conversation has not been restarted,
0 is returned.
Return a list of events after the most recent restart.
Creates a new state tracker with the same initial values.
Returns a generator of the previous trackers of this tracker.
The tuple with the tracker before each action, and the boolean flag representing whether this action should be hidden in the dialogue history created for ML-based policies.
Returns all actions that should be applied - w/o reverted events.
The events applied to the tracker.
Update the tracker based on a list of events.
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.
Creates a duplicate of this tracker
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.
Dialogue object containing all of the turns.
This can be serialised and later used to recover the state of this tracker exactly.
Modify the state of the tracker according to an
Adds multiple events to the tracker.
new_events- Events to apply.
domain- The current model's domain.
Truerefresh all timestamps of the events. As the events are usually created at some earlier point, this makes sure that all new events come after any current tracker events.
Dump the tracker as a story in the Rasa Core story format.
Returns the dumped tracker as a string.
Dump the tracker as a story in the Rasa Core story format.
The dumped tracker as a string.
Dump the tracker as a story to a file.
Gets the last event of a given type which was actually applied.
event_type- The type of event you want to find.
action_names_to_exclude- Events of type
ActionExecutedwhich should be excluded from the results. Can be used to skip
skip- Skips n possible results before return an event.
EventVerbosityshould be used to search for events.
event which matched the query or
None if no event matched.
Returns whether last
ActionExecuted event had a specific name.
name- Name of the event which should be matched.
skip- Skips n possible results in between.
True if last executed action had name
Triggers another action following the execution of the current.
Clears follow up action when it was executed.
Get the name of the currently active loop.
None if no active loop or the name of the currently active loop.
Get the name of the previously executed action or text of e2e action.
Returns: name of the previously executed action or text of e2e action
Get the name of current active loop.
state- The state from which the name of active loop should be extracted
the name of active loop or None
Check if action_listen is the previous executed action.
state- The state for which the check should be performed
boolean value indicating whether action_listen is previous action
Generate trackers for
tracker that are split by conversation sessions.
tracker- Instance of
The trackers split by conversation sessions.