Skip to content

Commit 38c610c

Browse files
committed
feat(Assistant v1): Add disambiguationOptOut prop to dialog nodes
1 parent d9b898d commit 38c610c

File tree

6 files changed

+99
-16
lines changed

6 files changed

+99
-16
lines changed

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

+14-8
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,6 @@ public ServiceCall<Workspace> createWorkspace(CreateWorkspaceOptions createWorks
285285
contentJson.add("system_settings", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
286286
createWorkspaceOptions.systemSettings()));
287287
}
288-
if (createWorkspaceOptions.webhooks() != null) {
289-
contentJson.add("webhooks", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
290-
createWorkspaceOptions.webhooks()));
291-
}
292288
if (createWorkspaceOptions.intents() != null) {
293289
contentJson.add("intents", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createWorkspaceOptions
294290
.intents()));
@@ -305,6 +301,10 @@ public ServiceCall<Workspace> createWorkspace(CreateWorkspaceOptions createWorks
305301
contentJson.add("counterexamples", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
306302
createWorkspaceOptions.counterexamples()));
307303
}
304+
if (createWorkspaceOptions.webhooks() != null) {
305+
contentJson.add("webhooks", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
306+
createWorkspaceOptions.webhooks()));
307+
}
308308
builder.bodyJson(contentJson);
309309
}
310310
ResponseConverter<Workspace> responseConverter = ResponseConverterUtils.getValue(
@@ -414,10 +414,6 @@ public ServiceCall<Workspace> updateWorkspace(UpdateWorkspaceOptions updateWorks
414414
contentJson.add("system_settings", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
415415
updateWorkspaceOptions.systemSettings()));
416416
}
417-
if (updateWorkspaceOptions.webhooks() != null) {
418-
contentJson.add("webhooks", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateWorkspaceOptions
419-
.webhooks()));
420-
}
421417
if (updateWorkspaceOptions.intents() != null) {
422418
contentJson.add("intents", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateWorkspaceOptions
423419
.intents()));
@@ -434,6 +430,10 @@ public ServiceCall<Workspace> updateWorkspace(UpdateWorkspaceOptions updateWorks
434430
contentJson.add("counterexamples", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(
435431
updateWorkspaceOptions.counterexamples()));
436432
}
433+
if (updateWorkspaceOptions.webhooks() != null) {
434+
contentJson.add("webhooks", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateWorkspaceOptions
435+
.webhooks()));
436+
}
437437
builder.bodyJson(contentJson);
438438
ResponseConverter<Workspace> responseConverter = ResponseConverterUtils.getValue(
439439
new com.google.gson.reflect.TypeToken<Workspace>() {
@@ -1783,6 +1783,9 @@ public ServiceCall<DialogNode> createDialogNode(CreateDialogNodeOptions createDi
17831783
if (createDialogNodeOptions.userLabel() != null) {
17841784
contentJson.addProperty("user_label", createDialogNodeOptions.userLabel());
17851785
}
1786+
if (createDialogNodeOptions.disambiguationOptOut() != null) {
1787+
contentJson.addProperty("disambiguation_opt_out", createDialogNodeOptions.disambiguationOptOut());
1788+
}
17861789
builder.bodyJson(contentJson);
17871790
ResponseConverter<DialogNode> responseConverter = ResponseConverterUtils.getValue(
17881791
new com.google.gson.reflect.TypeToken<DialogNode>() {
@@ -1908,6 +1911,9 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi
19081911
if (updateDialogNodeOptions.newUserLabel() != null) {
19091912
contentJson.addProperty("user_label", updateDialogNodeOptions.newUserLabel());
19101913
}
1914+
if (updateDialogNodeOptions.newDisambiguationOptOut() != null) {
1915+
contentJson.addProperty("disambiguation_opt_out", updateDialogNodeOptions.newDisambiguationOptOut());
1916+
}
19111917
builder.bodyJson(contentJson);
19121918
ResponseConverter<DialogNode> responseConverter = ResponseConverterUtils.getValue(
19131919
new com.google.gson.reflect.TypeToken<DialogNode>() {

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

+28-2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public interface DigressOutSlots {
120120
private String digressOut;
121121
private String digressOutSlots;
122122
private String userLabel;
123+
private Boolean disambiguationOptOut;
123124

124125
/**
125126
* Builder.
@@ -144,6 +145,7 @@ public static class Builder {
144145
private String digressOut;
145146
private String digressOutSlots;
146147
private String userLabel;
148+
private Boolean disambiguationOptOut;
147149

148150
private Builder(CreateDialogNodeOptions createDialogNodeOptions) {
149151
this.workspaceId = createDialogNodeOptions.workspaceId;
@@ -165,6 +167,7 @@ private Builder(CreateDialogNodeOptions createDialogNodeOptions) {
165167
this.digressOut = createDialogNodeOptions.digressOut;
166168
this.digressOutSlots = createDialogNodeOptions.digressOutSlots;
167169
this.userLabel = createDialogNodeOptions.userLabel;
170+
this.disambiguationOptOut = createDialogNodeOptions.disambiguationOptOut;
168171
}
169172

170173
/**
@@ -419,6 +422,17 @@ public Builder userLabel(String userLabel) {
419422
return this;
420423
}
421424

425+
/**
426+
* Set the disambiguationOptOut.
427+
*
428+
* @param disambiguationOptOut the disambiguationOptOut
429+
* @return the CreateDialogNodeOptions builder
430+
*/
431+
public Builder disambiguationOptOut(Boolean disambiguationOptOut) {
432+
this.disambiguationOptOut = disambiguationOptOut;
433+
return this;
434+
}
435+
422436
/**
423437
* Set the dialogNode.
424438
*
@@ -444,6 +458,7 @@ public Builder dialogNode(DialogNode dialogNode) {
444458
this.digressOut = dialogNode.digressOut();
445459
this.digressOutSlots = dialogNode.digressOutSlots();
446460
this.userLabel = dialogNode.userLabel();
461+
this.disambiguationOptOut = dialogNode.disambiguationOptOut();
447462
return this;
448463
}
449464
}
@@ -472,6 +487,7 @@ private CreateDialogNodeOptions(Builder builder) {
472487
digressOut = builder.digressOut;
473488
digressOutSlots = builder.digressOutSlots;
474489
userLabel = builder.userLabel;
490+
disambiguationOptOut = builder.disambiguationOptOut;
475491
}
476492

477493
/**
@@ -555,8 +571,7 @@ public String previousSibling() {
555571
* Gets the output.
556572
*
557573
* The output of the dialog node. For more information about how to specify dialog node output, see the
558-
* [documentation]
559-
* (https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
574+
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
560575
*
561576
* @return the output
562577
*/
@@ -696,4 +711,15 @@ public String digressOutSlots() {
696711
public String userLabel() {
697712
return userLabel;
698713
}
714+
715+
/**
716+
* Gets the disambiguationOptOut.
717+
*
718+
* Whether the dialog node should be excluded from disambiguation suggestions.
719+
*
720+
* @return the disambiguationOptOut
721+
*/
722+
public Boolean disambiguationOptOut() {
723+
return disambiguationOptOut;
724+
}
699725
}

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

+28-2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public interface DigressOutSlots {
129129
private String digressOutSlots;
130130
@SerializedName("user_label")
131131
private String userLabel;
132+
@SerializedName("disambiguation_opt_out")
133+
private Boolean disambiguationOptOut;
132134
private Boolean disabled;
133135
private Date created;
134136
private Date updated;
@@ -155,6 +157,7 @@ public static class Builder {
155157
private String digressOut;
156158
private String digressOutSlots;
157159
private String userLabel;
160+
private Boolean disambiguationOptOut;
158161
private Boolean disabled;
159162
private Date created;
160163
private Date updated;
@@ -178,6 +181,7 @@ private Builder(DialogNode dialogNode) {
178181
this.digressOut = dialogNode.digressOut;
179182
this.digressOutSlots = dialogNode.digressOutSlots;
180183
this.userLabel = dialogNode.userLabel;
184+
this.disambiguationOptOut = dialogNode.disambiguationOptOut;
181185
this.disabled = dialogNode.disabled;
182186
this.created = dialogNode.created;
183187
this.updated = dialogNode.updated;
@@ -422,6 +426,17 @@ public Builder userLabel(String userLabel) {
422426
return this;
423427
}
424428

429+
/**
430+
* Set the disambiguationOptOut.
431+
*
432+
* @param disambiguationOptOut the disambiguationOptOut
433+
* @return the DialogNode builder
434+
*/
435+
public Builder disambiguationOptOut(Boolean disambiguationOptOut) {
436+
this.disambiguationOptOut = disambiguationOptOut;
437+
return this;
438+
}
439+
425440
/**
426441
* Set the disabled.
427442
*
@@ -477,6 +492,7 @@ private DialogNode(Builder builder) {
477492
digressOut = builder.digressOut;
478493
digressOutSlots = builder.digressOutSlots;
479494
userLabel = builder.userLabel;
495+
disambiguationOptOut = builder.disambiguationOptOut;
480496
disabled = builder.disabled;
481497
created = builder.created;
482498
updated = builder.updated;
@@ -552,8 +568,7 @@ public String previousSibling() {
552568
* Gets the output.
553569
*
554570
* The output of the dialog node. For more information about how to specify dialog node output, see the
555-
* [documentation]
556-
* (https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
571+
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
557572
*
558573
* @return the output
559574
*/
@@ -694,6 +709,17 @@ public String userLabel() {
694709
return userLabel;
695710
}
696711

712+
/**
713+
* Gets the disambiguationOptOut.
714+
*
715+
* Whether the dialog node should be excluded from disambiguation suggestions.
716+
*
717+
* @return the disambiguationOptOut
718+
*/
719+
public Boolean disambiguationOptOut() {
720+
return disambiguationOptOut;
721+
}
722+
697723
/**
698724
* Gets the disabled.
699725
*

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public Builder newBuilder() {
136136
/**
137137
* Gets the label.
138138
*
139-
* The user-facing label for the disambiguation option. This label is taken from the **user_label** property of the
140-
* corresponding dialog node.
139+
* The user-facing label for the disambiguation option. This label is taken from the **title** or **user_label**
140+
* property of the corresponding dialog node, depending on the disambiguation options.
141141
*
142142
* @return the label
143143
*/

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

+27-2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public interface NewDigressOutSlots {
121121
private String newDigressOut;
122122
private String newDigressOutSlots;
123123
private String newUserLabel;
124+
private Boolean newDisambiguationOptOut;
124125

125126
/**
126127
* Builder.
@@ -146,6 +147,7 @@ public static class Builder {
146147
private String newDigressOut;
147148
private String newDigressOutSlots;
148149
private String newUserLabel;
150+
private Boolean newDisambiguationOptOut;
149151

150152
private Builder(UpdateDialogNodeOptions updateDialogNodeOptions) {
151153
this.workspaceId = updateDialogNodeOptions.workspaceId;
@@ -168,6 +170,7 @@ private Builder(UpdateDialogNodeOptions updateDialogNodeOptions) {
168170
this.newDigressOut = updateDialogNodeOptions.newDigressOut;
169171
this.newDigressOutSlots = updateDialogNodeOptions.newDigressOutSlots;
170172
this.newUserLabel = updateDialogNodeOptions.newUserLabel;
173+
this.newDisambiguationOptOut = updateDialogNodeOptions.newDisambiguationOptOut;
171174
}
172175

173176
/**
@@ -432,6 +435,17 @@ public Builder newUserLabel(String newUserLabel) {
432435
this.newUserLabel = newUserLabel;
433436
return this;
434437
}
438+
439+
/**
440+
* Set the newDisambiguationOptOut.
441+
*
442+
* @param newDisambiguationOptOut the newDisambiguationOptOut
443+
* @return the UpdateDialogNodeOptions builder
444+
*/
445+
public Builder newDisambiguationOptOut(Boolean newDisambiguationOptOut) {
446+
this.newDisambiguationOptOut = newDisambiguationOptOut;
447+
return this;
448+
}
435449
}
436450

437451
private UpdateDialogNodeOptions(Builder builder) {
@@ -459,6 +473,7 @@ private UpdateDialogNodeOptions(Builder builder) {
459473
newDigressOut = builder.newDigressOut;
460474
newDigressOutSlots = builder.newDigressOutSlots;
461475
newUserLabel = builder.newUserLabel;
476+
newDisambiguationOptOut = builder.newDisambiguationOptOut;
462477
}
463478

464479
/**
@@ -553,8 +568,7 @@ public String newPreviousSibling() {
553568
* Gets the newOutput.
554569
*
555570
* The output of the dialog node. For more information about how to specify dialog node output, see the
556-
* [documentation]
557-
* (https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
571+
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
558572
*
559573
* @return the newOutput
560574
*/
@@ -694,4 +708,15 @@ public String newDigressOutSlots() {
694708
public String newUserLabel() {
695709
return newUserLabel;
696710
}
711+
712+
/**
713+
* Gets the newDisambiguationOptOut.
714+
*
715+
* Whether the dialog node should be excluded from disambiguation suggestions.
716+
*
717+
* @return the newDisambiguationOptOut
718+
*/
719+
public Boolean newDisambiguationOptOut() {
720+
return newDisambiguationOptOut;
721+
}
697722
}

visual-recognition/src/test/resources/visual_recognition/v4/training-events.json

Whitespace-only changes.

0 commit comments

Comments
 (0)