paul590
paul590

Reputation: 1435

Predict next action based on Slot fill RASA

I have the following scenario and I would like to know if the following is possible. I have 2 different intents that return a list of results through their respective actions. The user is then asked to select a number to get more information about the item they selected. When the user replies the inform intent is called. The issue that I am seeing is it is randomly choosing the actions it should take and does not seem to have a pattern. I read the documentation and suggest I can add slots to help but my issue is when a user enters a number, how will rasa know I am referring to a specific subject and not the other one.

Story:

Upvotes: 0

Views: 954

Answers (1)

Tobias
Tobias

Reputation: 1910

What type of slots are you using for the numbers? If you are using text as slot type (which means Rasa Core only cares that the slot is set but not which value it has), then add the slots to the intents in your stories to indicate that this is the story for the case if the user is proving some value to the number slot.

## Story
* load_list_restaurants
  - get-restaurants
  - slot{"current_subject": "restaurants"}
* inform{"number": 5}  # <- changed
  - handle-index-slot-fill
  - slot{"restaurant": "Italian restaurant"}
  - get-restaurant-info
  - reset_slots
* load_list_foods
  - get-foods
  - slot{"current_subject": "foods"}
* inform{"number": 5}  # <- changed
  - handle-index-slot-fill
  - slot{"food": "Pasta"}
  - get-food-info
  - reset_slots

Upvotes: 1

Related Questions