[Solved]The sender ID is showing up default in mongodbDB. What does it mean? Is there any way to assign user ID to sender ID?

{ “_id” : ObjectId(“5bd6e007c5ac6f507adbf3a2”), “sender_id” : “default”, “events” : [ { “event” : “action”, “timestamp” : 1540808711.0658188, “name” : “action_listen” }, { “event” : “user”, “timestamp” : 1540808711.2268188, “text” : “hi”, “parse_data” : { “intent” : { “name” : “greet”, “confidence” : 0.9630651473999023 }, “entities” : [ ], “intent_ranking” : [ { “name” : “greet”, “confidence” : 0.9630651473999023 }, { “name” : “affirmation”, “confidence” : 0.03235085308551788 }, { “name” : “file”, “confidence” : 0 } ], “text” : “hi” }

I have also similar problem. Can someone pls answer?

1 Like

In the bot.py file I used sender_id=user_id

responses = agent.handle_text(a,sender_id=sender_id)

instead of

responses = agent.handle_message(a)

and I am able to store the conversation with desired sender_id

@ashukrishna100 bot.py usually runs the server by loading agent and agent.handle_channels(). But how can the sender_id value be replaced with a logged in user name which can be captured in actions.py only? Or where else we can replace the default value of sender_id with the user name captured from the user?

you can pass a custom sender_id to the api call you make. This custom sender_id can be generated via JS and passed via a post request to RASA server.

Please explain, how to achieve that?