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/)

## Rasa SDK

Rasa SDK provides the tools you need to write custom actions in python.

### Installation

Use `pip` to install `rasa-sdk` on your action server.
```bash
pip install rasa-sdk
```

### Running the Action Server

If you have `rasa` installed, run this command to start your action server:
```bash
rasa run actions
```

Otherwise, if you do not have `rasa` installed, run this command:
```bash
python -m rasa_sdk --actions actions
```

You can verify that the action server is up and running with the command:
```bash
curl http://localhost:5055/health
```

You can get the list of registered custom actions with the command:
```bash
curl http://localhost:5055/actions
```

The file that contains your custom actions should be called `actions.py`. Alternatively, you can use a package directory called `actions` or else manually specify an actions module or package with the `--actions` flag.

### Actions

The `Action` class is the base class for any custom action. It has two methods that both need to be overwritten, `name()` and `run()`.
```python
from rasa_sdk import Action
from rasa_sdk.events import SlotSet

class ActionCheckRestaurants(Action):
   def name(self) -> Text:
      return "action_check_restaurants"

def run(self,
           dispatcher: CollectingDispatcher,
           tracker: Tracker,
           domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

cuisine = tracker.get_slot('cuisine')
      q = "select * from restaurants where cuisine='{0}' limit 1".format(cuisine)
      result = db.query(q)

return [SlotSet("matches", result if result is not None else [])]
```

Details of the `run()` method:

Execute the side effects of this action.

Parameters
- **dispatcher** – used to send messages back to the user.
- **tracker** – the state tracker for the current user.
- **domain** – the bot’s domain

Returns a dictionary of `rasa_sdk.events.Event` instances returned through the endpoint.

### Customising the session start action

The default behaviour of the session start action is to take all existing slots and to carry them over into the next session.
```python
from typing import Text, List, Dict, Any

from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet, SessionStarted, ActionExecuted, EventType
from rasa_sdk.executor import CollectingDispatcher

class ActionSessionStart(Action):
    def name(self) -> Text:
        return "action_session_start"

async def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[EventType]:
        events = [SessionStarted()]
        return events
```

### Events

An action’s `run()` method returns a list of events.

### Tracker

The `rasa_sdk.Tracker` lets you access the bot’s memory in your custom actions. This allows you to get information about past events and the current state of the conversation through `Tracker` attributes and methods.

The following are available as attributes of a `Tracker` object:
- `sender_id`  
- `slots`  
- `latest_message`  
- `events`  
- `active_form`  
- `latest_action_name`

You can get the value of a slot by using `tracker.get_slot(key)`.
