Skip to content

Commit 27ad74c

Browse files
Merge pull request #1125 from watson-developer-cloud/german/feat/v8.4.0
2 parents 8a9fb49 + 27c8936 commit 27ad74c

File tree

79 files changed

+3656
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3656
-278
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
33
echo -e "Decrypt service instance apikeys for branch $TRAVIS_BRANCH.\n"
4-
openssl aes-256-cbc -K $encrypted_42d9c68e608d_key -iv $encrypted_42d9c68e608d_iv -in secrets.tar.enc -out secrets.tar -d
5-
tar xvf secrets.tar
4+
openssl aes-256-cbc -K $encrypted_75da58c42a01_key -iv $encrypted_75da58c42a01_iv \
5+
-in config.properties.enc -out common/src/test/resources/config.properties -d
66
else
77
echo -e "Not Decrypt service instance apikeys for branch $TRAVIS_BRANCH.\n"
88
fi

assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageInput.java

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ public class MessageInput extends DynamicModel<Object> {
2222
@SerializedName("text")
2323
protected String text;
2424

25+
@SerializedName("spelling_suggestions")
26+
protected Boolean spellingSuggestions;
27+
28+
@SerializedName("spelling_auto_correct")
29+
protected Boolean spellingAutoCorrect;
30+
31+
@SerializedName("suggested_text")
32+
protected String suggestedText;
33+
34+
@SerializedName("original_text")
35+
protected String originalText;
36+
2537
public MessageInput() {
2638
super(new TypeToken<Object>() {});
2739
}
@@ -46,4 +58,92 @@ public String getText() {
4658
public void setText(final String text) {
4759
this.text = text;
4860
}
61+
62+
/**
63+
* Gets the spellingSuggestions.
64+
*
65+
* <p>Whether to use spelling correction when processing the input. This property overrides the
66+
* value of the **spelling_suggestions** property in the workspace settings.
67+
*
68+
* @return the spellingSuggestions
69+
*/
70+
public Boolean isSpellingSuggestions() {
71+
return this.spellingSuggestions;
72+
}
73+
74+
/**
75+
* Sets the spellingSuggestions.
76+
*
77+
* @param spellingSuggestions the new spellingSuggestions
78+
*/
79+
public void setSpellingSuggestions(final Boolean spellingSuggestions) {
80+
this.spellingSuggestions = spellingSuggestions;
81+
}
82+
83+
/**
84+
* Gets the spellingAutoCorrect.
85+
*
86+
* <p>Whether to use autocorrection when processing the input. If spelling correction is used and
87+
* this property is `false`, any suggested corrections are returned in the **suggested_text**
88+
* property of the message response. If this property is `true`, any corrections are automatically
89+
* applied to the user input, and the original text is returned in the **original_text** property
90+
* of the message response. This property overrides the value of the **spelling_auto_correct**
91+
* property in the workspace settings.
92+
*
93+
* @return the spellingAutoCorrect
94+
*/
95+
public Boolean isSpellingAutoCorrect() {
96+
return this.spellingAutoCorrect;
97+
}
98+
99+
/**
100+
* Sets the spellingAutoCorrect.
101+
*
102+
* @param spellingAutoCorrect the new spellingAutoCorrect
103+
*/
104+
public void setSpellingAutoCorrect(final Boolean spellingAutoCorrect) {
105+
this.spellingAutoCorrect = spellingAutoCorrect;
106+
}
107+
108+
/**
109+
* Gets the suggestedText.
110+
*
111+
* <p>Any suggested corrections of the input text. This property is returned only if spelling
112+
* correction is enabled and autocorrection is disabled.
113+
*
114+
* @return the suggestedText
115+
*/
116+
public String getSuggestedText() {
117+
return this.suggestedText;
118+
}
119+
120+
/**
121+
* Sets the suggestedText.
122+
*
123+
* @param suggestedText the new suggestedText
124+
*/
125+
public void setSuggestedText(final String suggestedText) {
126+
this.suggestedText = suggestedText;
127+
}
128+
129+
/**
130+
* Gets the originalText.
131+
*
132+
* <p>The original user input text. This property is returned only if autocorrection is enabled
133+
* and the user input was corrected.
134+
*
135+
* @return the originalText
136+
*/
137+
public String getOriginalText() {
138+
return this.originalText;
139+
}
140+
141+
/**
142+
* Sets the originalText.
143+
*
144+
* @param originalText the new originalText
145+
*/
146+
public void setOriginalText(final String originalText) {
147+
this.originalText = originalText;
148+
}
49149
}

assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ public String messageToHumanAgent() {
443443
/**
444444
* Gets the topic.
445445
*
446-
* <p>A label identifying the topic of the conversation, derived from the **user_label** property
447-
* of the relevant node.
446+
* <p>A label identifying the topic of the conversation, derived from the **title** property of
447+
* the relevant node.
448448
*
449449
* @return the topic
450450
*/
@@ -456,7 +456,7 @@ public String topic() {
456456
* Gets the dialogNode.
457457
*
458458
* <p>The ID of the dialog node that the **topic** property is taken from. The **topic** property
459-
* is populated using the value of the dialog node's **user_label** property.
459+
* is populated using the value of the dialog node's **title** property.
460460
*
461461
* @return the dialogNode
462462
*/

assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettings.java

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public class WorkspaceSystemSettings extends GenericModel {
2525
@SerializedName("human_agent_assist")
2626
protected Map<String, Object> humanAgentAssist;
2727

28+
@SerializedName("spelling_suggestions")
29+
protected Boolean spellingSuggestions;
30+
31+
@SerializedName("spelling_auto_correct")
32+
protected Boolean spellingAutoCorrect;
33+
2834
@SerializedName("system_entities")
2935
protected WorkspaceSystemSettingsSystemEntities systemEntities;
3036

@@ -36,13 +42,17 @@ public static class Builder {
3642
private WorkspaceSystemSettingsTooling tooling;
3743
private WorkspaceSystemSettingsDisambiguation disambiguation;
3844
private Map<String, Object> humanAgentAssist;
45+
private Boolean spellingSuggestions;
46+
private Boolean spellingAutoCorrect;
3947
private WorkspaceSystemSettingsSystemEntities systemEntities;
4048
private WorkspaceSystemSettingsOffTopic offTopic;
4149

4250
private Builder(WorkspaceSystemSettings workspaceSystemSettings) {
4351
this.tooling = workspaceSystemSettings.tooling;
4452
this.disambiguation = workspaceSystemSettings.disambiguation;
4553
this.humanAgentAssist = workspaceSystemSettings.humanAgentAssist;
54+
this.spellingSuggestions = workspaceSystemSettings.spellingSuggestions;
55+
this.spellingAutoCorrect = workspaceSystemSettings.spellingAutoCorrect;
4656
this.systemEntities = workspaceSystemSettings.systemEntities;
4757
this.offTopic = workspaceSystemSettings.offTopic;
4858
}
@@ -92,6 +102,28 @@ public Builder humanAgentAssist(Map<String, Object> humanAgentAssist) {
92102
return this;
93103
}
94104

105+
/**
106+
* Set the spellingSuggestions.
107+
*
108+
* @param spellingSuggestions the spellingSuggestions
109+
* @return the WorkspaceSystemSettings builder
110+
*/
111+
public Builder spellingSuggestions(Boolean spellingSuggestions) {
112+
this.spellingSuggestions = spellingSuggestions;
113+
return this;
114+
}
115+
116+
/**
117+
* Set the spellingAutoCorrect.
118+
*
119+
* @param spellingAutoCorrect the spellingAutoCorrect
120+
* @return the WorkspaceSystemSettings builder
121+
*/
122+
public Builder spellingAutoCorrect(Boolean spellingAutoCorrect) {
123+
this.spellingAutoCorrect = spellingAutoCorrect;
124+
return this;
125+
}
126+
95127
/**
96128
* Set the systemEntities.
97129
*
@@ -119,6 +151,8 @@ protected WorkspaceSystemSettings(Builder builder) {
119151
tooling = builder.tooling;
120152
disambiguation = builder.disambiguation;
121153
humanAgentAssist = builder.humanAgentAssist;
154+
spellingSuggestions = builder.spellingSuggestions;
155+
spellingAutoCorrect = builder.spellingAutoCorrect;
122156
systemEntities = builder.systemEntities;
123157
offTopic = builder.offTopic;
124158
}
@@ -167,6 +201,32 @@ public Map<String, Object> humanAgentAssist() {
167201
return humanAgentAssist;
168202
}
169203

204+
/**
205+
* Gets the spellingSuggestions.
206+
*
207+
* <p>Whether spelling correction is enabled for the workspace.
208+
*
209+
* @return the spellingSuggestions
210+
*/
211+
public Boolean spellingSuggestions() {
212+
return spellingSuggestions;
213+
}
214+
215+
/**
216+
* Gets the spellingAutoCorrect.
217+
*
218+
* <p>Whether autocorrection is enabled for the workspace. If spelling correction is enabled and
219+
* this property is `false`, any suggested corrections are returned in the **suggested_text**
220+
* property of the message response. If this property is `true`, any corrections are automatically
221+
* applied to the user input, and the original text is returned in the **original_text** property
222+
* of the message response.
223+
*
224+
* @return the spellingAutoCorrect
225+
*/
226+
public Boolean spellingAutoCorrect() {
227+
return spellingAutoCorrect;
228+
}
229+
170230
/**
171231
* Gets the systemEntities.
172232
*

assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import com.ibm.watson.assistant.v2.model.DeleteSessionOptions;
2525
import com.ibm.watson.assistant.v2.model.MessageOptions;
2626
import com.ibm.watson.assistant.v2.model.MessageResponse;
27+
import com.ibm.watson.assistant.v2.model.MessageResponseStateless;
28+
import com.ibm.watson.assistant.v2.model.MessageStatelessOptions;
2729
import com.ibm.watson.assistant.v2.model.SessionResponse;
2830
import com.ibm.watson.common.SdkCommon;
2931
import java.util.Map;
@@ -168,9 +170,10 @@ public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions
168170
}
169171

170172
/**
171-
* Send user input to assistant.
173+
* Send user input to assistant (stateful).
172174
*
173-
* <p>Send user input to an assistant and receive a response.
175+
* <p>Send user input to an assistant and receive a response, with conversation state (including
176+
* context data) stored by Watson Assistant for the duration of the session.
174177
*
175178
* <p>There is no rate limit for this operation.
176179
*
@@ -207,4 +210,52 @@ public ServiceCall<MessageResponse> message(MessageOptions messageOptions) {
207210
new com.google.gson.reflect.TypeToken<MessageResponse>() {}.getType());
208211
return createServiceCall(builder.build(), responseConverter);
209212
}
213+
214+
/**
215+
* Send user input to assistant (stateless).
216+
*
217+
* <p>Send user input to an assistant and receive a response, with conversation state (including
218+
* context data) managed by your application.
219+
*
220+
* <p>There is no rate limit for this operation.
221+
*
222+
* @param messageStatelessOptions the {@link MessageStatelessOptions} containing the options for
223+
* the call
224+
* @return a {@link ServiceCall} with a response type of {@link MessageResponseStateless}
225+
*/
226+
public ServiceCall<MessageResponseStateless> messageStateless(
227+
MessageStatelessOptions messageStatelessOptions) {
228+
com.ibm.cloud.sdk.core.util.Validator.notNull(
229+
messageStatelessOptions, "messageStatelessOptions cannot be null");
230+
String[] pathSegments = {"v2/assistants", "message"};
231+
String[] pathParameters = {messageStatelessOptions.assistantId()};
232+
RequestBuilder builder =
233+
RequestBuilder.post(
234+
RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters));
235+
builder.query("version", versionDate);
236+
Map<String, String> sdkHeaders =
237+
SdkCommon.getSdkHeaders("conversation", "v2", "messageStateless");
238+
for (Entry<String, String> header : sdkHeaders.entrySet()) {
239+
builder.header(header.getKey(), header.getValue());
240+
}
241+
builder.header("Accept", "application/json");
242+
final JsonObject contentJson = new JsonObject();
243+
if (messageStatelessOptions.input() != null) {
244+
contentJson.add(
245+
"input",
246+
com.ibm.cloud.sdk.core.util.GsonSingleton.getGson()
247+
.toJsonTree(messageStatelessOptions.input()));
248+
}
249+
if (messageStatelessOptions.context() != null) {
250+
contentJson.add(
251+
"context",
252+
com.ibm.cloud.sdk.core.util.GsonSingleton.getGson()
253+
.toJsonTree(messageStatelessOptions.context()));
254+
}
255+
builder.bodyJson(contentJson);
256+
ResponseConverter<MessageResponseStateless> responseConverter =
257+
ResponseConverterUtils.getValue(
258+
new com.google.gson.reflect.TypeToken<MessageResponseStateless>() {}.getType());
259+
return createServiceCall(builder.build(), responseConverter);
260+
}
210261
}

assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Builder newBuilder() {
8282
/**
8383
* Gets the global.
8484
*
85-
* <p>Information that is shared by all skills used by the Assistant.
85+
* <p>Session context data that is shared by all skills used by the Assistant.
8686
*
8787
* @return the global
8888
*/
@@ -93,10 +93,10 @@ public MessageContextGlobal global() {
9393
/**
9494
* Gets the skills.
9595
*
96-
* <p>Information specific to particular skills used by the Assistant.
96+
* <p>Information specific to particular skills used by the assistant.
9797
*
98-
* <p>**Note:** Currently, only a single property named `main skill` is supported. This object
99-
* contains variables that apply to the dialog skill used by the assistant.
98+
* <p>**Note:** Currently, only a single child property is supported, containing variables that
99+
* apply to the dialog skill used by the assistant.
100100
*
101101
* @return the skills
102102
*/

0 commit comments

Comments
 (0)