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).
rasa.shared.core.slots
InvalidSlotTypeException Objects
Raised if a slot type is invalid.
InvalidSlotConfigError Objects
Raised if a slot's config is invalid.
Slot Objects
Key-value store for storing information during a conversation.
__init__
Create a Slot.
Arguments:
name
- The name of the slot.initial_value
- The initial value of the slot.value_reset_delay
- After how many turns the slot should be reset to the initial_value. This is behavior is currently not implemented.auto_fill
-True
if the slot should be filled automatically by entities with the same name.influence_conversation
- IfTrue
the slot will be featurized and hence influence the predictions of the dialogue polices.
feature_dimensionality
How many features this single slot creates.
Returns:
The number of features. 0
if the slot is unfeaturized. The dimensionality
of the array returned by as_feature
needs to correspond to this value.
has_features
Indicate if the slot creates any features.
value_reset_delay
After how many turns the slot should be reset to the initial_value.
If the delay is set to None
, the slot will keep its value forever.
reset
Resets the slot's value to the initial value.
value
Gets the slot's value.
value
Sets the slot's value.
has_been_set
Indicates if the slot's value has been set.
resolve_by_type
Returns a slots class by its type name.
FloatSlot Objects
persistence_info
Returns relevant information to persist this slot.
BooleanSlot Objects
A slot storing a truth value.
bool_from_any
Converts bool/float/int/str to bool or raises error
ListSlot Objects
value
Sets the slot's value.
UnfeaturizedSlot Objects
Deprecated slot type to represent slots which don't influence conversations.
__init__
Creates unfeaturized slot.
Arguments:
name
- The name of the slot.initial_value
- Its initial value.value_reset_delay
- After how many turns the slot should be reset to the initial_value. This is behavior is currently not implemented.auto_fill
-True
if it should be auto-filled by entities with the same name.influence_conversation
-True
if it should be featurized. OnlyFalse
is allowed. Any other value will lead to aInvalidSlotConfigError
.
CategoricalSlot Objects
add_default_value
Adds the special default value to the list of possible values.
persistence_info
Returns serialized slot.
AnySlot Objects
Slot which can be used to store any value. Users need to create a subclass of
Slot
in case the information is supposed to get featurized.
__eq__
Compares object with other object.