Skip to content

Commit 3ec3da0

Browse files
feat(wa-v2): add new turn event type
BREAKING CHANGE: conversationalSearch is now a required parameter when constructing SearchSettings Add new llmMetadata property Add new turn event TurnEventGenerativeAICalledCallout
1 parent e2aaf08 commit 3ec3da0

File tree

41 files changed

+1610
-73
lines changed

Some content is hidden

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

41 files changed

+1610
-73
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import com.google.gson.annotations.SerializedName;
1717
import com.ibm.cloud.sdk.core.service.model.GenericModel;
18+
import java.util.Map;
1819

1920
/** ClientAction. */
2021
public class ClientAction extends GenericModel {
@@ -34,7 +35,7 @@ public interface Skill {
3435

3536
protected String type;
3637
protected String skill;
37-
protected ClientActionParameters parameters;
38+
protected Map<String, Object> parameters;
3839

3940
protected ClientAction() {}
4041

@@ -52,6 +53,8 @@ public String getName() {
5253
/**
5354
* Gets the resultVariable.
5455
*
56+
* <p>The name of the variable that the results are stored in.
57+
*
5558
* @return the resultVariable
5659
*/
5760
public String getResultVariable() {
@@ -61,6 +64,8 @@ public String getResultVariable() {
6164
/**
6265
* Gets the type.
6366
*
67+
* <p>The type of turn event.
68+
*
6469
* @return the type
6570
*/
6671
public String getType() {
@@ -81,9 +86,11 @@ public String getSkill() {
8186
/**
8287
* Gets the parameters.
8388
*
89+
* <p>An object containing arbitrary variables that are included in the turn event.
90+
*
8491
* @return the parameters
8592
*/
86-
public ClientActionParameters getParameters() {
93+
public Map<String, Object> getParameters() {
8794
return parameters;
8895
}
8996
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2024, 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -32,6 +32,9 @@ public class FinalResponseOutput extends GenericModel {
3232

3333
protected MessageOutputSpelling spelling;
3434

35+
@SerializedName("llm_metadata")
36+
protected List<MessageOutputLLMMetadata> llmMetadata;
37+
3538
@SerializedName("streaming_metadata")
3639
protected MessageStreamMetadata streamingMetadata;
3740

@@ -116,6 +119,18 @@ public MessageOutputSpelling getSpelling() {
116119
return spelling;
117120
}
118121

122+
/**
123+
* Gets the llmMetadata.
124+
*
125+
* <p>An array of objects that provide information about calls to large language models that
126+
* occured as part of handling this message.
127+
*
128+
* @return the llmMetadata
129+
*/
130+
public List<MessageOutputLLMMetadata> getLlmMetadata() {
131+
return llmMetadata;
132+
}
133+
119134
/**
120135
* Gets the streamingMetadata.
121136
*
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.watson.assistant.v2.model;
15+
16+
import com.google.gson.annotations.SerializedName;
17+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
18+
19+
/**
20+
* GenerativeAITask.
21+
*
22+
* <p>Classes which extend this class: - GenerativeAITaskContentGroundedAnswering -
23+
* GenerativeAITaskGeneralPurposeAnswering
24+
*/
25+
public class GenerativeAITask extends GenericModel {
26+
@SuppressWarnings("unused")
27+
protected static String discriminatorPropertyName = "task";
28+
29+
protected static java.util.Map<String, Class<?>> discriminatorMapping;
30+
31+
static {
32+
discriminatorMapping = new java.util.HashMap<>();
33+
discriminatorMapping.put(
34+
"content_grounded_answering", GenerativeAITaskContentGroundedAnswering.class);
35+
discriminatorMapping.put(
36+
"general_purpose_answering", GenerativeAITaskGeneralPurposeAnswering.class);
37+
}
38+
39+
protected String task;
40+
41+
@SerializedName("is_idk_response")
42+
protected Boolean isIdkResponse;
43+
44+
@SerializedName("is_hap_detected")
45+
protected Boolean isHapDetected;
46+
47+
@SerializedName("confidence_scores")
48+
protected GenerativeAITaskConfidenceScores confidenceScores;
49+
50+
@SerializedName("original_response")
51+
protected String originalResponse;
52+
53+
@SerializedName("inferred_query")
54+
protected String inferredQuery;
55+
56+
protected GenerativeAITask() {}
57+
58+
/**
59+
* Gets the task.
60+
*
61+
* <p>The type of generative ai task.
62+
*
63+
* @return the task
64+
*/
65+
public String getTask() {
66+
return task;
67+
}
68+
69+
/**
70+
* Gets the isIdkResponse.
71+
*
72+
* <p>Whether response was an idk response.
73+
*
74+
* @return the isIdkResponse
75+
*/
76+
public Boolean isIsIdkResponse() {
77+
return isIdkResponse;
78+
}
79+
80+
/**
81+
* Gets the isHapDetected.
82+
*
83+
* <p>Whether response was a hap response.
84+
*
85+
* @return the isHapDetected
86+
*/
87+
public Boolean isIsHapDetected() {
88+
return isHapDetected;
89+
}
90+
91+
/**
92+
* Gets the confidenceScores.
93+
*
94+
* <p>The confidence scores for determining whether to show the generated response or an “I don't
95+
* know” response.
96+
*
97+
* @return the confidenceScores
98+
*/
99+
public GenerativeAITaskConfidenceScores getConfidenceScores() {
100+
return confidenceScores;
101+
}
102+
103+
/**
104+
* Gets the originalResponse.
105+
*
106+
* @return the originalResponse
107+
*/
108+
public String getOriginalResponse() {
109+
return originalResponse;
110+
}
111+
112+
/**
113+
* Gets the inferredQuery.
114+
*
115+
* @return the inferredQuery
116+
*/
117+
public String getInferredQuery() {
118+
return inferredQuery;
119+
}
120+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.watson.assistant.v2.model;
15+
16+
import com.google.gson.annotations.SerializedName;
17+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
18+
19+
/**
20+
* The confidence scores for determining whether to show the generated response or an “I don't know”
21+
* response.
22+
*/
23+
public class GenerativeAITaskConfidenceScores extends GenericModel {
24+
25+
@SerializedName("pre_gen")
26+
protected Double preGen;
27+
28+
@SerializedName("pre_gen_threshold")
29+
protected Double preGenThreshold;
30+
31+
@SerializedName("post_gen")
32+
protected Double postGen;
33+
34+
@SerializedName("post_gen_threshold")
35+
protected Double postGenThreshold;
36+
37+
protected GenerativeAITaskConfidenceScores() {}
38+
39+
/**
40+
* Gets the preGen.
41+
*
42+
* @return the preGen
43+
*/
44+
public Double getPreGen() {
45+
return preGen;
46+
}
47+
48+
/**
49+
* Gets the preGenThreshold.
50+
*
51+
* @return the preGenThreshold
52+
*/
53+
public Double getPreGenThreshold() {
54+
return preGenThreshold;
55+
}
56+
57+
/**
58+
* Gets the postGen.
59+
*
60+
* @return the postGen
61+
*/
62+
public Double getPostGen() {
63+
return postGen;
64+
}
65+
66+
/**
67+
* Gets the postGenThreshold.
68+
*
69+
* @return the postGenThreshold
70+
*/
71+
public Double getPostGenThreshold() {
72+
return postGenThreshold;
73+
}
74+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.watson.assistant.v2.model;
15+
16+
/** GenerativeAITaskContentGroundedAnswering. */
17+
public class GenerativeAITaskContentGroundedAnswering extends GenerativeAITask {
18+
19+
protected GenerativeAITaskContentGroundedAnswering() {}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.watson.assistant.v2.model;
15+
16+
/** GenerativeAITaskGeneralPurposeAnswering. */
17+
public class GenerativeAITaskGeneralPurposeAnswering extends GenerativeAITask {
18+
19+
protected GenerativeAITaskGeneralPurposeAnswering() {}
20+
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2024, 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -35,6 +35,9 @@ public class LogResponseOutput extends GenericModel {
3535

3636
protected MessageOutputSpelling spelling;
3737

38+
@SerializedName("llm_metadata")
39+
protected List<MessageOutputLLMMetadata> llmMetadata;
40+
3841
protected LogResponseOutput() {}
3942

4043
/**
@@ -115,4 +118,16 @@ public Map<String, Object> getUserDefined() {
115118
public MessageOutputSpelling getSpelling() {
116119
return spelling;
117120
}
121+
122+
/**
123+
* Gets the llmMetadata.
124+
*
125+
* <p>An array of objects that provide information about calls to large language models that
126+
* occured as part of handling this message.
127+
*
128+
* @return the llmMetadata
129+
*/
130+
public List<MessageOutputLLMMetadata> getLlmMetadata() {
131+
return llmMetadata;
132+
}
118133
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2018, 2024.
2+
* (C) Copyright IBM Corp. 2018, 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -32,6 +32,9 @@ public class MessageOutput extends GenericModel {
3232

3333
protected MessageOutputSpelling spelling;
3434

35+
@SerializedName("llm_metadata")
36+
protected List<MessageOutputLLMMetadata> llmMetadata;
37+
3538
protected MessageOutput() {}
3639

3740
/**
@@ -112,4 +115,16 @@ public Map<String, Object> getUserDefined() {
112115
public MessageOutputSpelling getSpelling() {
113116
return spelling;
114117
}
118+
119+
/**
120+
* Gets the llmMetadata.
121+
*
122+
* <p>An array of objects that provide information about calls to large language models that
123+
* occured as part of handling this message.
124+
*
125+
* @return the llmMetadata
126+
*/
127+
public List<MessageOutputLLMMetadata> getLlmMetadata() {
128+
return llmMetadata;
129+
}
115130
}

0 commit comments

Comments
 (0)