Should slots generally be reset to None after action is executed?

rasa-core

(Simon) #1

@akelad @Ghostvv and others: Would you generally recommend resetting slots to None after an action “consumed” all the information from relevant slots?

There’s two issues I’m not confident about. For example, let’s say in the restaurant example, I want to book a table:

  1. If I don’t reset it, how can I avoid booking the same table again, just because the slots were still filled from the previous attempt?
  2. If I reset it though, the bot always forgets about the past immediately. Therefore, in followup actions the bot cannot act on any information from previous messages

Any thoughts and experiences with this common issue are very much appreciated.

For example I might have a situation like this:

* book_table
 - action_book_table
 - slot{"status": some_status}  # e.g. confirmed or cancelled
* thanks
 - utter_thanks

Which could be either followed by something like:

* book_table  # book another table
 - action_book_table

Or

* confirm_booking
  - action_confirm_booking

In the former scenario, I’d want the slots to be reset, to guarantee the booking will not be based on any previous booking. The latter, however, would be unnecessarily complicated if I reset all the slots and require to ask about booking details prior to confirming the details.


(Akela Drissner) #2

In the action_book_table you could check whether any of the slots are set and ask the user whether that’s the table they want to book (listing their preferences, i.e. slot values)? if they say no, reset those slots and ask for everything again


(Simon) #3

That’s a good idea for some situations, thanks!

In my concrete situation, however, it’s very unlikely that the person is ordering the same product twice. So my default strategy should be to always ask for the information, even if the slot is already filled. Can I force a FormAction to ignore some specific slots that were set before the message that triggered the FormAction?

E.g. let’s say I have a situation like this:

* order_product
  - form_order_product
* ...
 - slot{"product_id": 123}
* ...
 - form{"name": null}
* confirm_order
 - action_confirm_order # can lookup last order because it's still stored in tracker

Then ten minutes later:

# Now the slot `product_id` should be ignored ...
* order_product
  - form_order_product

(Simon) #4

@akelad is there even a built-in way to ask the user to confirm an already set slot? Or do I need to override the request_next_slot method?

Edit: Please also see my remaining question from above (how to force Form Action to always (re-)ask all required slots)


How to prevent a slot from being overwritten?
From action never ask to fill slot if it is already filled
(Simon) #5

@akelad @Ghostvv: Running into a similar issue like this one regarding “forcing” slots to be asked at least once during a FormAction.

I realized that resetting slots doesn’t solve issue #1 from my initial post:

Because, e.g. situations like these might appear, which still suffer from the same problem:

* user_likes{"item": "strawberries"}  # "I like strawberries"
  - utter_user_likes
* order_food
  - form_food
  - form{"name": "food"}
  - form{"name": null}

Is there a “thought-through” solution for how to avoid that forms automatically “pre-filled” slots? It’s very inconvenient in situations like the one above to ask the user for confirmations (like “Do you want to order strawberries?” in the story from above). Ideally, I want to achieve something like this:

Requirement

Every slot that is at some point during the FormAction part of the required_slots, must be asked or confirmed at least once during a FormAction.


(Akela Drissner) #6

You would need to override the request_next_slot method I think yes. That way you can ask users to confirm pre-filled slots