Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/main/java/com/google/genai/Batches.java
Original file line number Diff line number Diff line change
Expand Up @@ -1095,11 +1095,6 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) {
Common.setValueByPath(
toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"}));
}

if (Common.getValueByPath(fromObject, new String[] {"args"}) != null) {
Common.setValueByPath(
toObject,
Expand Down Expand Up @@ -1846,10 +1841,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down
27 changes: 14 additions & 13 deletions src/main/java/com/google/genai/Caches.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,6 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) {
Common.setValueByPath(
toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"}));
}

if (Common.getValueByPath(fromObject, new String[] {"args"}) != null) {
Common.setValueByPath(
toObject,
Expand Down Expand Up @@ -818,10 +813,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down Expand Up @@ -925,10 +923,13 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down
27 changes: 14 additions & 13 deletions src/main/java/com/google/genai/LiveConverters.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) {
Common.setValueByPath(
toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"}));
}

if (Common.getValueByPath(fromObject, new String[] {"args"}) != null) {
Common.setValueByPath(
toObject,
Expand Down Expand Up @@ -1693,10 +1688,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down Expand Up @@ -1800,10 +1798,13 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/com/google/genai/Models.java
Original file line number Diff line number Diff line change
Expand Up @@ -1316,11 +1316,6 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNod
ObjectNode functionCallToMldev(
JsonNode fromObject, ObjectNode parentObject, JsonNode rootObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) {
Common.setValueByPath(
toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"}));
}

if (Common.getValueByPath(fromObject, new String[] {"args"}) != null) {
Common.setValueByPath(
toObject,
Expand Down Expand Up @@ -4156,10 +4151,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject, JsonNode ro
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/com/google/genai/TokensConverters.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"id"}) != null) {
Common.setValueByPath(
toObject, new String[] {"id"}, Common.getValueByPath(fromObject, new String[] {"id"}));
}

if (Common.getValueByPath(fromObject, new String[] {"args"}) != null) {
Common.setValueByPath(
toObject,
Expand Down Expand Up @@ -562,10 +557,13 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
}

if (Common.getValueByPath(fromObject, new String[] {"functionResponse"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"functionResponse"},
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
JsonNode functionResponseNode =
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"functionResponse"}));
if (functionResponseNode instanceof ObjectNode) {
((ObjectNode) functionResponseNode).remove("id");
}
Common.setValueByPath(toObject, new String[] {"functionResponse"}, functionResponseNode);
}

if (Common.getValueByPath(fromObject, new String[] {"inlineData"}) != null) {
Expand Down
Loading