@google/genai 1.42.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +910 -378
- package/dist/index.cjs +651 -402
- package/dist/index.mjs +651 -403
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +652 -403
- package/dist/node/index.mjs +652 -404
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +910 -378
- package/dist/tokenizer/node.cjs +207 -87
- package/dist/tokenizer/node.d.ts +144 -86
- package/dist/tokenizer/node.mjs +207 -87
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/web/index.mjs +651 -403
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +910 -378
- package/package.json +5 -1
package/dist/node/index.cjs
CHANGED
|
@@ -668,7 +668,7 @@ exports.FunctionResponseScheduling = void 0;
|
|
|
668
668
|
*/
|
|
669
669
|
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
670
670
|
})(exports.FunctionResponseScheduling || (exports.FunctionResponseScheduling = {}));
|
|
671
|
-
/**
|
|
671
|
+
/** Data type of the schema field. */
|
|
672
672
|
exports.Type = void 0;
|
|
673
673
|
(function (Type) {
|
|
674
674
|
/**
|
|
@@ -704,22 +704,38 @@ exports.Type = void 0;
|
|
|
704
704
|
*/
|
|
705
705
|
Type["NULL"] = "NULL";
|
|
706
706
|
})(exports.Type || (exports.Type = {}));
|
|
707
|
-
/**
|
|
708
|
-
exports.
|
|
709
|
-
(function (
|
|
707
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
708
|
+
exports.PhishBlockThreshold = void 0;
|
|
709
|
+
(function (PhishBlockThreshold) {
|
|
710
710
|
/**
|
|
711
|
-
*
|
|
711
|
+
* Defaults to unspecified.
|
|
712
712
|
*/
|
|
713
|
-
|
|
713
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
714
714
|
/**
|
|
715
|
-
*
|
|
715
|
+
* Blocks Low and above confidence URL that is risky.
|
|
716
716
|
*/
|
|
717
|
-
|
|
717
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
718
718
|
/**
|
|
719
|
-
*
|
|
719
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
720
720
|
*/
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
722
|
+
/**
|
|
723
|
+
* Blocks High and above confidence URL that is risky.
|
|
724
|
+
*/
|
|
725
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
726
|
+
/**
|
|
727
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
728
|
+
*/
|
|
729
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
730
|
+
/**
|
|
731
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
732
|
+
*/
|
|
733
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
734
|
+
/**
|
|
735
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
736
|
+
*/
|
|
737
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
738
|
+
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
723
739
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
724
740
|
exports.AuthType = void 0;
|
|
725
741
|
(function (AuthType) {
|
|
@@ -774,38 +790,22 @@ exports.HttpElementLocation = void 0;
|
|
|
774
790
|
*/
|
|
775
791
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
776
792
|
})(exports.HttpElementLocation || (exports.HttpElementLocation = {}));
|
|
777
|
-
/**
|
|
778
|
-
exports.
|
|
779
|
-
(function (
|
|
780
|
-
/**
|
|
781
|
-
* Defaults to unspecified.
|
|
782
|
-
*/
|
|
783
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
784
|
-
/**
|
|
785
|
-
* Blocks Low and above confidence URL that is risky.
|
|
786
|
-
*/
|
|
787
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
788
|
-
/**
|
|
789
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
790
|
-
*/
|
|
791
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
792
|
-
/**
|
|
793
|
-
* Blocks High and above confidence URL that is risky.
|
|
794
|
-
*/
|
|
795
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
793
|
+
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
794
|
+
exports.ApiSpec = void 0;
|
|
795
|
+
(function (ApiSpec) {
|
|
796
796
|
/**
|
|
797
|
-
*
|
|
797
|
+
* Unspecified API spec. This value should not be used.
|
|
798
798
|
*/
|
|
799
|
-
|
|
799
|
+
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
800
800
|
/**
|
|
801
|
-
*
|
|
801
|
+
* Simple search API spec.
|
|
802
802
|
*/
|
|
803
|
-
|
|
803
|
+
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
804
804
|
/**
|
|
805
|
-
*
|
|
805
|
+
* Elastic search API spec.
|
|
806
806
|
*/
|
|
807
|
-
|
|
808
|
-
})(exports.
|
|
807
|
+
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
808
|
+
})(exports.ApiSpec || (exports.ApiSpec = {}));
|
|
809
809
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
810
810
|
exports.Behavior = void 0;
|
|
811
811
|
(function (Behavior) {
|
|
@@ -882,27 +882,43 @@ exports.ThinkingLevel = void 0;
|
|
|
882
882
|
*/
|
|
883
883
|
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
884
884
|
})(exports.ThinkingLevel || (exports.ThinkingLevel = {}));
|
|
885
|
-
/**
|
|
885
|
+
/** Enum that controls the generation of people. */
|
|
886
|
+
exports.PersonGeneration = void 0;
|
|
887
|
+
(function (PersonGeneration) {
|
|
888
|
+
/**
|
|
889
|
+
* Block generation of images of people.
|
|
890
|
+
*/
|
|
891
|
+
PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
|
|
892
|
+
/**
|
|
893
|
+
* Generate images of adults, but not children.
|
|
894
|
+
*/
|
|
895
|
+
PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
|
|
896
|
+
/**
|
|
897
|
+
* Generate images that include adults and children.
|
|
898
|
+
*/
|
|
899
|
+
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
900
|
+
})(exports.PersonGeneration || (exports.PersonGeneration = {}));
|
|
901
|
+
/** The harm category to be blocked. */
|
|
886
902
|
exports.HarmCategory = void 0;
|
|
887
903
|
(function (HarmCategory) {
|
|
888
904
|
/**
|
|
889
|
-
*
|
|
905
|
+
* Default value. This value is unused.
|
|
890
906
|
*/
|
|
891
907
|
HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
|
|
892
908
|
/**
|
|
893
|
-
*
|
|
909
|
+
* Abusive, threatening, or content intended to bully, torment, or ridicule.
|
|
894
910
|
*/
|
|
895
911
|
HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
|
|
896
912
|
/**
|
|
897
|
-
*
|
|
913
|
+
* Content that promotes violence or incites hatred against individuals or groups based on certain attributes.
|
|
898
914
|
*/
|
|
899
915
|
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
900
916
|
/**
|
|
901
|
-
*
|
|
917
|
+
* Content that contains sexually explicit material.
|
|
902
918
|
*/
|
|
903
919
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
904
920
|
/**
|
|
905
|
-
*
|
|
921
|
+
* Content that promotes, facilitates, or enables dangerous activities.
|
|
906
922
|
*/
|
|
907
923
|
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
908
924
|
/**
|
|
@@ -910,27 +926,27 @@ exports.HarmCategory = void 0;
|
|
|
910
926
|
*/
|
|
911
927
|
HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
912
928
|
/**
|
|
913
|
-
*
|
|
929
|
+
* Images that contain hate speech. This enum value is not supported in Gemini API.
|
|
914
930
|
*/
|
|
915
931
|
HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
|
|
916
932
|
/**
|
|
917
|
-
*
|
|
933
|
+
* Images that contain dangerous content. This enum value is not supported in Gemini API.
|
|
918
934
|
*/
|
|
919
935
|
HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
|
|
920
936
|
/**
|
|
921
|
-
*
|
|
937
|
+
* Images that contain harassment. This enum value is not supported in Gemini API.
|
|
922
938
|
*/
|
|
923
939
|
HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
|
|
924
940
|
/**
|
|
925
|
-
*
|
|
941
|
+
* Images that contain sexually explicit content. This enum value is not supported in Gemini API.
|
|
926
942
|
*/
|
|
927
943
|
HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
|
|
928
944
|
/**
|
|
929
|
-
*
|
|
945
|
+
* Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.
|
|
930
946
|
*/
|
|
931
947
|
HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
|
|
932
948
|
})(exports.HarmCategory || (exports.HarmCategory = {}));
|
|
933
|
-
/**
|
|
949
|
+
/** The method for blocking content. If not specified, the default behavior is to use the probability score. This enum is not supported in Gemini API. */
|
|
934
950
|
exports.HarmBlockMethod = void 0;
|
|
935
951
|
(function (HarmBlockMethod) {
|
|
936
952
|
/**
|
|
@@ -946,31 +962,31 @@ exports.HarmBlockMethod = void 0;
|
|
|
946
962
|
*/
|
|
947
963
|
HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
|
|
948
964
|
})(exports.HarmBlockMethod || (exports.HarmBlockMethod = {}));
|
|
949
|
-
/** The harm
|
|
965
|
+
/** The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked. */
|
|
950
966
|
exports.HarmBlockThreshold = void 0;
|
|
951
967
|
(function (HarmBlockThreshold) {
|
|
952
968
|
/**
|
|
953
|
-
*
|
|
969
|
+
* The harm block threshold is unspecified.
|
|
954
970
|
*/
|
|
955
971
|
HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
956
972
|
/**
|
|
957
|
-
* Block
|
|
973
|
+
* Block content with a low harm probability or higher.
|
|
958
974
|
*/
|
|
959
975
|
HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
960
976
|
/**
|
|
961
|
-
* Block medium
|
|
977
|
+
* Block content with a medium harm probability or higher.
|
|
962
978
|
*/
|
|
963
979
|
HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
964
980
|
/**
|
|
965
|
-
* Block
|
|
981
|
+
* Block content with a high harm probability.
|
|
966
982
|
*/
|
|
967
983
|
HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
|
|
968
984
|
/**
|
|
969
|
-
*
|
|
985
|
+
* Do not block any content, regardless of its harm probability.
|
|
970
986
|
*/
|
|
971
987
|
HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE";
|
|
972
988
|
/**
|
|
973
|
-
* Turn off the safety filter.
|
|
989
|
+
* Turn off the safety filter entirely.
|
|
974
990
|
*/
|
|
975
991
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
976
992
|
})(exports.HarmBlockThreshold || (exports.HarmBlockThreshold = {}));
|
|
@@ -1048,55 +1064,55 @@ exports.FinishReason = void 0;
|
|
|
1048
1064
|
*/
|
|
1049
1065
|
FinishReason["IMAGE_OTHER"] = "IMAGE_OTHER";
|
|
1050
1066
|
})(exports.FinishReason || (exports.FinishReason = {}));
|
|
1051
|
-
/** Output only.
|
|
1067
|
+
/** Output only. The probability of harm for this category. */
|
|
1052
1068
|
exports.HarmProbability = void 0;
|
|
1053
1069
|
(function (HarmProbability) {
|
|
1054
1070
|
/**
|
|
1055
|
-
*
|
|
1071
|
+
* The harm probability is unspecified.
|
|
1056
1072
|
*/
|
|
1057
1073
|
HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED";
|
|
1058
1074
|
/**
|
|
1059
|
-
*
|
|
1075
|
+
* The harm probability is negligible.
|
|
1060
1076
|
*/
|
|
1061
1077
|
HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE";
|
|
1062
1078
|
/**
|
|
1063
|
-
*
|
|
1079
|
+
* The harm probability is low.
|
|
1064
1080
|
*/
|
|
1065
1081
|
HarmProbability["LOW"] = "LOW";
|
|
1066
1082
|
/**
|
|
1067
|
-
*
|
|
1083
|
+
* The harm probability is medium.
|
|
1068
1084
|
*/
|
|
1069
1085
|
HarmProbability["MEDIUM"] = "MEDIUM";
|
|
1070
1086
|
/**
|
|
1071
|
-
*
|
|
1087
|
+
* The harm probability is high.
|
|
1072
1088
|
*/
|
|
1073
1089
|
HarmProbability["HIGH"] = "HIGH";
|
|
1074
1090
|
})(exports.HarmProbability || (exports.HarmProbability = {}));
|
|
1075
|
-
/** Output only.
|
|
1091
|
+
/** Output only. The severity of harm for this category. This enum is not supported in Gemini API. */
|
|
1076
1092
|
exports.HarmSeverity = void 0;
|
|
1077
1093
|
(function (HarmSeverity) {
|
|
1078
1094
|
/**
|
|
1079
|
-
*
|
|
1095
|
+
* The harm severity is unspecified.
|
|
1080
1096
|
*/
|
|
1081
1097
|
HarmSeverity["HARM_SEVERITY_UNSPECIFIED"] = "HARM_SEVERITY_UNSPECIFIED";
|
|
1082
1098
|
/**
|
|
1083
|
-
*
|
|
1099
|
+
* The harm severity is negligible.
|
|
1084
1100
|
*/
|
|
1085
1101
|
HarmSeverity["HARM_SEVERITY_NEGLIGIBLE"] = "HARM_SEVERITY_NEGLIGIBLE";
|
|
1086
1102
|
/**
|
|
1087
|
-
*
|
|
1103
|
+
* The harm severity is low.
|
|
1088
1104
|
*/
|
|
1089
1105
|
HarmSeverity["HARM_SEVERITY_LOW"] = "HARM_SEVERITY_LOW";
|
|
1090
1106
|
/**
|
|
1091
|
-
*
|
|
1107
|
+
* The harm severity is medium.
|
|
1092
1108
|
*/
|
|
1093
1109
|
HarmSeverity["HARM_SEVERITY_MEDIUM"] = "HARM_SEVERITY_MEDIUM";
|
|
1094
1110
|
/**
|
|
1095
|
-
*
|
|
1111
|
+
* The harm severity is high.
|
|
1096
1112
|
*/
|
|
1097
1113
|
HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
|
|
1098
1114
|
})(exports.HarmSeverity || (exports.HarmSeverity = {}));
|
|
1099
|
-
/**
|
|
1115
|
+
/** The status of the URL retrieval. */
|
|
1100
1116
|
exports.UrlRetrievalStatus = void 0;
|
|
1101
1117
|
(function (UrlRetrievalStatus) {
|
|
1102
1118
|
/**
|
|
@@ -1104,11 +1120,11 @@ exports.UrlRetrievalStatus = void 0;
|
|
|
1104
1120
|
*/
|
|
1105
1121
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
|
|
1106
1122
|
/**
|
|
1107
|
-
*
|
|
1123
|
+
* The URL was retrieved successfully.
|
|
1108
1124
|
*/
|
|
1109
1125
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
|
|
1110
1126
|
/**
|
|
1111
|
-
*
|
|
1127
|
+
* The URL retrieval failed.
|
|
1112
1128
|
*/
|
|
1113
1129
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
1114
1130
|
/**
|
|
@@ -1167,6 +1183,14 @@ exports.TrafficType = void 0;
|
|
|
1167
1183
|
* The request was processed using Pay-As-You-Go quota.
|
|
1168
1184
|
*/
|
|
1169
1185
|
TrafficType["ON_DEMAND"] = "ON_DEMAND";
|
|
1186
|
+
/**
|
|
1187
|
+
* Type for Priority Pay-As-You-Go traffic.
|
|
1188
|
+
*/
|
|
1189
|
+
TrafficType["ON_DEMAND_PRIORITY"] = "ON_DEMAND_PRIORITY";
|
|
1190
|
+
/**
|
|
1191
|
+
* Type for Flex traffic.
|
|
1192
|
+
*/
|
|
1193
|
+
TrafficType["ON_DEMAND_FLEX"] = "ON_DEMAND_FLEX";
|
|
1170
1194
|
/**
|
|
1171
1195
|
* Type for Provisioned Throughput traffic.
|
|
1172
1196
|
*/
|
|
@@ -1312,6 +1336,102 @@ exports.JobState = void 0;
|
|
|
1312
1336
|
*/
|
|
1313
1337
|
JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
|
|
1314
1338
|
})(exports.JobState || (exports.JobState = {}));
|
|
1339
|
+
/** Output only. The detail state of the tuning job (while the overall `JobState` is running). This enum is not supported in Gemini API. */
|
|
1340
|
+
exports.TuningJobState = void 0;
|
|
1341
|
+
(function (TuningJobState) {
|
|
1342
|
+
/**
|
|
1343
|
+
* Default tuning job state.
|
|
1344
|
+
*/
|
|
1345
|
+
TuningJobState["TUNING_JOB_STATE_UNSPECIFIED"] = "TUNING_JOB_STATE_UNSPECIFIED";
|
|
1346
|
+
/**
|
|
1347
|
+
* Tuning job is waiting for job quota.
|
|
1348
|
+
*/
|
|
1349
|
+
TuningJobState["TUNING_JOB_STATE_WAITING_FOR_QUOTA"] = "TUNING_JOB_STATE_WAITING_FOR_QUOTA";
|
|
1350
|
+
/**
|
|
1351
|
+
* Tuning job is validating the dataset.
|
|
1352
|
+
*/
|
|
1353
|
+
TuningJobState["TUNING_JOB_STATE_PROCESSING_DATASET"] = "TUNING_JOB_STATE_PROCESSING_DATASET";
|
|
1354
|
+
/**
|
|
1355
|
+
* Tuning job is waiting for hardware capacity.
|
|
1356
|
+
*/
|
|
1357
|
+
TuningJobState["TUNING_JOB_STATE_WAITING_FOR_CAPACITY"] = "TUNING_JOB_STATE_WAITING_FOR_CAPACITY";
|
|
1358
|
+
/**
|
|
1359
|
+
* Tuning job is running.
|
|
1360
|
+
*/
|
|
1361
|
+
TuningJobState["TUNING_JOB_STATE_TUNING"] = "TUNING_JOB_STATE_TUNING";
|
|
1362
|
+
/**
|
|
1363
|
+
* Tuning job is doing some post processing steps.
|
|
1364
|
+
*/
|
|
1365
|
+
TuningJobState["TUNING_JOB_STATE_POST_PROCESSING"] = "TUNING_JOB_STATE_POST_PROCESSING";
|
|
1366
|
+
})(exports.TuningJobState || (exports.TuningJobState = {}));
|
|
1367
|
+
/** Aggregation metric. This enum is not supported in Gemini API. */
|
|
1368
|
+
exports.AggregationMetric = void 0;
|
|
1369
|
+
(function (AggregationMetric) {
|
|
1370
|
+
/**
|
|
1371
|
+
* Unspecified aggregation metric.
|
|
1372
|
+
*/
|
|
1373
|
+
AggregationMetric["AGGREGATION_METRIC_UNSPECIFIED"] = "AGGREGATION_METRIC_UNSPECIFIED";
|
|
1374
|
+
/**
|
|
1375
|
+
* Average aggregation metric. Not supported for Pairwise metric.
|
|
1376
|
+
*/
|
|
1377
|
+
AggregationMetric["AVERAGE"] = "AVERAGE";
|
|
1378
|
+
/**
|
|
1379
|
+
* Mode aggregation metric.
|
|
1380
|
+
*/
|
|
1381
|
+
AggregationMetric["MODE"] = "MODE";
|
|
1382
|
+
/**
|
|
1383
|
+
* Standard deviation aggregation metric. Not supported for pairwise metric.
|
|
1384
|
+
*/
|
|
1385
|
+
AggregationMetric["STANDARD_DEVIATION"] = "STANDARD_DEVIATION";
|
|
1386
|
+
/**
|
|
1387
|
+
* Variance aggregation metric. Not supported for pairwise metric.
|
|
1388
|
+
*/
|
|
1389
|
+
AggregationMetric["VARIANCE"] = "VARIANCE";
|
|
1390
|
+
/**
|
|
1391
|
+
* Minimum aggregation metric. Not supported for pairwise metric.
|
|
1392
|
+
*/
|
|
1393
|
+
AggregationMetric["MINIMUM"] = "MINIMUM";
|
|
1394
|
+
/**
|
|
1395
|
+
* Maximum aggregation metric. Not supported for pairwise metric.
|
|
1396
|
+
*/
|
|
1397
|
+
AggregationMetric["MAXIMUM"] = "MAXIMUM";
|
|
1398
|
+
/**
|
|
1399
|
+
* Median aggregation metric. Not supported for pairwise metric.
|
|
1400
|
+
*/
|
|
1401
|
+
AggregationMetric["MEDIAN"] = "MEDIAN";
|
|
1402
|
+
/**
|
|
1403
|
+
* 90th percentile aggregation metric. Not supported for pairwise metric.
|
|
1404
|
+
*/
|
|
1405
|
+
AggregationMetric["PERCENTILE_P90"] = "PERCENTILE_P90";
|
|
1406
|
+
/**
|
|
1407
|
+
* 95th percentile aggregation metric. Not supported for pairwise metric.
|
|
1408
|
+
*/
|
|
1409
|
+
AggregationMetric["PERCENTILE_P95"] = "PERCENTILE_P95";
|
|
1410
|
+
/**
|
|
1411
|
+
* 99th percentile aggregation metric. Not supported for pairwise metric.
|
|
1412
|
+
*/
|
|
1413
|
+
AggregationMetric["PERCENTILE_P99"] = "PERCENTILE_P99";
|
|
1414
|
+
})(exports.AggregationMetric || (exports.AggregationMetric = {}));
|
|
1415
|
+
/** Output only. Pairwise metric choice. This enum is not supported in Gemini API. */
|
|
1416
|
+
exports.PairwiseChoice = void 0;
|
|
1417
|
+
(function (PairwiseChoice) {
|
|
1418
|
+
/**
|
|
1419
|
+
* Unspecified prediction choice.
|
|
1420
|
+
*/
|
|
1421
|
+
PairwiseChoice["PAIRWISE_CHOICE_UNSPECIFIED"] = "PAIRWISE_CHOICE_UNSPECIFIED";
|
|
1422
|
+
/**
|
|
1423
|
+
* Baseline prediction wins
|
|
1424
|
+
*/
|
|
1425
|
+
PairwiseChoice["BASELINE"] = "BASELINE";
|
|
1426
|
+
/**
|
|
1427
|
+
* Candidate prediction wins
|
|
1428
|
+
*/
|
|
1429
|
+
PairwiseChoice["CANDIDATE"] = "CANDIDATE";
|
|
1430
|
+
/**
|
|
1431
|
+
* Winner cannot be determined
|
|
1432
|
+
*/
|
|
1433
|
+
PairwiseChoice["TIE"] = "TIE";
|
|
1434
|
+
})(exports.PairwiseChoice || (exports.PairwiseChoice = {}));
|
|
1315
1435
|
/** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
|
|
1316
1436
|
exports.TuningTask = void 0;
|
|
1317
1437
|
(function (TuningTask) {
|
|
@@ -1388,6 +1508,22 @@ exports.Environment = void 0;
|
|
|
1388
1508
|
*/
|
|
1389
1509
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1390
1510
|
})(exports.Environment || (exports.Environment = {}));
|
|
1511
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1512
|
+
exports.ProminentPeople = void 0;
|
|
1513
|
+
(function (ProminentPeople) {
|
|
1514
|
+
/**
|
|
1515
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
1516
|
+
*/
|
|
1517
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
1518
|
+
/**
|
|
1519
|
+
* Allows the model to generate images of prominent people.
|
|
1520
|
+
*/
|
|
1521
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
1522
|
+
/**
|
|
1523
|
+
* Prevents the model from generating images of prominent people.
|
|
1524
|
+
*/
|
|
1525
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
1526
|
+
})(exports.ProminentPeople || (exports.ProminentPeople = {}));
|
|
1391
1527
|
/** Enum representing the Vertex embedding API to use. */
|
|
1392
1528
|
exports.EmbeddingApiType = void 0;
|
|
1393
1529
|
(function (EmbeddingApiType) {
|
|
@@ -1408,22 +1544,6 @@ exports.SafetyFilterLevel = void 0;
|
|
|
1408
1544
|
SafetyFilterLevel["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
|
|
1409
1545
|
SafetyFilterLevel["BLOCK_NONE"] = "BLOCK_NONE";
|
|
1410
1546
|
})(exports.SafetyFilterLevel || (exports.SafetyFilterLevel = {}));
|
|
1411
|
-
/** Enum that controls the generation of people. */
|
|
1412
|
-
exports.PersonGeneration = void 0;
|
|
1413
|
-
(function (PersonGeneration) {
|
|
1414
|
-
/**
|
|
1415
|
-
* Block generation of images of people.
|
|
1416
|
-
*/
|
|
1417
|
-
PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
|
|
1418
|
-
/**
|
|
1419
|
-
* Generate images of adults, but not children.
|
|
1420
|
-
*/
|
|
1421
|
-
PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
|
|
1422
|
-
/**
|
|
1423
|
-
* Generate images that include adults and children.
|
|
1424
|
-
*/
|
|
1425
|
-
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
1426
|
-
})(exports.PersonGeneration || (exports.PersonGeneration = {}));
|
|
1427
1547
|
/** Enum that specifies the language of the text in the prompt. */
|
|
1428
1548
|
exports.ImagePromptLanguage = void 0;
|
|
1429
1549
|
(function (ImagePromptLanguage) {
|
|
@@ -2322,6 +2442,9 @@ class GenerateVideosOperation {
|
|
|
2322
2442
|
return operation;
|
|
2323
2443
|
}
|
|
2324
2444
|
}
|
|
2445
|
+
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
2446
|
+
class EvaluateDatasetResponse {
|
|
2447
|
+
}
|
|
2325
2448
|
/** Response for the list tuning jobs method. */
|
|
2326
2449
|
class ListTuningJobsResponse {
|
|
2327
2450
|
}
|
|
@@ -3441,6 +3564,33 @@ function tIsVertexEmbedContentModel(model) {
|
|
|
3441
3564
|
* Copyright 2025 Google LLC
|
|
3442
3565
|
* SPDX-License-Identifier: Apache-2.0
|
|
3443
3566
|
*/
|
|
3567
|
+
function authConfigToMldev$4(fromObject) {
|
|
3568
|
+
const toObject = {};
|
|
3569
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
3570
|
+
if (fromApiKey != null) {
|
|
3571
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
3572
|
+
}
|
|
3573
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
3574
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
3575
|
+
}
|
|
3576
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
3577
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
3578
|
+
}
|
|
3579
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
3580
|
+
undefined) {
|
|
3581
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
3582
|
+
}
|
|
3583
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
3584
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
3585
|
+
}
|
|
3586
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
3587
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
3588
|
+
}
|
|
3589
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
3590
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
3591
|
+
}
|
|
3592
|
+
return toObject;
|
|
3593
|
+
}
|
|
3444
3594
|
function batchJobDestinationFromMldev(fromObject) {
|
|
3445
3595
|
const toObject = {};
|
|
3446
3596
|
const fromFileName = getValueByPath(fromObject, ['responsesFile']);
|
|
@@ -3746,16 +3896,16 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3746
3896
|
if (fromFinishReason != null) {
|
|
3747
3897
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
3748
3898
|
}
|
|
3749
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3750
|
-
if (fromAvgLogprobs != null) {
|
|
3751
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3752
|
-
}
|
|
3753
3899
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
3754
3900
|
'groundingMetadata',
|
|
3755
3901
|
]);
|
|
3756
3902
|
if (fromGroundingMetadata != null) {
|
|
3757
3903
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
3758
3904
|
}
|
|
3905
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3906
|
+
if (fromAvgLogprobs != null) {
|
|
3907
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3908
|
+
}
|
|
3759
3909
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
3760
3910
|
if (fromIndex != null) {
|
|
3761
3911
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -4290,8 +4440,9 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
|
|
|
4290
4440
|
}
|
|
4291
4441
|
function googleMapsToMldev$4(fromObject) {
|
|
4292
4442
|
const toObject = {};
|
|
4293
|
-
|
|
4294
|
-
|
|
4443
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
4444
|
+
if (fromAuthConfig != null) {
|
|
4445
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$4(fromAuthConfig));
|
|
4295
4446
|
}
|
|
4296
4447
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
4297
4448
|
if (fromEnableWidget != null) {
|
|
@@ -4301,12 +4452,16 @@ function googleMapsToMldev$4(fromObject) {
|
|
|
4301
4452
|
}
|
|
4302
4453
|
function googleSearchToMldev$4(fromObject) {
|
|
4303
4454
|
const toObject = {};
|
|
4304
|
-
|
|
4305
|
-
|
|
4455
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
4456
|
+
if (fromSearchTypes != null) {
|
|
4457
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4306
4458
|
}
|
|
4307
4459
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
4308
4460
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
4309
4461
|
}
|
|
4462
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4463
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4464
|
+
}
|
|
4310
4465
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
4311
4466
|
'timeRangeFilter',
|
|
4312
4467
|
]);
|
|
@@ -4328,6 +4483,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4328
4483
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4329
4484
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4330
4485
|
}
|
|
4486
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4487
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
4488
|
+
}
|
|
4331
4489
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4332
4490
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4333
4491
|
}
|
|
@@ -4335,6 +4493,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4335
4493
|
undefined) {
|
|
4336
4494
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
4337
4495
|
}
|
|
4496
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
4497
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
4498
|
+
}
|
|
4338
4499
|
return toObject;
|
|
4339
4500
|
}
|
|
4340
4501
|
function inlinedRequestToMldev(apiClient, fromObject) {
|
|
@@ -4584,6 +4745,14 @@ function toolToMldev$4(fromObject) {
|
|
|
4584
4745
|
if (fromFileSearch != null) {
|
|
4585
4746
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
4586
4747
|
}
|
|
4748
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4749
|
+
if (fromGoogleSearch != null) {
|
|
4750
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4751
|
+
}
|
|
4752
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4753
|
+
if (fromGoogleMaps != null) {
|
|
4754
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4755
|
+
}
|
|
4587
4756
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4588
4757
|
'codeExecution',
|
|
4589
4758
|
]);
|
|
@@ -4605,24 +4774,29 @@ function toolToMldev$4(fromObject) {
|
|
|
4605
4774
|
}
|
|
4606
4775
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4607
4776
|
}
|
|
4608
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4609
|
-
if (fromGoogleMaps != null) {
|
|
4610
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4611
|
-
}
|
|
4612
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4613
|
-
if (fromGoogleSearch != null) {
|
|
4614
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4615
|
-
}
|
|
4616
4777
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4617
4778
|
'googleSearchRetrieval',
|
|
4618
4779
|
]);
|
|
4619
4780
|
if (fromGoogleSearchRetrieval != null) {
|
|
4620
4781
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4621
4782
|
}
|
|
4783
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
4784
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
4785
|
+
}
|
|
4622
4786
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4623
4787
|
if (fromUrlContext != null) {
|
|
4624
4788
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
4625
4789
|
}
|
|
4790
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
4791
|
+
if (fromMcpServers != null) {
|
|
4792
|
+
let transformedList = fromMcpServers;
|
|
4793
|
+
if (Array.isArray(transformedList)) {
|
|
4794
|
+
transformedList = transformedList.map((item) => {
|
|
4795
|
+
return item;
|
|
4796
|
+
});
|
|
4797
|
+
}
|
|
4798
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
4799
|
+
}
|
|
4626
4800
|
return toObject;
|
|
4627
4801
|
}
|
|
4628
4802
|
|
|
@@ -5318,6 +5492,33 @@ class Batches extends BaseModule {
|
|
|
5318
5492
|
* Copyright 2025 Google LLC
|
|
5319
5493
|
* SPDX-License-Identifier: Apache-2.0
|
|
5320
5494
|
*/
|
|
5495
|
+
function authConfigToMldev$3(fromObject) {
|
|
5496
|
+
const toObject = {};
|
|
5497
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
5498
|
+
if (fromApiKey != null) {
|
|
5499
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
5500
|
+
}
|
|
5501
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
5502
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
5503
|
+
}
|
|
5504
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
5505
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
5506
|
+
}
|
|
5507
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
5508
|
+
undefined) {
|
|
5509
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
5510
|
+
}
|
|
5511
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
5512
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
5513
|
+
}
|
|
5514
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
5515
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
5516
|
+
}
|
|
5517
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
5518
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
5519
|
+
}
|
|
5520
|
+
return toObject;
|
|
5521
|
+
}
|
|
5321
5522
|
function blobToMldev$3(fromObject) {
|
|
5322
5523
|
const toObject = {};
|
|
5323
5524
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -5618,8 +5819,9 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
|
|
|
5618
5819
|
}
|
|
5619
5820
|
function googleMapsToMldev$3(fromObject) {
|
|
5620
5821
|
const toObject = {};
|
|
5621
|
-
|
|
5622
|
-
|
|
5822
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
5823
|
+
if (fromAuthConfig != null) {
|
|
5824
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$3(fromAuthConfig));
|
|
5623
5825
|
}
|
|
5624
5826
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
5625
5827
|
if (fromEnableWidget != null) {
|
|
@@ -5629,12 +5831,16 @@ function googleMapsToMldev$3(fromObject) {
|
|
|
5629
5831
|
}
|
|
5630
5832
|
function googleSearchToMldev$3(fromObject) {
|
|
5631
5833
|
const toObject = {};
|
|
5632
|
-
|
|
5633
|
-
|
|
5834
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
5835
|
+
if (fromSearchTypes != null) {
|
|
5836
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5634
5837
|
}
|
|
5635
5838
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
5636
5839
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
5637
5840
|
}
|
|
5841
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5842
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5843
|
+
}
|
|
5638
5844
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
5639
5845
|
'timeRangeFilter',
|
|
5640
5846
|
]);
|
|
@@ -5828,6 +6034,14 @@ function toolToMldev$3(fromObject) {
|
|
|
5828
6034
|
if (fromFileSearch != null) {
|
|
5829
6035
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
5830
6036
|
}
|
|
6037
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
6038
|
+
if (fromGoogleSearch != null) {
|
|
6039
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
6040
|
+
}
|
|
6041
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6042
|
+
if (fromGoogleMaps != null) {
|
|
6043
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
6044
|
+
}
|
|
5831
6045
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5832
6046
|
'codeExecution',
|
|
5833
6047
|
]);
|
|
@@ -5849,24 +6063,29 @@ function toolToMldev$3(fromObject) {
|
|
|
5849
6063
|
}
|
|
5850
6064
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5851
6065
|
}
|
|
5852
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5853
|
-
if (fromGoogleMaps != null) {
|
|
5854
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5855
|
-
}
|
|
5856
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5857
|
-
if (fromGoogleSearch != null) {
|
|
5858
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5859
|
-
}
|
|
5860
6066
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5861
6067
|
'googleSearchRetrieval',
|
|
5862
6068
|
]);
|
|
5863
6069
|
if (fromGoogleSearchRetrieval != null) {
|
|
5864
6070
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5865
6071
|
}
|
|
6072
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
6073
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
6074
|
+
}
|
|
5866
6075
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5867
6076
|
if (fromUrlContext != null) {
|
|
5868
6077
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5869
6078
|
}
|
|
6079
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
6080
|
+
if (fromMcpServers != null) {
|
|
6081
|
+
let transformedList = fromMcpServers;
|
|
6082
|
+
if (Array.isArray(transformedList)) {
|
|
6083
|
+
transformedList = transformedList.map((item) => {
|
|
6084
|
+
return item;
|
|
6085
|
+
});
|
|
6086
|
+
}
|
|
6087
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6088
|
+
}
|
|
5870
6089
|
return toObject;
|
|
5871
6090
|
}
|
|
5872
6091
|
function toolToVertex$2(fromObject) {
|
|
@@ -5882,6 +6101,14 @@ function toolToVertex$2(fromObject) {
|
|
|
5882
6101
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
5883
6102
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
5884
6103
|
}
|
|
6104
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
6105
|
+
if (fromGoogleSearch != null) {
|
|
6106
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
6107
|
+
}
|
|
6108
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6109
|
+
if (fromGoogleMaps != null) {
|
|
6110
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
6111
|
+
}
|
|
5885
6112
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5886
6113
|
'codeExecution',
|
|
5887
6114
|
]);
|
|
@@ -5906,24 +6133,25 @@ function toolToVertex$2(fromObject) {
|
|
|
5906
6133
|
}
|
|
5907
6134
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5908
6135
|
}
|
|
5909
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5910
|
-
if (fromGoogleMaps != null) {
|
|
5911
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5912
|
-
}
|
|
5913
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5914
|
-
if (fromGoogleSearch != null) {
|
|
5915
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5916
|
-
}
|
|
5917
6136
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5918
6137
|
'googleSearchRetrieval',
|
|
5919
6138
|
]);
|
|
5920
6139
|
if (fromGoogleSearchRetrieval != null) {
|
|
5921
6140
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5922
6141
|
}
|
|
6142
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
6143
|
+
'parallelAiSearch',
|
|
6144
|
+
]);
|
|
6145
|
+
if (fromParallelAiSearch != null) {
|
|
6146
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
6147
|
+
}
|
|
5923
6148
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5924
6149
|
if (fromUrlContext != null) {
|
|
5925
6150
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5926
6151
|
}
|
|
6152
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
6153
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
6154
|
+
}
|
|
5927
6155
|
return toObject;
|
|
5928
6156
|
}
|
|
5929
6157
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7211,6 +7439,33 @@ class Files extends BaseModule {
|
|
|
7211
7439
|
* Copyright 2025 Google LLC
|
|
7212
7440
|
* SPDX-License-Identifier: Apache-2.0
|
|
7213
7441
|
*/
|
|
7442
|
+
function authConfigToMldev$2(fromObject) {
|
|
7443
|
+
const toObject = {};
|
|
7444
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
7445
|
+
if (fromApiKey != null) {
|
|
7446
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
7447
|
+
}
|
|
7448
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
7449
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
7450
|
+
}
|
|
7451
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
7452
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
7453
|
+
}
|
|
7454
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
7455
|
+
undefined) {
|
|
7456
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
7457
|
+
}
|
|
7458
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
7459
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
7460
|
+
}
|
|
7461
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
7462
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
7463
|
+
}
|
|
7464
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
7465
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
7466
|
+
}
|
|
7467
|
+
return toObject;
|
|
7468
|
+
}
|
|
7214
7469
|
function blobToMldev$2(fromObject) {
|
|
7215
7470
|
const toObject = {};
|
|
7216
7471
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -7446,8 +7701,9 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
7446
7701
|
}
|
|
7447
7702
|
function googleMapsToMldev$2(fromObject) {
|
|
7448
7703
|
const toObject = {};
|
|
7449
|
-
|
|
7450
|
-
|
|
7704
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7705
|
+
if (fromAuthConfig != null) {
|
|
7706
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$2(fromAuthConfig));
|
|
7451
7707
|
}
|
|
7452
7708
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
7453
7709
|
if (fromEnableWidget != null) {
|
|
@@ -7457,12 +7713,16 @@ function googleMapsToMldev$2(fromObject) {
|
|
|
7457
7713
|
}
|
|
7458
7714
|
function googleSearchToMldev$2(fromObject) {
|
|
7459
7715
|
const toObject = {};
|
|
7460
|
-
|
|
7461
|
-
|
|
7716
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
7717
|
+
if (fromSearchTypes != null) {
|
|
7718
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7462
7719
|
}
|
|
7463
7720
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
7464
7721
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
7465
7722
|
}
|
|
7723
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7724
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7725
|
+
}
|
|
7466
7726
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7467
7727
|
'timeRangeFilter',
|
|
7468
7728
|
]);
|
|
@@ -7972,6 +8232,14 @@ function toolToMldev$2(fromObject) {
|
|
|
7972
8232
|
if (fromFileSearch != null) {
|
|
7973
8233
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
7974
8234
|
}
|
|
8235
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8236
|
+
if (fromGoogleSearch != null) {
|
|
8237
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8238
|
+
}
|
|
8239
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8240
|
+
if (fromGoogleMaps != null) {
|
|
8241
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
8242
|
+
}
|
|
7975
8243
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7976
8244
|
'codeExecution',
|
|
7977
8245
|
]);
|
|
@@ -7993,24 +8261,29 @@ function toolToMldev$2(fromObject) {
|
|
|
7993
8261
|
}
|
|
7994
8262
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7995
8263
|
}
|
|
7996
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7997
|
-
if (fromGoogleMaps != null) {
|
|
7998
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
7999
|
-
}
|
|
8000
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8001
|
-
if (fromGoogleSearch != null) {
|
|
8002
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8003
|
-
}
|
|
8004
8264
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8005
8265
|
'googleSearchRetrieval',
|
|
8006
8266
|
]);
|
|
8007
8267
|
if (fromGoogleSearchRetrieval != null) {
|
|
8008
8268
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8009
8269
|
}
|
|
8270
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
8271
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
8272
|
+
}
|
|
8010
8273
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8011
8274
|
if (fromUrlContext != null) {
|
|
8012
8275
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8013
8276
|
}
|
|
8277
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
8278
|
+
if (fromMcpServers != null) {
|
|
8279
|
+
let transformedList = fromMcpServers;
|
|
8280
|
+
if (Array.isArray(transformedList)) {
|
|
8281
|
+
transformedList = transformedList.map((item) => {
|
|
8282
|
+
return item;
|
|
8283
|
+
});
|
|
8284
|
+
}
|
|
8285
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
8286
|
+
}
|
|
8014
8287
|
return toObject;
|
|
8015
8288
|
}
|
|
8016
8289
|
function toolToVertex$1(fromObject) {
|
|
@@ -8026,6 +8299,14 @@ function toolToVertex$1(fromObject) {
|
|
|
8026
8299
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8027
8300
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
8028
8301
|
}
|
|
8302
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8303
|
+
if (fromGoogleSearch != null) {
|
|
8304
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8305
|
+
}
|
|
8306
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8307
|
+
if (fromGoogleMaps != null) {
|
|
8308
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8309
|
+
}
|
|
8029
8310
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8030
8311
|
'codeExecution',
|
|
8031
8312
|
]);
|
|
@@ -8050,24 +8331,25 @@ function toolToVertex$1(fromObject) {
|
|
|
8050
8331
|
}
|
|
8051
8332
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8052
8333
|
}
|
|
8053
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8054
|
-
if (fromGoogleMaps != null) {
|
|
8055
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8056
|
-
}
|
|
8057
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8058
|
-
if (fromGoogleSearch != null) {
|
|
8059
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8060
|
-
}
|
|
8061
8334
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8062
8335
|
'googleSearchRetrieval',
|
|
8063
8336
|
]);
|
|
8064
8337
|
if (fromGoogleSearchRetrieval != null) {
|
|
8065
8338
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8066
8339
|
}
|
|
8340
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
8341
|
+
'parallelAiSearch',
|
|
8342
|
+
]);
|
|
8343
|
+
if (fromParallelAiSearch != null) {
|
|
8344
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
8345
|
+
}
|
|
8067
8346
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8068
8347
|
if (fromUrlContext != null) {
|
|
8069
8348
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8070
8349
|
}
|
|
8350
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
8351
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
8352
|
+
}
|
|
8071
8353
|
return toObject;
|
|
8072
8354
|
}
|
|
8073
8355
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -8176,6 +8458,33 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
8176
8458
|
* Copyright 2025 Google LLC
|
|
8177
8459
|
* SPDX-License-Identifier: Apache-2.0
|
|
8178
8460
|
*/
|
|
8461
|
+
function authConfigToMldev$1(fromObject, _rootObject) {
|
|
8462
|
+
const toObject = {};
|
|
8463
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
8464
|
+
if (fromApiKey != null) {
|
|
8465
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
8466
|
+
}
|
|
8467
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
8468
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
8469
|
+
}
|
|
8470
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
8471
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
8472
|
+
}
|
|
8473
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
8474
|
+
undefined) {
|
|
8475
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
8476
|
+
}
|
|
8477
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
8478
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
8479
|
+
}
|
|
8480
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
8481
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
8482
|
+
}
|
|
8483
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
8484
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
8485
|
+
}
|
|
8486
|
+
return toObject;
|
|
8487
|
+
}
|
|
8179
8488
|
function blobToMldev$1(fromObject, _rootObject) {
|
|
8180
8489
|
const toObject = {};
|
|
8181
8490
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -8211,16 +8520,16 @@ function candidateFromMldev(fromObject, rootObject) {
|
|
|
8211
8520
|
if (fromFinishReason != null) {
|
|
8212
8521
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
8213
8522
|
}
|
|
8214
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8215
|
-
if (fromAvgLogprobs != null) {
|
|
8216
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8217
|
-
}
|
|
8218
8523
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8219
8524
|
'groundingMetadata',
|
|
8220
8525
|
]);
|
|
8221
8526
|
if (fromGroundingMetadata != null) {
|
|
8222
8527
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8223
8528
|
}
|
|
8529
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8530
|
+
if (fromAvgLogprobs != null) {
|
|
8531
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8532
|
+
}
|
|
8224
8533
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
8225
8534
|
if (fromIndex != null) {
|
|
8226
8535
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -10324,10 +10633,11 @@ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
|
|
|
10324
10633
|
}
|
|
10325
10634
|
return toObject;
|
|
10326
10635
|
}
|
|
10327
|
-
function googleMapsToMldev$1(fromObject,
|
|
10636
|
+
function googleMapsToMldev$1(fromObject, rootObject) {
|
|
10328
10637
|
const toObject = {};
|
|
10329
|
-
|
|
10330
|
-
|
|
10638
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
10639
|
+
if (fromAuthConfig != null) {
|
|
10640
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$1(fromAuthConfig));
|
|
10331
10641
|
}
|
|
10332
10642
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
10333
10643
|
if (fromEnableWidget != null) {
|
|
@@ -10337,12 +10647,16 @@ function googleMapsToMldev$1(fromObject, _rootObject) {
|
|
|
10337
10647
|
}
|
|
10338
10648
|
function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
10339
10649
|
const toObject = {};
|
|
10340
|
-
|
|
10341
|
-
|
|
10650
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
10651
|
+
if (fromSearchTypes != null) {
|
|
10652
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10342
10653
|
}
|
|
10343
10654
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
10344
10655
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
10345
10656
|
}
|
|
10657
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10658
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10659
|
+
}
|
|
10346
10660
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
10347
10661
|
'timeRangeFilter',
|
|
10348
10662
|
]);
|
|
@@ -10364,6 +10678,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10364
10678
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10365
10679
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10366
10680
|
}
|
|
10681
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
10682
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
10683
|
+
}
|
|
10367
10684
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10368
10685
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10369
10686
|
}
|
|
@@ -10371,6 +10688,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10371
10688
|
undefined) {
|
|
10372
10689
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
10373
10690
|
}
|
|
10691
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
10692
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
10693
|
+
}
|
|
10374
10694
|
return toObject;
|
|
10375
10695
|
}
|
|
10376
10696
|
function imageConfigToVertex(fromObject, _rootObject) {
|
|
@@ -10389,6 +10709,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10389
10709
|
if (fromPersonGeneration != null) {
|
|
10390
10710
|
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10391
10711
|
}
|
|
10712
|
+
const fromProminentPeople = getValueByPath(fromObject, [
|
|
10713
|
+
'prominentPeople',
|
|
10714
|
+
]);
|
|
10715
|
+
if (fromProminentPeople != null) {
|
|
10716
|
+
setValueByPath(toObject, ['prominentPeople'], fromProminentPeople);
|
|
10717
|
+
}
|
|
10392
10718
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10393
10719
|
'outputMimeType',
|
|
10394
10720
|
]);
|
|
@@ -10401,6 +10727,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10401
10727
|
if (fromOutputCompressionQuality != null) {
|
|
10402
10728
|
setValueByPath(toObject, ['imageOutputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
10403
10729
|
}
|
|
10730
|
+
const fromImageOutputOptions = getValueByPath(fromObject, [
|
|
10731
|
+
'imageOutputOptions',
|
|
10732
|
+
]);
|
|
10733
|
+
if (fromImageOutputOptions != null) {
|
|
10734
|
+
setValueByPath(toObject, ['imageOutputOptions'], fromImageOutputOptions);
|
|
10735
|
+
}
|
|
10404
10736
|
return toObject;
|
|
10405
10737
|
}
|
|
10406
10738
|
function imageFromMldev(fromObject, _rootObject) {
|
|
@@ -11116,6 +11448,14 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11116
11448
|
if (fromFileSearch != null) {
|
|
11117
11449
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
11118
11450
|
}
|
|
11451
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11452
|
+
if (fromGoogleSearch != null) {
|
|
11453
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11454
|
+
}
|
|
11455
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11456
|
+
if (fromGoogleMaps != null) {
|
|
11457
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11458
|
+
}
|
|
11119
11459
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11120
11460
|
'codeExecution',
|
|
11121
11461
|
]);
|
|
@@ -11137,24 +11477,29 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11137
11477
|
}
|
|
11138
11478
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11139
11479
|
}
|
|
11140
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11141
|
-
if (fromGoogleMaps != null) {
|
|
11142
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11143
|
-
}
|
|
11144
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11145
|
-
if (fromGoogleSearch != null) {
|
|
11146
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11147
|
-
}
|
|
11148
11480
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11149
11481
|
'googleSearchRetrieval',
|
|
11150
11482
|
]);
|
|
11151
11483
|
if (fromGoogleSearchRetrieval != null) {
|
|
11152
11484
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11153
11485
|
}
|
|
11486
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
11487
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
11488
|
+
}
|
|
11154
11489
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11155
11490
|
if (fromUrlContext != null) {
|
|
11156
11491
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11157
11492
|
}
|
|
11493
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
11494
|
+
if (fromMcpServers != null) {
|
|
11495
|
+
let transformedList = fromMcpServers;
|
|
11496
|
+
if (Array.isArray(transformedList)) {
|
|
11497
|
+
transformedList = transformedList.map((item) => {
|
|
11498
|
+
return item;
|
|
11499
|
+
});
|
|
11500
|
+
}
|
|
11501
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
11502
|
+
}
|
|
11158
11503
|
return toObject;
|
|
11159
11504
|
}
|
|
11160
11505
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -11170,6 +11515,14 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11170
11515
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
11171
11516
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
11172
11517
|
}
|
|
11518
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11519
|
+
if (fromGoogleSearch != null) {
|
|
11520
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11521
|
+
}
|
|
11522
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11523
|
+
if (fromGoogleMaps != null) {
|
|
11524
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11525
|
+
}
|
|
11173
11526
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11174
11527
|
'codeExecution',
|
|
11175
11528
|
]);
|
|
@@ -11194,24 +11547,25 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11194
11547
|
}
|
|
11195
11548
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11196
11549
|
}
|
|
11197
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11198
|
-
if (fromGoogleMaps != null) {
|
|
11199
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11200
|
-
}
|
|
11201
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11202
|
-
if (fromGoogleSearch != null) {
|
|
11203
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11204
|
-
}
|
|
11205
11550
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11206
11551
|
'googleSearchRetrieval',
|
|
11207
11552
|
]);
|
|
11208
11553
|
if (fromGoogleSearchRetrieval != null) {
|
|
11209
11554
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11210
11555
|
}
|
|
11556
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
11557
|
+
'parallelAiSearch',
|
|
11558
|
+
]);
|
|
11559
|
+
if (fromParallelAiSearch != null) {
|
|
11560
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
11561
|
+
}
|
|
11211
11562
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11212
11563
|
if (fromUrlContext != null) {
|
|
11213
11564
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11214
11565
|
}
|
|
11566
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
11567
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
11568
|
+
}
|
|
11215
11569
|
return toObject;
|
|
11216
11570
|
}
|
|
11217
11571
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -11768,7 +12122,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11768
12122
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11769
12123
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11770
12124
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11771
|
-
const SDK_VERSION = '1.
|
|
12125
|
+
const SDK_VERSION = '1.44.0'; // x-release-please-version
|
|
11772
12126
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11773
12127
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11774
12128
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11787,6 +12141,9 @@ const DEFAULT_RETRY_HTTP_STATUS_CODES = [
|
|
|
11787
12141
|
/**
|
|
11788
12142
|
* The ApiClient class is used to send requests to the Gemini API or Vertex AI
|
|
11789
12143
|
* endpoints.
|
|
12144
|
+
*
|
|
12145
|
+
* WARNING: This is an internal API and may change without notice. Direct usage
|
|
12146
|
+
* is not supported and may break your application.
|
|
11790
12147
|
*/
|
|
11791
12148
|
class ApiClient {
|
|
11792
12149
|
constructor(opts) {
|
|
@@ -11834,10 +12191,7 @@ class ApiClient {
|
|
|
11834
12191
|
else {
|
|
11835
12192
|
// Gemini API
|
|
11836
12193
|
if (!this.clientOptions.apiKey) {
|
|
11837
|
-
|
|
11838
|
-
message: 'API key must be set when using the Gemini API.',
|
|
11839
|
-
status: 403,
|
|
11840
|
-
});
|
|
12194
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
11841
12195
|
}
|
|
11842
12196
|
initHttpOptions.apiVersion =
|
|
11843
12197
|
(_c = this.clientOptions.apiVersion) !== null && _c !== void 0 ? _c : GOOGLE_AI_API_DEFAULT_VERSION;
|
|
@@ -15100,6 +15454,33 @@ class Operations extends BaseModule {
|
|
|
15100
15454
|
* Copyright 2025 Google LLC
|
|
15101
15455
|
* SPDX-License-Identifier: Apache-2.0
|
|
15102
15456
|
*/
|
|
15457
|
+
function authConfigToMldev(fromObject) {
|
|
15458
|
+
const toObject = {};
|
|
15459
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
15460
|
+
if (fromApiKey != null) {
|
|
15461
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
15462
|
+
}
|
|
15463
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
15464
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
15465
|
+
}
|
|
15466
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
15467
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
15468
|
+
}
|
|
15469
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
15470
|
+
undefined) {
|
|
15471
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
15472
|
+
}
|
|
15473
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
15474
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
15475
|
+
}
|
|
15476
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
15477
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
15478
|
+
}
|
|
15479
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
15480
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
15481
|
+
}
|
|
15482
|
+
return toObject;
|
|
15483
|
+
}
|
|
15103
15484
|
function blobToMldev(fromObject) {
|
|
15104
15485
|
const toObject = {};
|
|
15105
15486
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -15210,8 +15591,9 @@ function functionCallToMldev(fromObject) {
|
|
|
15210
15591
|
}
|
|
15211
15592
|
function googleMapsToMldev(fromObject) {
|
|
15212
15593
|
const toObject = {};
|
|
15213
|
-
|
|
15214
|
-
|
|
15594
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
15595
|
+
if (fromAuthConfig != null) {
|
|
15596
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev(fromAuthConfig));
|
|
15215
15597
|
}
|
|
15216
15598
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
15217
15599
|
if (fromEnableWidget != null) {
|
|
@@ -15221,12 +15603,16 @@ function googleMapsToMldev(fromObject) {
|
|
|
15221
15603
|
}
|
|
15222
15604
|
function googleSearchToMldev(fromObject) {
|
|
15223
15605
|
const toObject = {};
|
|
15224
|
-
|
|
15225
|
-
|
|
15606
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
15607
|
+
if (fromSearchTypes != null) {
|
|
15608
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15226
15609
|
}
|
|
15227
15610
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
15228
15611
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
15229
15612
|
}
|
|
15613
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15614
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15615
|
+
}
|
|
15230
15616
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
15231
15617
|
'timeRangeFilter',
|
|
15232
15618
|
]);
|
|
@@ -15444,6 +15830,14 @@ function toolToMldev(fromObject) {
|
|
|
15444
15830
|
if (fromFileSearch != null) {
|
|
15445
15831
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
15446
15832
|
}
|
|
15833
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15834
|
+
if (fromGoogleSearch != null) {
|
|
15835
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15836
|
+
}
|
|
15837
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15838
|
+
if (fromGoogleMaps != null) {
|
|
15839
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15840
|
+
}
|
|
15447
15841
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15448
15842
|
'codeExecution',
|
|
15449
15843
|
]);
|
|
@@ -15465,24 +15859,29 @@ function toolToMldev(fromObject) {
|
|
|
15465
15859
|
}
|
|
15466
15860
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15467
15861
|
}
|
|
15468
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15469
|
-
if (fromGoogleMaps != null) {
|
|
15470
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15471
|
-
}
|
|
15472
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15473
|
-
if (fromGoogleSearch != null) {
|
|
15474
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15475
|
-
}
|
|
15476
15862
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15477
15863
|
'googleSearchRetrieval',
|
|
15478
15864
|
]);
|
|
15479
15865
|
if (fromGoogleSearchRetrieval != null) {
|
|
15480
15866
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15481
15867
|
}
|
|
15868
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
15869
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
15870
|
+
}
|
|
15482
15871
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15483
15872
|
if (fromUrlContext != null) {
|
|
15484
15873
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
15485
15874
|
}
|
|
15875
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
15876
|
+
if (fromMcpServers != null) {
|
|
15877
|
+
let transformedList = fromMcpServers;
|
|
15878
|
+
if (Array.isArray(transformedList)) {
|
|
15879
|
+
transformedList = transformedList.map((item) => {
|
|
15880
|
+
return item;
|
|
15881
|
+
});
|
|
15882
|
+
}
|
|
15883
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15884
|
+
}
|
|
15486
15885
|
return toObject;
|
|
15487
15886
|
}
|
|
15488
15887
|
|
|
@@ -16469,166 +16868,6 @@ const safeJSON = (text) => {
|
|
|
16469
16868
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16470
16869
|
const sleep$1 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16471
16870
|
|
|
16472
|
-
/**
|
|
16473
|
-
* @license
|
|
16474
|
-
* Copyright 2025 Google LLC
|
|
16475
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16476
|
-
*/
|
|
16477
|
-
const VERSION = '0.0.1';
|
|
16478
|
-
|
|
16479
|
-
/**
|
|
16480
|
-
* @license
|
|
16481
|
-
* Copyright 2025 Google LLC
|
|
16482
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16483
|
-
*/
|
|
16484
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16485
|
-
/**
|
|
16486
|
-
* Note this does not detect 'browser'; for that, use getBrowserInfo().
|
|
16487
|
-
*/
|
|
16488
|
-
function getDetectedPlatform() {
|
|
16489
|
-
if (typeof Deno !== 'undefined' && Deno.build != null) {
|
|
16490
|
-
return 'deno';
|
|
16491
|
-
}
|
|
16492
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16493
|
-
return 'edge';
|
|
16494
|
-
}
|
|
16495
|
-
if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {
|
|
16496
|
-
return 'node';
|
|
16497
|
-
}
|
|
16498
|
-
return 'unknown';
|
|
16499
|
-
}
|
|
16500
|
-
const getPlatformProperties = () => {
|
|
16501
|
-
var _a, _b, _c, _d, _e;
|
|
16502
|
-
const detectedPlatform = getDetectedPlatform();
|
|
16503
|
-
if (detectedPlatform === 'deno') {
|
|
16504
|
-
return {
|
|
16505
|
-
'X-Stainless-Lang': 'js',
|
|
16506
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16507
|
-
'X-Stainless-OS': normalizePlatform(Deno.build.os),
|
|
16508
|
-
'X-Stainless-Arch': normalizeArch(Deno.build.arch),
|
|
16509
|
-
'X-Stainless-Runtime': 'deno',
|
|
16510
|
-
'X-Stainless-Runtime-Version': typeof Deno.version === 'string' ? Deno.version : (_b = (_a = Deno.version) === null || _a === void 0 ? void 0 : _a.deno) !== null && _b !== void 0 ? _b : 'unknown',
|
|
16511
|
-
};
|
|
16512
|
-
}
|
|
16513
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16514
|
-
return {
|
|
16515
|
-
'X-Stainless-Lang': 'js',
|
|
16516
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16517
|
-
'X-Stainless-OS': 'Unknown',
|
|
16518
|
-
'X-Stainless-Arch': `other:${EdgeRuntime}`,
|
|
16519
|
-
'X-Stainless-Runtime': 'edge',
|
|
16520
|
-
'X-Stainless-Runtime-Version': globalThis.process.version,
|
|
16521
|
-
};
|
|
16522
|
-
}
|
|
16523
|
-
// Check if Node.js
|
|
16524
|
-
if (detectedPlatform === 'node') {
|
|
16525
|
-
return {
|
|
16526
|
-
'X-Stainless-Lang': 'js',
|
|
16527
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16528
|
-
'X-Stainless-OS': normalizePlatform((_c = globalThis.process.platform) !== null && _c !== void 0 ? _c : 'unknown'),
|
|
16529
|
-
'X-Stainless-Arch': normalizeArch((_d = globalThis.process.arch) !== null && _d !== void 0 ? _d : 'unknown'),
|
|
16530
|
-
'X-Stainless-Runtime': 'node',
|
|
16531
|
-
'X-Stainless-Runtime-Version': (_e = globalThis.process.version) !== null && _e !== void 0 ? _e : 'unknown',
|
|
16532
|
-
};
|
|
16533
|
-
}
|
|
16534
|
-
const browserInfo = getBrowserInfo();
|
|
16535
|
-
if (browserInfo) {
|
|
16536
|
-
return {
|
|
16537
|
-
'X-Stainless-Lang': 'js',
|
|
16538
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16539
|
-
'X-Stainless-OS': 'Unknown',
|
|
16540
|
-
'X-Stainless-Arch': 'unknown',
|
|
16541
|
-
'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
|
|
16542
|
-
'X-Stainless-Runtime-Version': browserInfo.version,
|
|
16543
|
-
};
|
|
16544
|
-
}
|
|
16545
|
-
// TODO add support for Cloudflare workers, etc.
|
|
16546
|
-
return {
|
|
16547
|
-
'X-Stainless-Lang': 'js',
|
|
16548
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16549
|
-
'X-Stainless-OS': 'Unknown',
|
|
16550
|
-
'X-Stainless-Arch': 'unknown',
|
|
16551
|
-
'X-Stainless-Runtime': 'unknown',
|
|
16552
|
-
'X-Stainless-Runtime-Version': 'unknown',
|
|
16553
|
-
};
|
|
16554
|
-
};
|
|
16555
|
-
// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
|
|
16556
|
-
function getBrowserInfo() {
|
|
16557
|
-
if (typeof navigator === 'undefined' || !navigator) {
|
|
16558
|
-
return null;
|
|
16559
|
-
}
|
|
16560
|
-
// NOTE: The order matters here!
|
|
16561
|
-
const browserPatterns = [
|
|
16562
|
-
{ key: 'edge', pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16563
|
-
{ key: 'ie', pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16564
|
-
{ key: 'ie', pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16565
|
-
{ key: 'chrome', pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16566
|
-
{ key: 'firefox', pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16567
|
-
{ key: 'safari', pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
|
|
16568
|
-
];
|
|
16569
|
-
// Find the FIRST matching browser
|
|
16570
|
-
for (const { key, pattern } of browserPatterns) {
|
|
16571
|
-
const match = pattern.exec(navigator.userAgent);
|
|
16572
|
-
if (match) {
|
|
16573
|
-
const major = match[1] || 0;
|
|
16574
|
-
const minor = match[2] || 0;
|
|
16575
|
-
const patch = match[3] || 0;
|
|
16576
|
-
return { browser: key, version: `${major}.${minor}.${patch}` };
|
|
16577
|
-
}
|
|
16578
|
-
}
|
|
16579
|
-
return null;
|
|
16580
|
-
}
|
|
16581
|
-
const normalizeArch = (arch) => {
|
|
16582
|
-
// Node docs:
|
|
16583
|
-
// - https://nodejs.org/api/process.html#processarch
|
|
16584
|
-
// Deno docs:
|
|
16585
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16586
|
-
if (arch === 'x32')
|
|
16587
|
-
return 'x32';
|
|
16588
|
-
if (arch === 'x86_64' || arch === 'x64')
|
|
16589
|
-
return 'x64';
|
|
16590
|
-
if (arch === 'arm')
|
|
16591
|
-
return 'arm';
|
|
16592
|
-
if (arch === 'aarch64' || arch === 'arm64')
|
|
16593
|
-
return 'arm64';
|
|
16594
|
-
if (arch)
|
|
16595
|
-
return `other:${arch}`;
|
|
16596
|
-
return 'unknown';
|
|
16597
|
-
};
|
|
16598
|
-
const normalizePlatform = (platform) => {
|
|
16599
|
-
// Node platforms:
|
|
16600
|
-
// - https://nodejs.org/api/process.html#processplatform
|
|
16601
|
-
// Deno platforms:
|
|
16602
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16603
|
-
// - https://github.com/denoland/deno/issues/14799
|
|
16604
|
-
platform = platform.toLowerCase();
|
|
16605
|
-
// NOTE: this iOS check is untested and may not work
|
|
16606
|
-
// Node does not work natively on IOS, there is a fork at
|
|
16607
|
-
// https://github.com/nodejs-mobile/nodejs-mobile
|
|
16608
|
-
// however it is unknown at the time of writing how to detect if it is running
|
|
16609
|
-
if (platform.includes('ios'))
|
|
16610
|
-
return 'iOS';
|
|
16611
|
-
if (platform === 'android')
|
|
16612
|
-
return 'Android';
|
|
16613
|
-
if (platform === 'darwin')
|
|
16614
|
-
return 'MacOS';
|
|
16615
|
-
if (platform === 'win32')
|
|
16616
|
-
return 'Windows';
|
|
16617
|
-
if (platform === 'freebsd')
|
|
16618
|
-
return 'FreeBSD';
|
|
16619
|
-
if (platform === 'openbsd')
|
|
16620
|
-
return 'OpenBSD';
|
|
16621
|
-
if (platform === 'linux')
|
|
16622
|
-
return 'Linux';
|
|
16623
|
-
if (platform)
|
|
16624
|
-
return `Other:${platform}`;
|
|
16625
|
-
return 'Unknown';
|
|
16626
|
-
};
|
|
16627
|
-
let _platformHeaders;
|
|
16628
|
-
const getPlatformHeaders = () => {
|
|
16629
|
-
return (_platformHeaders !== null && _platformHeaders !== void 0 ? _platformHeaders : (_platformHeaders = getPlatformProperties()));
|
|
16630
|
-
};
|
|
16631
|
-
|
|
16632
16871
|
/**
|
|
16633
16872
|
* @license
|
|
16634
16873
|
* Copyright 2025 Google LLC
|
|
@@ -16734,6 +16973,13 @@ const FallbackEncoder = ({ headers, body }) => {
|
|
|
16734
16973
|
};
|
|
16735
16974
|
};
|
|
16736
16975
|
|
|
16976
|
+
/**
|
|
16977
|
+
* @license
|
|
16978
|
+
* Copyright 2025 Google LLC
|
|
16979
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16980
|
+
*/
|
|
16981
|
+
const VERSION = '0.0.1';
|
|
16982
|
+
|
|
16737
16983
|
/**
|
|
16738
16984
|
* @license
|
|
16739
16985
|
* Copyright 2025 Google LLC
|
|
@@ -16940,14 +17186,17 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(st
|
|
|
16940
17186
|
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
16941
17187
|
}, '');
|
|
16942
17188
|
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
16943
|
-
const invalidSegmentPattern = /(
|
|
17189
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
16944
17190
|
let match;
|
|
16945
17191
|
// Find all invalid segments
|
|
16946
17192
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
17193
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
17194
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
17195
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
16947
17196
|
invalidSegments.push({
|
|
16948
|
-
start: match.index,
|
|
16949
|
-
length:
|
|
16950
|
-
error: `Value "${
|
|
17197
|
+
start: match.index + offset,
|
|
17198
|
+
length: cleanMatch.length,
|
|
17199
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
16951
17200
|
});
|
|
16952
17201
|
}
|
|
16953
17202
|
invalidSegments.sort((a, b) => a.start - b.start);
|
|
@@ -17069,8 +17318,10 @@ class LineDecoder {
|
|
|
17069
17318
|
constructor() {
|
|
17070
17319
|
this.buffer = new Uint8Array();
|
|
17071
17320
|
this.carriageReturnIndex = null;
|
|
17321
|
+
this.searchIndex = 0;
|
|
17072
17322
|
}
|
|
17073
17323
|
decode(chunk) {
|
|
17324
|
+
var _a;
|
|
17074
17325
|
if (chunk == null) {
|
|
17075
17326
|
return [];
|
|
17076
17327
|
}
|
|
@@ -17080,7 +17331,7 @@ class LineDecoder {
|
|
|
17080
17331
|
this.buffer = concatBytes([this.buffer, binaryChunk]);
|
|
17081
17332
|
const lines = [];
|
|
17082
17333
|
let patternIndex;
|
|
17083
|
-
while ((patternIndex = findNewlineIndex(this.buffer, this.carriageReturnIndex)) != null) {
|
|
17334
|
+
while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
|
|
17084
17335
|
if (patternIndex.carriage && this.carriageReturnIndex == null) {
|
|
17085
17336
|
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
17086
17337
|
this.carriageReturnIndex = patternIndex.index;
|
|
@@ -17092,6 +17343,7 @@ class LineDecoder {
|
|
|
17092
17343
|
lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
|
|
17093
17344
|
this.buffer = this.buffer.subarray(this.carriageReturnIndex);
|
|
17094
17345
|
this.carriageReturnIndex = null;
|
|
17346
|
+
this.searchIndex = 0;
|
|
17095
17347
|
continue;
|
|
17096
17348
|
}
|
|
17097
17349
|
const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
@@ -17099,7 +17351,9 @@ class LineDecoder {
|
|
|
17099
17351
|
lines.push(line);
|
|
17100
17352
|
this.buffer = this.buffer.subarray(patternIndex.index);
|
|
17101
17353
|
this.carriageReturnIndex = null;
|
|
17354
|
+
this.searchIndex = 0;
|
|
17102
17355
|
}
|
|
17356
|
+
this.searchIndex = Math.max(0, this.buffer.length - 1);
|
|
17103
17357
|
return lines;
|
|
17104
17358
|
}
|
|
17105
17359
|
flush() {
|
|
@@ -17124,41 +17378,23 @@ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
|
17124
17378
|
function findNewlineIndex(buffer, startIndex) {
|
|
17125
17379
|
const newline = 0x0a; // \n
|
|
17126
17380
|
const carriage = 0x0d; // \r
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
return { preceding: i, index: i + 1, carriage: true };
|
|
17133
|
-
}
|
|
17381
|
+
const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
|
|
17382
|
+
const nextNewline = buffer.indexOf(newline, start);
|
|
17383
|
+
const nextCarriage = buffer.indexOf(carriage, start);
|
|
17384
|
+
if (nextNewline === -1 && nextCarriage === -1) {
|
|
17385
|
+
return null;
|
|
17134
17386
|
}
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
17139
|
-
// and returns the index right after the first occurrence of any pattern,
|
|
17140
|
-
// or -1 if none of the patterns are found.
|
|
17141
|
-
const newline = 0x0a; // \n
|
|
17142
|
-
const carriage = 0x0d; // \r
|
|
17143
|
-
for (let i = 0; i < buffer.length - 1; i++) {
|
|
17144
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
17145
|
-
// \n\n
|
|
17146
|
-
return i + 2;
|
|
17147
|
-
}
|
|
17148
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
17149
|
-
// \r\r
|
|
17150
|
-
return i + 2;
|
|
17151
|
-
}
|
|
17152
|
-
if (buffer[i] === carriage &&
|
|
17153
|
-
buffer[i + 1] === newline &&
|
|
17154
|
-
i + 3 < buffer.length &&
|
|
17155
|
-
buffer[i + 2] === carriage &&
|
|
17156
|
-
buffer[i + 3] === newline) {
|
|
17157
|
-
// \r\n\r\n
|
|
17158
|
-
return i + 4;
|
|
17159
|
-
}
|
|
17387
|
+
let i;
|
|
17388
|
+
if (nextNewline !== -1 && nextCarriage !== -1) {
|
|
17389
|
+
i = Math.min(nextNewline, nextCarriage);
|
|
17160
17390
|
}
|
|
17161
|
-
|
|
17391
|
+
else {
|
|
17392
|
+
i = nextNewline !== -1 ? nextNewline : nextCarriage;
|
|
17393
|
+
}
|
|
17394
|
+
if (buffer[i] === newline) {
|
|
17395
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
17396
|
+
}
|
|
17397
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
17162
17398
|
}
|
|
17163
17399
|
|
|
17164
17400
|
/**
|
|
@@ -17469,7 +17705,7 @@ function _iterSSEMessages(response, controller) {
|
|
|
17469
17705
|
const lineDecoder = new LineDecoder();
|
|
17470
17706
|
const iter = ReadableStreamToAsyncIterable(response.body);
|
|
17471
17707
|
try {
|
|
17472
|
-
for (var _d = true, _e = __asyncValues(
|
|
17708
|
+
for (var _d = true, _e = __asyncValues(iterBinaryChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
17473
17709
|
_c = _f.value;
|
|
17474
17710
|
_d = false;
|
|
17475
17711
|
const sseChunk = _c;
|
|
@@ -17495,13 +17731,12 @@ function _iterSSEMessages(response, controller) {
|
|
|
17495
17731
|
});
|
|
17496
17732
|
}
|
|
17497
17733
|
/**
|
|
17498
|
-
* Given an async iterable iterator,
|
|
17499
|
-
*
|
|
17734
|
+
* Given an async iterable iterator, normalizes each chunk to a
|
|
17735
|
+
* Uint8Array and yields it.
|
|
17500
17736
|
*/
|
|
17501
|
-
function
|
|
17502
|
-
return __asyncGenerator(this, arguments, function*
|
|
17737
|
+
function iterBinaryChunks(iterator) {
|
|
17738
|
+
return __asyncGenerator(this, arguments, function* iterBinaryChunks_1() {
|
|
17503
17739
|
var _a, e_5, _b, _c;
|
|
17504
|
-
let data = new Uint8Array();
|
|
17505
17740
|
try {
|
|
17506
17741
|
for (var _d = true, iterator_3 = __asyncValues(iterator), iterator_3_1; iterator_3_1 = yield __await(iterator_3.next()), _a = iterator_3_1.done, !_a; _d = true) {
|
|
17507
17742
|
_c = iterator_3_1.value;
|
|
@@ -17513,15 +17748,7 @@ function iterSSEChunks(iterator) {
|
|
|
17513
17748
|
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
17514
17749
|
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
|
17515
17750
|
: chunk;
|
|
17516
|
-
|
|
17517
|
-
newData.set(data);
|
|
17518
|
-
newData.set(binaryChunk, data.length);
|
|
17519
|
-
data = newData;
|
|
17520
|
-
let patternIndex;
|
|
17521
|
-
while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
|
|
17522
|
-
yield yield __await(data.slice(0, patternIndex));
|
|
17523
|
-
data = data.slice(patternIndex);
|
|
17524
|
-
}
|
|
17751
|
+
yield yield __await(binaryChunk);
|
|
17525
17752
|
}
|
|
17526
17753
|
}
|
|
17527
17754
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -17531,9 +17758,6 @@ function iterSSEChunks(iterator) {
|
|
|
17531
17758
|
}
|
|
17532
17759
|
finally { if (e_5) throw e_5.error; }
|
|
17533
17760
|
}
|
|
17534
|
-
if (data.length > 0) {
|
|
17535
|
-
yield yield __await(data);
|
|
17536
|
-
}
|
|
17537
17761
|
});
|
|
17538
17762
|
}
|
|
17539
17763
|
class SSEDecoder {
|
|
@@ -18185,7 +18409,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18185
18409
|
const authHeaders = await this.authHeaders(options);
|
|
18186
18410
|
let headers = buildHeaders([
|
|
18187
18411
|
idempotencyHeaders,
|
|
18188
|
-
|
|
18412
|
+
{ Accept: 'application/json', 'User-Agent': this.getUserAgent() },
|
|
18189
18413
|
this._options.defaultHeaders,
|
|
18190
18414
|
bodyHeaders,
|
|
18191
18415
|
options.headers,
|
|
@@ -19208,10 +19432,28 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19208
19432
|
if (fromCustomBaseModel != null) {
|
|
19209
19433
|
setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
|
|
19210
19434
|
}
|
|
19435
|
+
const fromEvaluateDatasetRuns = getValueByPath(fromObject, [
|
|
19436
|
+
'evaluateDatasetRuns',
|
|
19437
|
+
]);
|
|
19438
|
+
if (fromEvaluateDatasetRuns != null) {
|
|
19439
|
+
let transformedList = fromEvaluateDatasetRuns;
|
|
19440
|
+
if (Array.isArray(transformedList)) {
|
|
19441
|
+
transformedList = transformedList.map((item) => {
|
|
19442
|
+
return item;
|
|
19443
|
+
});
|
|
19444
|
+
}
|
|
19445
|
+
setValueByPath(toObject, ['evaluateDatasetRuns'], transformedList);
|
|
19446
|
+
}
|
|
19211
19447
|
const fromExperiment = getValueByPath(fromObject, ['experiment']);
|
|
19212
19448
|
if (fromExperiment != null) {
|
|
19213
19449
|
setValueByPath(toObject, ['experiment'], fromExperiment);
|
|
19214
19450
|
}
|
|
19451
|
+
const fromFullFineTuningSpec = getValueByPath(fromObject, [
|
|
19452
|
+
'fullFineTuningSpec',
|
|
19453
|
+
]);
|
|
19454
|
+
if (fromFullFineTuningSpec != null) {
|
|
19455
|
+
setValueByPath(toObject, ['fullFineTuningSpec'], fromFullFineTuningSpec);
|
|
19456
|
+
}
|
|
19215
19457
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
19216
19458
|
if (fromLabels != null) {
|
|
19217
19459
|
setValueByPath(toObject, ['labels'], fromLabels);
|
|
@@ -19236,6 +19478,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19236
19478
|
if (fromTunedModelDisplayName != null) {
|
|
19237
19479
|
setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
|
|
19238
19480
|
}
|
|
19481
|
+
const fromTuningJobState = getValueByPath(fromObject, [
|
|
19482
|
+
'tuningJobState',
|
|
19483
|
+
]);
|
|
19484
|
+
if (fromTuningJobState != null) {
|
|
19485
|
+
setValueByPath(toObject, ['tuningJobState'], fromTuningJobState);
|
|
19486
|
+
}
|
|
19239
19487
|
const fromVeoTuningSpec = getValueByPath(fromObject, [
|
|
19240
19488
|
'veoTuningSpec',
|
|
19241
19489
|
]);
|
|
@@ -20088,7 +20336,7 @@ class GoogleGenAI {
|
|
|
20088
20336
|
this.project = (_d = options.project) !== null && _d !== void 0 ? _d : envProject;
|
|
20089
20337
|
this.location = (_e = options.location) !== null && _e !== void 0 ? _e : envLocation;
|
|
20090
20338
|
if (!this.vertexai && !this.apiKey) {
|
|
20091
|
-
|
|
20339
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
20092
20340
|
}
|
|
20093
20341
|
// Handle when to use Vertex AI in express mode (api key)
|
|
20094
20342
|
if (options.vertexai) {
|
|
@@ -20199,6 +20447,7 @@ exports.DeleteFileResponse = DeleteFileResponse;
|
|
|
20199
20447
|
exports.DeleteModelResponse = DeleteModelResponse;
|
|
20200
20448
|
exports.EditImageResponse = EditImageResponse;
|
|
20201
20449
|
exports.EmbedContentResponse = EmbedContentResponse;
|
|
20450
|
+
exports.EvaluateDatasetResponse = EvaluateDatasetResponse;
|
|
20202
20451
|
exports.Files = Files;
|
|
20203
20452
|
exports.FunctionResponse = FunctionResponse;
|
|
20204
20453
|
exports.FunctionResponseBlob = FunctionResponseBlob;
|