Rasa 2.0 - slot_was_set with user's message

Hello, According to the document:

If this slot is set inside a custom action, add the slot_was_set event immediately following the custom action call

…but if the slot’s value is user’s message

message = tracker.latest_message[“text”]

How can I set that value in slot_was_set in stories? Thank you.

Hi @thanhdo0711, the slot_was_set needs to reflect the value of the slot as it is relevant for featurization, meaning it depends on your slot’s type and whether it influences the conversation.

If you set influence_conversation to false for a slot, you don’t need to specify slot_was_set at all.

If you’re dealing with a text slot that does influence the conversation, the only thing that matters is whether the slot has any value or no value. In your stories, you could just give a random text string when you expect the slot to be set:

stories:
- story: user message slot set
  steps: 
  - intent: some_intent
  - action: action_set_usermessage
  - slot_was_set:
    - usermessage: "anything"
  - action: some action
5 Likes

Your explanation is very clear. Thanks @mloubser for your support!!!