Multiple entities values to single slot in rasa form

Hi All,

I have to build a conversational chatbot where user is trying to create a preference using some filters and the workflow goes like this

User : I would like to create an preference

Bot : Provide filter criteria? e.g HSQ, IEA, 10GE etc…

User : HSQ, EEA, IEA, 10GE, Ethernet, 100GE are the filters for my preference.

Bot : Provide preference name? e.g quick_checks, my_preference etc…

User : my_test_preference.

These HSQ, EEA, IEA, 10GE, Ethernet, 100GE are the values of multiple entities (portSpeed, productType, deviceType, deviceUsage and deviceModel) and user will always provide multiple filter values in single message, so I used form to collect the user input and trying to store all the user filter values in a slot (type as list).

I have define my slot and forms like this

slots:
  filter_criteria:
    type: list
    influence_conversation: false
  preference_name:
    type: text
    influence_conversation: false
forms:
  create_preference_form:
    filter_criteria:
      - type: from_entity
        entity: portSpeed
      - type: from_entity
        entity: productType
      - type: from_entity
        entity: deviceType
      - type: from_entity
        entity: deviceUsage
      - type: from_entity
        entity: deviceModel
    preference_name:
      - type: from_text

When I tried to get slot value in custom action like this, I always get filter_criteria value as None.

        filter_criteria = tracker.get_slot('filter_criteria')
        print('User filter criteria : ', filter_criteria)

How can I store multiple entities portSpeed, productType, deviceType, deviceUsage and deviceModel values in filter_criteria slot ?

Thanks in Advanced :slightly_smiling_face:

Hi @naveensiwas, may I ask why you are not using multiple slots? On slot for each entity. They can still be filled in one message. Do all entities need to be provided?

Hi @soerenetler good question,

It’s not necessary to provide all entities values at a time, but most of the time it will be multiple entities only, by user in one message.

If I need to define one slot for each entity, then how to define those entity blocks for each slot. Since those slots still be filled in one message only, can you please help me with sample code ?

Thanks in Advanced :slightly_smiling_face:

Hi @itsjhonny,

It would be great, if you can help me on this please.

Hi @naveensiwas ! :smiley:

I will check the problem and try to reproduce in my local environment to make a better investigation :smiley:

What is your rasa version? 3.1 ?

Hi @itsjhonny,

Yes please and I am using RASA 2.8.14 version.

hi @naveensiwas! You found the way?

No @karan I wrote my own code to handle this scenario.