notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.0.x).

Version: Master/Unreleased

rasa.shared.core.slots

InvalidSlotTypeException Objects

class InvalidSlotTypeException(RasaException)

Raised if a slot type is invalid.

Slot Objects

class Slot()

__init__

| __init__(name: Text, initial_value: Any = None, value_reset_delay: Optional[int] = None, auto_fill: bool = True, influence_conversation: bool = True) -> None

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 - If True the slot will be featurized and hence influence the predictions of the dialogue polices.

feature_dimensionality

| feature_dimensionality() -> int

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

| has_features() -> bool

Indicate if the slot creates any features.

value_reset_delay

| value_reset_delay() -> Optional[int]

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.

resolve_by_type

| @staticmethod
| resolve_by_type(type_name) -> Type["Slot"]

Returns a slots class by its type name.

bool_from_any

bool_from_any(x: Any) -> bool

Converts bool/float/int/str to bool or raises error

AnySlot Objects

class AnySlot(Slot)

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.