Skip to content

Commit 07f985b

Browse files
fix(wa-v2): add missing turn events
This commit updates missing turn event discriminators that, when returned from the server, were breaking the java sdk with deserialization errors.
1 parent 9ef627d commit 07f985b

File tree

57 files changed

+2960
-58
lines changed

Some content is hidden

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

57 files changed

+2960
-58
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
/** ClientAction. */
20+
public class ClientAction extends GenericModel {
21+
22+
/** The skill that is requesting the action. Included only if **type**=`client`. */
23+
public interface Skill {
24+
/** main skill. */
25+
String MAIN_SKILL = "main skill";
26+
/** actions skill. */
27+
String ACTIONS_SKILL = "actions skill";
28+
}
29+
30+
protected String name;
31+
32+
@SerializedName("result_variable")
33+
protected String resultVariable;
34+
35+
protected String type;
36+
protected String skill;
37+
protected ClientActionParameters parameters;
38+
39+
protected ClientAction() {}
40+
41+
/**
42+
* Gets the name.
43+
*
44+
* <p>The name of the client action.
45+
*
46+
* @return the name
47+
*/
48+
public String getName() {
49+
return name;
50+
}
51+
52+
/**
53+
* Gets the resultVariable.
54+
*
55+
* @return the resultVariable
56+
*/
57+
public String getResultVariable() {
58+
return resultVariable;
59+
}
60+
61+
/**
62+
* Gets the type.
63+
*
64+
* @return the type
65+
*/
66+
public String getType() {
67+
return type;
68+
}
69+
70+
/**
71+
* Gets the skill.
72+
*
73+
* <p>The skill that is requesting the action. Included only if **type**=`client`.
74+
*
75+
* @return the skill
76+
*/
77+
public String getSkill() {
78+
return skill;
79+
}
80+
81+
/**
82+
* Gets the parameters.
83+
*
84+
* @return the parameters
85+
*/
86+
public ClientActionParameters getParameters() {
87+
return parameters;
88+
}
89+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
/** ClientActionParameters. */
20+
public class ClientActionParameters extends GenericModel {
21+
22+
@SerializedName("account_id")
23+
protected String accountId;
24+
25+
protected String hash;
26+
protected String alias;
27+
28+
protected ClientActionParameters() {}
29+
30+
/**
31+
* Gets the accountId.
32+
*
33+
* @return the accountId
34+
*/
35+
public String getAccountId() {
36+
return accountId;
37+
}
38+
39+
/**
40+
* Gets the hash.
41+
*
42+
* @return the hash
43+
*/
44+
public String getHash() {
45+
return hash;
46+
}
47+
48+
/**
49+
* Gets the alias.
50+
*
51+
* @return the alias
52+
*/
53+
public String getAlias() {
54+
return alias;
55+
}
56+
}
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: - GenerativeAITaskContentGroundedAnsweringTask -
23+
* GenerativeAITaskGeneralPurposeAnsweringTask
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", GenerativeAITaskContentGroundedAnsweringTask.class);
35+
discriminatorMapping.put(
36+
"general_purpose_answering", GenerativeAITaskGeneralPurposeAnsweringTask.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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
18+
/** GenerativeAITaskContentGroundedAnsweringTask. */
19+
public class GenerativeAITaskContentGroundedAnsweringTask extends GenerativeAITask {
20+
21+
@SerializedName("confidence_scores")
22+
protected GenerativeAITaskConfidenceScores confidenceScores;
23+
24+
protected GenerativeAITaskContentGroundedAnsweringTask() {}
25+
26+
/**
27+
* Gets the confidenceScores.
28+
*
29+
* <p>The confidence scores for determining whether to show the generated response or an “I don't
30+
* know” response.
31+
*
32+
* @return the confidenceScores
33+
*/
34+
public GenerativeAITaskConfidenceScores getConfidenceScores() {
35+
return confidenceScores;
36+
}
37+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy