Hello developer & community,
I connected my angular frontend directly to rasa with socket.io connector. Sending responses with text, buttons and image works fine. Now I tried to send a custom payload as mentioned here Responses. But the frontend only recieves undefined.
Then i tried it this way Dispatcher with the dispatcher and a json_message. The response was also undefined in frontend.
The custom data is always in the console debug:
0|rasa | {‘sender_id’: ‘c481a32619ff40dbb02c3ac0b46b673c’, ‘event’: ‘bot’, ‘timestamp’: 1609840839.4135976, ‘metadata’: {‘template_name’: ‘utter_custom_test’}, ‘text’: None, ‘data’: {‘elements’: None, ‘quick_replies’: None, ‘buttons’: None, ‘attachment’: None, ‘image’: None, ‘custom’: {‘blocks’: [{‘type’: ‘section’, ‘text’: {‘text’: ‘Make a bet on when the world will end:’, ‘type’: ‘mrkdwn’}, ‘accessory’: {‘type’: ‘datepicker’, ‘initial_date’: ‘2019-05-21’, ‘placeholder’: {‘type’: ‘plain_text’, ‘text’: ‘Select a date’}}}], ‘room’: ‘c481a32619ff40dbb02c3ac0b46b673c’}}}
So I checked the " rasa/core/channels/socketio.py" and found a difference in these two functions:
I don’t know why the room is added as an key to the json_message and not as an parameter to the emit(…, room=…) function like in _send_message.
I hope you have some ideas to solve this issue.
Also it is not easy to understand how some response variables work. There is no example for elements or attachments in Responses. The custom output payload is defined as “custom” key in domain, but as json_message in the dispatcher. The “buttons” key in the domain changes to “quick_replies” in the response. The Response Format NLG Servers doesn’t contain quick_replies or mentions that keys can change their names.