Slots
These docs are for version 1.x of Rasa Open Source.
User Guide
- Installation
- Tutorial: Rasa Basics
- Tutorial: Building Assistants
- Command Line Interface
- Architecture
- Messaging and Voice Channels
- Evaluating Models
- Validate Data
- Configuring the HTTP API
- Deploying your Rasa Assistant
- Cloud Storage
NLU
- About
- Using NLU Only
- Training Data Format
- Choosing a Pipeline
- Language Support
- Entity Extraction
- Components
Core
- About
- Stories
- Domains
- Responses
- Actions
- Reminders and External Events
- Policies
- Slots
- Forms
- Retrieval Actions
- Interactive Learning
- Fallback Actions
- Knowledge Base Actions
Conversation Design
API Reference
- Action Server
- HTTP API
- Jupyter Notebooks
- Agent
- Custom NLU Components
- Rasa SDK
- Events
- Tracker
- Tracker Stores
- Event Brokers
- Lock Stores
- Training Data Importers
- Featurization of Conversations
- TensorFlow Configuration
- Migration Guide
- Rasa Open Source Change Log
Migrate from (beta)
Reference
Slots
Slots are your bot’s memory. They act as a key-value store which can be used to store information the user provided (e.g their home city) as well as information gathered about the outside world (e.g. the result of a database query).
Most of the time, you want slots to influence how the dialogue progresses. There are different slot types for different behaviors.
For example, if your user has provided their home city, you might have a text slot called home_city. If the user asks for the weather, and you don’t know their home city, you will have to ask them for it. A text slot only tells Rasa Core whether the slot has a value. The specific value of a text slot (e.g. Bangalore or New York or Hong Kong) doesn’t make any difference.
If the value itself is important, use a categorical or a bool slot. There are also float, and list slots. If you just want to store some data, but don’t want it to affect the flow of the conversation, use an unfeaturized slot.
Example of slots in usage.
You can provide an initial value for a slot in your domain file:
slots:
name:
type: text
initial_value: "human"
There are multiple ways that slots are set during a conversation:
- Slots Set from NLU: If your NLU model picks up an entity that matches a slot, it will automatically be set.
- Slots Set By Clicking Buttons: You can use buttons to trigger slot values based on user input.
- Slots Set by Actions: Slots can also be set through custom actions returning events during a conversation.
Slot Types
- Text Slot: For user preferences where the existence of a value matters.
- Boolean Slot: For true/false settings.
- Categorical Slot: For options among a set of predefined values.
- Float Slot: For continuous values.
- List Slot: For a list of items.
- Unfeaturized Slot: For data that shouldn’t impact the dialogue flow.