Responses

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

User Guide

NLU

Core

Conversation Design

API Reference

Migrate from (beta)

Reference

Responses

If you want your assistant to respond to user messages, you need to manage these responses. In the training data for your bot, your stories, you specify the actions your bot should execute. These actions can use responses to send messages back to the user.

There are three ways to manage these responses:

  1. Responses are normally stored in your domain file, see here

  2. Retrieval action responses are part of the training data, see here

  3. You can also create a custom NLG service to generate responses, see here

Including the responses in the domain

The default format is to include the responses in your domain file. This file then contains references to all your custom actions, available entities, slots and intents.

# all hashtags are comments :)
intents:
 - greet
 - default
 - goodbye
 - affirm
 - thank_you
 - change_bank_details
 - simple
 - hello
 - why
 - next_intent

entities:
 - name

slots:
  name:
    type: text

responses:
  utter_greet:
    - text: "hey there {name}!"  # {name} will be filled by slot (same name) or by custom action
  utter_channel:
    - text: "this is a default channel"
    - text: "you're talking to me on slack!"  # if you define channel-specific utterances, the bot will pick
      channel: "slack"                        # from those when talking on that specific channel
  utter_goodbye:
    - text: "goodbye 😢"   # multiple responses - bot will randomly pick one of them
    - text: "bye bye 😢"
  utter_default:   # utterance sent by action_default_fallback
    - text: "sorry, I didn't get that, can you rephrase it?"