Adding slots in domain.md

hey I have two different types of games 1)outdoor_game

  •   cricket
    
  •   football
    

2)indoor_games

  •   chess
    
  •   bliend_man_buff
    
  •    luddo
    

game type: indoor_games outdoor_games game name: cricket,football,chess,bliend_man_buff,luddo

how can add these slot values in domain file so that rasa should understand the order.

stories.md …

  • games_played
    • utter_ask_game_type
  • inform{“game_type”:“indoor”}
    • slot{“game_type”:“indoor”}
    • utter_ask_game_type_indoor
  • inform{“game_name”:“chess”}
    • slot{“game_name”:“chess”} … games_played
    • utter_ask_game_type
  • inform{“game_type”:“outdoor”}
    • slot{“game_type”:“outdoor”}
    • utter_ask_game_type_outdoor
  • inform{“game_name”:“cricket”}
    • slot{“game_name”:“cricket”}

@Juste @amn41 @akelad

how can add these slot values in domain file so that rasa should understand the order.What order?

The order of what, exactly?

that chess belongs to indoor game and cricket belongs to outdoor game for example in the story:

  • games_played
    • utter_ask_game_type
  • inform{“game_type”:“indoor”}
    • slot{“game_type”:“indoor”}
    • utter_ask_game_type_indoor
  • inform{“game_name”:“chess”}
  • slot{“game_name”:“chess”} … games_played
  • utter_ask_game_type
  • inform{“game_type”:“outdoor”}
    • slot{“game_type”:“outdoor”}
    • utter_ask_game_type_outdoor
  • inform{“game_name”:“cricket”}
    • slot{“game_name”:“cricket”}

At the pointed place if instead of chess(indoor) if the user gives cricket(outdoor) then it should give an error that cricket isn’t an intdoor game because I have only two entities: game_type and game_name and for all indoor and outdoor_games, the entity is game_name

hey @Juste @amn41 @akelad please help

1 Like

You probably should use FormAction for that kind of behavior. Using FormAction you can validate specific slots, utter error messages and make the user enter a slot again. You can read about FormAction here: Forms

Hey @capgos17. @fuih made a great suggestion, for such situation you should try out the FormAction. You can validate the slots and implement the slot mapping so that your bot would know better which intents should link to which slots.

but I’m useing node server for custom action I’m not using the rasa-sdk