From 07e06c891de94e205511c9098e947eb44737825f Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Wed, 8 Oct 2025 13:27:33 -0500 Subject: [PATCH 1/3] chore(wa-v2): update comments --- .../v2/model/CreateReleaseExportOptions.java | 20 +++---------------- .../v2/model/CreateReleaseImportOptions.java | 20 +++---------------- .../v2/model/CreateReleaseOptions.java | 20 +++---------------- .../v2/model/DeleteAssistantOptions.java | 20 +++---------------- .../v2/model/DeleteReleaseOptions.java | 20 +++---------------- .../v2/model/DeployReleaseOptions.java | 20 +++---------------- .../model/DownloadReleaseExportOptions.java | 20 +++---------------- .../v2/model/ExportSkillsOptions.java | 20 +++---------------- .../assistant/v2/model/GenerativeAITask.java | 5 +++++ .../GenerativeAITaskConfidenceScores.java | 12 +++++++++++ .../v2/model/GetEnvironmentOptions.java | 20 +++---------------- .../model/GetReleaseImportStatusOptions.java | 20 +++---------------- .../assistant/v2/model/GetReleaseOptions.java | 20 +++---------------- .../assistant/v2/model/GetSkillOptions.java | 20 +++---------------- .../v2/model/ImportSkillsOptions.java | 20 +++---------------- .../v2/model/ImportSkillsStatusOptions.java | 20 +++---------------- .../v2/model/ListEnvironmentsOptions.java | 20 +++---------------- .../v2/model/ListReleasesOptions.java | 20 +++---------------- .../assistant/v2/model/MessageOptions.java | 20 +++---------------- .../v2/model/MessageStatelessOptions.java | 20 +++---------------- .../v2/model/MessageStreamOptions.java | 20 +++---------------- .../model/MessageStreamStatelessOptions.java | 20 +++---------------- .../TurnEventGenerativeAICalledCallout.java | 7 +++++++ ...TurnEventGenerativeAICalledCalloutLlm.java | 17 ++++++++++++++++ ...tGenerativeAICalledCalloutLlmResponse.java | 6 ++++++ ...nEventGenerativeAICalledCalloutSearch.java | 7 +++++++ .../TurnEventGenerativeAICalledMetrics.java | 9 +++++++++ .../v2/model/UpdateEnvironmentOptions.java | 20 +++---------------- .../v2/model/UpdateSkillOptions.java | 20 +++---------------- 29 files changed, 129 insertions(+), 374 deletions(-) diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java index 68cdd6a842b..cc42660eec9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java @@ -119,23 +119,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java index 0380adce74a..71c8f968a35 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java @@ -135,23 +135,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java index 162d1e58e85..f107baaae37 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java @@ -112,23 +112,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java index 9fb620082ea..a1b71e51e1c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java @@ -86,23 +86,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java index ba1c187ef5c..afbcd5264a0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java @@ -104,23 +104,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java index 53e4a646254..f7a94727177 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java @@ -138,23 +138,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java index 77901e35acf..46a66525a0c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java @@ -119,23 +119,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java index c4474a357f1..272f6c448af 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java @@ -101,23 +101,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITask.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITask.java index 6079e9da8de..50c36ad9310 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITask.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITask.java @@ -103,6 +103,8 @@ public GenerativeAITaskConfidenceScores getConfidenceScores() { /** * Gets the originalResponse. * + *

The original response returned by the generative ai. + * * @return the originalResponse */ public String getOriginalResponse() { @@ -112,6 +114,9 @@ public String getOriginalResponse() { /** * Gets the inferredQuery. * + *

Generated from the input text after auto-correction. If this field is not present, the input + * text was used as the query to the generative ai. + * * @return the inferredQuery */ public String getInferredQuery() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITaskConfidenceScores.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITaskConfidenceScores.java index c0ddfabaaf2..de1b45eb174 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITaskConfidenceScores.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GenerativeAITaskConfidenceScores.java @@ -39,6 +39,8 @@ protected GenerativeAITaskConfidenceScores() {} /** * Gets the preGen. * + *

The confidence score based on user query and search results. + * * @return the preGen */ public Double getPreGen() { @@ -48,6 +50,10 @@ public Double getPreGen() { /** * Gets the preGenThreshold. * + *

The pre_gen confidence score threshold. If the pre_gen score is below this threshold, it + * shows an “I don't know” response instead of the generated response. Shown in the conversational + * search skill UI as the “Retrieval Confidence threshold”. + * * @return the preGenThreshold */ public Double getPreGenThreshold() { @@ -57,6 +63,8 @@ public Double getPreGenThreshold() { /** * Gets the postGen. * + *

The confidence score based on user query, search results, and the generated response. + * * @return the postGen */ public Double getPostGen() { @@ -66,6 +74,10 @@ public Double getPostGen() { /** * Gets the postGenThreshold. * + *

The post_gen confidence score threshold. If the post_gen score is below this threshold, it + * shows an “I don't know” response instead of the generated response. Shown in the conversational + * search skill UI as the “Response Confidence threshold”. + * * @return the postGenThreshold */ public Double getPostGenThreshold() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java index 1c96a4fb06f..25d0a589a37 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java @@ -120,23 +120,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java index 0a1d2c73a4e..817935985ec 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java @@ -101,23 +101,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java index acd43ee329c..7d845af4424 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java @@ -119,23 +119,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java index e3c16aa4738..a5583560b34 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java @@ -104,23 +104,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java index 6d037ebe6e0..1be9935e5b7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java @@ -158,23 +158,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java index 15683ce0339..b2a6efdcb87 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java @@ -86,23 +86,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java index 5a43b5d5eb1..aec63eec277 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java @@ -172,23 +172,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java index b474326a14d..b4c71a028b7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java @@ -172,23 +172,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java index 026669284fc..c0c11684698 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java @@ -168,23 +168,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java index 55ef4da76fa..e293def7c91 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java @@ -150,23 +150,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java index bdd7da82b38..edee0ae6dac 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java @@ -168,23 +168,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java index 39f48baccff..999f2e1ac09 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java @@ -150,23 +150,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCallout.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCallout.java index 58e2976aa00..b233722cbbb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCallout.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCallout.java @@ -36,6 +36,8 @@ protected TurnEventGenerativeAICalledCallout() {} /** * Gets the searchCalled. * + *

Whether the document search engine was called. + * * @return the searchCalled */ public Boolean isSearchCalled() { @@ -45,6 +47,8 @@ public Boolean isSearchCalled() { /** * Gets the llmCalled. * + *

Whether watsonx.ai was called during answer generation. + * * @return the llmCalled */ public Boolean isLlmCalled() { @@ -72,6 +76,9 @@ public TurnEventGenerativeAICalledCalloutLlm getLlm() { /** * Gets the idkReasonCode. * + *

Indicates why a conversational search response resolved to an idk response. This field will + * only be available when the conversational search response is an idk response. + * * @return the idkReasonCode */ public String getIdkReasonCode() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlm.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlm.java index e449783b143..80d3f7f9190 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlm.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlm.java @@ -43,6 +43,8 @@ protected TurnEventGenerativeAICalledCalloutLlm() {} /** * Gets the type. * + *

The name of the LLM engine called by the system. + * * @return the type */ public String getType() { @@ -52,6 +54,8 @@ public String getType() { /** * Gets the modelId. * + *

The LLM model used to generate the response. + * * @return the modelId */ public String getModelId() { @@ -61,6 +65,9 @@ public String getModelId() { /** * Gets the modelClassId. * + *

The watsonx.ai class ID that was used during the answer generation request to the LLM. This + * is only included when a request to the LLM has been made by the system. + * * @return the modelClassId */ public String getModelClassId() { @@ -70,6 +77,9 @@ public String getModelClassId() { /** * Gets the generatedTokenCount. * + *

The number of tokens that were generated in the response by the LLM. This is only included + * when a request to the LLM was successful and a response was generated. + * * @return the generatedTokenCount */ public Long getGeneratedTokenCount() { @@ -79,6 +89,9 @@ public Long getGeneratedTokenCount() { /** * Gets the inputTokenCount. * + *

The number of tokens that were sent to the LLM during answer generation. This is only + * included when a request to the LLM has been made by the system. + * * @return the inputTokenCount */ public Long getInputTokenCount() { @@ -88,6 +101,8 @@ public Long getInputTokenCount() { /** * Gets the success. * + *

Whether the answer generation request to the LLM was successful. + * * @return the success */ public Boolean isSuccess() { @@ -106,6 +121,8 @@ public TurnEventGenerativeAICalledCalloutLlmResponse getResponse() { /** * Gets the request. * + *

n array of objects containing the search results. + * * @return the request */ public List getRequest() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlmResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlmResponse.java index 0b6b4b396e9..2e5013f567c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlmResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutLlmResponse.java @@ -32,6 +32,8 @@ protected TurnEventGenerativeAICalledCalloutLlmResponse() {} /** * Gets the text. * + *

The LLM response that is returned. + * * @return the text */ public String getText() { @@ -41,6 +43,8 @@ public String getText() { /** * Gets the responseType. * + *

The type of response that is returned. + * * @return the responseType */ public String getResponseType() { @@ -50,6 +54,8 @@ public String getResponseType() { /** * Gets the isIdkResponse. * + *

Whether the response is an idk response. + * * @return the isIdkResponse */ public Boolean isIsIdkResponse() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutSearch.java index ce03cc2beba..890fd8508e7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutSearch.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledCalloutSearch.java @@ -29,6 +29,8 @@ protected TurnEventGenerativeAICalledCalloutSearch() {} /** * Gets the engine. * + *

The search engine that was used to scan the documents. + * * @return the engine */ public String getEngine() { @@ -38,6 +40,9 @@ public String getEngine() { /** * Gets the index. * + *

The name of the Elasticsearch index being used. This field is only available if the engine + * being used is Elasticsearch. + * * @return the index */ public String getIndex() { @@ -47,6 +52,8 @@ public String getIndex() { /** * Gets the query. * + *

The query that will be used by the system to initiate search on the document search engine. + * * @return the query */ public String getQuery() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledMetrics.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledMetrics.java index cb3bb31154a..7c433d0fd64 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledMetrics.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventGenerativeAICalledMetrics.java @@ -33,6 +33,9 @@ protected TurnEventGenerativeAICalledMetrics() {} /** * Gets the searchTimeMs. * + *

The amount of time (in milliseconds) it took for the system to complete the search using the + * document search engine. + * * @return the searchTimeMs */ public Double getSearchTimeMs() { @@ -42,6 +45,9 @@ public Double getSearchTimeMs() { /** * Gets the answerGenerationTimeMs. * + *

The amount of time (in milliseconds) it took for the system to complete answer generation + * process by reaching out to watsonx.ai. + * * @return the answerGenerationTimeMs */ public Double getAnswerGenerationTimeMs() { @@ -51,6 +57,9 @@ public Double getAnswerGenerationTimeMs() { /** * Gets the totalTimeMs. * + *

The amount of time (in milliseconds) it took for the system to fully process the + * conversational search. + * * @return the totalTimeMs */ public Double getTotalTimeMs() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java index e9829031bdf..18a8394b2d5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java @@ -198,23 +198,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java index 4381f894755..b82bcd54c36 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java @@ -180,23 +180,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ From f031c349bdccdb4fd38c7cad1602aefaccb12b9b Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Wed, 8 Oct 2025 13:32:33 -0500 Subject: [PATCH 2/3] feat(wa-v2): add environmentId param to sessions functions and update sdk headers BREAKING CHANGE: `assistantId` and `environmentId` are now required parameters for the `createSession` and `deleteSession` functions --- .../ibm/watson/assistant/v2/Assistant.java | 80 +++++++++---------- .../v2/model/CreateSessionOptions.java | 54 ++++++++----- .../v2/model/DeleteSessionOptions.java | 54 ++++++++----- .../watson/assistant/v2/AssistantTest.java | 12 ++- .../v2/model/CreateSessionOptionsTest.java | 4 +- .../v2/model/DeleteSessionOptionsTest.java | 4 +- 6 files changed, 124 insertions(+), 84 deletions(-) diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java index 309911e6e47..a76f0062a43 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java @@ -195,8 +195,7 @@ public ServiceCall createProvider(CreateProviderOptions create createProviderOptions, "createProviderOptions cannot be null"); RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/providers")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "createProvider"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "createProvider"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -234,7 +233,7 @@ public ServiceCall listProviders(ListProvidersOptions listPr } RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/providers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "listProviders"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "listProviders"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -290,8 +289,7 @@ public ServiceCall updateProvider(UpdateProviderOptions update RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/providers/{provider_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "updateProvider"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "updateProvider"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -330,8 +328,7 @@ public ServiceCall createAssistant(CreateAssistantOptions createA } RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/assistants")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "createAssistant"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "createAssistant"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -383,8 +380,7 @@ public ServiceCall listAssistants( } RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/assistants")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "listAssistants"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "listAssistants"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -440,8 +436,7 @@ public ServiceCall deleteAssistant(DeleteAssistantOptions deleteAssistantO RequestBuilder.delete( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "deleteAssistant"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "deleteAssistant"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -468,11 +463,14 @@ public ServiceCall createSession(CreateSessionOptions createSes createSessionOptions, "createSessionOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("assistant_id", createSessionOptions.assistantId()); + pathParamsMap.put("environment_id", createSessionOptions.environmentId()); RequestBuilder builder = RequestBuilder.post( RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v2/assistants/{assistant_id}/sessions", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "createSession"); + getServiceUrl(), + "/v2/assistants/{assistant_id}/environments/{environment_id}/sessions", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "createSession"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -508,14 +506,15 @@ public ServiceCall deleteSession(DeleteSessionOptions deleteSessionOptions deleteSessionOptions, "deleteSessionOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("assistant_id", deleteSessionOptions.assistantId()); + pathParamsMap.put("environment_id", deleteSessionOptions.environmentId()); pathParamsMap.put("session_id", deleteSessionOptions.sessionId()); RequestBuilder builder = RequestBuilder.delete( RequestBuilder.resolveRequestUrl( getServiceUrl(), - "/v2/assistants/{assistant_id}/sessions/{session_id}", + "/v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "deleteSession"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "deleteSession"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -546,7 +545,7 @@ public ServiceCall message(MessageOptions messageOption getServiceUrl(), "/v2/assistants/{assistant_id}/sessions/{session_id}/message", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "message"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "message"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -647,7 +646,7 @@ public ServiceCall messageStream(MessageStreamOptions messageStream getServiceUrl(), "/v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}/message_stream", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "messageStream"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "messageStream"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -698,7 +697,7 @@ public ServiceCall messageStreamStateless( "/v2/assistants/{assistant_id}/environments/{environment_id}/message_stream", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "messageStreamStateless"); + SdkCommon.getSdkHeaders("assistant", "v2", "messageStreamStateless"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -746,7 +745,7 @@ public ServiceCall bulkClassify(BulkClassifyOptions bulkCl RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/skills/{skill_id}/workspace/bulk_classify", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "bulkClassify"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "bulkClassify"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -788,7 +787,7 @@ public ServiceCall listLogs(ListLogsOptions listLogsOptions) { RequestBuilder.get( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/logs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "listLogs"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "listLogs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -837,8 +836,7 @@ public ServiceCall deleteUserData(DeleteUserDataOptions deleteUserDataOpti deleteUserDataOptions, "deleteUserDataOptions cannot be null"); RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/user_data")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "deleteUserData"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "deleteUserData"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -868,8 +866,7 @@ public ServiceCall listEnvironments( RequestBuilder.get( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/environments", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "listEnvironments"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "listEnvironments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -918,8 +915,7 @@ public ServiceCall getEnvironment(GetEnvironmentOptions getEnvironm getServiceUrl(), "/v2/assistants/{assistant_id}/environments/{environment_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "getEnvironment"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "getEnvironment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -959,7 +955,7 @@ public ServiceCall updateEnvironment( "/v2/assistants/{assistant_id}/environments/{environment_id}", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "updateEnvironment"); + SdkCommon.getSdkHeaders("assistant", "v2", "updateEnvironment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1013,7 +1009,7 @@ public ServiceCall createRelease(CreateReleaseOptions createReleaseOpti RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/releases", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "createRelease"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "createRelease"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1048,7 +1044,7 @@ public ServiceCall listReleases(ListReleasesOptions listRelea RequestBuilder.get( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/releases", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "listReleases"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "listReleases"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1100,7 +1096,7 @@ public ServiceCall getRelease(GetReleaseOptions getReleaseOptions) { getServiceUrl(), "/v2/assistants/{assistant_id}/releases/{release}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "getRelease"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "getRelease"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1137,7 +1133,7 @@ public ServiceCall deleteRelease(DeleteReleaseOptions deleteReleaseOptions getServiceUrl(), "/v2/assistants/{assistant_id}/releases/{release}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "deleteRelease"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "deleteRelease"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1169,7 +1165,7 @@ public ServiceCall deployRelease(DeployReleaseOptions deployRelease getServiceUrl(), "/v2/assistants/{assistant_id}/releases/{release}/deploy", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "deployRelease"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "deployRelease"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1216,7 +1212,7 @@ public ServiceCall createReleaseExport( "/v2/assistants/{assistant_id}/releases/{release}/export", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "createReleaseExport"); + SdkCommon.getSdkHeaders("assistant", "v2", "createReleaseExport"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1268,7 +1264,7 @@ public ServiceCall downloadReleaseExport( "/v2/assistants/{assistant_id}/releases/{release}/export", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "downloadReleaseExport"); + SdkCommon.getSdkHeaders("assistant", "v2", "downloadReleaseExport"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1320,7 +1316,7 @@ public ServiceCall downloadReleaseExportAsStream( "/v2/assistants/{assistant_id}/releases/{release}/export", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "downloadReleaseExportAsStream"); + SdkCommon.getSdkHeaders("assistant", "v2", "downloadReleaseExportAsStream"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1368,7 +1364,7 @@ public ServiceCall createReleaseImport( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/import", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "createReleaseImport"); + SdkCommon.getSdkHeaders("assistant", "v2", "createReleaseImport"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1407,7 +1403,7 @@ public ServiceCall getReleaseImpo RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/import", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "getReleaseImportStatus"); + SdkCommon.getSdkHeaders("assistant", "v2", "getReleaseImportStatus"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1441,7 +1437,7 @@ public ServiceCall getSkill(GetSkillOptions getSkillOptions) { RequestBuilder.get( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/skills/{skill_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "getSkill"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "getSkill"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1474,7 +1470,7 @@ public ServiceCall updateSkill(UpdateSkillOptions updateSkillOptions) { RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/skills/{skill_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "updateSkill"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "updateSkill"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1544,7 +1540,7 @@ public ServiceCall exportSkills(ExportSkillsOptions exportSkillsOp RequestBuilder.get( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/skills_export", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "exportSkills"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "exportSkills"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1586,7 +1582,7 @@ public ServiceCall importSkills( RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), "/v2/assistants/{assistant_id}/skills_import", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "importSkills"); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "importSkills"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1634,7 +1630,7 @@ public ServiceCall importSkillsStatus( "/v2/assistants/{assistant_id}/skills_import/status", pathParamsMap)); Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "importSkillsStatus"); + SdkCommon.getSdkHeaders("assistant", "v2", "importSkillsStatus"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java index f6e5ee6fdf0..2cd69d28c8e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java @@ -19,11 +19,13 @@ public class CreateSessionOptions extends GenericModel { protected String assistantId; + protected String environmentId; protected RequestAnalytics analytics; /** Builder. */ public static class Builder { private String assistantId; + private String environmentId; private RequestAnalytics analytics; /** @@ -33,6 +35,7 @@ public static class Builder { */ private Builder(CreateSessionOptions createSessionOptions) { this.assistantId = createSessionOptions.assistantId; + this.environmentId = createSessionOptions.environmentId; this.analytics = createSessionOptions.analytics; } @@ -43,9 +46,11 @@ public Builder() {} * Instantiates a new builder with required properties. * * @param assistantId the assistantId + * @param environmentId the environmentId */ - public Builder(String assistantId) { + public Builder(String assistantId, String environmentId) { this.assistantId = assistantId; + this.environmentId = environmentId; } /** @@ -68,6 +73,17 @@ public Builder assistantId(String assistantId) { return this; } + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the CreateSessionOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + /** * Set the analytics. * @@ -85,7 +101,10 @@ protected CreateSessionOptions() {} protected CreateSessionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); assistantId = builder.assistantId; + environmentId = builder.environmentId; analytics = builder.analytics; } @@ -101,23 +120,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ @@ -125,6 +130,19 @@ public String assistantId() { return assistantId; } + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + /** * Gets the analytics. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java index de7edfd5330..e0dac574a86 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java @@ -19,11 +19,13 @@ public class DeleteSessionOptions extends GenericModel { protected String assistantId; + protected String environmentId; protected String sessionId; /** Builder. */ public static class Builder { private String assistantId; + private String environmentId; private String sessionId; /** @@ -33,6 +35,7 @@ public static class Builder { */ private Builder(DeleteSessionOptions deleteSessionOptions) { this.assistantId = deleteSessionOptions.assistantId; + this.environmentId = deleteSessionOptions.environmentId; this.sessionId = deleteSessionOptions.sessionId; } @@ -43,10 +46,12 @@ public Builder() {} * Instantiates a new builder with required properties. * * @param assistantId the assistantId + * @param environmentId the environmentId * @param sessionId the sessionId */ - public Builder(String assistantId, String sessionId) { + public Builder(String assistantId, String environmentId, String sessionId) { this.assistantId = assistantId; + this.environmentId = environmentId; this.sessionId = sessionId; } @@ -70,6 +75,17 @@ public Builder assistantId(String assistantId) { return this; } + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the DeleteSessionOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + /** * Set the sessionId. * @@ -87,8 +103,11 @@ protected DeleteSessionOptions() {} protected DeleteSessionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.sessionId, "sessionId cannot be empty"); assistantId = builder.assistantId; + environmentId = builder.environmentId; sessionId = builder.sessionId; } @@ -104,23 +123,9 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID depending on the type of request: - * - *

- For message, session, and log requests, specify the environment ID of the environment - * where the assistant is deployed. - * - *

- For all other requests, specify the assistant ID of the assistant. - * - *

To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open - * the **Assistant settings** page, and scroll to the **Assistant IDs and API details** section - * and click **View Details**. - * - *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant - * ID. - * - *

To find the **assistant ID** in the user interface, open the **Assistant settings** and - * click **API Details**. + *

Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant + * interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API + * details** section and click **View Details**. * * @return the assistantId */ @@ -128,6 +133,19 @@ public String assistantId() { return assistantId; } + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + /** * Gets the sessionId. * diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java index 4bcfd6315b1..4e25f0d8d3d 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java @@ -644,7 +644,7 @@ public void testDeleteAssistantNoOptions() throws Throwable { public void testCreateSessionWOptions() throws Throwable { // Register a mock response String mockResponseBody = "{\"session_id\": \"sessionId\"}"; - String createSessionPath = "/v2/assistants/testString/sessions"; + String createSessionPath = "/v2/assistants/testString/environments/testString/sessions"; server.enqueue( new MockResponse() .setHeader("Content-type", "application/json") @@ -663,6 +663,7 @@ public void testCreateSessionWOptions() throws Throwable { CreateSessionOptions createSessionOptionsModel = new CreateSessionOptions.Builder() .assistantId("testString") + .environmentId("testString") .analytics(requestAnalyticsModel) .build(); @@ -708,13 +709,15 @@ public void testCreateSessionNoOptions() throws Throwable { public void testDeleteSessionWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteSessionPath = "/v2/assistants/testString/sessions/testString"; + String deleteSessionPath = + "/v2/assistants/testString/environments/testString/sessions/testString"; server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody)); // Construct an instance of the DeleteSessionOptions model DeleteSessionOptions deleteSessionOptionsModel = new DeleteSessionOptions.Builder() .assistantId("testString") + .environmentId("testString") .sessionId("testString") .build(); @@ -760,7 +763,8 @@ public void testMessageWOptions() throws Throwable { // Register a mock response String mockResponseBody = "{\"output\": {\"generic\": [{\"response_type\": \"conversation_search\", \"text\": \"text\", \"citations_title\": \"citationsTitle\", \"citations\": [{\"title\": \"title\", \"text\": \"text\", \"body\": \"body\", \"search_result_index\": 17, \"ranges\": [{\"start\": 5, \"end\": 3}]}], \"confidence_scores\": {\"threshold\": 9, \"pre_gen\": 6, \"post_gen\": 7, \"extractiveness\": 14}, \"response_length_option\": \"responseLengthOption\", \"search_results\": [{\"result_metadata\": {\"document_retrieval_source\": \"documentRetrievalSource\", \"score\": 5}, \"id\": \"id\", \"title\": \"title\", \"body\": \"body\"}], \"disclaimer\": \"disclaimer\"}], \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"actions\": [{\"name\": \"name\", \"type\": \"client\", \"parameters\": {\"anyKey\": \"anyValue\"}, \"result_variable\": \"resultVariable\", \"credentials\": \"credentials\"}], \"debug\": {\"nodes_visited\": [{\"dialog_node\": \"dialogNode\", \"title\": \"title\", \"conditions\": \"conditions\"}], \"log_messages\": [{\"level\": \"info\", \"message\": \"message\", \"code\": \"code\", \"source\": {\"type\": \"dialog_node\", \"dialog_node\": \"dialogNode\"}}], \"branch_exited\": true, \"branch_exited_reason\": \"completed\", \"turn_events\": [{\"event\": \"action_visited\", \"source\": {\"type\": \"action\", \"action\": \"action\", \"action_title\": \"actionTitle\", \"condition\": \"condition\"}, \"action_start_time\": \"actionStartTime\", \"condition_type\": \"user_defined\", \"reason\": \"intent\", \"result_variable\": \"resultVariable\"}]}, \"user_defined\": {\"anyKey\": \"anyValue\"}, \"spelling\": {\"text\": \"text\", \"original_text\": \"originalText\", \"suggested_text\": \"suggestedText\"}, \"llm_metadata\": [{\"task\": \"task\", \"model_id\": \"modelId\"}]}, \"context\": {\"global\": {\"system\": {\"timezone\": \"timezone\", \"user_id\": \"userId\", \"turn_count\": 9, \"locale\": \"en-us\", \"reference_time\": \"referenceTime\", \"session_start_time\": \"sessionStartTime\", \"state\": \"state\", \"skip_user_input\": false}, \"session_id\": \"sessionId\"}, \"skills\": {\"main skill\": {\"user_defined\": {\"anyKey\": \"anyValue\"}, \"system\": {\"state\": \"state\"}}, \"actions skill\": {\"user_defined\": {\"anyKey\": \"anyValue\"}, \"system\": {\"state\": \"state\"}, \"action_variables\": {\"anyKey\": \"anyValue\"}, \"skill_variables\": {\"anyKey\": \"anyValue\"}}}, \"integrations\": {\"anyKey\": \"anyValue\"}}, \"user_id\": \"userId\", \"masked_output\": {\"generic\": [{\"response_type\": \"conversation_search\", \"text\": \"text\", \"citations_title\": \"citationsTitle\", \"citations\": [{\"title\": \"title\", \"text\": \"text\", \"body\": \"body\", \"search_result_index\": 17, \"ranges\": [{\"start\": 5, \"end\": 3}]}], \"confidence_scores\": {\"threshold\": 9, \"pre_gen\": 6, \"post_gen\": 7, \"extractiveness\": 14}, \"response_length_option\": \"responseLengthOption\", \"search_results\": [{\"result_metadata\": {\"document_retrieval_source\": \"documentRetrievalSource\", \"score\": 5}, \"id\": \"id\", \"title\": \"title\", \"body\": \"body\"}], \"disclaimer\": \"disclaimer\"}], \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"actions\": [{\"name\": \"name\", \"type\": \"client\", \"parameters\": {\"anyKey\": \"anyValue\"}, \"result_variable\": \"resultVariable\", \"credentials\": \"credentials\"}], \"debug\": {\"nodes_visited\": [{\"dialog_node\": \"dialogNode\", \"title\": \"title\", \"conditions\": \"conditions\"}], \"log_messages\": [{\"level\": \"info\", \"message\": \"message\", \"code\": \"code\", \"source\": {\"type\": \"dialog_node\", \"dialog_node\": \"dialogNode\"}}], \"branch_exited\": true, \"branch_exited_reason\": \"completed\", \"turn_events\": [{\"event\": \"action_visited\", \"source\": {\"type\": \"action\", \"action\": \"action\", \"action_title\": \"actionTitle\", \"condition\": \"condition\"}, \"action_start_time\": \"actionStartTime\", \"condition_type\": \"user_defined\", \"reason\": \"intent\", \"result_variable\": \"resultVariable\"}]}, \"user_defined\": {\"anyKey\": \"anyValue\"}, \"spelling\": {\"text\": \"text\", \"original_text\": \"originalText\", \"suggested_text\": \"suggestedText\"}, \"llm_metadata\": [{\"task\": \"task\", \"model_id\": \"modelId\"}]}, \"masked_input\": {\"message_type\": \"text\", \"text\": \"text\", \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"suggestion_id\": \"suggestionId\", \"attachments\": [{\"url\": \"url\", \"media_type\": \"mediaType\"}], \"analytics\": {\"browser\": \"browser\", \"device\": \"device\", \"pageUrl\": \"pageUrl\"}, \"options\": {\"restart\": false, \"alternate_intents\": false, \"async_callout\": false, \"spelling\": {\"suggestions\": false, \"auto_correct\": false}, \"debug\": false, \"return_context\": false, \"export\": false}}}"; - String messagePath = "/v2/assistants/testString/sessions/testString/message"; + String messagePath = + "/v2/assistants/testString/environments/testString/sessions/testString/message"; server.enqueue( new MockResponse() .setHeader("Content-type", "application/json") @@ -988,7 +992,7 @@ public void testMessageStatelessWOptions() throws Throwable { // Register a mock response String mockResponseBody = "{\"output\": {\"generic\": [{\"response_type\": \"conversation_search\", \"text\": \"text\", \"citations_title\": \"citationsTitle\", \"citations\": [{\"title\": \"title\", \"text\": \"text\", \"body\": \"body\", \"search_result_index\": 17, \"ranges\": [{\"start\": 5, \"end\": 3}]}], \"confidence_scores\": {\"threshold\": 9, \"pre_gen\": 6, \"post_gen\": 7, \"extractiveness\": 14}, \"response_length_option\": \"responseLengthOption\", \"search_results\": [{\"result_metadata\": {\"document_retrieval_source\": \"documentRetrievalSource\", \"score\": 5}, \"id\": \"id\", \"title\": \"title\", \"body\": \"body\"}], \"disclaimer\": \"disclaimer\"}], \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"actions\": [{\"name\": \"name\", \"type\": \"client\", \"parameters\": {\"anyKey\": \"anyValue\"}, \"result_variable\": \"resultVariable\", \"credentials\": \"credentials\"}], \"debug\": {\"nodes_visited\": [{\"dialog_node\": \"dialogNode\", \"title\": \"title\", \"conditions\": \"conditions\"}], \"log_messages\": [{\"level\": \"info\", \"message\": \"message\", \"code\": \"code\", \"source\": {\"type\": \"dialog_node\", \"dialog_node\": \"dialogNode\"}}], \"branch_exited\": true, \"branch_exited_reason\": \"completed\", \"turn_events\": [{\"event\": \"action_visited\", \"source\": {\"type\": \"action\", \"action\": \"action\", \"action_title\": \"actionTitle\", \"condition\": \"condition\"}, \"action_start_time\": \"actionStartTime\", \"condition_type\": \"user_defined\", \"reason\": \"intent\", \"result_variable\": \"resultVariable\"}]}, \"user_defined\": {\"anyKey\": \"anyValue\"}, \"spelling\": {\"text\": \"text\", \"original_text\": \"originalText\", \"suggested_text\": \"suggestedText\"}, \"llm_metadata\": [{\"task\": \"task\", \"model_id\": \"modelId\"}]}, \"context\": {\"global\": {\"system\": {\"timezone\": \"timezone\", \"user_id\": \"userId\", \"turn_count\": 9, \"locale\": \"en-us\", \"reference_time\": \"referenceTime\", \"session_start_time\": \"sessionStartTime\", \"state\": \"state\", \"skip_user_input\": false}, \"session_id\": \"sessionId\"}, \"skills\": {\"main skill\": {\"user_defined\": {\"anyKey\": \"anyValue\"}, \"system\": {\"state\": \"state\"}}, \"actions skill\": {\"user_defined\": {\"anyKey\": \"anyValue\"}, \"system\": {\"state\": \"state\"}, \"action_variables\": {\"anyKey\": \"anyValue\"}, \"skill_variables\": {\"anyKey\": \"anyValue\"}, \"private_action_variables\": {\"anyKey\": \"anyValue\"}, \"private_skill_variables\": {\"anyKey\": \"anyValue\"}}}, \"integrations\": {\"anyKey\": \"anyValue\"}}, \"masked_output\": {\"generic\": [{\"response_type\": \"conversation_search\", \"text\": \"text\", \"citations_title\": \"citationsTitle\", \"citations\": [{\"title\": \"title\", \"text\": \"text\", \"body\": \"body\", \"search_result_index\": 17, \"ranges\": [{\"start\": 5, \"end\": 3}]}], \"confidence_scores\": {\"threshold\": 9, \"pre_gen\": 6, \"post_gen\": 7, \"extractiveness\": 14}, \"response_length_option\": \"responseLengthOption\", \"search_results\": [{\"result_metadata\": {\"document_retrieval_source\": \"documentRetrievalSource\", \"score\": 5}, \"id\": \"id\", \"title\": \"title\", \"body\": \"body\"}], \"disclaimer\": \"disclaimer\"}], \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"actions\": [{\"name\": \"name\", \"type\": \"client\", \"parameters\": {\"anyKey\": \"anyValue\"}, \"result_variable\": \"resultVariable\", \"credentials\": \"credentials\"}], \"debug\": {\"nodes_visited\": [{\"dialog_node\": \"dialogNode\", \"title\": \"title\", \"conditions\": \"conditions\"}], \"log_messages\": [{\"level\": \"info\", \"message\": \"message\", \"code\": \"code\", \"source\": {\"type\": \"dialog_node\", \"dialog_node\": \"dialogNode\"}}], \"branch_exited\": true, \"branch_exited_reason\": \"completed\", \"turn_events\": [{\"event\": \"action_visited\", \"source\": {\"type\": \"action\", \"action\": \"action\", \"action_title\": \"actionTitle\", \"condition\": \"condition\"}, \"action_start_time\": \"actionStartTime\", \"condition_type\": \"user_defined\", \"reason\": \"intent\", \"result_variable\": \"resultVariable\"}]}, \"user_defined\": {\"anyKey\": \"anyValue\"}, \"spelling\": {\"text\": \"text\", \"original_text\": \"originalText\", \"suggested_text\": \"suggestedText\"}, \"llm_metadata\": [{\"task\": \"task\", \"model_id\": \"modelId\"}]}, \"masked_input\": {\"message_type\": \"text\", \"text\": \"text\", \"intents\": [{\"intent\": \"intent\", \"confidence\": 10, \"skill\": \"skill\"}], \"entities\": [{\"entity\": \"entity\", \"location\": [8], \"value\": \"value\", \"confidence\": 10, \"groups\": [{\"group\": \"group\", \"location\": [8]}], \"interpretation\": {\"calendar_type\": \"calendarType\", \"datetime_link\": \"datetimeLink\", \"festival\": \"festival\", \"granularity\": \"day\", \"range_link\": \"rangeLink\", \"range_modifier\": \"rangeModifier\", \"relative_day\": 11, \"relative_month\": 13, \"relative_week\": 12, \"relative_weekend\": 15, \"relative_year\": 12, \"specific_day\": 11, \"specific_day_of_week\": \"specificDayOfWeek\", \"specific_month\": 13, \"specific_quarter\": 15, \"specific_year\": 12, \"numeric_value\": 12, \"subtype\": \"subtype\", \"part_of_day\": \"partOfDay\", \"relative_hour\": 12, \"relative_minute\": 14, \"relative_second\": 14, \"specific_hour\": 12, \"specific_minute\": 14, \"specific_second\": 14, \"timezone\": \"timezone\"}, \"alternatives\": [{\"value\": \"value\", \"confidence\": 10}], \"role\": {\"type\": \"date_from\"}, \"skill\": \"skill\"}], \"suggestion_id\": \"suggestionId\", \"attachments\": [{\"url\": \"url\", \"media_type\": \"mediaType\"}], \"analytics\": {\"browser\": \"browser\", \"device\": \"device\", \"pageUrl\": \"pageUrl\"}, \"options\": {\"restart\": false, \"alternate_intents\": false, \"async_callout\": false, \"spelling\": {\"suggestions\": false, \"auto_correct\": false}, \"debug\": false, \"return_context\": false, \"export\": false}}, \"user_id\": \"userId\"}"; - String messageStatelessPath = "/v2/assistants/testString/message"; + String messageStatelessPath = "/v2/assistants/testString/environments/testString/message"; server.enqueue( new MockResponse() .setHeader("Content-type", "application/json") diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateSessionOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateSessionOptionsTest.java index 92a440b1f5c..89d51537a6b 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateSessionOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateSessionOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -43,9 +43,11 @@ public void testCreateSessionOptions() throws Throwable { CreateSessionOptions createSessionOptionsModel = new CreateSessionOptions.Builder() .assistantId("testString") + .environmentId("testString") .analytics(requestAnalyticsModel) .build(); assertEquals(createSessionOptionsModel.assistantId(), "testString"); + assertEquals(createSessionOptionsModel.environmentId(), "testString"); assertEquals(createSessionOptionsModel.analytics(), requestAnalyticsModel); } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptionsTest.java index 9673ca3bf6a..de5c02dbffa 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,9 +33,11 @@ public void testDeleteSessionOptions() throws Throwable { DeleteSessionOptions deleteSessionOptionsModel = new DeleteSessionOptions.Builder() .assistantId("testString") + .environmentId("testString") .sessionId("testString") .build(); assertEquals(deleteSessionOptionsModel.assistantId(), "testString"); + assertEquals(deleteSessionOptionsModel.environmentId(), "testString"); assertEquals(deleteSessionOptionsModel.sessionId(), "testString"); } From 5e304a0941731a96f9ce74712c74c3c9ef886f03 Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Wed, 8 Oct 2025 13:44:42 -0500 Subject: [PATCH 3/3] fix(wa-v2): fix missing path parameter in HTTP request creation for message functions --- .../main/java/com/ibm/watson/assistant/v2/Assistant.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java index a76f0062a43..0316d173cb7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java @@ -543,7 +543,7 @@ public ServiceCall message(MessageOptions messageOption RequestBuilder.post( RequestBuilder.resolveRequestUrl( getServiceUrl(), - "/v2/assistants/{assistant_id}/sessions/{session_id}/message", + "/v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}/message", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "message"); for (Entry header : sdkHeaders.entrySet()) { @@ -592,9 +592,10 @@ public ServiceCall messageStateless( RequestBuilder builder = RequestBuilder.post( RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v2/assistants/{assistant_id}/message", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("conversation", "v2", "messageStateless"); + getServiceUrl(), + "/v2/assistants/{assistant_id}/environments/{environment_id}/message", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("assistant", "v2", "messageStateless"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); }