Skip to content

Commit 34a7371

Browse files
jaycee-licopybara-github
authored andcommitted
chore: test TAP failure when adding a new field to Part
PiperOrigin-RevId: 868543245
1 parent 16f3a68 commit 34a7371

6 files changed

Lines changed: 57 additions & 0 deletions

File tree

src/main/java/com/google/genai/Batches.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
16591659
Common.getValueByPath(fromObject, new String[] {"mediaResolution"}));
16601660
}
16611661

1662+
if (Common.getValueByPath(fromObject, new String[] {"testJava"}) != null) {
1663+
Common.setValueByPath(
1664+
toObject,
1665+
new String[] {"testJava"},
1666+
Common.getValueByPath(fromObject, new String[] {"testJava"}));
1667+
}
1668+
16621669
if (Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"}) != null) {
16631670
Common.setValueByPath(
16641671
toObject,

src/main/java/com/google/genai/Caches.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
693693
Common.getValueByPath(fromObject, new String[] {"mediaResolution"}));
694694
}
695695

696+
if (Common.getValueByPath(fromObject, new String[] {"testJava"}) != null) {
697+
Common.setValueByPath(
698+
toObject,
699+
new String[] {"testJava"},
700+
Common.getValueByPath(fromObject, new String[] {"testJava"}));
701+
}
702+
696703
if (Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"}) != null) {
697704
Common.setValueByPath(
698705
toObject,

src/main/java/com/google/genai/LiveConverters.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
14571457
Common.getValueByPath(fromObject, new String[] {"mediaResolution"}));
14581458
}
14591459

1460+
if (Common.getValueByPath(fromObject, new String[] {"testJava"}) != null) {
1461+
Common.setValueByPath(
1462+
toObject,
1463+
new String[] {"testJava"},
1464+
Common.getValueByPath(fromObject, new String[] {"testJava"}));
1465+
}
1466+
14601467
if (Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"}) != null) {
14611468
Common.setValueByPath(
14621469
toObject,

src/main/java/com/google/genai/Models.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3772,6 +3772,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro
37723772
Common.getValueByPath(fromObject, new String[] {"mediaResolution"}));
37733773
}
37743774

3775+
if (Common.getValueByPath(fromObject, new String[] {"testJava"}) != null) {
3776+
Common.setValueByPath(
3777+
toObject,
3778+
new String[] {"testJava"},
3779+
Common.getValueByPath(fromObject, new String[] {"testJava"}));
3780+
}
3781+
37753782
if (Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"}) != null) {
37763783
Common.setValueByPath(
37773784
toObject,

src/main/java/com/google/genai/TokensConverters.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
438438
Common.getValueByPath(fromObject, new String[] {"mediaResolution"}));
439439
}
440440

441+
if (Common.getValueByPath(fromObject, new String[] {"testJava"}) != null) {
442+
Common.setValueByPath(
443+
toObject,
444+
new String[] {"testJava"},
445+
Common.getValueByPath(fromObject, new String[] {"testJava"}));
446+
}
447+
441448
if (Common.getValueByPath(fromObject, new String[] {"codeExecutionResult"}) != null) {
442449
Common.setValueByPath(
443450
toObject,

src/main/java/com/google/genai/types/Part.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public abstract class Part extends JsonSerializable {
4040
@JsonProperty("mediaResolution")
4141
public abstract Optional<PartMediaResolution> mediaResolution();
4242

43+
/** Test field for Java TAP. */
44+
@JsonProperty("testJava")
45+
public abstract Optional<String> testJava();
46+
4347
/** Optional. Result of executing the [ExecutableCode]. */
4448
@JsonProperty("codeExecutionResult")
4549
public abstract Optional<CodeExecutionResult> codeExecutionResult();
@@ -136,6 +140,24 @@ public Builder clearMediaResolution() {
136140
return mediaResolution(Optional.empty());
137141
}
138142

143+
/**
144+
* Setter for testJava.
145+
*
146+
* <p>testJava: Test field for Java TAP.
147+
*/
148+
@JsonProperty("testJava")
149+
public abstract Builder testJava(String testJava);
150+
151+
@ExcludeFromGeneratedCoverageReport
152+
abstract Builder testJava(Optional<String> testJava);
153+
154+
/** Clears the value of testJava field. */
155+
@ExcludeFromGeneratedCoverageReport
156+
@CanIgnoreReturnValue
157+
public Builder clearTestJava() {
158+
return testJava(Optional.empty());
159+
}
160+
139161
/**
140162
* Setter for codeExecutionResult.
141163
*

0 commit comments

Comments
 (0)