Pedram
Pedram

Reputation: 53

Ibm watson Assistant setting context variables

I am working on a chatbot with Watson assistant. I would like to add the code here but my question is conceptual.

Let say a person is chating with my bot. Upon a certain request I want to call the same chat session and set a variable in there ( context variable as said in IBM watson assistant )

Is this possible ? Has anyone one ever done such a thing ?

Python Ibm watson assistant python SDK Ibm cloud functions

Upvotes: 1

Views: 757

Answers (2)

Vinit Sharswat
Vinit Sharswat

Reputation: 19

There is a "system" context variable which is used by Watson Assistant to keep track of the chat flow(dialog node) where the user is in at that point in time. You can try using the "system" context of the dialog node where you want the user to jump and go back to that previous chat.

Upvotes: 0

ronanb3
ronanb3

Reputation: 136

There is 2 answer here.

First, if you want to keep going on in your chat session previously opened and still active, you can use the chat session ID to go on where you left it.

Second, if you want your bot to remind some data about the user, the sessions are not saved. You need to save data you want to keep in a database. This can be done through Webhooks or through your orchestrator. Then when you start your session, you get all your data from the database for this user and include them in the context. Then your chatbot will react to this context. Of course you need to include this behavior in your skill.

Upvotes: 1

Related Questions