Events | Rasa Documentation

Event Types

Conversations in Rasa are represented as a sequence of events. Custom actions can influence the course of a conversation by returning events in the response to the action server request.

Not all events are typically returned by custom actions since they are tracked automatically by Rasa (e.g. user messages). Others events can only be tracked if they are returned by a custom action.

slot

Sets a slot on the tracker. It can set a slot to a value, or reset a slot by setting its value to null.

Automatic Tracking:

A custom action is needed to set any slot not auto-filled by an entity.

JSON:

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

Parameters:

Rasa Class: rasa.core.events.SlotSet

reset_slots

Resets all slots on the tracker to null.

Automatic Tracking: Never

JSON:

{
  "event": "reset_slots"
}

Rasa Class: rasa.core.events.AllSlotsReset

reminder

Schedules an intent to be triggered at a certain time in the future.

Automatic Tracking: Never

JSON:

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

Parameters:

Rasa Class: rasa.core.events.ReminderScheduled

cancel_reminder

Cancels a scheduled reminder or reminders. All reminders which match the supplied parameters will be cancelled.

Automatic Tracking: Never

JSON:

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

Parameters:

Rasa Class: rasa.core.events.ReminderCancelled

pause

Stops the bot from responding to user messages. The conversation will remain paused and no actions will be predicted until the conversation is explicitly resumed.

Automatic Tracking: Never

JSON:

{
  "event": "pause"
}

Rasa Class: rasa.core.events.ConversationPaused

resume

Resume a previously paused conversation. Once this event is added to the tracker the bot will start predicting actions again. It will not predict actions for user messages received while the conversation was paused.

Automatic Tracking: Never

JSON:

{
  "event": "resume"
}

Rasa Class: rasa.core.events.ConversationResumed

followup

Force a follow up action, bypassing action prediction.

Automatic Tracking: Never

JSON:

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

Parameters:

Rasa Class: rasa.core.events.FollowupAction

rewind

Reverts all side effects of the last user message and removes the last user event from the tracker.

Automatic Tracking:

JSON:

{
  "event": "rewind"
}

Rasa Class: rasa.core.events.UserUtteranceReverted

undo

Undoes all side effects of the last bot action and removes the last bot action from the tracker.

Automatic Tracking:

JSON:

{
  "event": "undo"
}

Rasa Class: rasa.core.events.ActionReverted

restart

Resets the tracker. After a restart event, there will be no conversation history and no record of the restart.

Automatic Tracking:

JSON:

{
  "event": "restart"
}

Rasa Class: rasa.core.events.Restarted

session_started

Starts a new conversation by resetting the tracker and running the default action ActionSessionStart. This action will by default carry over existing SlotSet events to a new conversation session. You can configure this behaviour in your domain file under session_config.

Automatic Tracking:

Restarting a conversation with restart event does not automatically cause a session_started event.

JSON:

{
  "event": "session_started"
}

Rasa Class: rasa.core.events.SessionStarted

user

The user sent a message to the bot.

Automatic Tracking:

This event is not usually returned by a custom action.

JSON:

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

Parameters:

Rasa Class: rasa.core.events.UserUttered

bot

The bot sent a message to the user.

Automatic Tracking:

This event is not usually returned explicitly by a custom action; responses would be returned instead.

JSON:

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

Parameters:

Rasa Class: rasa.core.events.BotUttered

action

Logs an action called by the bot. Only the action itself is logged; the events that the action creates are logged separately when they are applied.

Automatic Tracking:

This event is not usually returned explicitly by a custom action.

JSON:

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

Parameters:

Rasa Class: rasa.core.events.ActionExecuted