I am wondering how its expected we are able to associate a call from rasa to our backend (ie the “/webhook” and “/nlg” endpoints) with our backend’s user session. Rasa is technically a different client from the front end so we cannot access the user session when rasa makes a call to us, which we need so we can use user details when running actions.
I tried putting the session id in the rasa jwt but it seems rasa does not return the jwt in the returning header. Not sure if I missed something in the docs. Thanks.
to maintain context. I need to grab the session once rasa requests at my /webhook endpoint bc I need to use some session context when running my actions
I am able to maintain context for conversation using sender_id. Suppose user A1 logs in and then logs out. I assign the sender_id to be A1 and save the conversation in tracker store. Once user A1 logs in again ,his past conversation are fetched from the tracker store and then fed to the tracker. This sets the tracker to the last event occurred. And so the context is maintained.
I have some psuedo code below. If I run any action or utter I need the most up to date information about the chat and session. Not sure how other apps are doing this. I don’t want to query my database, or even my session store at that matter for every rasa call to my backend.
@requestmapping("/webhook")
// I need the context here
context = getContext(sessionId)
runAction(context)
saveContext(context)
@requestmapping("/nlg")
context = getContext(sessionId)
runUtter(context)
saveContext(context)
Can you let me know where this changes needs to be made, i am also trying for the scenario where multiple users can speak to Rasa bot at the same time but the chats should be independent.
If you are using the Rasa API, the “sender” is used to distinguish between conversations… for example, we have an API that processes a queue of messages to send to RASA. We use something like this to forward to Rasa (I’ve removed exception handling code to make it easier to understand):