What is the best to write the stories when you have 10s of user state and not all state need their different utterance some user state share the same utterance?

Currently, we are using the boolean slot like below

## anonymous user greeitng
* greet  
  - slot{"is_registered":false}
  - utter_greet

## registered
* greet
  - slot{"is_registered":true} 
  - utter_greet_registered_user

The problem with the above is that we can only handle two variances, so if we have multiple users states a categorical slot would make much more sense

## anonymous user greeting
* greet  
  - slot{"user_state":"anonymous"}
  - utter_greet

## registered  user greeitng
* greet
 - slot{"user_state":"registered"}
  - utter_greet_registered_user

## regular user greeitng
* greet
 - slot{"user_state":"regular"}
  - utter_greet_regular_user

the issue with the above is that if we want to have the same greeting for two user state we will be writing something like

## registered  user greeitng
* greet
 - slot{"user_state":"registered"}
  - utter_greet_same_greeting

## regular user greeitng
* greet
 - slot{"user_state":"regular"}
  - utter_greet_same_greeting

is there a way to have or condition in slots like

## registered  user greeitng
* greet
 - slot{"user_state":"registered"} or slot{"user_state":"regular"}
  - utter_greet_same_greeting

I was thinking of using a list for this

* greet
 - slot{"user_state":["registered","regular"]}
  - utter_greet_same_greeting

but list only acts as a boolean based on whether the list is empty or not, it does not work based on the list content

We don’t currently have a way to do this (slot OR slot type of thing), but you can file a feature request for it: https://github.com/RasaHQ/rasa/issues/new/choose

If it’s a fairly similar greeting you could try using slot filling. So it’s a single utterance but you use the content of the greeting_type to fill it out.

No, it’s a totally different message so slot filling will not work.

I ended up using two slots one boolean to distinguish registered vs anonymous user, and one categorical for their final state.

1 Like