Extraction of entities from slot_mappings

So I have been following the formbot example from rasa GitHub. My goal is to extract user’s information like (fname, lname, email, dob, gender). I have set up the data, stories, domain and all and the bot is able to ask the user the information and show it out via the utter_slots_values action. Now in actions.py, I’m returning those values in the slot_mappings function. The issue is that I’m unaware of how to access those values. I want to extract those values so I can insert them into my local via sqlite3 database, but I don’t know how I can get those user-defined values individually in local variables so I can use those variables to add them to my db.

Here is my action.py

actions.py (1.8 KB)

If your entities have the same names as your slots, you do not need to define a slot mapping. The slots are automatically filled if the names match. E.g. the NER detects a fname and your have an entity called fname and a slot with the name fname. Rasa will automatically set the slot fname with the value of the entity fname.

You can obtain the values of a slot by calling tracker.get_slot('fname') (see Tracker).

Thanks. It works. I’m able to extract the entities via the tracker.

@Tanja my formaction is not working …it got mapping but failed to extract slot name …please how should i fix it