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, 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)[source]
as_dict()[source]
as_story_string()[source]
type_name = u'action'
class rasa_core.events.ActionReverted(timestamp=None)[source]

Bases: rasa_core.events.Event

Bot undoes its last action.

Shouldn’t be used during actual user interactions, mostly for train. As a side effect the Tracker‘s last turn is removed.

apply_to(tracker)[source]
as_story_string()[source]
type_name = u'undo'
class rasa_core.events.AllSlotsReset(timestamp=None)[source]

Bases: rasa_core.events.Event

Conversation should start over & history wiped.

As a side effect the Tracker will be reinitialised.

apply_to(tracker)[source]
as_story_string()[source]
type_name = u'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)[source]
as_dict()[source]
as_story_string()[source]
static empty()[source]
type_name = u'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 = u'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 = u'resume'
class rasa_core.events.Event(timestamp=None)[source]

Bases: object

An event is one of the following: - something the user has said to the bot (starts a new turn) - the topic has been set - the bot has taken an action

Events are logged by the Tracker’s update method. This updates the list of turns so that the current state can be recovered by consuming the list of turns.

apply_to(tracker)[source]
as_dict()[source]
as_story_string()[source]
static from_parameters(parameters, default=None)[source]
static from_story_string(event_name, parameters, default=None)[source]
static resolve_by_type(type_name, default=None)[source]

Returns a slots class by its type name.

type_name = u'event'
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 = u'reminder'
class rasa_core.events.Restarted(timestamp=None)[source]

Bases: rasa_core.events.Event

Conversation should start over & history wiped.

As a side effect the Tracker will be reinitialised.

apply_to(tracker)[source]
as_story_string()[source]
type_name = u'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.

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 = u'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)[source]
as_story_string()[source]
type_name = u'export'
class rasa_core.events.TopicSet(topic, timestamp=None)[source]

Bases: rasa_core.events.Event

The topic of conversation has changed.

As a side effect self.topic will be pushed on to Tracker.topic_stack.

apply_to(tracker)[source]
as_dict()[source]
as_story_string()[source]
type_name = u'topic'
class rasa_core.events.UserUtteranceReverted(timestamp=None)[source]

Bases: rasa_core.events.Event

Bot undoes its last action.

Shouldn’t be used during actual user interactions, mostly for train. As a side effect the Tracker‘s last turn is removed.

apply_to(tracker)[source]
as_story_string()[source]
type_name = u'rewind'
class rasa_core.events.UserUttered(text, intent=None, entities=None, parse_data=None, timestamp=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)[source]
as_dict()[source]
as_story_string()[source]
static empty()[source]
type_name = u'user'
rasa_core.events.deserialise_events(serialized_events)[source]

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

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