55##### Maven
66``` xml
77<dependency >
8- <groupId >com.ibm.watson.developer_cloud </groupId >
8+ <groupId >com.ibm.watson</groupId >
99 <artifactId >assistant</artifactId >
1010 <version >6.14.0</version >
1111</dependency >
1212```
1313
1414##### Gradle
1515``` gradle
16- 'com.ibm.watson.developer_cloud :assistant:6.14.0'
16+ 'com.ibm.watson:assistant:6.14.0'
1717```
1818
1919## Usage
@@ -22,15 +22,16 @@ Use the [Assistant][assistant] service to identify intents, entities, and conduc
2222### Using Assistant v1
2323``` java
2424// make sure to use the Assistant v1 import!
25- import com.ibm.watson.developer_cloud. assistant.v1.Assistant ;
25+ import com.ibm.watson.assistant.v1.Assistant ;
2626
2727Assistant service = new Assistant (" 2018-02-16" );
2828IamOptions options = new IamOptions .Builder ()
2929 .apiKey(" <iam_api_key>" )
3030 .build();
3131service. setIamCredentials(options);
3232
33- InputData input = new InputData .Builder (" Hi" ). build();
33+ MessageInput input = new MessageInput ();
34+ input. setText(" Hi" );
3435MessageOptions options = new MessageOptions .Builder (workspaceId)
3536 .input(input)
3637 .build();
@@ -41,24 +42,27 @@ System.out.println(response);
4142Maintaining context across messages:
4243``` java
4344// make sure to use the Assistant v1 import!
44- import com.ibm.watson.developer_cloud. assistant.v1.Assistant ;
45+ import com.ibm.watson.assistant.v1.Assistant ;
4546
4647Context context = null ;
48+ MessageInput input = new MessageInput ();
4749
4850// first message
51+ input. setText(" First message" );
4952MessageOptions newMessageOptions = new MessageOptions .Builder ()
5053 .workspaceId(" <workspace-id>" )
51- .input(new InputData . Builder ( " First message " ) . build() )
54+ .input(input )
5255 .context(context)
5356 .build();
5457
5558MessageResponse response = service. message(newMessageOptions). execute(). getResult();
5659context = response. getContext();
5760
5861// second message
62+ input. setText(" Second message" );
5963newMessageOptions = new MessageOptions .Builder ()
6064 .workspaceId(" <workspace-id>" )
61- .input(new InputData . Builder ( " Second message " ) . build() )
65+ .input(input )
6266 .context(context) // using context from the first message
6367 .build();
6468
@@ -72,7 +76,7 @@ System.out.println(response);
7276### Using Assistant v2
7377``` java
7478// make sure to use the Assistant v2 import!
75- import com.ibm.watson.developer_cloud. assistant.v2.Assistant ;
79+ import com.ibm.watson.assistant.v2.Assistant ;
7680
7781Assistant service = new Assistant (" 2018-09-20" );
7882IamOptions options = new IamOptions .Builder ()
@@ -96,7 +100,7 @@ System.out.println(messageResponse);
96100Maintaining context across messages:
97101``` java
98102// make sure to use the Assistant v2 import!
99- import com.ibm.watson.developer_cloud. assistant.v2.Assistant ;
103+ import com.ibm.watson.assistant.v2.Assistant ;
100104
101105MessageContext context = new MessageContext ();
102106
0 commit comments