This is my first project using rasa. So I am using Django for the website backend (logging users into website). I am integrating the database with rasa to make custom queries for creating custom actions but I am unable to figure out how to inform rasa about which user(primary key) is logged in into the website. Note: Chat-Widget used is the one given on rasa open source documentation. Any help would be appreciated. Thankyou.
Welcome to the forum
You can POST
messages to http://your.rasa.server/webhooks/rest/webhook
, with the following format:
{ "sender": "ACB123", "message": "Hello, REST!"}
sender
is the sender/conversation ID of the user sending the message, message
is the message you want to send.
Messages can be either regular text or a payload to force an intent and (optionally) entities. A payload is of this form:
/intent_name{"entity_one": "value_one", "entity_two", "value_two"}
Of course you will need to choose an intent (I would create an inform
intent for that), and each entity should have at least 2 examples in that intent.
On top of defining an intent and entities, you need to define a slot to save those entity values in for the long-term - unless you will use a custom action as a response which will read the entities from the tracker and do whatever then forget about them.
Please read:
- Entities and Slots for retreiving and saving info
- Rich Responses for forcing intents and entities
- REST Channels for communicating with the bot via HTTP
- Custom Actions SDK for executing Python code as a response
- Tracker SDK to get info about the message (intent, entities, …) in custom actions
Hi, @ChrisRahme hope u are doing well !!! I have tried your solution(by posting data to RASA URL) but when fetching the sender id from rasa it displays the default rather than the one which I have set. Does the fact that my chat widget is using socketio, make this solution ineffective? Also, I have tried to use the data-initial-payload attribute to convey the intent, but it isn’t working? Any help would be appreciated!! Thanks
That’s weird. Can you share the output of rasa --version
?
What do you mean? Where did you try that?
Rasa version 2.8.7
Can you show me how you send the message? And how you “fetch the sender id from rasa”?