@@ -70,30 +70,40 @@ ObjectNode authConfigToMldev(JsonNode fromObject, ObjectNode parentObject) {
7070 }
7171
7272 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"apiKeyConfig" }))) {
73- throw new IllegalArgumentException ("apiKeyConfig parameter is not supported in Gemini API." );
73+ throw new IllegalArgumentException (
74+ "apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not"
75+ + " in Gemini Developer API mode." );
7476 }
7577
7678 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"authType" }))) {
77- throw new IllegalArgumentException ("authType parameter is not supported in Gemini API." );
79+ throw new IllegalArgumentException (
80+ "authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
81+ + " Gemini Developer API mode." );
7882 }
7983
8084 if (!Common .isZero (
8185 Common .getValueByPath (fromObject , new String [] {"googleServiceAccountConfig" }))) {
8286 throw new IllegalArgumentException (
83- "googleServiceAccountConfig parameter is not supported in Gemini API." );
87+ "googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent"
88+ + " Platform mode, not in Gemini Developer API mode." );
8489 }
8590
8691 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"httpBasicAuthConfig" }))) {
8792 throw new IllegalArgumentException (
88- "httpBasicAuthConfig parameter is not supported in Gemini API." );
93+ "httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform"
94+ + " mode, not in Gemini Developer API mode." );
8995 }
9096
9197 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"oauthConfig" }))) {
92- throw new IllegalArgumentException ("oauthConfig parameter is not supported in Gemini API." );
98+ throw new IllegalArgumentException (
99+ "oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
100+ + " Gemini Developer API mode." );
93101 }
94102
95103 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"oidcConfig" }))) {
96- throw new IllegalArgumentException ("oidcConfig parameter is not supported in Gemini API." );
104+ throw new IllegalArgumentException (
105+ "oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
106+ + " Gemini Developer API mode." );
97107 }
98108
99109 return toObject ;
@@ -110,7 +120,9 @@ ObjectNode blobToMldev(JsonNode fromObject, ObjectNode parentObject) {
110120 }
111121
112122 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"displayName" }))) {
113- throw new IllegalArgumentException ("displayName parameter is not supported in Gemini API." );
123+ throw new IllegalArgumentException (
124+ "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
125+ + " Gemini Developer API mode." );
114126 }
115127
116128 if (Common .getValueByPath (fromObject , new String [] {"mimeType" }) != null ) {
@@ -242,7 +254,9 @@ ObjectNode createCachedContentConfigToMldev(JsonNode fromObject, ObjectNode pare
242254 }
243255
244256 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"kmsKeyName" }))) {
245- throw new IllegalArgumentException ("kmsKeyName parameter is not supported in Gemini API." );
257+ throw new IllegalArgumentException (
258+ "kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
259+ + " Gemini Developer API mode." );
246260 }
247261
248262 return toObject ;
@@ -434,7 +448,9 @@ ObjectNode deleteCachedContentResponseFromVertex(JsonNode fromObject, ObjectNode
434448 ObjectNode fileDataToMldev (JsonNode fromObject , ObjectNode parentObject ) {
435449 ObjectNode toObject = JsonSerializable .objectMapper ().createObjectNode ();
436450 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"displayName" }))) {
437- throw new IllegalArgumentException ("displayName parameter is not supported in Gemini API." );
451+ throw new IllegalArgumentException (
452+ "displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
453+ + " Gemini Developer API mode." );
438454 }
439455
440456 if (Common .getValueByPath (fromObject , new String [] {"fileUri" }) != null ) {
@@ -477,11 +493,15 @@ ObjectNode functionCallToMldev(JsonNode fromObject, ObjectNode parentObject) {
477493 }
478494
479495 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"partialArgs" }))) {
480- throw new IllegalArgumentException ("partialArgs parameter is not supported in Gemini API." );
496+ throw new IllegalArgumentException (
497+ "partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
498+ + " Gemini Developer API mode." );
481499 }
482500
483501 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"willContinue" }))) {
484- throw new IllegalArgumentException ("willContinue parameter is not supported in Gemini API." );
502+ throw new IllegalArgumentException (
503+ "willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not"
504+ + " in Gemini Developer API mode." );
485505 }
486506
487507 return toObject ;
@@ -507,7 +527,8 @@ ObjectNode functionCallingConfigToMldev(JsonNode fromObject, ObjectNode parentOb
507527 if (!Common .isZero (
508528 Common .getValueByPath (fromObject , new String [] {"streamFunctionCallArguments" }))) {
509529 throw new IllegalArgumentException (
510- "streamFunctionCallArguments parameter is not supported in Gemini API." );
530+ "streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent"
531+ + " Platform mode, not in Gemini Developer API mode." );
511532 }
512533
513534 return toObject ;
@@ -578,12 +599,14 @@ ObjectNode googleSearchToMldev(JsonNode fromObject, ObjectNode parentObject) {
578599
579600 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"blockingConfidence" }))) {
580601 throw new IllegalArgumentException (
581- "blockingConfidence parameter is not supported in Gemini API." );
602+ "blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode,"
603+ + " not in Gemini Developer API mode." );
582604 }
583605
584606 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"excludeDomains" }))) {
585607 throw new IllegalArgumentException (
586- "excludeDomains parameter is not supported in Gemini API." );
608+ "excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not"
609+ + " in Gemini Developer API mode." );
587610 }
588611
589612 if (Common .getValueByPath (fromObject , new String [] {"timeRangeFilter" }) != null ) {
@@ -915,17 +938,20 @@ ObjectNode partToVertex(JsonNode fromObject, ObjectNode parentObject) {
915938
916939 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"toolCall" }))) {
917940 throw new IllegalArgumentException (
918- "toolCall parameter is not supported in Gemini Enterprise Agent Platform." );
941+ "toolCall parameter is only supported in Gemini Developer API mode, not in Gemini"
942+ + " Enterprise Agent Platform mode." );
919943 }
920944
921945 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"toolResponse" }))) {
922946 throw new IllegalArgumentException (
923- "toolResponse parameter is not supported in Gemini Enterprise Agent Platform." );
947+ "toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini"
948+ + " Enterprise Agent Platform mode." );
924949 }
925950
926951 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"partMetadata" }))) {
927952 throw new IllegalArgumentException (
928- "partMetadata parameter is not supported in Gemini Enterprise Agent Platform." );
953+ "partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini"
954+ + " Enterprise Agent Platform mode." );
929955 }
930956
931957 return toObject ;
@@ -982,8 +1008,8 @@ ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject) {
9821008 if (!Common .isZero (
9831009 Common .getValueByPath (fromObject , new String [] {"includeServerSideToolInvocations" }))) {
9841010 throw new IllegalArgumentException (
985- "includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent "
986- + " Platform." );
1011+ "includeServerSideToolInvocations parameter is only supported in Gemini Developer API "
1012+ + " mode, not in Gemini Enterprise Agent Platform mode ." );
9871013 }
9881014
9891015 return toObject ;
@@ -993,7 +1019,9 @@ ObjectNode toolConfigToVertex(JsonNode fromObject, ObjectNode parentObject) {
9931019 ObjectNode toolToMldev (JsonNode fromObject , ObjectNode parentObject ) {
9941020 ObjectNode toObject = JsonSerializable .objectMapper ().createObjectNode ();
9951021 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"retrieval" }))) {
996- throw new IllegalArgumentException ("retrieval parameter is not supported in Gemini API." );
1022+ throw new IllegalArgumentException (
1023+ "retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in"
1024+ + " Gemini Developer API mode." );
9971025 }
9981026
9991027 if (Common .getValueByPath (fromObject , new String [] {"computerUse" }) != null ) {
@@ -1039,7 +1067,8 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) {
10391067
10401068 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"enterpriseWebSearch" }))) {
10411069 throw new IllegalArgumentException (
1042- "enterpriseWebSearch parameter is not supported in Gemini API." );
1070+ "enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform"
1071+ + " mode, not in Gemini Developer API mode." );
10431072 }
10441073
10451074 if (Common .getValueByPath (fromObject , new String [] {"functionDeclarations" }) != null ) {
@@ -1058,7 +1087,8 @@ ObjectNode toolToMldev(JsonNode fromObject, ObjectNode parentObject) {
10581087
10591088 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"parallelAiSearch" }))) {
10601089 throw new IllegalArgumentException (
1061- "parallelAiSearch parameter is not supported in Gemini API." );
1090+ "parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode,"
1091+ + " not in Gemini Developer API mode." );
10621092 }
10631093
10641094 if (Common .getValueByPath (fromObject , new String [] {"urlContext" }) != null ) {
@@ -1097,7 +1127,8 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) {
10971127
10981128 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"fileSearch" }))) {
10991129 throw new IllegalArgumentException (
1100- "fileSearch parameter is not supported in Gemini Enterprise Agent Platform." );
1130+ "fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini"
1131+ + " Enterprise Agent Platform mode." );
11011132 }
11021133
11031134 if (Common .getValueByPath (fromObject , new String [] {"googleSearch" }) != null ) {
@@ -1158,7 +1189,8 @@ ObjectNode toolToVertex(JsonNode fromObject, ObjectNode parentObject) {
11581189
11591190 if (!Common .isZero (Common .getValueByPath (fromObject , new String [] {"mcpServers" }))) {
11601191 throw new IllegalArgumentException (
1161- "mcpServers parameter is not supported in Gemini Enterprise Agent Platform." );
1192+ "mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini"
1193+ + " Enterprise Agent Platform mode." );
11621194 }
11631195
11641196 return toObject ;
0 commit comments