How to create custom policy?

Hey, I need to create a custom policy. However there is no example on rasa docs of custom policy.

Could you please provide a working custom policy? The point I am trying to achieve is basically this: if custom slot is set, go for custom action. Otherwise follow other policies.

Thanks!

If your slot is set in a custom action, you can use the event FollowupAction.

Thanks but thats not even quite answer to my question. I want to have a policy to run specific action (which will be checking the slot and running multiple times after user’s input), not followup action (running just once and not reacting to user’s input).

I can solve this either with forms (which is not a clean way) or with policy (which is the way I wanna go).

Can you write a pair of toy example stories? With/without the slot, so it’s more clear what you want to accomplish.