We are using Watson Conversation service for ChatBot functionality. We want to configure a standard sequence of communication with users using Dialog and intents and entities. We are writing the application is java to communicate with the Conversation service via RESTful API. I understand we have to maintain the context and pass it between the application and Conversation until the conversation ends. In order to achieve this, I understand we need to store and manage the context for each user in our application. Could anyone please clarify if my understanding is correct? Also is Java a right fit for this functionality? Thanks
Asked
Active
Viewed 748 times
0
-
The botkit-middleware repo has an example in Node.js that manages those contexts https://github.com/watson-developer-cloud/botkit-middleware – data_henrik Mar 09 '17 at 09:58
2 Answers
0
There are a number of SDK's for different languages which make this easier for you.

Simon O'Doherty
- 9,259
- 3
- 26
- 54
-
Thanks Simon. We will use java SDK to communicate with Conversation service. However we have to take care of storing the map containing the users and their contexts through our application logic. Is that right Simon? – Raghu Bandi Mar 09 '17 at 16:54
-
Hi Dudi, i thought you could help me answer http://stackoverflow.com/questions/42723050/watson-conversation-context-previous-input-text – Raghu Bandi Mar 13 '17 at 14:51
0
Each conversation has its own conversation_id and its own context in the Json sent from the service. So, you don't have to store each context in your application. You could, but it is not necessary.
The usual way to use this is, when you get an answer from the Conversation Service, you store the context object, update it and send it back. In the next iteration, the service is going to send the context inside the Json again. If you use the same conversation_id, you should be able to send and receive the context, so, you don't need to store it.

Danilo Silveira
- 96
- 5
-
Thanks Danilo. What is mean is for any user i will store at most one context in the context map at any point in time. The context will be updated after every response from the conversation service. If the user ID is unique, i do not have to worry about the conversationId. For every users request, i will pull the context for the user, update it and send it back to the conversation service. Is that correct? – Raghu Bandi Mar 10 '17 at 01:33
-
Thanks Danilo. What I mean is for each user i will store at most one context in the context map at any point in time. The context will be updated after every response from the conversation service. If the user ID is unique, i do not have to worry about the conversationId. For every users request, i will pull the context for the user, update it and send it back to the conversation service. Is that correct? – Raghu Bandi Mar 10 '17 at 03:54
-
Yes, that's it. You extract the context from the json, update the message text and send it back. You don't have to worry about anything else. – Danilo Silveira Mar 10 '17 at 11:03