notice
This is unreleased documentation for Rasa Open Source Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.shared.core.slot_mappings
SlotMapping Objects
Defines functionality for the available slot mappings.
validate
Validates a slot mapping.
Arguments:
mapping
- The mapping which is validated.slot_name
- The name of the slot which is mapped by this mapping.
Raises:
InvalidDomain
- In case the slot mapping is not valid.
intent_is_desired
Checks whether user intent matches slot mapping intent specifications.
to_list
Convert object to a list if it isn't.
entity_is_desired
Checks whether slot should be filled by an entity in the input or not.
Arguments:
mapping
- Slot mapping.tracker
- The tracker.
Returns:
True, if slot should be filled, false otherwise.
check_mapping_validity
Checks the mapping for validity.
Arguments:
slot_name
- The name of the slot to be validated.mapping_type
- The type of the slot mapping.mapping
- Slot mapping.domain
- The domain to check against.
Returns:
True, if intent and entity specified in a mapping exist in domain.
validate_slot_mappings
Raises InvalidDomain exception if slot mappings are invalid.