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

## User Guide

- [Installation](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/installation/)
- [Tutorial: Rasa Basics](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/rasa-tutorial/)
- [Tutorial: Building Assistants](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/building-assistants/)
- [Command Line Interface](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/command-line-interface/)
- [Architecture](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/architecture/)
- [Messaging and Voice Channels](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/messaging-and-voice-channels/)
- [Testing Your Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/testing-your-assistant/)
- [Setting up CI/CD](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/setting-up-ci-cd/)
- [Validate Data](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/validate-files/)
- [Configuring the HTTP API](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/configuring-http-api/)
- [Deploying Your Rasa Assistant](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/how-to-deploy/)
- [Cloud Storage](https://legacy-docs-v1.rasa.com/1.10.24/user-guide/cloud-storage/)

## NLU

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

## Core

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

## Conversation Design

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

## API Reference

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

## Migrate from (beta)

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

## Reference

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

## Versions

viewing: 1.10.24

# Jupyter Notebooks

This page contains the most important methods for using Rasa in a Jupyter notebook.

Running asynchronous Rasa code in Jupyter Notebooks requires an extra requirement, since Jupyter Notebooks already run on event loops. Install this requirement in the command line before launching jupyter:

```
pip install nest_asyncio
```

Then in the first cell of your notebook, include:

```python
import nest_asyncio
nest_asyncio.apply()
print("Event loop ready.")
```

To create a project if you don’t already have one, run:

```python
from rasa.cli.scaffold import create_initial_project
import os
project = "test-project"
create_initial_project(project)
os.chdir(project)
print(os.listdir("."))
```

To train a model, define the following variables:

```python
config = "config.yml"
training_files = "data/"
domain = "domain.yml"
output = "models/"
print(config, training_files, domain, output)
```

## Train a Model

Now we can train a model by passing in the paths to the `rasa.train` function:

```python
import rasa
model_path = rasa.train(domain, config, [training_files], output)
print(model_path)
```

## Chat with your assistant

To start chatting with an assistant:

```python
from rasa.jupyter import chat
chat(model_path)
```

## Evaluate your model against test data

Use the convenience function:

```python
import rasa.data as data
stories_directory, nlu_data_directory = data.get_core_nlu_directories(training_files)
print(stories_directory, nlu_data_directory)
```

To test your model:

```python
rasa.test(model_path, stories_directory, nlu_data_directory)
print("Done testing.")
```

The results will be written to a file called `results`. NLU errors will be reported to `errors.json`:

```python
if os.path.isfile("errors.json"):
    print("NLU Errors:")
    print(open("errors.json").read())
else:
    print("No NLU errors.")

if os.path.isdir("results"):
    print("Core Errors:")
    print(open("results/failed_stories.md").read())
```
