I try to mark internally if a slot_example has been filled. Therefore, I created another boolean slot is_set with a custom mapping that should be set to “yes” as soon as slot_example is not None anymore and has been filled. However, unfortunately my custom action within ValidateCustomSlotMappings does not work.
Here are my two slots:
slots: number: type: categorical influence_conversation: true mappings: - type: from_entity entity: number conditions: - active_loop: set_marker_form requested_slot: number slot_number_set: type: bool influence_conversation: true initial_value: no mappings: - type: custom forms: set_marker_form: required_slots: - number
While my code in the action file looks like this (I had changed None to “None” and tried with SlotSet and without but both did not make any difference.
class ValidateCustomSlotMappings(ValidationAction): async def extract_slot_number_set( self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict ) -> Dict[Text, Any]: value_of_number = tracker.get_slot("number") if value_of_number != None: return [SlotSet("slot_number_set", "yes")]
Do I need to set the slot in a different class? Or is there an error in my syntax? I hope someone can help me with this!