Retraining the bot just to change the text copy can be suboptimal for some workflows. That's why Rasa Open Source also allows you to outsource the response generation and separate it from the dialogue learning.
The assistant will still learn to predict actions and to react to user input based on past dialogues, but the responses it sends back to the user will be generated outside of Rasa Open Source.
When the assistant wants to send a message to the user, it will call an external HTTP server that you define.
Responding to Requests
When your model predicts that your bot should send a response to the user, it will send a request to your server, giving you the information required to select or generate a response.
The body of the
POST request sent to your NLG endpoint will be structured
Here is an overview of the high-level keys in the post request:
|The name of the response predicted by Rasa Open Source.|
|Optional keyword arguments that can be provided by custom actions.|
|A dictionary containing the entire conversation history.|
|The output channel this message will be sent to.|
You can use any or all of this information to decide how to generate your response.
The endpoint needs to respond with the generated response. Rasa will then send this response back to the user.
Below are the possible keys of a response and their (empty) types:
You can choose to provide just text, or a combination of different types of rich responses.
Just like the responses defined in the domain file, a response needs to contain at the very least
custom to be a valid response.
Calling responses from stories
If you use an external NLG service, you don't need to specify the
responses in the domain. However, you still need to add the response names
actions list of the domain if you want to call them directly from
Configuring the Server URL
To tell Rasa Open Source where to find your NLG server, add the URL to your
If your NLG server is protected and Rasa Open Source will need authentication to access it, you can configure authentication in the endpoints: