Events

Events

Conversations in Rasa are represented as a sequence of events. This page lists the event types defined in Rasa Core.

Note

If you are using the Rasa SDK to write custom actions in python, you need to import the events from rasa_sdk.events, not from rasa.core.events. If you are writing actions in another language, your events should be formatted like the JSON objects on this page.

General Purpose Events

Set a Slot

Short

Event to set a slot on a tracker

JSON

evt = {"event": "slot", "name": "departure_airport", "value": "BER"}

Class rasa.core.events.SlotSet (key, value=None, timestamp=None, metadata=None)
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.

Restart a conversation

Short

Resets anything logged on the tracker.

JSON

evt = {"event": "restart"}

Class rasa.core.events.Restarted (timestamp=None, metadata=None)
Conversation should start over & history wiped.

Reset all Slots

Short

Resets all the slots of a conversation.

JSON

evt = {"event": "reset_slots"}

Class rasa.core.events.AllSlotsReset (timestamp=None, metadata=None)
All Slots are reset to their initial values.

Schedule a reminder

Short

Schedule an intent to be triggered in the future.

JSON

evt = {
  "event": "reminder",
  "intent": "my_intent",
  "entities": {"entity1": "value1", "entity2": "value2"},
  "date_time": "2018-09-03T11:41:10.128172",
  "name": "my_reminder",
  "kill_on_user_msg": true,
}

Class rasa.core.events.ReminderScheduled (intent, trigger_date_time, entities=None, name=None, kill_on_user_message=True, timestamp=None, metadata=None)
Schedules the asynchronous triggering of a user intent (with entities if needed) at a given time.

Cancel a reminder

Short

Cancel one or more reminders.

JSON

evt = {
  "event": "cancel_reminder",
  "name": "my_reminder",
  "intent": "my_intent",
  "entities": [
        {"entity": "entity1", "value": "value1"},
        {"entity": "entity2", "value": "value2"},
    ],
  "date_time": "2018-09-03T11:41:10.128172",
}

Class rasa.core.events.ReminderCancelled (name=None, intent=None, entities=None, timestamp=None, metadata=None)
Cancel certain jobs.

Pause a conversation

Short

Stops the bot from responding to messages. Action prediction will be halted until resumed.

JSON

evt = {"event": "pause"}

Class rasa.core.events.ConversationPaused (timestamp=None, metadata=None)
Ignore messages from the user to let a human take over.

Resume a conversation

Short

Resumes a previously paused conversation. The bot will start predicting actions again.

JSON

evt = {"event": "resume"}

Class rasa.core.events.ConversationResumed (timestamp=None, metadata=None)
Bot takes over conversation.

Force a followup action

Short

Instead of predicting the next action, force the next action to be a fixed one.

JSON

evt = {"event": "followup", "name": "my_action"}

Class rasa.core.events.FollowupAction (name, timestamp=None, metadata=None)
Enqueue a followup action.

Automatically tracked events

User sent message

Short

Message a user sent to the bot.

JSON

evt = {
    "event": "user",
    "text": "Hey",
    "parse_data": {
        "intent": {
            "name": "greet",
            "confidence": 0.9
        },
        "entities": []
    },
    "metadata": {},
}

Class rasa.core.events.UserUttered (text=None, intent=None, entities=None, parse_data=None, timestamp=None, input_channel=None, message_id=None, metadata=None)
The user has said something to the bot.

Bot responded message

Short

Message a bot sent to the user.

JSON

evt = {"event": "bot", "text": "Hey there!", "data": {}}

Class rasa.core.events.BotUttered (text=None, data=None, metadata=None, timestamp=None)
The bot has said something to the user.