Rasa Stories with entities and slots

Hello, Lets say I have a single intent that I am using in all my stories.

That single intent can contain slot 1 and entity 1, slot 2 and entity 2, slot 3 and entity 3, or slot 4 and entity 4. These slots and entities can have any number of combinations in the stories, like slot 1 and slot 3 can exist but slot 2 and slot 4 don’t. etc etc So my question is will I have to write down all the possible combinations of these slots because then my stories file ends up getting very large. Like approximately 2000 stories if there are around 11 slots. Is there any way to reduce this. I would appreciate any guidance.

Use rules and forms as shown in the docs here. Try not to use stories.

I don’t think forms can achieve the behaviour I want, as a form would ask the user for inputs one by one. I don’t want to do that. I just want to allow the user to input any of the entities they want to without putting any kinds of restrictions on them

Forms don’t necessarily need to take input one by one. Anyway, it looks like you could like to use custom actions.

You could fetch all the detected entities and program what it should do next, that way you don’t really need to write all the combinations of what happens next in your story.

Forms will process the slots in a predefined or dynamic order. Read the section about dynamic forms.

@stephens can you please let me know - I have defined in domain.yml -

  • 3 slots(filled by entity values)
  • 3 entities
  • 3 intents
  • 1 form which requires these 3 slots to be filled

And If I write script in rules.yml to activate the form and submit the form. Do, I need to add anything else? How does assistant should ask for the requested slots?

Do, I need to add anything else?

Not necessarily. It depends on if you have any of the situations described on the forms docs (like custom slot validation).

How does assistant should ask for the requested slots?

This is described in the docs I linked above. It will ask for the slots in the order you list them in the forms required_slots section and it expects you to have defined utterances for each slot as described there.