Warning: This document is for an old version of Rasa Core. The latest version is 0.14.5.

Events

List of all the events the dialogue system is able to handle and supports.

An event can be referenced by its type_name attribute (e.g. when returning events in an http callback).

class rasa_core.events.ActionExecuted(action_name, policy=None, confidence=None, timestamp=None)[source]

Bases: rasa_core.events.Event

An operation describes an action taken + its result.

It comprises an action and a list of events. operations will be appended to the latest Turn in the Tracker.turns.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
type_name = 'action'
class rasa_core.events.ActionExecutionRejected(action_name, policy=None, confidence=None, timestamp=None)[source]

Bases: rasa_core.events.Event

Notify Core that the execution of the action has been rejected

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
type_name = 'action_execution_rejected'
class rasa_core.events.ActionReverted(timestamp=None)[source]

Bases: rasa_core.events.Event

Bot undoes its last action.

The bot everts everything until before the most recent action. This includes the action itself, as well as any events that action created, like set slot events - the bot will now predict a new action using the state before the most recent action.

apply_to(tracker: DialogueStateTracker) → None[source]
as_story_string()[source]
type_name = 'undo'
class rasa_core.events.AgentUttered(text=None, data=None, timestamp=None)[source]

Bases: rasa_core.events.Event

The agent has said something to the user.

This class is not used in the story training as it is contained in the ActionExecuted class. An entry is made in the Tracker.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
static empty()[source]
type_name = 'agent'
class rasa_core.events.AllSlotsReset(timestamp=None)[source]

Bases: rasa_core.events.Event

All Slots are reset to their initial values.

If you want to keep the dialogue history and only want to reset the slots, you can use this event to set all the slots to their initial values.

apply_to(tracker)[source]
as_story_string()[source]
type_name = 'reset_slots'
class rasa_core.events.BotUttered(text=None, data=None, timestamp=None)[source]

Bases: rasa_core.events.Event

The bot has said something to the user.

This class is not used in the story training as it is contained in the

ActionExecuted class. An entry is made in the Tracker.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
static empty()[source]
type_name = 'bot'
class rasa_core.events.ConversationPaused(timestamp=None)[source]

Bases: rasa_core.events.Event

Ignore messages from the user to let a human take over.

As a side effect the Tracker’s paused attribute will be set to True.

apply_to(tracker)[source]
as_story_string()[source]
type_name = 'pause'
class rasa_core.events.ConversationResumed(timestamp=None)[source]

Bases: rasa_core.events.Event

Bot takes over conversation.

Inverse of PauseConversation. As a side effect the Tracker’s paused attribute will be set to False.

apply_to(tracker)[source]
as_story_string()[source]
type_name = 'resume'
class rasa_core.events.Event(timestamp=None)[source]

Bases: object

Events describe everything that occurs in a conversation and tell the rasa_core.trackers.DialogueStateTracker how to update its state.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
static from_parameters(parameters: Dict[str, Any], default: Optional[Type[Event]] = None) → Optional[rasa_core.events.Event][source]
static from_story_string(event_name: str, parameters: Dict[str, Any], default: Optional[Type[Event]] = None) → Optional[List[rasa_core.events.Event]][source]
static resolve_by_type(type_name: str, default: Optional[Type[Event]] = None) → Optional[Type[rasa_core.events.Event]][source]

Returns a slots class by its type name.

type_name = 'event'
class rasa_core.events.FollowupAction(name, timestamp=None)[source]

Bases: rasa_core.events.Event

Enqueue a followup action.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
type_name = 'followup'
class rasa_core.events.Form(name, timestamp=None)[source]

Bases: rasa_core.events.Event

If name is not None: activates a form with name else deactivates active form

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
type_name = 'form'
class rasa_core.events.FormValidation(validate, timestamp=None)[source]

Bases: rasa_core.events.Event

Event added by FormPolicy to notify form action whether or not to validate the user input

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string()[source]
type_name = 'form_validation'
class rasa_core.events.ReminderScheduled(action_name, trigger_date_time, name=None, kill_on_user_message=True, timestamp=None)[source]

Bases: rasa_core.events.Event

Allows asynchronous scheduling of action execution.

As a side effect the message processor will schedule an action to be run at the trigger date.

as_dict()[source]
as_story_string()[source]
type_name = 'reminder'
class rasa_core.events.Restarted(timestamp=None)[source]

Bases: rasa_core.events.Event

Conversation should start over & history wiped.

Instead of deleting all events, this event can be used to reset the trackers state (e.g. ignoring any past user messages & resetting all the slots).

apply_to(tracker)[source]
as_story_string()[source]
type_name = 'restart'
class rasa_core.events.SlotSet(key, value=None, timestamp=None)[source]

Bases: rasa_core.events.Event

The user has specified their preference for the value of a slot.

Every slot has a name and a value. This event can be used to set a value for a slot on a conversation.

As a side effect the Tracker’s slots will be updated so that tracker.slots[key]=value.

apply_to(tracker)[source]
as_dict()[source]
as_story_string()[source]
type_name = 'slot'
class rasa_core.events.StoryExported(path=None, timestamp=None)[source]

Bases: rasa_core.events.Event

Story should get dumped to a file.

apply_to(tracker: DialogueStateTracker) → None[source]
as_story_string()[source]
type_name = 'export'
class rasa_core.events.UserUtteranceReverted(timestamp=None)[source]

Bases: rasa_core.events.Event

Bot reverts everything until before the most recent user message.

The bot will revert all events after the latest UserUttered, this also means that the last event on the tracker is usually action_listen and the bot is waiting for a new user message.

apply_to(tracker: DialogueStateTracker) → None[source]
as_story_string()[source]
type_name = 'rewind'
class rasa_core.events.UserUttered(text, intent=None, entities=None, parse_data=None, timestamp=None, input_channel=None, message_id=None)[source]

Bases: rasa_core.events.Event

The user has said something to the bot.

As a side effect a new Turn will be created in the Tracker.

apply_to(tracker: DialogueStateTracker) → None[source]
as_dict()[source]
as_story_string(e2e=False)[source]
static empty()[source]
type_name = 'user'
rasa_core.events.deserialise_entities(entities)[source]
rasa_core.events.deserialise_events(serialized_events: List[Dict[str, Any]]) → List[rasa_core.events.Event][source]

Convert a list of dictionaries to a list of corresponding events.

Example format:
[{“event”: “slot”, “value”: 5, “name”: “my_slot”}]
rasa_core.events.first_key(d, default_key)[source]
rasa_core.events.md_format_message(text, intent, entities)[source]