Skip to content

Commit 439ed47

Browse files
feat(wa-v2): new method params
1 parent 78d93b7 commit 439ed47

File tree

11 files changed

+165
-77
lines changed

11 files changed

+165
-77
lines changed

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

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2023.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
15-
* IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647
15+
* IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220
1616
*/
1717

1818
package com.ibm.watson.assistant.v2;
@@ -68,13 +68,15 @@
6868
import java.util.Map.Entry;
6969

7070
/**
71-
* The IBM Watson™ Assistant service combines machine learning, natural language
71+
* The IBM® watsonx™ Assistant service combines machine learning, natural language
7272
* understanding, and an integrated dialog editor to create conversation flows between your apps and
7373
* your users.
7474
*
7575
* <p>The Assistant v2 API provides runtime methods your client application can use to send user
7676
* input to an assistant and receive a response.
7777
*
78+
* <p>You need a paid Plus plan or higher to use the watsonx Assistant v2 API.
79+
*
7880
* <p>API Version: 2.0 See: https://cloud.ibm.com/docs/assistant
7981
*/
8082
public class Assistant extends BaseService {
@@ -93,7 +95,7 @@ public class Assistant extends BaseService {
9395
* the client instance.
9496
*
9597
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
96-
* format. The current version is `2021-11-27`.
98+
* format. The current version is `2023-06-15`.
9799
*/
98100
public Assistant(String version) {
99101
this(
@@ -107,7 +109,7 @@ public Assistant(String version) {
107109
* authenticator are used to configure the client instance.
108110
*
109111
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
110-
* format. The current version is `2021-11-27`.
112+
* format. The current version is `2023-06-15`.
111113
* @param authenticator the {@link Authenticator} instance to be configured for this client
112114
*/
113115
public Assistant(String version, Authenticator authenticator) {
@@ -119,7 +121,7 @@ public Assistant(String version, Authenticator authenticator) {
119121
* configure the client instance.
120122
*
121123
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
122-
* format. The current version is `2021-11-27`.
124+
* format. The current version is `2023-06-15`.
123125
* @param serviceName the service name to be used when configuring the client instance
124126
*/
125127
public Assistant(String version, String serviceName) {
@@ -131,7 +133,7 @@ public Assistant(String version, String serviceName) {
131133
* are used to configure the client instance.
132134
*
133135
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
134-
* format. The current version is `2021-11-27`.
136+
* format. The current version is `2023-06-15`.
135137
* @param serviceName the service name to be used when configuring the client instance
136138
* @param authenticator the {@link Authenticator} instance to be configured for this client
137139
*/
@@ -146,7 +148,7 @@ public Assistant(String version, String serviceName, Authenticator authenticator
146148
* Gets the version.
147149
*
148150
* <p>Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The
149-
* current version is `2021-11-27`.
151+
* current version is `2023-06-15`.
150152
*
151153
* @return the version
152154
*/
@@ -169,8 +171,6 @@ public void setVersion(final String version) {
169171
*
170172
* <p>Create a new assistant.
171173
*
172-
* <p>This method is available only with Enterprise plans.
173-
*
174174
* @param createAssistantOptions the {@link CreateAssistantOptions} containing the options for the
175175
* call
176176
* @return a {@link ServiceCall} with a result of type {@link AssistantData}
@@ -214,8 +214,6 @@ public ServiceCall<AssistantData> createAssistant(CreateAssistantOptions createA
214214
*
215215
* <p>Create a new assistant.
216216
*
217-
* <p>This method is available only with Enterprise plans.
218-
*
219217
* @return a {@link ServiceCall} with a result of type {@link AssistantData}
220218
*/
221219
public ServiceCall<AssistantData> createAssistant() {
@@ -225,9 +223,7 @@ public ServiceCall<AssistantData> createAssistant() {
225223
/**
226224
* List assistants.
227225
*
228-
* <p>List the assistants associated with a Watson Assistant service instance.
229-
*
230-
* <p>This method is available only with Enterprise plans.
226+
* <p>List the assistants associated with a watsonx Assistant service instance.
231227
*
232228
* @param listAssistantsOptions the {@link ListAssistantsOptions} containing the options for the
233229
* call
@@ -271,9 +267,7 @@ public ServiceCall<AssistantCollection> listAssistants(
271267
/**
272268
* List assistants.
273269
*
274-
* <p>List the assistants associated with a Watson Assistant service instance.
275-
*
276-
* <p>This method is available only with Enterprise plans.
270+
* <p>List the assistants associated with a watsonx Assistant service instance.
277271
*
278272
* @return a {@link ServiceCall} with a result of type {@link AssistantCollection}
279273
*/
@@ -286,8 +280,6 @@ public ServiceCall<AssistantCollection> listAssistants() {
286280
*
287281
* <p>Delete an assistant.
288282
*
289-
* <p>This method is available only with Enterprise plans.
290-
*
291283
* @param deleteAssistantOptions the {@link DeleteAssistantOptions} containing the options for the
292284
* call
293285
* @return a {@link ServiceCall} with a void result
@@ -318,7 +310,7 @@ public ServiceCall<Void> deleteAssistant(DeleteAssistantOptions deleteAssistantO
318310
* <p>Create a new session. A session is used to send user input to a skill and receive responses.
319311
* It also maintains the state of the conversation. A session persists until it is deleted, or
320312
* until it times out because of inactivity. (For more information, see the
321-
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).
313+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).).
322314
*
323315
* @param createSessionOptions the {@link CreateSessionOptions} containing the options for the
324316
* call
@@ -390,7 +382,7 @@ public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions
390382
* Send user input to assistant (stateful).
391383
*
392384
* <p>Send user input to an assistant and receive a response, with conversation state (including
393-
* context data) stored by Watson Assistant for the duration of the session.
385+
* context data) stored by watsonx Assistant for the duration of the session.
394386
*
395387
* @param messageOptions the {@link MessageOptions} containing the options for the call
396388
* @return a {@link ServiceCall} with a result of type {@link MessageResponse}
@@ -527,7 +519,7 @@ public ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkCl
527519
*
528520
* <p>List the events from the log of an assistant.
529521
*
530-
* <p>This method requires Manager access, and is available only with Plus and Enterprise plans.
522+
* <p>This method requires Manager access.
531523
*
532524
* <p>**Note:** If you use the **cursor** parameter to retrieve results one page at a time,
533525
* subsequent requests must be no more than 5 minutes apart. Any returned value for the **cursor**
@@ -583,7 +575,7 @@ public ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions) {
583575
*
584576
* <p>**Note:** This operation is intended only for deleting data associated with a single
585577
* specific customer, not for deleting data associated with multiple customers or for any other
586-
* purpose. For more information, see [Labeling and deleting data in Watson
578+
* purpose. For more information, see [Labeling and deleting data in watsonx
587579
* Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
588580
*
589581
* @param deleteUserDataOptions the {@link DeleteUserDataOptions} containing the options for the
@@ -612,8 +604,6 @@ public ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOpti
612604
*
613605
* <p>List the environments associated with an assistant.
614606
*
615-
* <p>This method is available only with Enterprise plans.
616-
*
617607
* @param listEnvironmentsOptions the {@link ListEnvironmentsOptions} containing the options for
618608
* the call
619609
* @return a {@link ServiceCall} with a result of type {@link EnvironmentCollection}
@@ -662,8 +652,6 @@ public ServiceCall<EnvironmentCollection> listEnvironments(
662652
* <p>Get information about an environment. For more information about environments, see
663653
* [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments).
664654
*
665-
* <p>This method is available only with Enterprise plans.
666-
*
667655
* @param getEnvironmentOptions the {@link GetEnvironmentOptions} containing the options for the
668656
* call
669657
* @return a {@link ServiceCall} with a result of type {@link Environment}
@@ -703,8 +691,6 @@ public ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironm
703691
* see
704692
* [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments).
705693
*
706-
* <p>This method is available only with Enterprise plans.
707-
*
708694
* @param updateEnvironmentOptions the {@link UpdateEnvironmentOptions} containing the options for
709695
* the call
710696
* @return a {@link ServiceCall} with a result of type {@link Environment}
@@ -736,6 +722,12 @@ public ServiceCall<Environment> updateEnvironment(
736722
if (updateEnvironmentOptions.description() != null) {
737723
contentJson.addProperty("description", updateEnvironmentOptions.description());
738724
}
725+
if (updateEnvironmentOptions.orchestration() != null) {
726+
contentJson.add(
727+
"orchestration",
728+
com.ibm.cloud.sdk.core.util.GsonSingleton.getGson()
729+
.toJsonTree(updateEnvironmentOptions.orchestration()));
730+
}
739731
if (updateEnvironmentOptions.sessionTimeout() != null) {
740732
contentJson.addProperty("session_timeout", updateEnvironmentOptions.sessionTimeout());
741733
}
@@ -756,9 +748,7 @@ public ServiceCall<Environment> updateEnvironment(
756748
* Create release.
757749
*
758750
* <p>Create a new release using the current content of the dialog and action skills in the draft
759-
* environment. (In the Watson Assistant user interface, a release is called a *version*.)
760-
*
761-
* <p>This method is available only with Enterprise plans.
751+
* environment. (In the watsonx Assistant user interface, a release is called a *version*.).
762752
*
763753
* @param createReleaseOptions the {@link CreateReleaseOptions} containing the options for the
764754
* call
@@ -793,10 +783,8 @@ public ServiceCall<Release> createRelease(CreateReleaseOptions createReleaseOpti
793783
/**
794784
* List releases.
795785
*
796-
* <p>List the releases associated with an assistant. (In the Watson Assistant user interface, a
797-
* release is called a *version*.)
798-
*
799-
* <p>This method is available only with Enterprise plans.
786+
* <p>List the releases associated with an assistant. (In the watsonx Assistant user interface, a
787+
* release is called a *version*.).
800788
*
801789
* @param listReleasesOptions the {@link ListReleasesOptions} containing the options for the call
802790
* @return a {@link ServiceCall} with a result of type {@link ReleaseCollection}
@@ -847,8 +835,6 @@ public ServiceCall<ReleaseCollection> listReleases(ListReleasesOptions listRelea
847835
* value of the **status** property. When processing has completed, the request returns the
848836
* release data.
849837
*
850-
* <p>This method is available only with Enterprise plans.
851-
*
852838
* @param getReleaseOptions the {@link GetReleaseOptions} containing the options for the call
853839
* @return a {@link ServiceCall} with a result of type {@link Release}
854840
*/
@@ -882,9 +868,8 @@ public ServiceCall<Release> getRelease(GetReleaseOptions getReleaseOptions) {
882868
/**
883869
* Delete release.
884870
*
885-
* <p>Delete a release. (In the Watson Assistant user interface, a release is called a *version*.)
886-
*
887-
* <p>This method is available only with Enterprise plans.
871+
* <p>Delete a release. (In the watsonx Assistant user interface, a release is called a
872+
* *version*.).
888873
*
889874
* @param deleteReleaseOptions the {@link DeleteReleaseOptions} containing the options for the
890875
* call
@@ -918,8 +903,6 @@ public ServiceCall<Void> deleteRelease(DeleteReleaseOptions deleteReleaseOptions
918903
* <p>Update the environment with the content of the release. All snapshots saved as part of the
919904
* release become active in the environment.
920905
*
921-
* <p>This method is available only with Enterprise plans.
922-
*
923906
* @param deployReleaseOptions the {@link DeployReleaseOptions} containing the options for the
924907
* call
925908
* @return a {@link ServiceCall} with a result of type {@link Environment}
@@ -959,8 +942,6 @@ public ServiceCall<Environment> deployRelease(DeployReleaseOptions deployRelease
959942
*
960943
* <p>Get information about a skill.
961944
*
962-
* <p>This method is available only with Enterprise plans.
963-
*
964945
* @param getSkillOptions the {@link GetSkillOptions} containing the options for the call
965946
* @return a {@link ServiceCall} with a result of type {@link Skill}
966947
*/
@@ -994,8 +975,6 @@ public ServiceCall<Skill> getSkill(GetSkillOptions getSkillOptions) {
994975
* <p>**Note:** The update is performed asynchronously; you can see the status of the update by
995976
* calling the **Get skill** method and checking the value of the **status** property.
996977
*
997-
* <p>This method is available only with Enterprise plans.
998-
*
999978
* @param updateSkillOptions the {@link UpdateSkillOptions} containing the options for the call
1000979
* @return a {@link ServiceCall} with a result of type {@link Skill}
1001980
*/
@@ -1066,8 +1045,6 @@ public ServiceCall<Skill> updateSkill(UpdateSkillOptions updateSkillOptions) {
10661045
* <p>When processing has completed, the request returns the exported JSON data. Remember that the
10671046
* usual rate limits apply.
10681047
*
1069-
* <p>This method is available only with Enterprise plans.
1070-
*
10711048
* @param exportSkillsOptions the {@link ExportSkillsOptions} containing the options for the call
10721049
* @return a {@link ServiceCall} with a result of type {@link SkillsExport}
10731050
*/
@@ -1107,8 +1084,6 @@ public ServiceCall<SkillsExport> exportSkills(ExportSkillsOptions exportSkillsOp
11071084
* belonging to the assistant are not available until processing completes. To check the status of
11081085
* the asynchronous import operation, use the **Get status of skills import** method.
11091086
*
1110-
* <p>This method is available only with Enterprise plans.
1111-
*
11121087
* @param importSkillsOptions the {@link ImportSkillsOptions} containing the options for the call
11131088
* @return a {@link ServiceCall} with a result of type {@link SkillsAsyncRequestStatus}
11141089
*/
@@ -1153,8 +1128,6 @@ public ServiceCall<SkillsAsyncRequestStatus> importSkills(
11531128
* <p>Retrieve the status of an asynchronous import operation previously initiated by using the
11541129
* **Import skills** method.
11551130
*
1156-
* <p>This method is available only with Enterprise plans.
1157-
*
11581131
* @param importSkillsStatusOptions the {@link ImportSkillsStatusOptions} containing the options
11591132
* for the call
11601133
* @return a {@link ServiceCall} with a result of type {@link SkillsAsyncRequestStatus}

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2018, 2023.
2+
* (C) Copyright IBM Corp. 2024.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -23,6 +23,9 @@ public class MessageInputOptions extends GenericModel {
2323
@SerializedName("alternate_intents")
2424
protected Boolean alternateIntents;
2525

26+
@SerializedName("async_callout")
27+
protected Boolean asyncCallout;
28+
2629
protected MessageInputOptionsSpelling spelling;
2730
protected Boolean debug;
2831

@@ -35,6 +38,7 @@ public class MessageInputOptions extends GenericModel {
3538
public static class Builder {
3639
private Boolean restart;
3740
private Boolean alternateIntents;
41+
private Boolean asyncCallout;
3842
private MessageInputOptionsSpelling spelling;
3943
private Boolean debug;
4044
private Boolean returnContext;
@@ -48,6 +52,7 @@ public static class Builder {
4852
private Builder(MessageInputOptions messageInputOptions) {
4953
this.restart = messageInputOptions.restart;
5054
this.alternateIntents = messageInputOptions.alternateIntents;
55+
this.asyncCallout = messageInputOptions.asyncCallout;
5156
this.spelling = messageInputOptions.spelling;
5257
this.debug = messageInputOptions.debug;
5358
this.returnContext = messageInputOptions.returnContext;
@@ -88,6 +93,17 @@ public Builder alternateIntents(Boolean alternateIntents) {
8893
return this;
8994
}
9095

96+
/**
97+
* Set the asyncCallout.
98+
*
99+
* @param asyncCallout the asyncCallout
100+
* @return the MessageInputOptions builder
101+
*/
102+
public Builder asyncCallout(Boolean asyncCallout) {
103+
this.asyncCallout = asyncCallout;
104+
return this;
105+
}
106+
91107
/**
92108
* Set the spelling.
93109
*
@@ -138,6 +154,7 @@ protected MessageInputOptions() {}
138154
protected MessageInputOptions(Builder builder) {
139155
restart = builder.restart;
140156
alternateIntents = builder.alternateIntents;
157+
asyncCallout = builder.asyncCallout;
141158
spelling = builder.spelling;
142159
debug = builder.debug;
143160
returnContext = builder.returnContext;
@@ -176,6 +193,22 @@ public Boolean alternateIntents() {
176193
return alternateIntents;
177194
}
178195

196+
/**
197+
* Gets the asyncCallout.
198+
*
199+
* <p>Whether custom extension callouts are executed asynchronously. Asynchronous execution means
200+
* the response to the extension callout will be processed on the subsequent message call, the
201+
* initial message response signals to the client that the operation may be long running. With
202+
* synchronous execution the custom extension is executed and returns the response in a single
203+
* message turn. **Note:** **async_callout** defaults to true for API versions earlier than
204+
* 2023-06-15.
205+
*
206+
* @return the asyncCallout
207+
*/
208+
public Boolean asyncCallout() {
209+
return asyncCallout;
210+
}
211+
179212
/**
180213
* Gets the spelling.
181214
*

0 commit comments

Comments
 (0)