@@ -818,6 +818,138 @@ ObjectNode functionDeclarationToVertex(JsonNode fromObject, ObjectNode parentObj
818818 return toObject ;
819819 }
820820
821+ @ ExcludeFromGeneratedCoverageReport
822+ ObjectNode functionResponseBlobToMldev (JsonNode fromObject , ObjectNode parentObject ) {
823+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
824+ if (Common .getValueByPath (fromObject , new String [] {"mimeType" }) != null ) {
825+ Common .setValueByPath (
826+ toObject ,
827+ new String [] {"mimeType" },
828+ Common .getValueByPath (fromObject , new String [] {"mimeType" }));
829+ }
830+
831+ if (Common .getValueByPath (fromObject , new String [] {"data" }) != null ) {
832+ Common .setValueByPath (
833+ toObject ,
834+ new String [] {"data" },
835+ Common .getValueByPath (fromObject , new String [] {"data" }));
836+ }
837+
838+ return toObject ;
839+ }
840+
841+ @ ExcludeFromGeneratedCoverageReport
842+ ObjectNode functionResponseBlobToVertex (JsonNode fromObject , ObjectNode parentObject ) {
843+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
844+ if (Common .getValueByPath (fromObject , new String [] {"mimeType" }) != null ) {
845+ Common .setValueByPath (
846+ toObject ,
847+ new String [] {"mimeType" },
848+ Common .getValueByPath (fromObject , new String [] {"mimeType" }));
849+ }
850+
851+ if (Common .getValueByPath (fromObject , new String [] {"data" }) != null ) {
852+ Common .setValueByPath (
853+ toObject ,
854+ new String [] {"data" },
855+ Common .getValueByPath (fromObject , new String [] {"data" }));
856+ }
857+
858+ return toObject ;
859+ }
860+
861+ @ ExcludeFromGeneratedCoverageReport
862+ ObjectNode functionResponseFileDataToMldev (JsonNode fromObject , ObjectNode parentObject ) {
863+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
864+ if (Common .getValueByPath (fromObject , new String [] {"fileUri" }) != null ) {
865+ Common .setValueByPath (
866+ toObject ,
867+ new String [] {"fileUri" },
868+ Common .getValueByPath (fromObject , new String [] {"fileUri" }));
869+ }
870+
871+ if (Common .getValueByPath (fromObject , new String [] {"mimeType" }) != null ) {
872+ Common .setValueByPath (
873+ toObject ,
874+ new String [] {"mimeType" },
875+ Common .getValueByPath (fromObject , new String [] {"mimeType" }));
876+ }
877+
878+ return toObject ;
879+ }
880+
881+ @ ExcludeFromGeneratedCoverageReport
882+ ObjectNode functionResponseFileDataToVertex (JsonNode fromObject , ObjectNode parentObject ) {
883+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
884+ if (Common .getValueByPath (fromObject , new String [] {"fileUri" }) != null ) {
885+ Common .setValueByPath (
886+ toObject ,
887+ new String [] {"fileUri" },
888+ Common .getValueByPath (fromObject , new String [] {"fileUri" }));
889+ }
890+
891+ if (Common .getValueByPath (fromObject , new String [] {"mimeType" }) != null ) {
892+ Common .setValueByPath (
893+ toObject ,
894+ new String [] {"mimeType" },
895+ Common .getValueByPath (fromObject , new String [] {"mimeType" }));
896+ }
897+
898+ return toObject ;
899+ }
900+
901+ @ ExcludeFromGeneratedCoverageReport
902+ ObjectNode functionResponsePartToMldev (JsonNode fromObject , ObjectNode parentObject ) {
903+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
904+ if (Common .getValueByPath (fromObject , new String [] {"inlineData" }) != null ) {
905+ Common .setValueByPath (
906+ toObject ,
907+ new String [] {"inlineData" },
908+ functionResponseBlobToMldev (
909+ JsonSerializable .toJsonNode (
910+ Common .getValueByPath (fromObject , new String [] {"inlineData" })),
911+ toObject ));
912+ }
913+
914+ if (Common .getValueByPath (fromObject , new String [] {"fileData" }) != null ) {
915+ Common .setValueByPath (
916+ toObject ,
917+ new String [] {"fileData" },
918+ functionResponseFileDataToMldev (
919+ JsonSerializable .toJsonNode (
920+ Common .getValueByPath (fromObject , new String [] {"fileData" })),
921+ toObject ));
922+ }
923+
924+ return toObject ;
925+ }
926+
927+ @ ExcludeFromGeneratedCoverageReport
928+ ObjectNode functionResponsePartToVertex (JsonNode fromObject , ObjectNode parentObject ) {
929+ ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
930+ if (Common .getValueByPath (fromObject , new String [] {"inlineData" }) != null ) {
931+ Common .setValueByPath (
932+ toObject ,
933+ new String [] {"inlineData" },
934+ functionResponseBlobToVertex (
935+ JsonSerializable .toJsonNode (
936+ Common .getValueByPath (fromObject , new String [] {"inlineData" })),
937+ toObject ));
938+ }
939+
940+ if (Common .getValueByPath (fromObject , new String [] {"fileData" }) != null ) {
941+ Common .setValueByPath (
942+ toObject ,
943+ new String [] {"fileData" },
944+ functionResponseFileDataToVertex (
945+ JsonSerializable .toJsonNode (
946+ Common .getValueByPath (fromObject , new String [] {"fileData" })),
947+ toObject ));
948+ }
949+
950+ return toObject ;
951+ }
952+
821953 @ ExcludeFromGeneratedCoverageReport
822954 ObjectNode functionResponseToMldev (JsonNode fromObject , ObjectNode parentObject ) {
823955 ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
@@ -835,6 +967,17 @@ ObjectNode functionResponseToMldev(JsonNode fromObject, ObjectNode parentObject)
835967 Common .getValueByPath (fromObject , new String [] {"scheduling" }));
836968 }
837969
970+ if (Common .getValueByPath (fromObject , new String [] {"parts" }) != null ) {
971+ ArrayNode keyArray = (ArrayNode ) Common .getValueByPath (fromObject , new String [] {"parts" });
972+ ObjectMapper objectMapper = new ObjectMapper ();
973+ ArrayNode result = objectMapper .createArrayNode ();
974+
975+ for (JsonNode item : keyArray ) {
976+ result .add (functionResponsePartToMldev (JsonSerializable .toJsonNode (item ), toObject ));
977+ }
978+ Common .setValueByPath (toObject , new String [] {"parts" }, result );
979+ }
980+
838981 if (Common .getValueByPath (fromObject , new String [] {"id" }) != null ) {
839982 Common .setValueByPath (
840983 toObject , new String [] {"id" }, Common .getValueByPath (fromObject , new String [] {"id" }));
@@ -868,6 +1011,17 @@ ObjectNode functionResponseToVertex(JsonNode fromObject, ObjectNode parentObject
8681011 throw new IllegalArgumentException ("scheduling parameter is not supported in Vertex AI." );
8691012 }
8701013
1014+ if (Common .getValueByPath (fromObject , new String [] {"parts" }) != null ) {
1015+ ArrayNode keyArray = (ArrayNode ) Common .getValueByPath (fromObject , new String [] {"parts" });
1016+ ObjectMapper objectMapper = new ObjectMapper ();
1017+ ArrayNode result = objectMapper .createArrayNode ();
1018+
1019+ for (JsonNode item : keyArray ) {
1020+ result .add (functionResponsePartToVertex (JsonSerializable .toJsonNode (item ), toObject ));
1021+ }
1022+ Common .setValueByPath (toObject , new String [] {"parts" }, result );
1023+ }
1024+
8711025 if (Common .getValueByPath (fromObject , new String [] {"id" }) != null ) {
8721026 Common .setValueByPath (
8731027 toObject , new String [] {"id" }, Common .getValueByPath (fromObject , new String [] {"id" }));
@@ -3206,6 +3360,13 @@ ObjectNode toolComputerUseToMldev(JsonNode fromObject, ObjectNode parentObject)
32063360 Common .getValueByPath (fromObject , new String [] {"environment" }));
32073361 }
32083362
3363+ if (Common .getValueByPath (fromObject , new String [] {"excludedPredefinedFunctions" }) != null ) {
3364+ Common .setValueByPath (
3365+ toObject ,
3366+ new String [] {"excludedPredefinedFunctions" },
3367+ Common .getValueByPath (fromObject , new String [] {"excludedPredefinedFunctions" }));
3368+ }
3369+
32093370 return toObject ;
32103371 }
32113372
@@ -3219,6 +3380,13 @@ ObjectNode toolComputerUseToVertex(JsonNode fromObject, ObjectNode parentObject)
32193380 Common .getValueByPath (fromObject , new String [] {"environment" }));
32203381 }
32213382
3383+ if (Common .getValueByPath (fromObject , new String [] {"excludedPredefinedFunctions" }) != null ) {
3384+ Common .setValueByPath (
3385+ toObject ,
3386+ new String [] {"excludedPredefinedFunctions" },
3387+ Common .getValueByPath (fromObject , new String [] {"excludedPredefinedFunctions" }));
3388+ }
3389+
32223390 return toObject ;
32233391 }
32243392
0 commit comments