notice

This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).

Version: 2.x

rasa.core.nlg.response

TemplatedNaturalLanguageGenerator Objects

class TemplatedNaturalLanguageGenerator(NaturalLanguageGenerator)

Natural language generator that generates messages based on responses.

The responses can use variables to customize the utterances based on the state of the dialogue.

__init__

| __init__(responses: Dict[Text, List[Dict[Text, Any]]]) -> None

Creates a Template Natural Language Generator.

Arguments:

  • responses - responses that will be used to generate messages.

generate

| async generate(utter_action: Text, tracker: DialogueStateTracker, output_channel: Text, **kwargs: Any, ,) -> Optional[Dict[Text, Any]]

Generate a response for the requested utter action.

generate_from_slots

| generate_from_slots(utter_action: Text, filled_slots: Dict[Text, Any], output_channel: Text, **kwargs: Any, ,) -> Optional[Dict[Text, Any]]

Generate a response for the requested utter action.