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

## User Guide

- [Installation](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/installation/)
- [Tutorial: Rasa Basics](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/rasa-tutorial/)
- [Tutorial: Building Assistants](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/building-assistants/)
- [Command Line Interface](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/command-line-interface/)
- [Architecture](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/architecture/)
- [Messaging and Voice Channels](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/messaging-and-voice-channels/)
- [Evaluating Models](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/evaluating-models/)
- [Validate Data](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/validate-files/)
- [Configuring the HTTP API](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/configuring-http-api/)
- [Deploying your Rasa Assistant](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/how-to-deploy/)
- [Cloud Storage](https://legacy-docs-v1.rasa.com/1.7.2/user-guide/cloud-storage/)

## NLU

- [About](https://legacy-docs-v1.rasa.com/1.7.2/nlu/about/)
- [Using NLU Only](https://legacy-docs-v1.rasa.com/1.7.2/nlu/using-nlu-only/)
- [Training Data Format](https://legacy-docs-v1.rasa.com/1.7.2/nlu/training-data-format/)
- [Choosing a Pipeline](https://legacy-docs-v1.rasa.com/1.7.2/nlu/choosing-a-pipeline/)
- [Language Support](https://legacy-docs-v1.rasa.com/1.7.2/nlu/language-support/)
- [Entity Extraction](https://legacy-docs-v1.rasa.com/1.7.2/nlu/entity-extraction/)
- [Components](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/)

## Core

- [About](https://legacy-docs-v1.rasa.com/1.7.2/core/about/)
- [Stories](https://legacy-docs-v1.rasa.com/1.7.2/core/stories/)
- [Domains](https://legacy-docs-v1.rasa.com/1.7.2/core/domains/)
- [Responses](https://legacy-docs-v1.rasa.com/1.7.2/core/responses/)
- [Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/actions/)
- [Policies](https://legacy-docs-v1.rasa.com/1.7.2/core/policies/)
- [Slots](https://legacy-docs-v1.rasa.com/1.7.2/core/slots/)
- [Forms](https://legacy-docs-v1.rasa.com/1.7.2/core/forms/)
- [Retrieval Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/retrieval-actions/)
- [Interactive Learning](https://legacy-docs-v1.rasa.com/1.7.2/core/interactive-learning/)
- [Fallback Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/fallback-actions/)
- [Knowledge Base Actions](https://legacy-docs-v1.rasa.com/1.7.2/core/knowledge-bases/)

## Conversation Design

- [Dialogue Elements](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/dialogue-elements/)
- [Small Talk](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/small-talk/)
- [Completing Tasks](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/completing-tasks/)
- [Guiding Users](https://legacy-docs-v1.rasa.com/1.7.2/dialogue-elements/guiding-users/)

## API Reference

- [Action Server](https://legacy-docs-v1.rasa.com/1.7.2/api/action-server/)
- [HTTP API](https://legacy-docs-v1.rasa.com/1.7.2/api/http-api/)
- [Jupyter Notebooks](https://legacy-docs-v1.rasa.com/1.7.2/api/jupyter-notebooks/)
- [Agent](https://legacy-docs-v1.rasa.com/1.7.2/api/agent/)
- [Custom NLU Components](https://legacy-docs-v1.rasa.com/1.7.2/api/custom-nlu-components/)
- [Rasa SDK](https://legacy-docs-v1.rasa.com/1.7.2/api/rasa-sdk/)
- [Events](https://legacy-docs-v1.rasa.com/1.7.2/api/events/)
- [Tracker](https://legacy-docs-v1.rasa.com/1.7.2/api/tracker/)
- [Tracker Stores](https://legacy-docs-v1.rasa.com/1.7.2/api/tracker-stores/)
- [Event Brokers](https://legacy-docs-v1.rasa.com/1.7.2/api/event-brokers/)
- [Lock Stores](https://legacy-docs-v1.rasa.com/1.7.2/api/lock-stores/)
- [Training Data Importers](https://legacy-docs-v1.rasa.com/1.7.2/api/training-data-importers/#)
- [Featurization of Conversations](https://legacy-docs-v1.rasa.com/1.7.2/api/core-featurization/)
- [Migration Guide](https://legacy-docs-v1.rasa.com/1.7.2/migration-guide/)
- [Rasa OSS Change Log](https://legacy-docs-v1.rasa.com/1.7.2/changelog/)

## Migrate from (beta)

- [Dialogflow](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/google-dialogflow-to-rasa/)
- [Wit.ai](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/facebook-wit-ai-to-rasa/)
- [LUIS](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/microsoft-luis-to-rasa/)
- [IBM Watson](https://legacy-docs-v1.rasa.com/1.7.2/migrate-from/ibm-watson-to-rasa/)

## Reference

- [Glossary](https://legacy-docs-v1.rasa.com/1.7.2/glossary/)

# Training Data Importers

By default, you can use command line arguments to specify where Rasa should look for training data on your disk. Rasa then loads any potential training files and uses them to train your assistant.

If needed, you can also customize how Rasa imports training data. Potential use cases for this might be:

- using a custom parser to load training data in other formats
- using different approaches to collect training data (e.g. loading them from different resources)

You can instruct Rasa to load and use your custom importer by adding the section `importers` to the Rasa configuration file and specifying the importer with its full class path:

```yaml
importers:
- name: "module.CustomImporter"
  parameter1: "value"
  parameter2: "value2"
- name: "module.AnotherCustomImporter"
```

The `name` key is used to determine which importer should be loaded. Any extra parameters are passed as constructor arguments to the loaded importer.

### RasaFileImporter (default)

By default Rasa uses the importer `RasaFileImporter`. If you want to use it on its own, you don’t have to specify anything in your configuration file. If you want to use it together with other importers, add it to your configuration file:

```yaml
importers:
- name: "RasaFileImporter"
```

### MultiProjectImporter (experimental)

Warning: This feature is currently experimental and might change or be removed in the future. Please share your feedback on it in the forum to help us making this feature ready for production.

With this importer you can build a contextual AI assistant by combining multiple reusable Rasa projects. You might, for example, handle chitchat with one project and greet your users with another. These projects can be developed in isolation, and then combined at train time to create your assistant.

An example directory structure could look like this:

```shell
.
├── config.yml
└── projects
    ├── GreetBot
    │   ├── data
    │   │   ├── nlu.md
    │   │   └── stories.md
    │   └── domain.yml
    └── ChitchatBot
        ├── config.yml
        ├── data
        │   ├── nlu.md
        │   └── stories.md
        └── domain.yml
```

In this example the contextual AI assistant imports the `ChitchatBot` project which in turn imports the `GreetBot` project. Project imports are defined in the configuration files of each project. To instruct Rasa to use the `MultiProjectImporter` module, put this section in the config file of your root project:

```yaml
importers:
- name: MultiProjectImporter
```

Then specify which projects you want to import. In our example, the `config.yml` in the root project would look like this:

```yaml
imports:
- projects/ChitchatBot
```

The configuration file of the `ChitchatBot` in turn references the `GreetBot`:

```yaml
imports:
- ../GreetBot
```

The `GreetBot` project does not specify further projects so the `config.yml` can be omitted.

Rasa uses relative paths from the referencing configuration file to import projects. These can be anywhere on your file system as long as the file access is permitted.

During the training process Rasa will import all required training files, combine them, and train a unified AI assistant. The merging of the training data happens during runtime, so no additional files with training data are created or visible.

Note: Rasa will use the policy and NLU pipeline configuration of the root project directory during training. Policy or NLU configurations of imported projects will be ignored.

Note: Equal intents, entities, slots, responses, actions and forms will be merged, e.g. if two projects have training data for an intent `greet`, their training data will be combined.

### Writing a Custom Importer

If you are writing a custom importer, this importer has to implement the interface of [TrainingDataImporter](https://legacy-docs-v1.rasa.com/1.7.2/api/training-data-importers/#training-data-importers-trainingfileimporter):

```python
from typing import Optional, Text, Dict, List, Union

import rasa
from rasa.core.domain import Domain
from rasa.core.interpreter import RegexInterpreter, NaturalLanguageInterpreter
from rasa.core.training.structures import StoryGraph
from rasa.importers.importer import TrainingDataImporter
from rasa.nlu.training_data import TrainingData

class MyImporter(TrainingDataImporter):
    """Example implementation of a custom importer component."""

def __init__(
        self,
        config_file: Optional[Text] = None,
        domain_path: Optional[Text] = None,
        training_data_paths: Optional[Union[List[Text], Text]] = None,
        **kwargs: Dict
    ):
        """Constructor of your custom file importer.

Args:
            config_file: Path to configuration file from command line arguments.
            domain_path: Path to domain file from command line arguments.
            training_data_paths: Path to training files from command line arguments.
            **kwargs: Extra parameters passed through configuration in configuration file.
        """

pass

async def get_domain(self) -> Domain:
        path_to_domain_file = self._custom_get_domain_file()
        return Domain.load(path_to_domain_file)

def _custom_get_domain_file(self) -> Text:
        pass

async def get_stories(
        self,
        interpreter: "NaturalLanguageInterpreter" = RegexInterpreter(),
        template_variables: Optional[Dict] = None,
        use_e2e: bool = False,
        exclusion_percentage: Optional[int] = None,
    ) -> StoryGraph:
        from rasa.core.training.dsl import StoryFileReader

path_to_stories = self._custom_get_story_file()
        return await StoryFileReader.read_from_file(path_to_stories, await self.get_domain())

def _custom_get_story_file(self) -> Text:
        pass

async def get_config(self) -> Dict:
        path_to_config = self._custom_get_config_file()
        return rasa.utils.io.read_config_file(path_to_config)

def _custom_get_config_file(self) -> Text:
        pass

async def get_nlu_data(self, language: Optional[Text] = "en") -> TrainingData:
        from rasa.nlu.training_data import loading

path_to_nlu_file = self._custom_get_nlu_file()
        return loading.load_data(path_to_nlu_file)

def _custom_get_nlu_file(self) -> Text:
        pass
```

### TrainingDataImporter

_class_`rasa.importers.importer.``TrainingDataImporter` Common interface for different mechanisms to load training data.

_async_`get_domain`() Retrieves the domain of the bot. Returns Loaded `Domain`. Return type `Domain`

_async_`get_config`() Retrieves the configuration that should be used for the training. Returns The configuration as dictionary. Return type `Dict`

_async_`get_nlu_data( language='en')` Retrieves the NLU training data that should be used for training. Parameters Language, can be used to only load training data for a certain language. Returns Loaded NLU `TrainingData`. Return type `TrainingData`

_async_`get_stories(interpreter=<rasa.core.interpreter.RegexInterpreter object>, template_variables=None, use_e2e=False, exclusion_percentage=None)` Retrieves the stories that should be used for training. Parameters Interpreter that should be used to parse end to end learning annotations. Values of templates that should be replaced while reading the story files. Specifies whether to parse end to end learning annotations. Amount of training data that should be excluded. Returns  `StoryGraph` containing all loaded stories. Return type `StoryGraph`.
