Slot in Stories File

I was going through the tutorial of RASA pace_finder, in the stories file slot is used after performing a custom action.


  • greet
    • utter_greet
  • place_search{“query”:“restaurant”, “number”:“55”}
    • action_place_search
    • slot{“location_match”:“one”}
    • slot{“rating”:“4.5”}
    • slot{“address”:“Alexanderplatz 15”}
    • slot{“opening_hours”:“open”}
  • address
    • utter_address
  • rating
    • utter_rating
  • opening_hours
    • utter_opening_hours
  • thanks
    • utter_thanks
  • goodbye
    • utter_goodbye . . . rating = i[‘rating’] address = i[‘vicinity’] if i[‘opening_hours’][‘open_now’]==True: opening_hours = ‘open’ else: opening_hours = ‘closed’ break speech = “I found a {} called {} based on your specified parameters.”.format(query, name) dispatcher.utter_message(speech) #send the response back to the user return [SlotSet(‘location_match’, ‘one’), SlotSet(‘rating’, rating), SlotSet(‘address’, address), SlotSet(‘opening_hours’, opening_hours)] #set returned details as slots

My question is that in the custom action file the slot is already set than what the slot is doing in file

You can use slot values to define different dialogue paths. If in the stories it is indicated that a slot value is set, you could provide different utterances, actions etc. for the bot to perform. This is described here in the docu.