@@ -818,6 +818,138 @@ ObjectNode functionDeclarationToVertex(JsonNode fromObject, ObjectNode parentObj
818
818
return toObject ;
819
819
}
820
820
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
+
821
953
@ ExcludeFromGeneratedCoverageReport
822
954
ObjectNode functionResponseToMldev (JsonNode fromObject , ObjectNode parentObject ) {
823
955
ObjectNode toObject = JsonSerializable .objectMapper .createObjectNode ();
@@ -835,6 +967,17 @@ ObjectNode functionResponseToMldev(JsonNode fromObject, ObjectNode parentObject)
835
967
Common .getValueByPath (fromObject , new String [] {"scheduling" }));
836
968
}
837
969
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
+
838
981
if (Common .getValueByPath (fromObject , new String [] {"id" }) != null ) {
839
982
Common .setValueByPath (
840
983
toObject , new String [] {"id" }, Common .getValueByPath (fromObject , new String [] {"id" }));
@@ -868,6 +1011,17 @@ ObjectNode functionResponseToVertex(JsonNode fromObject, ObjectNode parentObject
868
1011
throw new IllegalArgumentException ("scheduling parameter is not supported in Vertex AI." );
869
1012
}
870
1013
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
+
871
1025
if (Common .getValueByPath (fromObject , new String [] {"id" }) != null ) {
872
1026
Common .setValueByPath (
873
1027
toObject , new String [] {"id" }, Common .getValueByPath (fromObject , new String [] {"id" }));
@@ -3206,6 +3360,13 @@ ObjectNode toolComputerUseToMldev(JsonNode fromObject, ObjectNode parentObject)
3206
3360
Common .getValueByPath (fromObject , new String [] {"environment" }));
3207
3361
}
3208
3362
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
+
3209
3370
return toObject ;
3210
3371
}
3211
3372
@@ -3219,6 +3380,13 @@ ObjectNode toolComputerUseToVertex(JsonNode fromObject, ObjectNode parentObject)
3219
3380
Common .getValueByPath (fromObject , new String [] {"environment" }));
3220
3381
}
3221
3382
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
+
3222
3390
return toObject ;
3223
3391
}
3224
3392
0 commit comments