Reset specific slots when conversation ends

Hello, I’m trying to figure out how to reset some specific slots when conversation session ends (my session_expiration_time is 60)

I only want to reset some slots, not all of them. This is because I want to keep slots as the usernames but not their passwords.

it’s possible? How can I get to this?

Thanks

@Huascar321 you can try SlotSet Ref: Events

Demo:

from rasa_sdk.events import SlotSet

def run(self, dispatcher, tracker, domain):
    return [SlotSet("usernames", None)]

Hope this will help!

2 Likes

There’s no action_session_expired event. Rasa determines that the session has expired on action_session_start and it is at this point that it decides whether to carryover slots which you can see in the source here.

A good approach would be to override action_session_start as described here and you can handle your custom slot slot carryover rules there.

1 Like