I would like to store some data for each user in a form action, e.g. some metadata of chat so that I can access it in functions like slot_mappings, currently I do it via self.id. What I found out is that there is only 1 instance of a class so this self.id is actually mutual, which isn’t the way I planned.
I know that for this purpose there are slots, but I can’t access them in functions where I have only self like slot_mappings. What should I do in that case?
For example I can create an instance of a class for each user and store them in a dictionary, then in run function I will can run of an instance so that information is separate. This also solves synchronization issues
What is your use case is for this? How/why do you want to use the metadata in a function like slot_mappings and when is this metadata generated?
Maybe an option would be to set some variables that can be accessed by any function in your class (e.g. self.metainfo1, self.metainfo2) when the form starts. Would that solve your problem?
Setting these variables can be done in the beginning of the run function. So you could either directly set them in the rasa_sdk code here, or probably the nicer way would be to override the run function in your MyForm(FormAction) class such that it first sets the metadata variables and then calls super.run.