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 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.

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}!"
  utter_channel:
    - text: "this is a default channel"
    - text: "you're talking to me on slack!"
  utter_goodbye:
    - text: "goodbye 😢"
    - text: "bye bye 😢"
  utter_default:
    - text: "sorry, I didn't get that, can you rephrase it?"

The responses section contains the responses the assistant uses to send messages to the user.

Creating your own NLG service for bot responses

Retraining the bot just to change the text copy can be suboptimal. That’s why Core allows you to outsource the response generation and separate it from the dialogue learning. The assistant will send a message to the user using an external HTTP server. To configure this endpoint, you need to create an endpoints.yml.

Proactively Reaching Out to the User with External Events

You may want to proactively reach out to the user, example to display output of a long-running background operation or notify the user of an external event.