Events

These docs are for version 1.x of Rasa Open Source.

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"}

Effect: When added to a tracker, updates the tracker with the specified slot.

Restart a conversation

Short: Resets anything logged on the tracker.
JSON

evt = {"event": "restart"}

Effect: Conversation should start over & history wiped.

Reset all Slots

Short: Resets all the slots of a conversation.
JSON

evt = {"event": "reset_slots"}

Effect: 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
}

Effect: Schedules the asynchronous triggering of a user intent 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"
}

Effect: Cancels certain jobs.

Pause a conversation

Short: Stops the bot from responding to messages.
JSON

evt = {"event": "pause"}

Effect: Prevents the bot from responding to further messages until resumed.

Resume a conversation

Short: Resumes a previously paused conversation. JSON

evt = {"event": "resume"}

Effect: Bot takes over conversation.

Force a followup action

Short: Force a follow-up action to be a fixed one.
JSON

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

Effect: Enqueues 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": {}
}

Effect: Records the user message and updates the tracker.

Bot responded message

Short: Message a bot sent to the user.
JSON

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

Effect: Records the bot message to the user.

Undo a user message

Short: Undoes all side effects that happen after the last user message.
JSON

evt = {"event": "rewind"}

Effect: Reverts to the state before the last user message.

Undo an action

Short: Undoes all side effects that happened after the last action.
JSON

evt = {"event": "undo"}

Effect: Reverts all effects of the last action.

Log an executed action

Short: Logs an action the bot executed to the conversation.
JSON

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

Effect: Records an action taken by the bot and its result.

Start a new conversation session

Short: Marks the beginning of a new conversation session. JSON

evt = {"event": "session_started"}

Effect: Resets the tracker to begin a new session.