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.
type_name
Name of the type of slot.
__init__
Create a Slot.
Arguments:
name
- The name of the slot.initial_value
- The initial value of the slot.mappings
- List containing slot mappings.value_reset_delay
- After how many turns the slot should be reset to the initial_value. This is behavior is currently not implemented.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.
persistence_info
Returns relevant information to persist this slot.
fingerprint
Returns a unique hash for the slot which is stable across python runs.
Returns:
fingerprint of the slot
FloatSlot Objects
A slot storing a float value.
__init__
Creates a FloatSlot.
Raises:
InvalidSlotConfigError, if the min-max range is invalid. UserWarning, if initial_value is outside the min-max range.
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.
CategoricalSlot Objects
Slot type which can be used to branch conversations based on its value.
__init__
Creates a Categorical Slot
(see parent class for detailed docstring).
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.
__init__
Creates an Any Slot
(see parent class for detailed docstring).
Raises:
InvalidSlotConfigError, if slot is featurized.
__eq__
Compares object with other object.