TypeError: Object of type SlotSet is not JSON serializable

Hi there.

Whenever the action server recieves a custom action with the SlotSet function, it gives me the next error:

Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\flask\app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Anaconda3\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Anaconda3\lib\site-packages\flask\_compat.py", line 35, in reraise
    raise value
  File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Anaconda3\lib\site-packages\flask_cors\decorator.py", line 128, in wrapped_function
    resp = make_response(f(*args, **kwargs))
  File "C:\Anaconda3\lib\site-packages\rasa_core_sdk\endpoint.py", line 74, in webhook
    return jsonify(response)
  File "C:\Anaconda3\lib\site-packages\flask\json\__init__.py", line 321, in jsonify
    dumps(data, indent=indent, separators=separators) + '\n',
  File "C:\Anaconda3\lib\site-packages\flask\json\__init__.py", line 179, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "C:\Anaconda3\lib\site-packages\simplejson\__init__.py", line 399, in dumps
  File "C:\Anaconda3\lib\site-packages\simplejson\encoder.py", line 296, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Anaconda3\lib\site-packages\simplejson\encoder.py", line 378, in iterencode
    return _iterencode(o, 0)
  File "C:\Anaconda3\lib\site-packages\flask\json\__init__.py", line 81, in default
    return _json.JSONEncoder.default(self, o)
  File "C:\Anaconda3\lib\site-packages\simplejson\encoder.py", line 273, in default
TypeError: Object of type SlotSet is not JSON serializable

Please advise :smile:

Going to bump this up. Can’t find a solution on my own. Help would be appreciated :slight_smile:

Same error , but for me TypeError: Object of type UserUtteranceReverted is not JSON serializable

Hi @Andre please refer this github issue link fix

1 Like

Thank you very much. I must have missed that import when changing the files to the latest version. :grin:

It helped me as well. Thanks a lot