TypeError: Object of type AllSlotsReset is not JSON serializable

Hi, I am trying to clear slots as a custom action: This is my custom action code:

from rasa_core.events import SlotSet, AllSlotsReset
class action_slot_reset(Action): def name(self): return ‘action_slot_reset’

def run(self, dispatcher, tracker, domain):
return [AllSlotsReset()]

When this action gets triggered, I am getting an error from the server: TypeError: Object of type AllSlotsReset is not JSON serializable

Stories:

  • reset -action_slot_reset -reset_slots

from rasa_core.events import SlotSet, AllSlotsReset - it is wrong import

these classes should be imported from sdk, see docs for details:

1 Like

Thank you very much, that helps!

@Ghostvv If you can give your inputs on this, that will be really really helpful!