Hey, thanks for the quick reply.
Okay, but… Would you raise an error if a list
slot is mapped to different entities in the domain? What about when it’s mapped to an entity and also to an intent (using from_intent
)? To me, it’s all getting quite hairy at this point
I argue that a “list” contains things of the same type. If you squeeze other things in it, e.g. a date into a color list I would like to be warned as a developer.
Do I understand correctly that each dict in there comes from one user utterance? Then you’d only achieve this kind of slot contents if you filled it from some custom action (Rasa itself wouldn’t add a new entry to a list
slot I think – instead, it would replace the entire slot value with the new entry ). If we forget about this detail, I think we can talk about a slot that would be mapped from different entities and stored as a dict, each entity having a key:value record in the dict:
The mixed entities example indeed asumes that the user provides all entities in one utterance.
Indeed, the entire dict would get overwritten completely every time (unless you’d tweak the slot filling in a custom action). Now, what I’m struggling with is the complexity here: Why would you want to have a complex slot type for this, instead of having 2 slots for the different entities? If you really want, in a custom action, you can still grab those 2 slots and combine them into a complex one, or even create a list of dicts that accumulates new entries over time, but I think that creating a dedicated slot type wouldn’t necessarily help much. Sorry if this sounds discouraging, I just think that once you get into advanced use cases, there starts to be too many of them because of minute specific, with no one being too common – and then the question is whether it’s not better after all to let users implement these in their custom actions instead of providing support for tens of very specific use cases. This being said, this forum is great for collecting evidence on how popular specific patterns or use cases are, and of course it makes sense to add something to Rasa if many folks use it
I agree that the complex slot does not make much sense if it is overwritten. I think it would be relevant when I need to keep the relationship between two entities intact for several turns. Relationship means that e.g. date and color belong to the same context. I try to make a different example:
User: "Put apples and pears on the shopping list for tomorrow"
Bot: shopping-list-slot: { "day": "tomorrow", "items": ["apples", "pears"] }
If I maintain two separate slots, I am ok as long as no entity apears in the conversation that overrides one of the slots but not the other. I am not asking for a “complex” slot in particular, but I felt that the slot mechanics in Rasa make it quite difficult to handle complex context where entities relate to each other and I need to navigate between them - but maybe this is not even the scope of the slots anymore but a data organization issue of the backend (custom actions). While talking about that, are there plans to introduce alternative tools to manage complex contexts in Rasa?