Usage of slots in stories

Hi, I am a bit confused what using slots mean in stories. For example consider the following story

##story_test

  • intent_setName
  • action_setName
  • slot {“name”:“John”}
  • action_heyJohn

So, does the third statement mean

  1. Like a case statement, checking the value of the slot OR
  2. Denotes the occurrence of a SlotSet event ?

If the 1st case is right, that means I can write my stories by using that statement as a condition, correct? If the 2nd case is right, then would that mean that if I wanted to split my story based on the slot “name” long after the slot set event, this would not work? For example:

##story_test

  • intent_setName
  • action_setName
  • doRandomStuff1
  • sayRandomStuff
  • doRandomStuff
  • slot {“name”:“John”}
  • action_heyJohn
1 Like

It’s both of them really. So it marks that the action set a slot, and also you can use it to determine the path of the conversation. So yeah if your action failed to set the slot you can have a different story. Or if you have a categorical slot, then you can have a different story path dependent on the exact value of the conversation.

2 Likes

hi akelad, i have another question. is this statement below is necessary?

‘slot {“name”:“John”}’

and there maybe several slots in a action, should i list them all after the call of action?

and could i write the story like this:

intent_setName
action_setName
action_depent_slot_value_of_name

that is i’ll get value of slot ‘name’, and do something in another action according the value, could i? thanks a lot.