@google/genai 1.43.0 → 1.45.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 +629 -257
- package/dist/index.cjs +531 -364
- package/dist/index.mjs +531 -365
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +532 -365
- package/dist/node/index.mjs +532 -366
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +629 -257
- package/dist/tokenizer/node.cjs +171 -67
- package/dist/tokenizer/node.d.ts +96 -83
- package/dist/tokenizer/node.mjs +171 -67
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +2980 -0
- package/dist/vertex_internal/index.cjs.map +1 -0
- package/dist/vertex_internal/index.d.ts +7960 -0
- package/dist/vertex_internal/index.js +2951 -0
- package/dist/vertex_internal/index.js.map +1 -0
- package/dist/web/index.mjs +531 -365
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +629 -257
- package/package.json +13 -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
|
/**
|
|
@@ -736,22 +736,6 @@ exports.PhishBlockThreshold = void 0;
|
|
|
736
736
|
*/
|
|
737
737
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
738
738
|
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
739
|
-
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
740
|
-
exports.ApiSpec = void 0;
|
|
741
|
-
(function (ApiSpec) {
|
|
742
|
-
/**
|
|
743
|
-
* Unspecified API spec. This value should not be used.
|
|
744
|
-
*/
|
|
745
|
-
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
746
|
-
/**
|
|
747
|
-
* Simple search API spec.
|
|
748
|
-
*/
|
|
749
|
-
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
750
|
-
/**
|
|
751
|
-
* Elastic search API spec.
|
|
752
|
-
*/
|
|
753
|
-
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
754
|
-
})(exports.ApiSpec || (exports.ApiSpec = {}));
|
|
755
739
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
756
740
|
exports.AuthType = void 0;
|
|
757
741
|
(function (AuthType) {
|
|
@@ -806,6 +790,22 @@ exports.HttpElementLocation = void 0;
|
|
|
806
790
|
*/
|
|
807
791
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
808
792
|
})(exports.HttpElementLocation || (exports.HttpElementLocation = {}));
|
|
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
|
+
/**
|
|
797
|
+
* Unspecified API spec. This value should not be used.
|
|
798
|
+
*/
|
|
799
|
+
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
800
|
+
/**
|
|
801
|
+
* Simple search API spec.
|
|
802
|
+
*/
|
|
803
|
+
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
804
|
+
/**
|
|
805
|
+
* Elastic search API spec.
|
|
806
|
+
*/
|
|
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) {
|
|
@@ -1424,22 +1544,6 @@ exports.SafetyFilterLevel = void 0;
|
|
|
1424
1544
|
SafetyFilterLevel["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
|
|
1425
1545
|
SafetyFilterLevel["BLOCK_NONE"] = "BLOCK_NONE";
|
|
1426
1546
|
})(exports.SafetyFilterLevel || (exports.SafetyFilterLevel = {}));
|
|
1427
|
-
/** Enum that controls the generation of people. */
|
|
1428
|
-
exports.PersonGeneration = void 0;
|
|
1429
|
-
(function (PersonGeneration) {
|
|
1430
|
-
/**
|
|
1431
|
-
* Block generation of images of people.
|
|
1432
|
-
*/
|
|
1433
|
-
PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
|
|
1434
|
-
/**
|
|
1435
|
-
* Generate images of adults, but not children.
|
|
1436
|
-
*/
|
|
1437
|
-
PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
|
|
1438
|
-
/**
|
|
1439
|
-
* Generate images that include adults and children.
|
|
1440
|
-
*/
|
|
1441
|
-
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
1442
|
-
})(exports.PersonGeneration || (exports.PersonGeneration = {}));
|
|
1443
1547
|
/** Enum that specifies the language of the text in the prompt. */
|
|
1444
1548
|
exports.ImagePromptLanguage = void 0;
|
|
1445
1549
|
(function (ImagePromptLanguage) {
|
|
@@ -2338,6 +2442,9 @@ class GenerateVideosOperation {
|
|
|
2338
2442
|
return operation;
|
|
2339
2443
|
}
|
|
2340
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
|
+
}
|
|
2341
2448
|
/** Response for the list tuning jobs method. */
|
|
2342
2449
|
class ListTuningJobsResponse {
|
|
2343
2450
|
}
|
|
@@ -3457,6 +3564,33 @@ function tIsVertexEmbedContentModel(model) {
|
|
|
3457
3564
|
* Copyright 2025 Google LLC
|
|
3458
3565
|
* SPDX-License-Identifier: Apache-2.0
|
|
3459
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
|
+
}
|
|
3460
3594
|
function batchJobDestinationFromMldev(fromObject) {
|
|
3461
3595
|
const toObject = {};
|
|
3462
3596
|
const fromFileName = getValueByPath(fromObject, ['responsesFile']);
|
|
@@ -4306,8 +4440,9 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
|
|
|
4306
4440
|
}
|
|
4307
4441
|
function googleMapsToMldev$4(fromObject) {
|
|
4308
4442
|
const toObject = {};
|
|
4309
|
-
|
|
4310
|
-
|
|
4443
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
4444
|
+
if (fromAuthConfig != null) {
|
|
4445
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$4(fromAuthConfig));
|
|
4311
4446
|
}
|
|
4312
4447
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
4313
4448
|
if (fromEnableWidget != null) {
|
|
@@ -4321,12 +4456,12 @@ function googleSearchToMldev$4(fromObject) {
|
|
|
4321
4456
|
if (fromSearchTypes != null) {
|
|
4322
4457
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4323
4458
|
}
|
|
4324
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4325
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4326
|
-
}
|
|
4327
4459
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
4328
4460
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
4329
4461
|
}
|
|
4462
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4463
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4464
|
+
}
|
|
4330
4465
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
4331
4466
|
'timeRangeFilter',
|
|
4332
4467
|
]);
|
|
@@ -4358,6 +4493,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4358
4493
|
undefined) {
|
|
4359
4494
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
4360
4495
|
}
|
|
4496
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
4497
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
4498
|
+
}
|
|
4361
4499
|
return toObject;
|
|
4362
4500
|
}
|
|
4363
4501
|
function inlinedRequestToMldev(apiClient, fromObject) {
|
|
@@ -4611,6 +4749,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4611
4749
|
if (fromGoogleSearch != null) {
|
|
4612
4750
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4613
4751
|
}
|
|
4752
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4753
|
+
if (fromGoogleMaps != null) {
|
|
4754
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4755
|
+
}
|
|
4614
4756
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4615
4757
|
'codeExecution',
|
|
4616
4758
|
]);
|
|
@@ -4632,16 +4774,15 @@ function toolToMldev$4(fromObject) {
|
|
|
4632
4774
|
}
|
|
4633
4775
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4634
4776
|
}
|
|
4635
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4636
|
-
if (fromGoogleMaps != null) {
|
|
4637
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4638
|
-
}
|
|
4639
4777
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4640
4778
|
'googleSearchRetrieval',
|
|
4641
4779
|
]);
|
|
4642
4780
|
if (fromGoogleSearchRetrieval != null) {
|
|
4643
4781
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4644
4782
|
}
|
|
4783
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
4784
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
4785
|
+
}
|
|
4645
4786
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4646
4787
|
if (fromUrlContext != null) {
|
|
4647
4788
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5351,6 +5492,33 @@ class Batches extends BaseModule {
|
|
|
5351
5492
|
* Copyright 2025 Google LLC
|
|
5352
5493
|
* SPDX-License-Identifier: Apache-2.0
|
|
5353
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
|
+
}
|
|
5354
5522
|
function blobToMldev$3(fromObject) {
|
|
5355
5523
|
const toObject = {};
|
|
5356
5524
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -5651,8 +5819,9 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
|
|
|
5651
5819
|
}
|
|
5652
5820
|
function googleMapsToMldev$3(fromObject) {
|
|
5653
5821
|
const toObject = {};
|
|
5654
|
-
|
|
5655
|
-
|
|
5822
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
5823
|
+
if (fromAuthConfig != null) {
|
|
5824
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$3(fromAuthConfig));
|
|
5656
5825
|
}
|
|
5657
5826
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
5658
5827
|
if (fromEnableWidget != null) {
|
|
@@ -5666,12 +5835,12 @@ function googleSearchToMldev$3(fromObject) {
|
|
|
5666
5835
|
if (fromSearchTypes != null) {
|
|
5667
5836
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5668
5837
|
}
|
|
5669
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5670
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5671
|
-
}
|
|
5672
5838
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
5673
5839
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
5674
5840
|
}
|
|
5841
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5842
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5843
|
+
}
|
|
5675
5844
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
5676
5845
|
'timeRangeFilter',
|
|
5677
5846
|
]);
|
|
@@ -5869,6 +6038,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5869
6038
|
if (fromGoogleSearch != null) {
|
|
5870
6039
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5871
6040
|
}
|
|
6041
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6042
|
+
if (fromGoogleMaps != null) {
|
|
6043
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
6044
|
+
}
|
|
5872
6045
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5873
6046
|
'codeExecution',
|
|
5874
6047
|
]);
|
|
@@ -5890,16 +6063,15 @@ function toolToMldev$3(fromObject) {
|
|
|
5890
6063
|
}
|
|
5891
6064
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5892
6065
|
}
|
|
5893
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5894
|
-
if (fromGoogleMaps != null) {
|
|
5895
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5896
|
-
}
|
|
5897
6066
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5898
6067
|
'googleSearchRetrieval',
|
|
5899
6068
|
]);
|
|
5900
6069
|
if (fromGoogleSearchRetrieval != null) {
|
|
5901
6070
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5902
6071
|
}
|
|
6072
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
6073
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
6074
|
+
}
|
|
5903
6075
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5904
6076
|
if (fromUrlContext != null) {
|
|
5905
6077
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5933,6 +6105,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5933
6105
|
if (fromGoogleSearch != null) {
|
|
5934
6106
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5935
6107
|
}
|
|
6108
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6109
|
+
if (fromGoogleMaps != null) {
|
|
6110
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
6111
|
+
}
|
|
5936
6112
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5937
6113
|
'codeExecution',
|
|
5938
6114
|
]);
|
|
@@ -5957,16 +6133,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5957
6133
|
}
|
|
5958
6134
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5959
6135
|
}
|
|
5960
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5961
|
-
if (fromGoogleMaps != null) {
|
|
5962
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5963
|
-
}
|
|
5964
6136
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5965
6137
|
'googleSearchRetrieval',
|
|
5966
6138
|
]);
|
|
5967
6139
|
if (fromGoogleSearchRetrieval != null) {
|
|
5968
6140
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5969
6141
|
}
|
|
6142
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
6143
|
+
'parallelAiSearch',
|
|
6144
|
+
]);
|
|
6145
|
+
if (fromParallelAiSearch != null) {
|
|
6146
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
6147
|
+
}
|
|
5970
6148
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5971
6149
|
if (fromUrlContext != null) {
|
|
5972
6150
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7261,6 +7439,40 @@ class Files extends BaseModule {
|
|
|
7261
7439
|
* Copyright 2025 Google LLC
|
|
7262
7440
|
* SPDX-License-Identifier: Apache-2.0
|
|
7263
7441
|
*/
|
|
7442
|
+
function audioTranscriptionConfigToMldev$1(fromObject) {
|
|
7443
|
+
const toObject = {};
|
|
7444
|
+
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
7445
|
+
throw new Error('languageCodes parameter is not supported in Gemini API.');
|
|
7446
|
+
}
|
|
7447
|
+
return toObject;
|
|
7448
|
+
}
|
|
7449
|
+
function authConfigToMldev$2(fromObject) {
|
|
7450
|
+
const toObject = {};
|
|
7451
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
7452
|
+
if (fromApiKey != null) {
|
|
7453
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
7454
|
+
}
|
|
7455
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
7456
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
7457
|
+
}
|
|
7458
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
7459
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
7460
|
+
}
|
|
7461
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
7462
|
+
undefined) {
|
|
7463
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
7464
|
+
}
|
|
7465
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
7466
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
7467
|
+
}
|
|
7468
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
7469
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
7470
|
+
}
|
|
7471
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
7472
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
7473
|
+
}
|
|
7474
|
+
return toObject;
|
|
7475
|
+
}
|
|
7264
7476
|
function blobToMldev$2(fromObject) {
|
|
7265
7477
|
const toObject = {};
|
|
7266
7478
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -7496,8 +7708,9 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
7496
7708
|
}
|
|
7497
7709
|
function googleMapsToMldev$2(fromObject) {
|
|
7498
7710
|
const toObject = {};
|
|
7499
|
-
|
|
7500
|
-
|
|
7711
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7712
|
+
if (fromAuthConfig != null) {
|
|
7713
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$2(fromAuthConfig));
|
|
7501
7714
|
}
|
|
7502
7715
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
7503
7716
|
if (fromEnableWidget != null) {
|
|
@@ -7511,12 +7724,12 @@ function googleSearchToMldev$2(fromObject) {
|
|
|
7511
7724
|
if (fromSearchTypes != null) {
|
|
7512
7725
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7513
7726
|
}
|
|
7514
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7515
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7516
|
-
}
|
|
7517
7727
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
7518
7728
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
7519
7729
|
}
|
|
7730
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7731
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7732
|
+
}
|
|
7520
7733
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7521
7734
|
'timeRangeFilter',
|
|
7522
7735
|
]);
|
|
@@ -7609,13 +7822,13 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
7609
7822
|
'inputAudioTranscription',
|
|
7610
7823
|
]);
|
|
7611
7824
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
7612
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
|
|
7825
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromInputAudioTranscription));
|
|
7613
7826
|
}
|
|
7614
7827
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
7615
7828
|
'outputAudioTranscription',
|
|
7616
7829
|
]);
|
|
7617
7830
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
7618
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
|
|
7831
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromOutputAudioTranscription));
|
|
7619
7832
|
}
|
|
7620
7833
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
7621
7834
|
'realtimeInputConfig',
|
|
@@ -8030,6 +8243,10 @@ function toolToMldev$2(fromObject) {
|
|
|
8030
8243
|
if (fromGoogleSearch != null) {
|
|
8031
8244
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8032
8245
|
}
|
|
8246
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8247
|
+
if (fromGoogleMaps != null) {
|
|
8248
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
8249
|
+
}
|
|
8033
8250
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8034
8251
|
'codeExecution',
|
|
8035
8252
|
]);
|
|
@@ -8051,16 +8268,15 @@ function toolToMldev$2(fromObject) {
|
|
|
8051
8268
|
}
|
|
8052
8269
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8053
8270
|
}
|
|
8054
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8055
|
-
if (fromGoogleMaps != null) {
|
|
8056
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
8057
|
-
}
|
|
8058
8271
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8059
8272
|
'googleSearchRetrieval',
|
|
8060
8273
|
]);
|
|
8061
8274
|
if (fromGoogleSearchRetrieval != null) {
|
|
8062
8275
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8063
8276
|
}
|
|
8277
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
8278
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
8279
|
+
}
|
|
8064
8280
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8065
8281
|
if (fromUrlContext != null) {
|
|
8066
8282
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8094,6 +8310,10 @@ function toolToVertex$1(fromObject) {
|
|
|
8094
8310
|
if (fromGoogleSearch != null) {
|
|
8095
8311
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8096
8312
|
}
|
|
8313
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8314
|
+
if (fromGoogleMaps != null) {
|
|
8315
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8316
|
+
}
|
|
8097
8317
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8098
8318
|
'codeExecution',
|
|
8099
8319
|
]);
|
|
@@ -8118,16 +8338,18 @@ function toolToVertex$1(fromObject) {
|
|
|
8118
8338
|
}
|
|
8119
8339
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8120
8340
|
}
|
|
8121
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8122
|
-
if (fromGoogleMaps != null) {
|
|
8123
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8124
|
-
}
|
|
8125
8341
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8126
8342
|
'googleSearchRetrieval',
|
|
8127
8343
|
]);
|
|
8128
8344
|
if (fromGoogleSearchRetrieval != null) {
|
|
8129
8345
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8130
8346
|
}
|
|
8347
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
8348
|
+
'parallelAiSearch',
|
|
8349
|
+
]);
|
|
8350
|
+
if (fromParallelAiSearch != null) {
|
|
8351
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
8352
|
+
}
|
|
8131
8353
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8132
8354
|
if (fromUrlContext != null) {
|
|
8133
8355
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8243,6 +8465,33 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
8243
8465
|
* Copyright 2025 Google LLC
|
|
8244
8466
|
* SPDX-License-Identifier: Apache-2.0
|
|
8245
8467
|
*/
|
|
8468
|
+
function authConfigToMldev$1(fromObject, _rootObject) {
|
|
8469
|
+
const toObject = {};
|
|
8470
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
8471
|
+
if (fromApiKey != null) {
|
|
8472
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
8473
|
+
}
|
|
8474
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
8475
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
8476
|
+
}
|
|
8477
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
8478
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
8479
|
+
}
|
|
8480
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
8481
|
+
undefined) {
|
|
8482
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
8483
|
+
}
|
|
8484
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
8485
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
8486
|
+
}
|
|
8487
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
8488
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
8489
|
+
}
|
|
8490
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
8491
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
8492
|
+
}
|
|
8493
|
+
return toObject;
|
|
8494
|
+
}
|
|
8246
8495
|
function blobToMldev$1(fromObject, _rootObject) {
|
|
8247
8496
|
const toObject = {};
|
|
8248
8497
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -10391,10 +10640,11 @@ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
|
|
|
10391
10640
|
}
|
|
10392
10641
|
return toObject;
|
|
10393
10642
|
}
|
|
10394
|
-
function googleMapsToMldev$1(fromObject,
|
|
10643
|
+
function googleMapsToMldev$1(fromObject, rootObject) {
|
|
10395
10644
|
const toObject = {};
|
|
10396
|
-
|
|
10397
|
-
|
|
10645
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
10646
|
+
if (fromAuthConfig != null) {
|
|
10647
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$1(fromAuthConfig));
|
|
10398
10648
|
}
|
|
10399
10649
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
10400
10650
|
if (fromEnableWidget != null) {
|
|
@@ -10408,12 +10658,12 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
|
10408
10658
|
if (fromSearchTypes != null) {
|
|
10409
10659
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10410
10660
|
}
|
|
10411
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10412
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10413
|
-
}
|
|
10414
10661
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
10415
10662
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
10416
10663
|
}
|
|
10664
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10665
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10666
|
+
}
|
|
10417
10667
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
10418
10668
|
'timeRangeFilter',
|
|
10419
10669
|
]);
|
|
@@ -10445,6 +10695,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10445
10695
|
undefined) {
|
|
10446
10696
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
10447
10697
|
}
|
|
10698
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
10699
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
10700
|
+
}
|
|
10448
10701
|
return toObject;
|
|
10449
10702
|
}
|
|
10450
10703
|
function imageConfigToVertex(fromObject, _rootObject) {
|
|
@@ -10481,6 +10734,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10481
10734
|
if (fromOutputCompressionQuality != null) {
|
|
10482
10735
|
setValueByPath(toObject, ['imageOutputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
10483
10736
|
}
|
|
10737
|
+
const fromImageOutputOptions = getValueByPath(fromObject, [
|
|
10738
|
+
'imageOutputOptions',
|
|
10739
|
+
]);
|
|
10740
|
+
if (fromImageOutputOptions != null) {
|
|
10741
|
+
setValueByPath(toObject, ['imageOutputOptions'], fromImageOutputOptions);
|
|
10742
|
+
}
|
|
10484
10743
|
return toObject;
|
|
10485
10744
|
}
|
|
10486
10745
|
function imageFromMldev(fromObject, _rootObject) {
|
|
@@ -11200,6 +11459,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11200
11459
|
if (fromGoogleSearch != null) {
|
|
11201
11460
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11202
11461
|
}
|
|
11462
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11463
|
+
if (fromGoogleMaps != null) {
|
|
11464
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11465
|
+
}
|
|
11203
11466
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11204
11467
|
'codeExecution',
|
|
11205
11468
|
]);
|
|
@@ -11221,16 +11484,15 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11221
11484
|
}
|
|
11222
11485
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11223
11486
|
}
|
|
11224
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11225
|
-
if (fromGoogleMaps != null) {
|
|
11226
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11227
|
-
}
|
|
11228
11487
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11229
11488
|
'googleSearchRetrieval',
|
|
11230
11489
|
]);
|
|
11231
11490
|
if (fromGoogleSearchRetrieval != null) {
|
|
11232
11491
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11233
11492
|
}
|
|
11493
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
11494
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
11495
|
+
}
|
|
11234
11496
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11235
11497
|
if (fromUrlContext != null) {
|
|
11236
11498
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11264,6 +11526,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11264
11526
|
if (fromGoogleSearch != null) {
|
|
11265
11527
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11266
11528
|
}
|
|
11529
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11530
|
+
if (fromGoogleMaps != null) {
|
|
11531
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11532
|
+
}
|
|
11267
11533
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11268
11534
|
'codeExecution',
|
|
11269
11535
|
]);
|
|
@@ -11288,16 +11554,18 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11288
11554
|
}
|
|
11289
11555
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11290
11556
|
}
|
|
11291
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11292
|
-
if (fromGoogleMaps != null) {
|
|
11293
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11294
|
-
}
|
|
11295
11557
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11296
11558
|
'googleSearchRetrieval',
|
|
11297
11559
|
]);
|
|
11298
11560
|
if (fromGoogleSearchRetrieval != null) {
|
|
11299
11561
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11300
11562
|
}
|
|
11563
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
11564
|
+
'parallelAiSearch',
|
|
11565
|
+
]);
|
|
11566
|
+
if (fromParallelAiSearch != null) {
|
|
11567
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
11568
|
+
}
|
|
11301
11569
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11302
11570
|
if (fromUrlContext != null) {
|
|
11303
11571
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11861,7 +12129,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11861
12129
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11862
12130
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11863
12131
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11864
|
-
const SDK_VERSION = '1.
|
|
12132
|
+
const SDK_VERSION = '1.45.0'; // x-release-please-version
|
|
11865
12133
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11866
12134
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11867
12135
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11880,6 +12148,9 @@ const DEFAULT_RETRY_HTTP_STATUS_CODES = [
|
|
|
11880
12148
|
/**
|
|
11881
12149
|
* The ApiClient class is used to send requests to the Gemini API or Vertex AI
|
|
11882
12150
|
* endpoints.
|
|
12151
|
+
*
|
|
12152
|
+
* WARNING: This is an internal API and may change without notice. Direct usage
|
|
12153
|
+
* is not supported and may break your application.
|
|
11883
12154
|
*/
|
|
11884
12155
|
class ApiClient {
|
|
11885
12156
|
constructor(opts) {
|
|
@@ -11927,10 +12198,7 @@ class ApiClient {
|
|
|
11927
12198
|
else {
|
|
11928
12199
|
// Gemini API
|
|
11929
12200
|
if (!this.clientOptions.apiKey) {
|
|
11930
|
-
|
|
11931
|
-
message: 'API key must be set when using the Gemini API.',
|
|
11932
|
-
status: 403,
|
|
11933
|
-
});
|
|
12201
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
11934
12202
|
}
|
|
11935
12203
|
initHttpOptions.apiVersion =
|
|
11936
12204
|
(_c = this.clientOptions.apiVersion) !== null && _c !== void 0 ? _c : GOOGLE_AI_API_DEFAULT_VERSION;
|
|
@@ -15193,6 +15461,40 @@ class Operations extends BaseModule {
|
|
|
15193
15461
|
* Copyright 2025 Google LLC
|
|
15194
15462
|
* SPDX-License-Identifier: Apache-2.0
|
|
15195
15463
|
*/
|
|
15464
|
+
function audioTranscriptionConfigToMldev(fromObject) {
|
|
15465
|
+
const toObject = {};
|
|
15466
|
+
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
15467
|
+
throw new Error('languageCodes parameter is not supported in Gemini API.');
|
|
15468
|
+
}
|
|
15469
|
+
return toObject;
|
|
15470
|
+
}
|
|
15471
|
+
function authConfigToMldev(fromObject) {
|
|
15472
|
+
const toObject = {};
|
|
15473
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
15474
|
+
if (fromApiKey != null) {
|
|
15475
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
15476
|
+
}
|
|
15477
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
15478
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
15479
|
+
}
|
|
15480
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
15481
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
15482
|
+
}
|
|
15483
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
15484
|
+
undefined) {
|
|
15485
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
15486
|
+
}
|
|
15487
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
15488
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
15489
|
+
}
|
|
15490
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
15491
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
15492
|
+
}
|
|
15493
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
15494
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
15495
|
+
}
|
|
15496
|
+
return toObject;
|
|
15497
|
+
}
|
|
15196
15498
|
function blobToMldev(fromObject) {
|
|
15197
15499
|
const toObject = {};
|
|
15198
15500
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -15303,8 +15605,9 @@ function functionCallToMldev(fromObject) {
|
|
|
15303
15605
|
}
|
|
15304
15606
|
function googleMapsToMldev(fromObject) {
|
|
15305
15607
|
const toObject = {};
|
|
15306
|
-
|
|
15307
|
-
|
|
15608
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
15609
|
+
if (fromAuthConfig != null) {
|
|
15610
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev(fromAuthConfig));
|
|
15308
15611
|
}
|
|
15309
15612
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
15310
15613
|
if (fromEnableWidget != null) {
|
|
@@ -15318,12 +15621,12 @@ function googleSearchToMldev(fromObject) {
|
|
|
15318
15621
|
if (fromSearchTypes != null) {
|
|
15319
15622
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15320
15623
|
}
|
|
15321
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15322
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15323
|
-
}
|
|
15324
15624
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
15325
15625
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
15326
15626
|
}
|
|
15627
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15628
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15629
|
+
}
|
|
15327
15630
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
15328
15631
|
'timeRangeFilter',
|
|
15329
15632
|
]);
|
|
@@ -15416,13 +15719,13 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
15416
15719
|
'inputAudioTranscription',
|
|
15417
15720
|
]);
|
|
15418
15721
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
15419
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
|
|
15722
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev(fromInputAudioTranscription));
|
|
15420
15723
|
}
|
|
15421
15724
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
15422
15725
|
'outputAudioTranscription',
|
|
15423
15726
|
]);
|
|
15424
15727
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
15425
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
|
|
15728
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev(fromOutputAudioTranscription));
|
|
15426
15729
|
}
|
|
15427
15730
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
15428
15731
|
'realtimeInputConfig',
|
|
@@ -15545,6 +15848,10 @@ function toolToMldev(fromObject) {
|
|
|
15545
15848
|
if (fromGoogleSearch != null) {
|
|
15546
15849
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15547
15850
|
}
|
|
15851
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15852
|
+
if (fromGoogleMaps != null) {
|
|
15853
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15854
|
+
}
|
|
15548
15855
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15549
15856
|
'codeExecution',
|
|
15550
15857
|
]);
|
|
@@ -15566,16 +15873,15 @@ function toolToMldev(fromObject) {
|
|
|
15566
15873
|
}
|
|
15567
15874
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15568
15875
|
}
|
|
15569
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15570
|
-
if (fromGoogleMaps != null) {
|
|
15571
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15572
|
-
}
|
|
15573
15876
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15574
15877
|
'googleSearchRetrieval',
|
|
15575
15878
|
]);
|
|
15576
15879
|
if (fromGoogleSearchRetrieval != null) {
|
|
15577
15880
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15578
15881
|
}
|
|
15882
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
15883
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
15884
|
+
}
|
|
15579
15885
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15580
15886
|
if (fromUrlContext != null) {
|
|
15581
15887
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -16576,166 +16882,6 @@ const safeJSON = (text) => {
|
|
|
16576
16882
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16577
16883
|
const sleep$1 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16578
16884
|
|
|
16579
|
-
/**
|
|
16580
|
-
* @license
|
|
16581
|
-
* Copyright 2025 Google LLC
|
|
16582
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16583
|
-
*/
|
|
16584
|
-
const VERSION = '0.0.1';
|
|
16585
|
-
|
|
16586
|
-
/**
|
|
16587
|
-
* @license
|
|
16588
|
-
* Copyright 2025 Google LLC
|
|
16589
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16590
|
-
*/
|
|
16591
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16592
|
-
/**
|
|
16593
|
-
* Note this does not detect 'browser'; for that, use getBrowserInfo().
|
|
16594
|
-
*/
|
|
16595
|
-
function getDetectedPlatform() {
|
|
16596
|
-
if (typeof Deno !== 'undefined' && Deno.build != null) {
|
|
16597
|
-
return 'deno';
|
|
16598
|
-
}
|
|
16599
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16600
|
-
return 'edge';
|
|
16601
|
-
}
|
|
16602
|
-
if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {
|
|
16603
|
-
return 'node';
|
|
16604
|
-
}
|
|
16605
|
-
return 'unknown';
|
|
16606
|
-
}
|
|
16607
|
-
const getPlatformProperties = () => {
|
|
16608
|
-
var _a, _b, _c, _d, _e;
|
|
16609
|
-
const detectedPlatform = getDetectedPlatform();
|
|
16610
|
-
if (detectedPlatform === 'deno') {
|
|
16611
|
-
return {
|
|
16612
|
-
'X-Stainless-Lang': 'js',
|
|
16613
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16614
|
-
'X-Stainless-OS': normalizePlatform(Deno.build.os),
|
|
16615
|
-
'X-Stainless-Arch': normalizeArch(Deno.build.arch),
|
|
16616
|
-
'X-Stainless-Runtime': 'deno',
|
|
16617
|
-
'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',
|
|
16618
|
-
};
|
|
16619
|
-
}
|
|
16620
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16621
|
-
return {
|
|
16622
|
-
'X-Stainless-Lang': 'js',
|
|
16623
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16624
|
-
'X-Stainless-OS': 'Unknown',
|
|
16625
|
-
'X-Stainless-Arch': `other:${EdgeRuntime}`,
|
|
16626
|
-
'X-Stainless-Runtime': 'edge',
|
|
16627
|
-
'X-Stainless-Runtime-Version': globalThis.process.version,
|
|
16628
|
-
};
|
|
16629
|
-
}
|
|
16630
|
-
// Check if Node.js
|
|
16631
|
-
if (detectedPlatform === 'node') {
|
|
16632
|
-
return {
|
|
16633
|
-
'X-Stainless-Lang': 'js',
|
|
16634
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16635
|
-
'X-Stainless-OS': normalizePlatform((_c = globalThis.process.platform) !== null && _c !== void 0 ? _c : 'unknown'),
|
|
16636
|
-
'X-Stainless-Arch': normalizeArch((_d = globalThis.process.arch) !== null && _d !== void 0 ? _d : 'unknown'),
|
|
16637
|
-
'X-Stainless-Runtime': 'node',
|
|
16638
|
-
'X-Stainless-Runtime-Version': (_e = globalThis.process.version) !== null && _e !== void 0 ? _e : 'unknown',
|
|
16639
|
-
};
|
|
16640
|
-
}
|
|
16641
|
-
const browserInfo = getBrowserInfo();
|
|
16642
|
-
if (browserInfo) {
|
|
16643
|
-
return {
|
|
16644
|
-
'X-Stainless-Lang': 'js',
|
|
16645
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16646
|
-
'X-Stainless-OS': 'Unknown',
|
|
16647
|
-
'X-Stainless-Arch': 'unknown',
|
|
16648
|
-
'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
|
|
16649
|
-
'X-Stainless-Runtime-Version': browserInfo.version,
|
|
16650
|
-
};
|
|
16651
|
-
}
|
|
16652
|
-
// TODO add support for Cloudflare workers, etc.
|
|
16653
|
-
return {
|
|
16654
|
-
'X-Stainless-Lang': 'js',
|
|
16655
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16656
|
-
'X-Stainless-OS': 'Unknown',
|
|
16657
|
-
'X-Stainless-Arch': 'unknown',
|
|
16658
|
-
'X-Stainless-Runtime': 'unknown',
|
|
16659
|
-
'X-Stainless-Runtime-Version': 'unknown',
|
|
16660
|
-
};
|
|
16661
|
-
};
|
|
16662
|
-
// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
|
|
16663
|
-
function getBrowserInfo() {
|
|
16664
|
-
if (typeof navigator === 'undefined' || !navigator) {
|
|
16665
|
-
return null;
|
|
16666
|
-
}
|
|
16667
|
-
// NOTE: The order matters here!
|
|
16668
|
-
const browserPatterns = [
|
|
16669
|
-
{ key: 'edge', pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16670
|
-
{ key: 'ie', pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16671
|
-
{ key: 'ie', pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16672
|
-
{ key: 'chrome', pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16673
|
-
{ key: 'firefox', pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16674
|
-
{ key: 'safari', pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
|
|
16675
|
-
];
|
|
16676
|
-
// Find the FIRST matching browser
|
|
16677
|
-
for (const { key, pattern } of browserPatterns) {
|
|
16678
|
-
const match = pattern.exec(navigator.userAgent);
|
|
16679
|
-
if (match) {
|
|
16680
|
-
const major = match[1] || 0;
|
|
16681
|
-
const minor = match[2] || 0;
|
|
16682
|
-
const patch = match[3] || 0;
|
|
16683
|
-
return { browser: key, version: `${major}.${minor}.${patch}` };
|
|
16684
|
-
}
|
|
16685
|
-
}
|
|
16686
|
-
return null;
|
|
16687
|
-
}
|
|
16688
|
-
const normalizeArch = (arch) => {
|
|
16689
|
-
// Node docs:
|
|
16690
|
-
// - https://nodejs.org/api/process.html#processarch
|
|
16691
|
-
// Deno docs:
|
|
16692
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16693
|
-
if (arch === 'x32')
|
|
16694
|
-
return 'x32';
|
|
16695
|
-
if (arch === 'x86_64' || arch === 'x64')
|
|
16696
|
-
return 'x64';
|
|
16697
|
-
if (arch === 'arm')
|
|
16698
|
-
return 'arm';
|
|
16699
|
-
if (arch === 'aarch64' || arch === 'arm64')
|
|
16700
|
-
return 'arm64';
|
|
16701
|
-
if (arch)
|
|
16702
|
-
return `other:${arch}`;
|
|
16703
|
-
return 'unknown';
|
|
16704
|
-
};
|
|
16705
|
-
const normalizePlatform = (platform) => {
|
|
16706
|
-
// Node platforms:
|
|
16707
|
-
// - https://nodejs.org/api/process.html#processplatform
|
|
16708
|
-
// Deno platforms:
|
|
16709
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16710
|
-
// - https://github.com/denoland/deno/issues/14799
|
|
16711
|
-
platform = platform.toLowerCase();
|
|
16712
|
-
// NOTE: this iOS check is untested and may not work
|
|
16713
|
-
// Node does not work natively on IOS, there is a fork at
|
|
16714
|
-
// https://github.com/nodejs-mobile/nodejs-mobile
|
|
16715
|
-
// however it is unknown at the time of writing how to detect if it is running
|
|
16716
|
-
if (platform.includes('ios'))
|
|
16717
|
-
return 'iOS';
|
|
16718
|
-
if (platform === 'android')
|
|
16719
|
-
return 'Android';
|
|
16720
|
-
if (platform === 'darwin')
|
|
16721
|
-
return 'MacOS';
|
|
16722
|
-
if (platform === 'win32')
|
|
16723
|
-
return 'Windows';
|
|
16724
|
-
if (platform === 'freebsd')
|
|
16725
|
-
return 'FreeBSD';
|
|
16726
|
-
if (platform === 'openbsd')
|
|
16727
|
-
return 'OpenBSD';
|
|
16728
|
-
if (platform === 'linux')
|
|
16729
|
-
return 'Linux';
|
|
16730
|
-
if (platform)
|
|
16731
|
-
return `Other:${platform}`;
|
|
16732
|
-
return 'Unknown';
|
|
16733
|
-
};
|
|
16734
|
-
let _platformHeaders;
|
|
16735
|
-
const getPlatformHeaders = () => {
|
|
16736
|
-
return (_platformHeaders !== null && _platformHeaders !== void 0 ? _platformHeaders : (_platformHeaders = getPlatformProperties()));
|
|
16737
|
-
};
|
|
16738
|
-
|
|
16739
16885
|
/**
|
|
16740
16886
|
* @license
|
|
16741
16887
|
* Copyright 2025 Google LLC
|
|
@@ -16841,6 +16987,37 @@ const FallbackEncoder = ({ headers, body }) => {
|
|
|
16841
16987
|
};
|
|
16842
16988
|
};
|
|
16843
16989
|
|
|
16990
|
+
/**
|
|
16991
|
+
* @license
|
|
16992
|
+
* Copyright 2025 Google LLC
|
|
16993
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16994
|
+
*/
|
|
16995
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16996
|
+
/**
|
|
16997
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
16998
|
+
*/
|
|
16999
|
+
function stringifyQuery(query) {
|
|
17000
|
+
return Object.entries(query)
|
|
17001
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
17002
|
+
.map(([key, value]) => {
|
|
17003
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
17004
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
17005
|
+
}
|
|
17006
|
+
if (value === null) {
|
|
17007
|
+
return `${encodeURIComponent(key)}=`;
|
|
17008
|
+
}
|
|
17009
|
+
throw new GeminiNextGenAPIClientError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
|
|
17010
|
+
})
|
|
17011
|
+
.join('&');
|
|
17012
|
+
}
|
|
17013
|
+
|
|
17014
|
+
/**
|
|
17015
|
+
* @license
|
|
17016
|
+
* Copyright 2025 Google LLC
|
|
17017
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17018
|
+
*/
|
|
17019
|
+
const VERSION = '0.0.1';
|
|
17020
|
+
|
|
16844
17021
|
/**
|
|
16845
17022
|
* @license
|
|
16846
17023
|
* Copyright 2025 Google LLC
|
|
@@ -17179,8 +17356,10 @@ class LineDecoder {
|
|
|
17179
17356
|
constructor() {
|
|
17180
17357
|
this.buffer = new Uint8Array();
|
|
17181
17358
|
this.carriageReturnIndex = null;
|
|
17359
|
+
this.searchIndex = 0;
|
|
17182
17360
|
}
|
|
17183
17361
|
decode(chunk) {
|
|
17362
|
+
var _a;
|
|
17184
17363
|
if (chunk == null) {
|
|
17185
17364
|
return [];
|
|
17186
17365
|
}
|
|
@@ -17190,7 +17369,7 @@ class LineDecoder {
|
|
|
17190
17369
|
this.buffer = concatBytes([this.buffer, binaryChunk]);
|
|
17191
17370
|
const lines = [];
|
|
17192
17371
|
let patternIndex;
|
|
17193
|
-
while ((patternIndex = findNewlineIndex(this.buffer, this.carriageReturnIndex)) != null) {
|
|
17372
|
+
while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
|
|
17194
17373
|
if (patternIndex.carriage && this.carriageReturnIndex == null) {
|
|
17195
17374
|
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
17196
17375
|
this.carriageReturnIndex = patternIndex.index;
|
|
@@ -17202,6 +17381,7 @@ class LineDecoder {
|
|
|
17202
17381
|
lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
|
|
17203
17382
|
this.buffer = this.buffer.subarray(this.carriageReturnIndex);
|
|
17204
17383
|
this.carriageReturnIndex = null;
|
|
17384
|
+
this.searchIndex = 0;
|
|
17205
17385
|
continue;
|
|
17206
17386
|
}
|
|
17207
17387
|
const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
@@ -17209,7 +17389,9 @@ class LineDecoder {
|
|
|
17209
17389
|
lines.push(line);
|
|
17210
17390
|
this.buffer = this.buffer.subarray(patternIndex.index);
|
|
17211
17391
|
this.carriageReturnIndex = null;
|
|
17392
|
+
this.searchIndex = 0;
|
|
17212
17393
|
}
|
|
17394
|
+
this.searchIndex = Math.max(0, this.buffer.length - 1);
|
|
17213
17395
|
return lines;
|
|
17214
17396
|
}
|
|
17215
17397
|
flush() {
|
|
@@ -17234,41 +17416,23 @@ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
|
17234
17416
|
function findNewlineIndex(buffer, startIndex) {
|
|
17235
17417
|
const newline = 0x0a; // \n
|
|
17236
17418
|
const carriage = 0x0d; // \r
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
return { preceding: i, index: i + 1, carriage: true };
|
|
17243
|
-
}
|
|
17419
|
+
const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
|
|
17420
|
+
const nextNewline = buffer.indexOf(newline, start);
|
|
17421
|
+
const nextCarriage = buffer.indexOf(carriage, start);
|
|
17422
|
+
if (nextNewline === -1 && nextCarriage === -1) {
|
|
17423
|
+
return null;
|
|
17244
17424
|
}
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
17255
|
-
// \n\n
|
|
17256
|
-
return i + 2;
|
|
17257
|
-
}
|
|
17258
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
17259
|
-
// \r\r
|
|
17260
|
-
return i + 2;
|
|
17261
|
-
}
|
|
17262
|
-
if (buffer[i] === carriage &&
|
|
17263
|
-
buffer[i + 1] === newline &&
|
|
17264
|
-
i + 3 < buffer.length &&
|
|
17265
|
-
buffer[i + 2] === carriage &&
|
|
17266
|
-
buffer[i + 3] === newline) {
|
|
17267
|
-
// \r\n\r\n
|
|
17268
|
-
return i + 4;
|
|
17269
|
-
}
|
|
17425
|
+
let i;
|
|
17426
|
+
if (nextNewline !== -1 && nextCarriage !== -1) {
|
|
17427
|
+
i = Math.min(nextNewline, nextCarriage);
|
|
17428
|
+
}
|
|
17429
|
+
else {
|
|
17430
|
+
i = nextNewline !== -1 ? nextNewline : nextCarriage;
|
|
17431
|
+
}
|
|
17432
|
+
if (buffer[i] === newline) {
|
|
17433
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
17270
17434
|
}
|
|
17271
|
-
return
|
|
17435
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
17272
17436
|
}
|
|
17273
17437
|
|
|
17274
17438
|
/**
|
|
@@ -17579,7 +17743,7 @@ function _iterSSEMessages(response, controller) {
|
|
|
17579
17743
|
const lineDecoder = new LineDecoder();
|
|
17580
17744
|
const iter = ReadableStreamToAsyncIterable(response.body);
|
|
17581
17745
|
try {
|
|
17582
|
-
for (var _d = true, _e = __asyncValues(
|
|
17746
|
+
for (var _d = true, _e = __asyncValues(iterBinaryChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
17583
17747
|
_c = _f.value;
|
|
17584
17748
|
_d = false;
|
|
17585
17749
|
const sseChunk = _c;
|
|
@@ -17605,13 +17769,12 @@ function _iterSSEMessages(response, controller) {
|
|
|
17605
17769
|
});
|
|
17606
17770
|
}
|
|
17607
17771
|
/**
|
|
17608
|
-
* Given an async iterable iterator,
|
|
17609
|
-
*
|
|
17772
|
+
* Given an async iterable iterator, normalizes each chunk to a
|
|
17773
|
+
* Uint8Array and yields it.
|
|
17610
17774
|
*/
|
|
17611
|
-
function
|
|
17612
|
-
return __asyncGenerator(this, arguments, function*
|
|
17775
|
+
function iterBinaryChunks(iterator) {
|
|
17776
|
+
return __asyncGenerator(this, arguments, function* iterBinaryChunks_1() {
|
|
17613
17777
|
var _a, e_5, _b, _c;
|
|
17614
|
-
let data = new Uint8Array();
|
|
17615
17778
|
try {
|
|
17616
17779
|
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) {
|
|
17617
17780
|
_c = iterator_3_1.value;
|
|
@@ -17623,15 +17786,7 @@ function iterSSEChunks(iterator) {
|
|
|
17623
17786
|
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
17624
17787
|
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
|
17625
17788
|
: chunk;
|
|
17626
|
-
|
|
17627
|
-
newData.set(data);
|
|
17628
|
-
newData.set(binaryChunk, data.length);
|
|
17629
|
-
data = newData;
|
|
17630
|
-
let patternIndex;
|
|
17631
|
-
while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
|
|
17632
|
-
yield yield __await(data.slice(0, patternIndex));
|
|
17633
|
-
data = data.slice(patternIndex);
|
|
17634
|
-
}
|
|
17789
|
+
yield yield __await(binaryChunk);
|
|
17635
17790
|
}
|
|
17636
17791
|
}
|
|
17637
17792
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -17641,9 +17796,6 @@ function iterSSEChunks(iterator) {
|
|
|
17641
17796
|
}
|
|
17642
17797
|
finally { if (e_5) throw e_5.error; }
|
|
17643
17798
|
}
|
|
17644
|
-
if (data.length > 0) {
|
|
17645
|
-
yield yield __await(data);
|
|
17646
|
-
}
|
|
17647
17799
|
});
|
|
17648
17800
|
}
|
|
17649
17801
|
class SSEDecoder {
|
|
@@ -18002,18 +18154,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18002
18154
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
18003
18155
|
*/
|
|
18004
18156
|
stringifyQuery(query) {
|
|
18005
|
-
return
|
|
18006
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
18007
|
-
.map(([key, value]) => {
|
|
18008
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
18009
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
18010
|
-
}
|
|
18011
|
-
if (value === null) {
|
|
18012
|
-
return `${encodeURIComponent(key)}=`;
|
|
18013
|
-
}
|
|
18014
|
-
throw new GeminiNextGenAPIClientError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
|
|
18015
|
-
})
|
|
18016
|
-
.join('&');
|
|
18157
|
+
return stringifyQuery(query);
|
|
18017
18158
|
}
|
|
18018
18159
|
getUserAgent() {
|
|
18019
18160
|
return `${this.constructor.name}/JS ${VERSION}`;
|
|
@@ -18030,8 +18171,9 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18030
18171
|
new URL(path)
|
|
18031
18172
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
18032
18173
|
const defaultQuery = this.defaultQuery();
|
|
18033
|
-
|
|
18034
|
-
|
|
18174
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
18175
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
18176
|
+
query = Object.assign(Object.assign(Object.assign({}, pathQuery), defaultQuery), query);
|
|
18035
18177
|
}
|
|
18036
18178
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
18037
18179
|
url.search = this.stringifyQuery(query);
|
|
@@ -18252,9 +18394,9 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18252
18394
|
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
18253
18395
|
}
|
|
18254
18396
|
}
|
|
18255
|
-
// If the API asks us to wait a certain amount of time
|
|
18256
|
-
//
|
|
18257
|
-
if (
|
|
18397
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
18398
|
+
// says, but otherwise calculate a default
|
|
18399
|
+
if (timeoutMillis === undefined) {
|
|
18258
18400
|
const maxRetries = (_b = options.maxRetries) !== null && _b !== void 0 ? _b : this.maxRetries;
|
|
18259
18401
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
18260
18402
|
}
|
|
@@ -18295,7 +18437,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18295
18437
|
const authHeaders = await this.authHeaders(options);
|
|
18296
18438
|
let headers = buildHeaders([
|
|
18297
18439
|
idempotencyHeaders,
|
|
18298
|
-
|
|
18440
|
+
{ Accept: 'application/json', 'User-Agent': this.getUserAgent() },
|
|
18299
18441
|
this._options.defaultHeaders,
|
|
18300
18442
|
bodyHeaders,
|
|
18301
18443
|
options.headers,
|
|
@@ -19318,10 +19460,28 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19318
19460
|
if (fromCustomBaseModel != null) {
|
|
19319
19461
|
setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
|
|
19320
19462
|
}
|
|
19463
|
+
const fromEvaluateDatasetRuns = getValueByPath(fromObject, [
|
|
19464
|
+
'evaluateDatasetRuns',
|
|
19465
|
+
]);
|
|
19466
|
+
if (fromEvaluateDatasetRuns != null) {
|
|
19467
|
+
let transformedList = fromEvaluateDatasetRuns;
|
|
19468
|
+
if (Array.isArray(transformedList)) {
|
|
19469
|
+
transformedList = transformedList.map((item) => {
|
|
19470
|
+
return item;
|
|
19471
|
+
});
|
|
19472
|
+
}
|
|
19473
|
+
setValueByPath(toObject, ['evaluateDatasetRuns'], transformedList);
|
|
19474
|
+
}
|
|
19321
19475
|
const fromExperiment = getValueByPath(fromObject, ['experiment']);
|
|
19322
19476
|
if (fromExperiment != null) {
|
|
19323
19477
|
setValueByPath(toObject, ['experiment'], fromExperiment);
|
|
19324
19478
|
}
|
|
19479
|
+
const fromFullFineTuningSpec = getValueByPath(fromObject, [
|
|
19480
|
+
'fullFineTuningSpec',
|
|
19481
|
+
]);
|
|
19482
|
+
if (fromFullFineTuningSpec != null) {
|
|
19483
|
+
setValueByPath(toObject, ['fullFineTuningSpec'], fromFullFineTuningSpec);
|
|
19484
|
+
}
|
|
19325
19485
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
19326
19486
|
if (fromLabels != null) {
|
|
19327
19487
|
setValueByPath(toObject, ['labels'], fromLabels);
|
|
@@ -19346,6 +19506,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19346
19506
|
if (fromTunedModelDisplayName != null) {
|
|
19347
19507
|
setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
|
|
19348
19508
|
}
|
|
19509
|
+
const fromTuningJobState = getValueByPath(fromObject, [
|
|
19510
|
+
'tuningJobState',
|
|
19511
|
+
]);
|
|
19512
|
+
if (fromTuningJobState != null) {
|
|
19513
|
+
setValueByPath(toObject, ['tuningJobState'], fromTuningJobState);
|
|
19514
|
+
}
|
|
19349
19515
|
const fromVeoTuningSpec = getValueByPath(fromObject, [
|
|
19350
19516
|
'veoTuningSpec',
|
|
19351
19517
|
]);
|
|
@@ -20198,7 +20364,7 @@ class GoogleGenAI {
|
|
|
20198
20364
|
this.project = (_d = options.project) !== null && _d !== void 0 ? _d : envProject;
|
|
20199
20365
|
this.location = (_e = options.location) !== null && _e !== void 0 ? _e : envLocation;
|
|
20200
20366
|
if (!this.vertexai && !this.apiKey) {
|
|
20201
|
-
|
|
20367
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
20202
20368
|
}
|
|
20203
20369
|
// Handle when to use Vertex AI in express mode (api key)
|
|
20204
20370
|
if (options.vertexai) {
|
|
@@ -20309,6 +20475,7 @@ exports.DeleteFileResponse = DeleteFileResponse;
|
|
|
20309
20475
|
exports.DeleteModelResponse = DeleteModelResponse;
|
|
20310
20476
|
exports.EditImageResponse = EditImageResponse;
|
|
20311
20477
|
exports.EmbedContentResponse = EmbedContentResponse;
|
|
20478
|
+
exports.EvaluateDatasetResponse = EvaluateDatasetResponse;
|
|
20312
20479
|
exports.Files = Files;
|
|
20313
20480
|
exports.FunctionResponse = FunctionResponse;
|
|
20314
20481
|
exports.FunctionResponseBlob = FunctionResponseBlob;
|