How do we put an 'or' condition for slot_was_set condition in stories?

I want to check single slot having different values rather than all of them at once. For different values, we have to execute different actions. How should we do that? Like an ‘OR’ condition in stories or rules for slots

I’m not sure I understand. Can you please give an example?

1 Like
slot_was_set:
- or:
  - slot_name: 2
  - slot_name: 4
  - slot_name: 5
action: utter_executable_action1

slot_was_set:
- or:
  - slot_name: 1
  - slot_name: 3
  - slot_name: 6
action: utter_executable_action2

Like this, can it be written to execute particular actions for different values of the same slot?

Ah I understand. That’s how you do it:

stories:
- story:
  steps:
  - intent: greet
  - action: utter_greet
  - intent: tell_name
  - or:
    - slot_was_set:
        - name: joe
    - slot_was_set:
        - name: bob
  # ... next actions

Reference: Stories > Or Statements

1 Like

I have a question about this. Can I use a list in slot_was_set?

  • or:
    • slot_was_set:
      • name: [joe,bob]
1 Like

I don’t think so. It’s not python. It’s YML. in YML lists are like this →

list1:
- item1
- item2
- item3

list2:
- item1
- item2
- item3

You can explore the ‘any’ type slot if you want to store lists

1 Like

tks

No you can’t

@ChrisRahme

- story: Eligibility related queries 
  steps:
  - intent: FAQ_eligibility
    entities:
    - subject: ccl
  - slot_was_set:
    - subject: any
  - action: action_subject_check
  - or:
    - slot_was_set:
      - subject_cat: child care leave
    - slot_was_set:
      - subject_cat: ccl
  - action: utter_CCL_eligibility
  - action: action_restarted

I am getting error in ‘or’ statements. What is the wrong here?

@actorkrishna can I not use the list slot?

list slot can have influence on the conversation, provided if there are any values at all. So for ‘or’ statements, you can’t use it

1 Like