Skip to content

Commit cc828f8

Browse files
author
Nathan Zylbersztejn
authored
Merge pull request #48 from ivopisarovic/master
Added customData manual to README.
2 parents 2e6afee + 2511410 commit cc828f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function CustomWidget = () => {
7575
initPayload={"/get_started"}
7676
socketUrl={"http://localhost:5500"}
7777
socketPath={"/socket.io/"}
78+
customData: {{"userId": "123"}}, // arbitrary custom data. Stay minimal as this will be added to the socket
7879
title={"Title"}
7980
inputTextFieldHint={"Type a message..."}
8081
connectingText={"Waiting for server..."}
@@ -105,6 +106,8 @@ set to `true` if you don't want to see the launcher.
105106

106107
Use the SocketIOInput channel: See [instructions in the Rasa Core documentation](https://rasa.com/docs/core/connectors/#socketio-connector)
107108

109+
If you want to process `customData` in Rasa Core you have to [create a new channel](https://rasa.com/docs/core/connectors/#custom-channels). Use channel `rasa_core.channels.socketio` as a template for your new channel. In such channel `customData` can be retrieved via `data['customData']`. Then you can modify `sender_id`, save `customData` to the database, fill slots or whatever you need to with your additional data.
110+
108111
#### Others
109112
Your backend must expose a socket with [socket.io](http://socket.io)
110113

0 commit comments

Comments
 (0)