Slot_mapping for rasa12

Hi all ,

I am looking example of slot mapping and DB validation in new core. Anyone already worked with it please let me know. I tried o define slot_mapping but it’s not mapping it . May be i am missing something

def slot_mappings(self):

    return {"Customer_ID": [self.from_entity(entity="number", intent="inform"),
                            self.from_entity(entity="number", intent="Customer_ID"),
                            self.from_entity(entity="Customer_ID", intent="Customer_ID") ] ,
      
                }

Hi @neerajb1,

I see a trailing comma in your code which might be messing things up, try:

    return {"Customer_ID": [self.from_entity(entity="number", intent="inform"),
                            self.from_entity(entity="number", intent="Customer_ID"),
                            self.from_entity(entity="Customer_ID", intent="Customer_ID")]}

As always, ping me if that hasn’t solved it

@neerajb1 Do you define this mapping in form action or other any action? Do you need to include the slot in the story? I only include it in the domain file, but it can’t find the slot values.