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 https://rasa.com/docs/rasa/responses#custom-output-payloads. But the frontend only recieves undefined.
Then i tried it this way https://rasa.com/docs/action-server/sdk-dispatcher#collectingdispatcherutter_message 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 https://rasa.com/docs/rasa/responses#custom-output-payloads. 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 https://rasa.com/docs/rasa/next/nlg#response-format-1 doesnât contain quick_replies or mentions that keys can change their names.