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
62 changes: 2 additions & 60 deletions src/main/java/com/google/genai/Batches.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,32 +554,6 @@ ObjectNode batchJobSourceToVertex(JsonNode fromObject, ObjectNode parentObject)
return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"data"},
Common.getValueByPath(fromObject, new String[] {"data"}));
}

if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) {
throw new IllegalArgumentException(
"displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
+ " Gemini Developer API mode.");
}

if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"mimeType"},
Common.getValueByPath(fromObject, new String[] {"mimeType"}));
}

return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode cancelBatchJobParametersToMldev(
ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) {
Expand Down Expand Up @@ -1100,32 +1074,6 @@ ObjectNode embeddingsBatchJobSourceToMldev(
return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) {
throw new IllegalArgumentException(
"displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
+ " Gemini Developer API mode.");
}

if (Common.getValueByPath(fromObject, new String[] {"fileUri"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"fileUri"},
Common.getValueByPath(fromObject, new String[] {"fileUri"}));
}

if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"mimeType"},
Common.getValueByPath(fromObject, new String[] {"mimeType"}));
}

return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
Expand Down Expand Up @@ -1898,10 +1846,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
Common.setValueByPath(
toObject,
new String[] {"fileData"},
fileDataToMldev(
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"fileData"})),
toObject));
Common.getValueByPath(fromObject, new String[] {"fileData"}));
}

if (Common.getValueByPath(fromObject, new String[] {"functionCall"}) != null) {
Expand All @@ -1925,10 +1870,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
Common.setValueByPath(
toObject,
new String[] {"inlineData"},
blobToMldev(
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"inlineData"})),
toObject));
Common.getValueByPath(fromObject, new String[] {"inlineData"}));
}

if (Common.getValueByPath(fromObject, new String[] {"text"}) != null) {
Expand Down
62 changes: 2 additions & 60 deletions src/main/java/com/google/genai/Caches.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,32 +109,6 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) {
return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (Common.getValueByPath(fromObject, new String[] {"data"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"data"},
Common.getValueByPath(fromObject, new String[] {"data"}));
}

if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) {
throw new IllegalArgumentException(
"displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
+ " Gemini Developer API mode.");
}

if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"mimeType"},
Common.getValueByPath(fromObject, new String[] {"mimeType"}));
}

return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode computerUseToVertex(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
Expand Down Expand Up @@ -479,32 +453,6 @@ ObjectNode deleteCachedContentResponseFromVertex(JsonNode fromObject, ObjectNode
return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode fileDataToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
if (!Common.isZero(Common.getValueByPath(fromObject, new String[] {"displayName"}))) {
throw new IllegalArgumentException(
"displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
+ " Gemini Developer API mode.");
}

if (Common.getValueByPath(fromObject, new String[] {"fileUri"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"fileUri"},
Common.getValueByPath(fromObject, new String[] {"fileUri"}));
}

if (Common.getValueByPath(fromObject, new String[] {"mimeType"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"mimeType"},
Common.getValueByPath(fromObject, new String[] {"mimeType"}));
}

return toObject;
}

@ExcludeFromGeneratedCoverageReport
ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
ObjectNode toObject = JsonSerializable.objectMapper().createObjectNode();
Expand Down Expand Up @@ -831,10 +779,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
Common.setValueByPath(
toObject,
new String[] {"fileData"},
fileDataToMldev(
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"fileData"})),
toObject));
Common.getValueByPath(fromObject, new String[] {"fileData"}));
}

if (Common.getValueByPath(fromObject, new String[] {"functionCall"}) != null) {
Expand All @@ -858,10 +803,7 @@ ObjectNode partToMldev(JsonNode fromObject, ObjectNode parentObject) {
Common.setValueByPath(
toObject,
new String[] {"inlineData"},
blobToMldev(
JsonSerializable.toJsonNode(
Common.getValueByPath(fromObject, new String[] {"inlineData"})),
toObject));
Common.getValueByPath(fromObject, new String[] {"inlineData"}));
}

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