@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.mjs
CHANGED
|
@@ -646,7 +646,7 @@ var FunctionResponseScheduling;
|
|
|
646
646
|
*/
|
|
647
647
|
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
648
648
|
})(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
|
|
649
|
-
/**
|
|
649
|
+
/** Data type of the schema field. */
|
|
650
650
|
var Type;
|
|
651
651
|
(function (Type) {
|
|
652
652
|
/**
|
|
@@ -714,22 +714,6 @@ var PhishBlockThreshold;
|
|
|
714
714
|
*/
|
|
715
715
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
716
716
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
717
|
-
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
718
|
-
var ApiSpec;
|
|
719
|
-
(function (ApiSpec) {
|
|
720
|
-
/**
|
|
721
|
-
* Unspecified API spec. This value should not be used.
|
|
722
|
-
*/
|
|
723
|
-
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
724
|
-
/**
|
|
725
|
-
* Simple search API spec.
|
|
726
|
-
*/
|
|
727
|
-
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
728
|
-
/**
|
|
729
|
-
* Elastic search API spec.
|
|
730
|
-
*/
|
|
731
|
-
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
732
|
-
})(ApiSpec || (ApiSpec = {}));
|
|
733
717
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
734
718
|
var AuthType;
|
|
735
719
|
(function (AuthType) {
|
|
@@ -784,6 +768,22 @@ var HttpElementLocation;
|
|
|
784
768
|
*/
|
|
785
769
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
786
770
|
})(HttpElementLocation || (HttpElementLocation = {}));
|
|
771
|
+
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
772
|
+
var ApiSpec;
|
|
773
|
+
(function (ApiSpec) {
|
|
774
|
+
/**
|
|
775
|
+
* Unspecified API spec. This value should not be used.
|
|
776
|
+
*/
|
|
777
|
+
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
778
|
+
/**
|
|
779
|
+
* Simple search API spec.
|
|
780
|
+
*/
|
|
781
|
+
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
782
|
+
/**
|
|
783
|
+
* Elastic search API spec.
|
|
784
|
+
*/
|
|
785
|
+
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
786
|
+
})(ApiSpec || (ApiSpec = {}));
|
|
787
787
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
788
788
|
var Behavior;
|
|
789
789
|
(function (Behavior) {
|
|
@@ -860,27 +860,43 @@ var ThinkingLevel;
|
|
|
860
860
|
*/
|
|
861
861
|
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
862
862
|
})(ThinkingLevel || (ThinkingLevel = {}));
|
|
863
|
-
/**
|
|
863
|
+
/** Enum that controls the generation of people. */
|
|
864
|
+
var PersonGeneration;
|
|
865
|
+
(function (PersonGeneration) {
|
|
866
|
+
/**
|
|
867
|
+
* Block generation of images of people.
|
|
868
|
+
*/
|
|
869
|
+
PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
|
|
870
|
+
/**
|
|
871
|
+
* Generate images of adults, but not children.
|
|
872
|
+
*/
|
|
873
|
+
PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
|
|
874
|
+
/**
|
|
875
|
+
* Generate images that include adults and children.
|
|
876
|
+
*/
|
|
877
|
+
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
878
|
+
})(PersonGeneration || (PersonGeneration = {}));
|
|
879
|
+
/** The harm category to be blocked. */
|
|
864
880
|
var HarmCategory;
|
|
865
881
|
(function (HarmCategory) {
|
|
866
882
|
/**
|
|
867
|
-
*
|
|
883
|
+
* Default value. This value is unused.
|
|
868
884
|
*/
|
|
869
885
|
HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
|
|
870
886
|
/**
|
|
871
|
-
*
|
|
887
|
+
* Abusive, threatening, or content intended to bully, torment, or ridicule.
|
|
872
888
|
*/
|
|
873
889
|
HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
|
|
874
890
|
/**
|
|
875
|
-
*
|
|
891
|
+
* Content that promotes violence or incites hatred against individuals or groups based on certain attributes.
|
|
876
892
|
*/
|
|
877
893
|
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
878
894
|
/**
|
|
879
|
-
*
|
|
895
|
+
* Content that contains sexually explicit material.
|
|
880
896
|
*/
|
|
881
897
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
882
898
|
/**
|
|
883
|
-
*
|
|
899
|
+
* Content that promotes, facilitates, or enables dangerous activities.
|
|
884
900
|
*/
|
|
885
901
|
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
886
902
|
/**
|
|
@@ -888,27 +904,27 @@ var HarmCategory;
|
|
|
888
904
|
*/
|
|
889
905
|
HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
890
906
|
/**
|
|
891
|
-
*
|
|
907
|
+
* Images that contain hate speech. This enum value is not supported in Gemini API.
|
|
892
908
|
*/
|
|
893
909
|
HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
|
|
894
910
|
/**
|
|
895
|
-
*
|
|
911
|
+
* Images that contain dangerous content. This enum value is not supported in Gemini API.
|
|
896
912
|
*/
|
|
897
913
|
HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
|
|
898
914
|
/**
|
|
899
|
-
*
|
|
915
|
+
* Images that contain harassment. This enum value is not supported in Gemini API.
|
|
900
916
|
*/
|
|
901
917
|
HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
|
|
902
918
|
/**
|
|
903
|
-
*
|
|
919
|
+
* Images that contain sexually explicit content. This enum value is not supported in Gemini API.
|
|
904
920
|
*/
|
|
905
921
|
HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
|
|
906
922
|
/**
|
|
907
|
-
*
|
|
923
|
+
* Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.
|
|
908
924
|
*/
|
|
909
925
|
HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
|
|
910
926
|
})(HarmCategory || (HarmCategory = {}));
|
|
911
|
-
/**
|
|
927
|
+
/** 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. */
|
|
912
928
|
var HarmBlockMethod;
|
|
913
929
|
(function (HarmBlockMethod) {
|
|
914
930
|
/**
|
|
@@ -924,31 +940,31 @@ var HarmBlockMethod;
|
|
|
924
940
|
*/
|
|
925
941
|
HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
|
|
926
942
|
})(HarmBlockMethod || (HarmBlockMethod = {}));
|
|
927
|
-
/** The harm
|
|
943
|
+
/** The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked. */
|
|
928
944
|
var HarmBlockThreshold;
|
|
929
945
|
(function (HarmBlockThreshold) {
|
|
930
946
|
/**
|
|
931
|
-
*
|
|
947
|
+
* The harm block threshold is unspecified.
|
|
932
948
|
*/
|
|
933
949
|
HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
934
950
|
/**
|
|
935
|
-
* Block
|
|
951
|
+
* Block content with a low harm probability or higher.
|
|
936
952
|
*/
|
|
937
953
|
HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
938
954
|
/**
|
|
939
|
-
* Block medium
|
|
955
|
+
* Block content with a medium harm probability or higher.
|
|
940
956
|
*/
|
|
941
957
|
HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
942
958
|
/**
|
|
943
|
-
* Block
|
|
959
|
+
* Block content with a high harm probability.
|
|
944
960
|
*/
|
|
945
961
|
HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
|
|
946
962
|
/**
|
|
947
|
-
*
|
|
963
|
+
* Do not block any content, regardless of its harm probability.
|
|
948
964
|
*/
|
|
949
965
|
HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE";
|
|
950
966
|
/**
|
|
951
|
-
* Turn off the safety filter.
|
|
967
|
+
* Turn off the safety filter entirely.
|
|
952
968
|
*/
|
|
953
969
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
954
970
|
})(HarmBlockThreshold || (HarmBlockThreshold = {}));
|
|
@@ -1026,55 +1042,55 @@ var FinishReason;
|
|
|
1026
1042
|
*/
|
|
1027
1043
|
FinishReason["IMAGE_OTHER"] = "IMAGE_OTHER";
|
|
1028
1044
|
})(FinishReason || (FinishReason = {}));
|
|
1029
|
-
/** Output only.
|
|
1045
|
+
/** Output only. The probability of harm for this category. */
|
|
1030
1046
|
var HarmProbability;
|
|
1031
1047
|
(function (HarmProbability) {
|
|
1032
1048
|
/**
|
|
1033
|
-
*
|
|
1049
|
+
* The harm probability is unspecified.
|
|
1034
1050
|
*/
|
|
1035
1051
|
HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED";
|
|
1036
1052
|
/**
|
|
1037
|
-
*
|
|
1053
|
+
* The harm probability is negligible.
|
|
1038
1054
|
*/
|
|
1039
1055
|
HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE";
|
|
1040
1056
|
/**
|
|
1041
|
-
*
|
|
1057
|
+
* The harm probability is low.
|
|
1042
1058
|
*/
|
|
1043
1059
|
HarmProbability["LOW"] = "LOW";
|
|
1044
1060
|
/**
|
|
1045
|
-
*
|
|
1061
|
+
* The harm probability is medium.
|
|
1046
1062
|
*/
|
|
1047
1063
|
HarmProbability["MEDIUM"] = "MEDIUM";
|
|
1048
1064
|
/**
|
|
1049
|
-
*
|
|
1065
|
+
* The harm probability is high.
|
|
1050
1066
|
*/
|
|
1051
1067
|
HarmProbability["HIGH"] = "HIGH";
|
|
1052
1068
|
})(HarmProbability || (HarmProbability = {}));
|
|
1053
|
-
/** Output only.
|
|
1069
|
+
/** Output only. The severity of harm for this category. This enum is not supported in Gemini API. */
|
|
1054
1070
|
var HarmSeverity;
|
|
1055
1071
|
(function (HarmSeverity) {
|
|
1056
1072
|
/**
|
|
1057
|
-
*
|
|
1073
|
+
* The harm severity is unspecified.
|
|
1058
1074
|
*/
|
|
1059
1075
|
HarmSeverity["HARM_SEVERITY_UNSPECIFIED"] = "HARM_SEVERITY_UNSPECIFIED";
|
|
1060
1076
|
/**
|
|
1061
|
-
*
|
|
1077
|
+
* The harm severity is negligible.
|
|
1062
1078
|
*/
|
|
1063
1079
|
HarmSeverity["HARM_SEVERITY_NEGLIGIBLE"] = "HARM_SEVERITY_NEGLIGIBLE";
|
|
1064
1080
|
/**
|
|
1065
|
-
*
|
|
1081
|
+
* The harm severity is low.
|
|
1066
1082
|
*/
|
|
1067
1083
|
HarmSeverity["HARM_SEVERITY_LOW"] = "HARM_SEVERITY_LOW";
|
|
1068
1084
|
/**
|
|
1069
|
-
*
|
|
1085
|
+
* The harm severity is medium.
|
|
1070
1086
|
*/
|
|
1071
1087
|
HarmSeverity["HARM_SEVERITY_MEDIUM"] = "HARM_SEVERITY_MEDIUM";
|
|
1072
1088
|
/**
|
|
1073
|
-
*
|
|
1089
|
+
* The harm severity is high.
|
|
1074
1090
|
*/
|
|
1075
1091
|
HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
|
|
1076
1092
|
})(HarmSeverity || (HarmSeverity = {}));
|
|
1077
|
-
/**
|
|
1093
|
+
/** The status of the URL retrieval. */
|
|
1078
1094
|
var UrlRetrievalStatus;
|
|
1079
1095
|
(function (UrlRetrievalStatus) {
|
|
1080
1096
|
/**
|
|
@@ -1082,11 +1098,11 @@ var UrlRetrievalStatus;
|
|
|
1082
1098
|
*/
|
|
1083
1099
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
|
|
1084
1100
|
/**
|
|
1085
|
-
*
|
|
1101
|
+
* The URL was retrieved successfully.
|
|
1086
1102
|
*/
|
|
1087
1103
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
|
|
1088
1104
|
/**
|
|
1089
|
-
*
|
|
1105
|
+
* The URL retrieval failed.
|
|
1090
1106
|
*/
|
|
1091
1107
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
1092
1108
|
/**
|
|
@@ -1145,6 +1161,14 @@ var TrafficType;
|
|
|
1145
1161
|
* The request was processed using Pay-As-You-Go quota.
|
|
1146
1162
|
*/
|
|
1147
1163
|
TrafficType["ON_DEMAND"] = "ON_DEMAND";
|
|
1164
|
+
/**
|
|
1165
|
+
* Type for Priority Pay-As-You-Go traffic.
|
|
1166
|
+
*/
|
|
1167
|
+
TrafficType["ON_DEMAND_PRIORITY"] = "ON_DEMAND_PRIORITY";
|
|
1168
|
+
/**
|
|
1169
|
+
* Type for Flex traffic.
|
|
1170
|
+
*/
|
|
1171
|
+
TrafficType["ON_DEMAND_FLEX"] = "ON_DEMAND_FLEX";
|
|
1148
1172
|
/**
|
|
1149
1173
|
* Type for Provisioned Throughput traffic.
|
|
1150
1174
|
*/
|
|
@@ -1290,6 +1314,102 @@ var JobState;
|
|
|
1290
1314
|
*/
|
|
1291
1315
|
JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
|
|
1292
1316
|
})(JobState || (JobState = {}));
|
|
1317
|
+
/** Output only. The detail state of the tuning job (while the overall `JobState` is running). This enum is not supported in Gemini API. */
|
|
1318
|
+
var TuningJobState;
|
|
1319
|
+
(function (TuningJobState) {
|
|
1320
|
+
/**
|
|
1321
|
+
* Default tuning job state.
|
|
1322
|
+
*/
|
|
1323
|
+
TuningJobState["TUNING_JOB_STATE_UNSPECIFIED"] = "TUNING_JOB_STATE_UNSPECIFIED";
|
|
1324
|
+
/**
|
|
1325
|
+
* Tuning job is waiting for job quota.
|
|
1326
|
+
*/
|
|
1327
|
+
TuningJobState["TUNING_JOB_STATE_WAITING_FOR_QUOTA"] = "TUNING_JOB_STATE_WAITING_FOR_QUOTA";
|
|
1328
|
+
/**
|
|
1329
|
+
* Tuning job is validating the dataset.
|
|
1330
|
+
*/
|
|
1331
|
+
TuningJobState["TUNING_JOB_STATE_PROCESSING_DATASET"] = "TUNING_JOB_STATE_PROCESSING_DATASET";
|
|
1332
|
+
/**
|
|
1333
|
+
* Tuning job is waiting for hardware capacity.
|
|
1334
|
+
*/
|
|
1335
|
+
TuningJobState["TUNING_JOB_STATE_WAITING_FOR_CAPACITY"] = "TUNING_JOB_STATE_WAITING_FOR_CAPACITY";
|
|
1336
|
+
/**
|
|
1337
|
+
* Tuning job is running.
|
|
1338
|
+
*/
|
|
1339
|
+
TuningJobState["TUNING_JOB_STATE_TUNING"] = "TUNING_JOB_STATE_TUNING";
|
|
1340
|
+
/**
|
|
1341
|
+
* Tuning job is doing some post processing steps.
|
|
1342
|
+
*/
|
|
1343
|
+
TuningJobState["TUNING_JOB_STATE_POST_PROCESSING"] = "TUNING_JOB_STATE_POST_PROCESSING";
|
|
1344
|
+
})(TuningJobState || (TuningJobState = {}));
|
|
1345
|
+
/** Aggregation metric. This enum is not supported in Gemini API. */
|
|
1346
|
+
var AggregationMetric;
|
|
1347
|
+
(function (AggregationMetric) {
|
|
1348
|
+
/**
|
|
1349
|
+
* Unspecified aggregation metric.
|
|
1350
|
+
*/
|
|
1351
|
+
AggregationMetric["AGGREGATION_METRIC_UNSPECIFIED"] = "AGGREGATION_METRIC_UNSPECIFIED";
|
|
1352
|
+
/**
|
|
1353
|
+
* Average aggregation metric. Not supported for Pairwise metric.
|
|
1354
|
+
*/
|
|
1355
|
+
AggregationMetric["AVERAGE"] = "AVERAGE";
|
|
1356
|
+
/**
|
|
1357
|
+
* Mode aggregation metric.
|
|
1358
|
+
*/
|
|
1359
|
+
AggregationMetric["MODE"] = "MODE";
|
|
1360
|
+
/**
|
|
1361
|
+
* Standard deviation aggregation metric. Not supported for pairwise metric.
|
|
1362
|
+
*/
|
|
1363
|
+
AggregationMetric["STANDARD_DEVIATION"] = "STANDARD_DEVIATION";
|
|
1364
|
+
/**
|
|
1365
|
+
* Variance aggregation metric. Not supported for pairwise metric.
|
|
1366
|
+
*/
|
|
1367
|
+
AggregationMetric["VARIANCE"] = "VARIANCE";
|
|
1368
|
+
/**
|
|
1369
|
+
* Minimum aggregation metric. Not supported for pairwise metric.
|
|
1370
|
+
*/
|
|
1371
|
+
AggregationMetric["MINIMUM"] = "MINIMUM";
|
|
1372
|
+
/**
|
|
1373
|
+
* Maximum aggregation metric. Not supported for pairwise metric.
|
|
1374
|
+
*/
|
|
1375
|
+
AggregationMetric["MAXIMUM"] = "MAXIMUM";
|
|
1376
|
+
/**
|
|
1377
|
+
* Median aggregation metric. Not supported for pairwise metric.
|
|
1378
|
+
*/
|
|
1379
|
+
AggregationMetric["MEDIAN"] = "MEDIAN";
|
|
1380
|
+
/**
|
|
1381
|
+
* 90th percentile aggregation metric. Not supported for pairwise metric.
|
|
1382
|
+
*/
|
|
1383
|
+
AggregationMetric["PERCENTILE_P90"] = "PERCENTILE_P90";
|
|
1384
|
+
/**
|
|
1385
|
+
* 95th percentile aggregation metric. Not supported for pairwise metric.
|
|
1386
|
+
*/
|
|
1387
|
+
AggregationMetric["PERCENTILE_P95"] = "PERCENTILE_P95";
|
|
1388
|
+
/**
|
|
1389
|
+
* 99th percentile aggregation metric. Not supported for pairwise metric.
|
|
1390
|
+
*/
|
|
1391
|
+
AggregationMetric["PERCENTILE_P99"] = "PERCENTILE_P99";
|
|
1392
|
+
})(AggregationMetric || (AggregationMetric = {}));
|
|
1393
|
+
/** Output only. Pairwise metric choice. This enum is not supported in Gemini API. */
|
|
1394
|
+
var PairwiseChoice;
|
|
1395
|
+
(function (PairwiseChoice) {
|
|
1396
|
+
/**
|
|
1397
|
+
* Unspecified prediction choice.
|
|
1398
|
+
*/
|
|
1399
|
+
PairwiseChoice["PAIRWISE_CHOICE_UNSPECIFIED"] = "PAIRWISE_CHOICE_UNSPECIFIED";
|
|
1400
|
+
/**
|
|
1401
|
+
* Baseline prediction wins
|
|
1402
|
+
*/
|
|
1403
|
+
PairwiseChoice["BASELINE"] = "BASELINE";
|
|
1404
|
+
/**
|
|
1405
|
+
* Candidate prediction wins
|
|
1406
|
+
*/
|
|
1407
|
+
PairwiseChoice["CANDIDATE"] = "CANDIDATE";
|
|
1408
|
+
/**
|
|
1409
|
+
* Winner cannot be determined
|
|
1410
|
+
*/
|
|
1411
|
+
PairwiseChoice["TIE"] = "TIE";
|
|
1412
|
+
})(PairwiseChoice || (PairwiseChoice = {}));
|
|
1293
1413
|
/** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
|
|
1294
1414
|
var TuningTask;
|
|
1295
1415
|
(function (TuningTask) {
|
|
@@ -1402,22 +1522,6 @@ var SafetyFilterLevel;
|
|
|
1402
1522
|
SafetyFilterLevel["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
|
|
1403
1523
|
SafetyFilterLevel["BLOCK_NONE"] = "BLOCK_NONE";
|
|
1404
1524
|
})(SafetyFilterLevel || (SafetyFilterLevel = {}));
|
|
1405
|
-
/** Enum that controls the generation of people. */
|
|
1406
|
-
var PersonGeneration;
|
|
1407
|
-
(function (PersonGeneration) {
|
|
1408
|
-
/**
|
|
1409
|
-
* Block generation of images of people.
|
|
1410
|
-
*/
|
|
1411
|
-
PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
|
|
1412
|
-
/**
|
|
1413
|
-
* Generate images of adults, but not children.
|
|
1414
|
-
*/
|
|
1415
|
-
PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
|
|
1416
|
-
/**
|
|
1417
|
-
* Generate images that include adults and children.
|
|
1418
|
-
*/
|
|
1419
|
-
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
1420
|
-
})(PersonGeneration || (PersonGeneration = {}));
|
|
1421
1525
|
/** Enum that specifies the language of the text in the prompt. */
|
|
1422
1526
|
var ImagePromptLanguage;
|
|
1423
1527
|
(function (ImagePromptLanguage) {
|
|
@@ -2316,6 +2420,9 @@ class GenerateVideosOperation {
|
|
|
2316
2420
|
return operation;
|
|
2317
2421
|
}
|
|
2318
2422
|
}
|
|
2423
|
+
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
2424
|
+
class EvaluateDatasetResponse {
|
|
2425
|
+
}
|
|
2319
2426
|
/** Response for the list tuning jobs method. */
|
|
2320
2427
|
class ListTuningJobsResponse {
|
|
2321
2428
|
}
|
|
@@ -3435,6 +3542,33 @@ function tIsVertexEmbedContentModel(model) {
|
|
|
3435
3542
|
* Copyright 2025 Google LLC
|
|
3436
3543
|
* SPDX-License-Identifier: Apache-2.0
|
|
3437
3544
|
*/
|
|
3545
|
+
function authConfigToMldev$4(fromObject) {
|
|
3546
|
+
const toObject = {};
|
|
3547
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
3548
|
+
if (fromApiKey != null) {
|
|
3549
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
3550
|
+
}
|
|
3551
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
3552
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
3553
|
+
}
|
|
3554
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
3555
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
3556
|
+
}
|
|
3557
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
3558
|
+
undefined) {
|
|
3559
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
3560
|
+
}
|
|
3561
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
3562
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
3563
|
+
}
|
|
3564
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
3565
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
3566
|
+
}
|
|
3567
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
3568
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
3569
|
+
}
|
|
3570
|
+
return toObject;
|
|
3571
|
+
}
|
|
3438
3572
|
function batchJobDestinationFromMldev(fromObject) {
|
|
3439
3573
|
const toObject = {};
|
|
3440
3574
|
const fromFileName = getValueByPath(fromObject, ['responsesFile']);
|
|
@@ -4284,8 +4418,9 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
|
|
|
4284
4418
|
}
|
|
4285
4419
|
function googleMapsToMldev$4(fromObject) {
|
|
4286
4420
|
const toObject = {};
|
|
4287
|
-
|
|
4288
|
-
|
|
4421
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
4422
|
+
if (fromAuthConfig != null) {
|
|
4423
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$4(fromAuthConfig));
|
|
4289
4424
|
}
|
|
4290
4425
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
4291
4426
|
if (fromEnableWidget != null) {
|
|
@@ -4299,12 +4434,12 @@ function googleSearchToMldev$4(fromObject) {
|
|
|
4299
4434
|
if (fromSearchTypes != null) {
|
|
4300
4435
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4301
4436
|
}
|
|
4302
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4303
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4304
|
-
}
|
|
4305
4437
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
4306
4438
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
4307
4439
|
}
|
|
4440
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4441
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4442
|
+
}
|
|
4308
4443
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
4309
4444
|
'timeRangeFilter',
|
|
4310
4445
|
]);
|
|
@@ -4336,6 +4471,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4336
4471
|
undefined) {
|
|
4337
4472
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
4338
4473
|
}
|
|
4474
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
4475
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
4476
|
+
}
|
|
4339
4477
|
return toObject;
|
|
4340
4478
|
}
|
|
4341
4479
|
function inlinedRequestToMldev(apiClient, fromObject) {
|
|
@@ -4589,6 +4727,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4589
4727
|
if (fromGoogleSearch != null) {
|
|
4590
4728
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4591
4729
|
}
|
|
4730
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4731
|
+
if (fromGoogleMaps != null) {
|
|
4732
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4733
|
+
}
|
|
4592
4734
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4593
4735
|
'codeExecution',
|
|
4594
4736
|
]);
|
|
@@ -4610,16 +4752,15 @@ function toolToMldev$4(fromObject) {
|
|
|
4610
4752
|
}
|
|
4611
4753
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4612
4754
|
}
|
|
4613
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4614
|
-
if (fromGoogleMaps != null) {
|
|
4615
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4616
|
-
}
|
|
4617
4755
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4618
4756
|
'googleSearchRetrieval',
|
|
4619
4757
|
]);
|
|
4620
4758
|
if (fromGoogleSearchRetrieval != null) {
|
|
4621
4759
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4622
4760
|
}
|
|
4761
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
4762
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
4763
|
+
}
|
|
4623
4764
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4624
4765
|
if (fromUrlContext != null) {
|
|
4625
4766
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5329,6 +5470,33 @@ class Batches extends BaseModule {
|
|
|
5329
5470
|
* Copyright 2025 Google LLC
|
|
5330
5471
|
* SPDX-License-Identifier: Apache-2.0
|
|
5331
5472
|
*/
|
|
5473
|
+
function authConfigToMldev$3(fromObject) {
|
|
5474
|
+
const toObject = {};
|
|
5475
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
5476
|
+
if (fromApiKey != null) {
|
|
5477
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
5478
|
+
}
|
|
5479
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
5480
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
5481
|
+
}
|
|
5482
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
5483
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
5484
|
+
}
|
|
5485
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
5486
|
+
undefined) {
|
|
5487
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
5488
|
+
}
|
|
5489
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
5490
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
5491
|
+
}
|
|
5492
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
5493
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
5494
|
+
}
|
|
5495
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
5496
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
5497
|
+
}
|
|
5498
|
+
return toObject;
|
|
5499
|
+
}
|
|
5332
5500
|
function blobToMldev$3(fromObject) {
|
|
5333
5501
|
const toObject = {};
|
|
5334
5502
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -5629,8 +5797,9 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
|
|
|
5629
5797
|
}
|
|
5630
5798
|
function googleMapsToMldev$3(fromObject) {
|
|
5631
5799
|
const toObject = {};
|
|
5632
|
-
|
|
5633
|
-
|
|
5800
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
5801
|
+
if (fromAuthConfig != null) {
|
|
5802
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$3(fromAuthConfig));
|
|
5634
5803
|
}
|
|
5635
5804
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
5636
5805
|
if (fromEnableWidget != null) {
|
|
@@ -5644,12 +5813,12 @@ function googleSearchToMldev$3(fromObject) {
|
|
|
5644
5813
|
if (fromSearchTypes != null) {
|
|
5645
5814
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5646
5815
|
}
|
|
5647
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5648
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5649
|
-
}
|
|
5650
5816
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
5651
5817
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
5652
5818
|
}
|
|
5819
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5820
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5821
|
+
}
|
|
5653
5822
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
5654
5823
|
'timeRangeFilter',
|
|
5655
5824
|
]);
|
|
@@ -5847,6 +6016,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5847
6016
|
if (fromGoogleSearch != null) {
|
|
5848
6017
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5849
6018
|
}
|
|
6019
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6020
|
+
if (fromGoogleMaps != null) {
|
|
6021
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
6022
|
+
}
|
|
5850
6023
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5851
6024
|
'codeExecution',
|
|
5852
6025
|
]);
|
|
@@ -5868,16 +6041,15 @@ function toolToMldev$3(fromObject) {
|
|
|
5868
6041
|
}
|
|
5869
6042
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5870
6043
|
}
|
|
5871
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5872
|
-
if (fromGoogleMaps != null) {
|
|
5873
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5874
|
-
}
|
|
5875
6044
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5876
6045
|
'googleSearchRetrieval',
|
|
5877
6046
|
]);
|
|
5878
6047
|
if (fromGoogleSearchRetrieval != null) {
|
|
5879
6048
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5880
6049
|
}
|
|
6050
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
6051
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
6052
|
+
}
|
|
5881
6053
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5882
6054
|
if (fromUrlContext != null) {
|
|
5883
6055
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5911,6 +6083,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5911
6083
|
if (fromGoogleSearch != null) {
|
|
5912
6084
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5913
6085
|
}
|
|
6086
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
6087
|
+
if (fromGoogleMaps != null) {
|
|
6088
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
6089
|
+
}
|
|
5914
6090
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5915
6091
|
'codeExecution',
|
|
5916
6092
|
]);
|
|
@@ -5935,16 +6111,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5935
6111
|
}
|
|
5936
6112
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5937
6113
|
}
|
|
5938
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5939
|
-
if (fromGoogleMaps != null) {
|
|
5940
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5941
|
-
}
|
|
5942
6114
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5943
6115
|
'googleSearchRetrieval',
|
|
5944
6116
|
]);
|
|
5945
6117
|
if (fromGoogleSearchRetrieval != null) {
|
|
5946
6118
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5947
6119
|
}
|
|
6120
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
6121
|
+
'parallelAiSearch',
|
|
6122
|
+
]);
|
|
6123
|
+
if (fromParallelAiSearch != null) {
|
|
6124
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
6125
|
+
}
|
|
5948
6126
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5949
6127
|
if (fromUrlContext != null) {
|
|
5950
6128
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7239,6 +7417,40 @@ class Files extends BaseModule {
|
|
|
7239
7417
|
* Copyright 2025 Google LLC
|
|
7240
7418
|
* SPDX-License-Identifier: Apache-2.0
|
|
7241
7419
|
*/
|
|
7420
|
+
function audioTranscriptionConfigToMldev$1(fromObject) {
|
|
7421
|
+
const toObject = {};
|
|
7422
|
+
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
7423
|
+
throw new Error('languageCodes parameter is not supported in Gemini API.');
|
|
7424
|
+
}
|
|
7425
|
+
return toObject;
|
|
7426
|
+
}
|
|
7427
|
+
function authConfigToMldev$2(fromObject) {
|
|
7428
|
+
const toObject = {};
|
|
7429
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
7430
|
+
if (fromApiKey != null) {
|
|
7431
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
7432
|
+
}
|
|
7433
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
7434
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
7435
|
+
}
|
|
7436
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
7437
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
7438
|
+
}
|
|
7439
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
7440
|
+
undefined) {
|
|
7441
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
7442
|
+
}
|
|
7443
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
7444
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
7445
|
+
}
|
|
7446
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
7447
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
7448
|
+
}
|
|
7449
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
7450
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
7451
|
+
}
|
|
7452
|
+
return toObject;
|
|
7453
|
+
}
|
|
7242
7454
|
function blobToMldev$2(fromObject) {
|
|
7243
7455
|
const toObject = {};
|
|
7244
7456
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -7474,8 +7686,9 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
7474
7686
|
}
|
|
7475
7687
|
function googleMapsToMldev$2(fromObject) {
|
|
7476
7688
|
const toObject = {};
|
|
7477
|
-
|
|
7478
|
-
|
|
7689
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7690
|
+
if (fromAuthConfig != null) {
|
|
7691
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$2(fromAuthConfig));
|
|
7479
7692
|
}
|
|
7480
7693
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
7481
7694
|
if (fromEnableWidget != null) {
|
|
@@ -7489,12 +7702,12 @@ function googleSearchToMldev$2(fromObject) {
|
|
|
7489
7702
|
if (fromSearchTypes != null) {
|
|
7490
7703
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7491
7704
|
}
|
|
7492
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7493
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7494
|
-
}
|
|
7495
7705
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
7496
7706
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
7497
7707
|
}
|
|
7708
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7709
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7710
|
+
}
|
|
7498
7711
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7499
7712
|
'timeRangeFilter',
|
|
7500
7713
|
]);
|
|
@@ -7587,13 +7800,13 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
7587
7800
|
'inputAudioTranscription',
|
|
7588
7801
|
]);
|
|
7589
7802
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
7590
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
|
|
7803
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromInputAudioTranscription));
|
|
7591
7804
|
}
|
|
7592
7805
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
7593
7806
|
'outputAudioTranscription',
|
|
7594
7807
|
]);
|
|
7595
7808
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
7596
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
|
|
7809
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromOutputAudioTranscription));
|
|
7597
7810
|
}
|
|
7598
7811
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
7599
7812
|
'realtimeInputConfig',
|
|
@@ -8008,6 +8221,10 @@ function toolToMldev$2(fromObject) {
|
|
|
8008
8221
|
if (fromGoogleSearch != null) {
|
|
8009
8222
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8010
8223
|
}
|
|
8224
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8225
|
+
if (fromGoogleMaps != null) {
|
|
8226
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
8227
|
+
}
|
|
8011
8228
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8012
8229
|
'codeExecution',
|
|
8013
8230
|
]);
|
|
@@ -8029,16 +8246,15 @@ function toolToMldev$2(fromObject) {
|
|
|
8029
8246
|
}
|
|
8030
8247
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8031
8248
|
}
|
|
8032
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8033
|
-
if (fromGoogleMaps != null) {
|
|
8034
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
8035
|
-
}
|
|
8036
8249
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8037
8250
|
'googleSearchRetrieval',
|
|
8038
8251
|
]);
|
|
8039
8252
|
if (fromGoogleSearchRetrieval != null) {
|
|
8040
8253
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8041
8254
|
}
|
|
8255
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
8256
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
8257
|
+
}
|
|
8042
8258
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8043
8259
|
if (fromUrlContext != null) {
|
|
8044
8260
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8072,6 +8288,10 @@ function toolToVertex$1(fromObject) {
|
|
|
8072
8288
|
if (fromGoogleSearch != null) {
|
|
8073
8289
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8074
8290
|
}
|
|
8291
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8292
|
+
if (fromGoogleMaps != null) {
|
|
8293
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8294
|
+
}
|
|
8075
8295
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8076
8296
|
'codeExecution',
|
|
8077
8297
|
]);
|
|
@@ -8096,16 +8316,18 @@ function toolToVertex$1(fromObject) {
|
|
|
8096
8316
|
}
|
|
8097
8317
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8098
8318
|
}
|
|
8099
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8100
|
-
if (fromGoogleMaps != null) {
|
|
8101
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8102
|
-
}
|
|
8103
8319
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8104
8320
|
'googleSearchRetrieval',
|
|
8105
8321
|
]);
|
|
8106
8322
|
if (fromGoogleSearchRetrieval != null) {
|
|
8107
8323
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
8108
8324
|
}
|
|
8325
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
8326
|
+
'parallelAiSearch',
|
|
8327
|
+
]);
|
|
8328
|
+
if (fromParallelAiSearch != null) {
|
|
8329
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
8330
|
+
}
|
|
8109
8331
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8110
8332
|
if (fromUrlContext != null) {
|
|
8111
8333
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8221,6 +8443,33 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
8221
8443
|
* Copyright 2025 Google LLC
|
|
8222
8444
|
* SPDX-License-Identifier: Apache-2.0
|
|
8223
8445
|
*/
|
|
8446
|
+
function authConfigToMldev$1(fromObject, _rootObject) {
|
|
8447
|
+
const toObject = {};
|
|
8448
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
8449
|
+
if (fromApiKey != null) {
|
|
8450
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
8451
|
+
}
|
|
8452
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
8453
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
8454
|
+
}
|
|
8455
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
8456
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
8457
|
+
}
|
|
8458
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
8459
|
+
undefined) {
|
|
8460
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
8461
|
+
}
|
|
8462
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
8463
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
8464
|
+
}
|
|
8465
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
8466
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
8467
|
+
}
|
|
8468
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
8469
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
8470
|
+
}
|
|
8471
|
+
return toObject;
|
|
8472
|
+
}
|
|
8224
8473
|
function blobToMldev$1(fromObject, _rootObject) {
|
|
8225
8474
|
const toObject = {};
|
|
8226
8475
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -10369,10 +10618,11 @@ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
|
|
|
10369
10618
|
}
|
|
10370
10619
|
return toObject;
|
|
10371
10620
|
}
|
|
10372
|
-
function googleMapsToMldev$1(fromObject,
|
|
10621
|
+
function googleMapsToMldev$1(fromObject, rootObject) {
|
|
10373
10622
|
const toObject = {};
|
|
10374
|
-
|
|
10375
|
-
|
|
10623
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
10624
|
+
if (fromAuthConfig != null) {
|
|
10625
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev$1(fromAuthConfig));
|
|
10376
10626
|
}
|
|
10377
10627
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
10378
10628
|
if (fromEnableWidget != null) {
|
|
@@ -10386,12 +10636,12 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
|
10386
10636
|
if (fromSearchTypes != null) {
|
|
10387
10637
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10388
10638
|
}
|
|
10389
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10390
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10391
|
-
}
|
|
10392
10639
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
10393
10640
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
10394
10641
|
}
|
|
10642
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10643
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10644
|
+
}
|
|
10395
10645
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
10396
10646
|
'timeRangeFilter',
|
|
10397
10647
|
]);
|
|
@@ -10423,6 +10673,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10423
10673
|
undefined) {
|
|
10424
10674
|
throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
|
|
10425
10675
|
}
|
|
10676
|
+
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
10677
|
+
throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
|
|
10678
|
+
}
|
|
10426
10679
|
return toObject;
|
|
10427
10680
|
}
|
|
10428
10681
|
function imageConfigToVertex(fromObject, _rootObject) {
|
|
@@ -10459,6 +10712,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10459
10712
|
if (fromOutputCompressionQuality != null) {
|
|
10460
10713
|
setValueByPath(toObject, ['imageOutputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
10461
10714
|
}
|
|
10715
|
+
const fromImageOutputOptions = getValueByPath(fromObject, [
|
|
10716
|
+
'imageOutputOptions',
|
|
10717
|
+
]);
|
|
10718
|
+
if (fromImageOutputOptions != null) {
|
|
10719
|
+
setValueByPath(toObject, ['imageOutputOptions'], fromImageOutputOptions);
|
|
10720
|
+
}
|
|
10462
10721
|
return toObject;
|
|
10463
10722
|
}
|
|
10464
10723
|
function imageFromMldev(fromObject, _rootObject) {
|
|
@@ -11178,6 +11437,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11178
11437
|
if (fromGoogleSearch != null) {
|
|
11179
11438
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11180
11439
|
}
|
|
11440
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11441
|
+
if (fromGoogleMaps != null) {
|
|
11442
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11443
|
+
}
|
|
11181
11444
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11182
11445
|
'codeExecution',
|
|
11183
11446
|
]);
|
|
@@ -11199,16 +11462,15 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11199
11462
|
}
|
|
11200
11463
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11201
11464
|
}
|
|
11202
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11203
|
-
if (fromGoogleMaps != null) {
|
|
11204
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11205
|
-
}
|
|
11206
11465
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11207
11466
|
'googleSearchRetrieval',
|
|
11208
11467
|
]);
|
|
11209
11468
|
if (fromGoogleSearchRetrieval != null) {
|
|
11210
11469
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11211
11470
|
}
|
|
11471
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
11472
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
11473
|
+
}
|
|
11212
11474
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11213
11475
|
if (fromUrlContext != null) {
|
|
11214
11476
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11242,6 +11504,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11242
11504
|
if (fromGoogleSearch != null) {
|
|
11243
11505
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11244
11506
|
}
|
|
11507
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11508
|
+
if (fromGoogleMaps != null) {
|
|
11509
|
+
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11510
|
+
}
|
|
11245
11511
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11246
11512
|
'codeExecution',
|
|
11247
11513
|
]);
|
|
@@ -11266,16 +11532,18 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11266
11532
|
}
|
|
11267
11533
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11268
11534
|
}
|
|
11269
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11270
|
-
if (fromGoogleMaps != null) {
|
|
11271
|
-
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11272
|
-
}
|
|
11273
11535
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11274
11536
|
'googleSearchRetrieval',
|
|
11275
11537
|
]);
|
|
11276
11538
|
if (fromGoogleSearchRetrieval != null) {
|
|
11277
11539
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11278
11540
|
}
|
|
11541
|
+
const fromParallelAiSearch = getValueByPath(fromObject, [
|
|
11542
|
+
'parallelAiSearch',
|
|
11543
|
+
]);
|
|
11544
|
+
if (fromParallelAiSearch != null) {
|
|
11545
|
+
setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
|
|
11546
|
+
}
|
|
11279
11547
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11280
11548
|
if (fromUrlContext != null) {
|
|
11281
11549
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11839,7 +12107,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11839
12107
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11840
12108
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11841
12109
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11842
|
-
const SDK_VERSION = '1.
|
|
12110
|
+
const SDK_VERSION = '1.45.0'; // x-release-please-version
|
|
11843
12111
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11844
12112
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11845
12113
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11858,6 +12126,9 @@ const DEFAULT_RETRY_HTTP_STATUS_CODES = [
|
|
|
11858
12126
|
/**
|
|
11859
12127
|
* The ApiClient class is used to send requests to the Gemini API or Vertex AI
|
|
11860
12128
|
* endpoints.
|
|
12129
|
+
*
|
|
12130
|
+
* WARNING: This is an internal API and may change without notice. Direct usage
|
|
12131
|
+
* is not supported and may break your application.
|
|
11861
12132
|
*/
|
|
11862
12133
|
class ApiClient {
|
|
11863
12134
|
constructor(opts) {
|
|
@@ -11905,10 +12176,7 @@ class ApiClient {
|
|
|
11905
12176
|
else {
|
|
11906
12177
|
// Gemini API
|
|
11907
12178
|
if (!this.clientOptions.apiKey) {
|
|
11908
|
-
|
|
11909
|
-
message: 'API key must be set when using the Gemini API.',
|
|
11910
|
-
status: 403,
|
|
11911
|
-
});
|
|
12179
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
11912
12180
|
}
|
|
11913
12181
|
initHttpOptions.apiVersion =
|
|
11914
12182
|
(_c = this.clientOptions.apiVersion) !== null && _c !== void 0 ? _c : GOOGLE_AI_API_DEFAULT_VERSION;
|
|
@@ -15171,6 +15439,40 @@ class Operations extends BaseModule {
|
|
|
15171
15439
|
* Copyright 2025 Google LLC
|
|
15172
15440
|
* SPDX-License-Identifier: Apache-2.0
|
|
15173
15441
|
*/
|
|
15442
|
+
function audioTranscriptionConfigToMldev(fromObject) {
|
|
15443
|
+
const toObject = {};
|
|
15444
|
+
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
15445
|
+
throw new Error('languageCodes parameter is not supported in Gemini API.');
|
|
15446
|
+
}
|
|
15447
|
+
return toObject;
|
|
15448
|
+
}
|
|
15449
|
+
function authConfigToMldev(fromObject) {
|
|
15450
|
+
const toObject = {};
|
|
15451
|
+
const fromApiKey = getValueByPath(fromObject, ['apiKey']);
|
|
15452
|
+
if (fromApiKey != null) {
|
|
15453
|
+
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
15454
|
+
}
|
|
15455
|
+
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
15456
|
+
throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
|
|
15457
|
+
}
|
|
15458
|
+
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
15459
|
+
throw new Error('authType parameter is not supported in Gemini API.');
|
|
15460
|
+
}
|
|
15461
|
+
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
15462
|
+
undefined) {
|
|
15463
|
+
throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
|
|
15464
|
+
}
|
|
15465
|
+
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
15466
|
+
throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
|
|
15467
|
+
}
|
|
15468
|
+
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
15469
|
+
throw new Error('oauthConfig parameter is not supported in Gemini API.');
|
|
15470
|
+
}
|
|
15471
|
+
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
15472
|
+
throw new Error('oidcConfig parameter is not supported in Gemini API.');
|
|
15473
|
+
}
|
|
15474
|
+
return toObject;
|
|
15475
|
+
}
|
|
15174
15476
|
function blobToMldev(fromObject) {
|
|
15175
15477
|
const toObject = {};
|
|
15176
15478
|
const fromData = getValueByPath(fromObject, ['data']);
|
|
@@ -15281,8 +15583,9 @@ function functionCallToMldev(fromObject) {
|
|
|
15281
15583
|
}
|
|
15282
15584
|
function googleMapsToMldev(fromObject) {
|
|
15283
15585
|
const toObject = {};
|
|
15284
|
-
|
|
15285
|
-
|
|
15586
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
15587
|
+
if (fromAuthConfig != null) {
|
|
15588
|
+
setValueByPath(toObject, ['authConfig'], authConfigToMldev(fromAuthConfig));
|
|
15286
15589
|
}
|
|
15287
15590
|
const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
|
|
15288
15591
|
if (fromEnableWidget != null) {
|
|
@@ -15296,12 +15599,12 @@ function googleSearchToMldev(fromObject) {
|
|
|
15296
15599
|
if (fromSearchTypes != null) {
|
|
15297
15600
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15298
15601
|
}
|
|
15299
|
-
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15300
|
-
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15301
|
-
}
|
|
15302
15602
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
15303
15603
|
throw new Error('blockingConfidence parameter is not supported in Gemini API.');
|
|
15304
15604
|
}
|
|
15605
|
+
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15606
|
+
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15607
|
+
}
|
|
15305
15608
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
15306
15609
|
'timeRangeFilter',
|
|
15307
15610
|
]);
|
|
@@ -15394,13 +15697,13 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
15394
15697
|
'inputAudioTranscription',
|
|
15395
15698
|
]);
|
|
15396
15699
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
15397
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
|
|
15700
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev(fromInputAudioTranscription));
|
|
15398
15701
|
}
|
|
15399
15702
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
15400
15703
|
'outputAudioTranscription',
|
|
15401
15704
|
]);
|
|
15402
15705
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
15403
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
|
|
15706
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev(fromOutputAudioTranscription));
|
|
15404
15707
|
}
|
|
15405
15708
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
15406
15709
|
'realtimeInputConfig',
|
|
@@ -15523,6 +15826,10 @@ function toolToMldev(fromObject) {
|
|
|
15523
15826
|
if (fromGoogleSearch != null) {
|
|
15524
15827
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15525
15828
|
}
|
|
15829
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15830
|
+
if (fromGoogleMaps != null) {
|
|
15831
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15832
|
+
}
|
|
15526
15833
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15527
15834
|
'codeExecution',
|
|
15528
15835
|
]);
|
|
@@ -15544,16 +15851,15 @@ function toolToMldev(fromObject) {
|
|
|
15544
15851
|
}
|
|
15545
15852
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15546
15853
|
}
|
|
15547
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15548
|
-
if (fromGoogleMaps != null) {
|
|
15549
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15550
|
-
}
|
|
15551
15854
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15552
15855
|
'googleSearchRetrieval',
|
|
15553
15856
|
]);
|
|
15554
15857
|
if (fromGoogleSearchRetrieval != null) {
|
|
15555
15858
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15556
15859
|
}
|
|
15860
|
+
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
15861
|
+
throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
|
|
15862
|
+
}
|
|
15557
15863
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15558
15864
|
if (fromUrlContext != null) {
|
|
15559
15865
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -16554,166 +16860,6 @@ const safeJSON = (text) => {
|
|
|
16554
16860
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16555
16861
|
const sleep$1 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16556
16862
|
|
|
16557
|
-
/**
|
|
16558
|
-
* @license
|
|
16559
|
-
* Copyright 2025 Google LLC
|
|
16560
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16561
|
-
*/
|
|
16562
|
-
const VERSION = '0.0.1';
|
|
16563
|
-
|
|
16564
|
-
/**
|
|
16565
|
-
* @license
|
|
16566
|
-
* Copyright 2025 Google LLC
|
|
16567
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16568
|
-
*/
|
|
16569
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16570
|
-
/**
|
|
16571
|
-
* Note this does not detect 'browser'; for that, use getBrowserInfo().
|
|
16572
|
-
*/
|
|
16573
|
-
function getDetectedPlatform() {
|
|
16574
|
-
if (typeof Deno !== 'undefined' && Deno.build != null) {
|
|
16575
|
-
return 'deno';
|
|
16576
|
-
}
|
|
16577
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16578
|
-
return 'edge';
|
|
16579
|
-
}
|
|
16580
|
-
if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {
|
|
16581
|
-
return 'node';
|
|
16582
|
-
}
|
|
16583
|
-
return 'unknown';
|
|
16584
|
-
}
|
|
16585
|
-
const getPlatformProperties = () => {
|
|
16586
|
-
var _a, _b, _c, _d, _e;
|
|
16587
|
-
const detectedPlatform = getDetectedPlatform();
|
|
16588
|
-
if (detectedPlatform === 'deno') {
|
|
16589
|
-
return {
|
|
16590
|
-
'X-Stainless-Lang': 'js',
|
|
16591
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16592
|
-
'X-Stainless-OS': normalizePlatform(Deno.build.os),
|
|
16593
|
-
'X-Stainless-Arch': normalizeArch(Deno.build.arch),
|
|
16594
|
-
'X-Stainless-Runtime': 'deno',
|
|
16595
|
-
'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',
|
|
16596
|
-
};
|
|
16597
|
-
}
|
|
16598
|
-
if (typeof EdgeRuntime !== 'undefined') {
|
|
16599
|
-
return {
|
|
16600
|
-
'X-Stainless-Lang': 'js',
|
|
16601
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16602
|
-
'X-Stainless-OS': 'Unknown',
|
|
16603
|
-
'X-Stainless-Arch': `other:${EdgeRuntime}`,
|
|
16604
|
-
'X-Stainless-Runtime': 'edge',
|
|
16605
|
-
'X-Stainless-Runtime-Version': globalThis.process.version,
|
|
16606
|
-
};
|
|
16607
|
-
}
|
|
16608
|
-
// Check if Node.js
|
|
16609
|
-
if (detectedPlatform === 'node') {
|
|
16610
|
-
return {
|
|
16611
|
-
'X-Stainless-Lang': 'js',
|
|
16612
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16613
|
-
'X-Stainless-OS': normalizePlatform((_c = globalThis.process.platform) !== null && _c !== void 0 ? _c : 'unknown'),
|
|
16614
|
-
'X-Stainless-Arch': normalizeArch((_d = globalThis.process.arch) !== null && _d !== void 0 ? _d : 'unknown'),
|
|
16615
|
-
'X-Stainless-Runtime': 'node',
|
|
16616
|
-
'X-Stainless-Runtime-Version': (_e = globalThis.process.version) !== null && _e !== void 0 ? _e : 'unknown',
|
|
16617
|
-
};
|
|
16618
|
-
}
|
|
16619
|
-
const browserInfo = getBrowserInfo();
|
|
16620
|
-
if (browserInfo) {
|
|
16621
|
-
return {
|
|
16622
|
-
'X-Stainless-Lang': 'js',
|
|
16623
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16624
|
-
'X-Stainless-OS': 'Unknown',
|
|
16625
|
-
'X-Stainless-Arch': 'unknown',
|
|
16626
|
-
'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
|
|
16627
|
-
'X-Stainless-Runtime-Version': browserInfo.version,
|
|
16628
|
-
};
|
|
16629
|
-
}
|
|
16630
|
-
// TODO add support for Cloudflare workers, etc.
|
|
16631
|
-
return {
|
|
16632
|
-
'X-Stainless-Lang': 'js',
|
|
16633
|
-
'X-Stainless-Package-Version': VERSION,
|
|
16634
|
-
'X-Stainless-OS': 'Unknown',
|
|
16635
|
-
'X-Stainless-Arch': 'unknown',
|
|
16636
|
-
'X-Stainless-Runtime': 'unknown',
|
|
16637
|
-
'X-Stainless-Runtime-Version': 'unknown',
|
|
16638
|
-
};
|
|
16639
|
-
};
|
|
16640
|
-
// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
|
|
16641
|
-
function getBrowserInfo() {
|
|
16642
|
-
if (typeof navigator === 'undefined' || !navigator) {
|
|
16643
|
-
return null;
|
|
16644
|
-
}
|
|
16645
|
-
// NOTE: The order matters here!
|
|
16646
|
-
const browserPatterns = [
|
|
16647
|
-
{ key: 'edge', pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16648
|
-
{ key: 'ie', pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16649
|
-
{ key: 'ie', pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16650
|
-
{ key: 'chrome', pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16651
|
-
{ key: 'firefox', pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
|
|
16652
|
-
{ key: 'safari', pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
|
|
16653
|
-
];
|
|
16654
|
-
// Find the FIRST matching browser
|
|
16655
|
-
for (const { key, pattern } of browserPatterns) {
|
|
16656
|
-
const match = pattern.exec(navigator.userAgent);
|
|
16657
|
-
if (match) {
|
|
16658
|
-
const major = match[1] || 0;
|
|
16659
|
-
const minor = match[2] || 0;
|
|
16660
|
-
const patch = match[3] || 0;
|
|
16661
|
-
return { browser: key, version: `${major}.${minor}.${patch}` };
|
|
16662
|
-
}
|
|
16663
|
-
}
|
|
16664
|
-
return null;
|
|
16665
|
-
}
|
|
16666
|
-
const normalizeArch = (arch) => {
|
|
16667
|
-
// Node docs:
|
|
16668
|
-
// - https://nodejs.org/api/process.html#processarch
|
|
16669
|
-
// Deno docs:
|
|
16670
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16671
|
-
if (arch === 'x32')
|
|
16672
|
-
return 'x32';
|
|
16673
|
-
if (arch === 'x86_64' || arch === 'x64')
|
|
16674
|
-
return 'x64';
|
|
16675
|
-
if (arch === 'arm')
|
|
16676
|
-
return 'arm';
|
|
16677
|
-
if (arch === 'aarch64' || arch === 'arm64')
|
|
16678
|
-
return 'arm64';
|
|
16679
|
-
if (arch)
|
|
16680
|
-
return `other:${arch}`;
|
|
16681
|
-
return 'unknown';
|
|
16682
|
-
};
|
|
16683
|
-
const normalizePlatform = (platform) => {
|
|
16684
|
-
// Node platforms:
|
|
16685
|
-
// - https://nodejs.org/api/process.html#processplatform
|
|
16686
|
-
// Deno platforms:
|
|
16687
|
-
// - https://doc.deno.land/deno/stable/~/Deno.build
|
|
16688
|
-
// - https://github.com/denoland/deno/issues/14799
|
|
16689
|
-
platform = platform.toLowerCase();
|
|
16690
|
-
// NOTE: this iOS check is untested and may not work
|
|
16691
|
-
// Node does not work natively on IOS, there is a fork at
|
|
16692
|
-
// https://github.com/nodejs-mobile/nodejs-mobile
|
|
16693
|
-
// however it is unknown at the time of writing how to detect if it is running
|
|
16694
|
-
if (platform.includes('ios'))
|
|
16695
|
-
return 'iOS';
|
|
16696
|
-
if (platform === 'android')
|
|
16697
|
-
return 'Android';
|
|
16698
|
-
if (platform === 'darwin')
|
|
16699
|
-
return 'MacOS';
|
|
16700
|
-
if (platform === 'win32')
|
|
16701
|
-
return 'Windows';
|
|
16702
|
-
if (platform === 'freebsd')
|
|
16703
|
-
return 'FreeBSD';
|
|
16704
|
-
if (platform === 'openbsd')
|
|
16705
|
-
return 'OpenBSD';
|
|
16706
|
-
if (platform === 'linux')
|
|
16707
|
-
return 'Linux';
|
|
16708
|
-
if (platform)
|
|
16709
|
-
return `Other:${platform}`;
|
|
16710
|
-
return 'Unknown';
|
|
16711
|
-
};
|
|
16712
|
-
let _platformHeaders;
|
|
16713
|
-
const getPlatformHeaders = () => {
|
|
16714
|
-
return (_platformHeaders !== null && _platformHeaders !== void 0 ? _platformHeaders : (_platformHeaders = getPlatformProperties()));
|
|
16715
|
-
};
|
|
16716
|
-
|
|
16717
16863
|
/**
|
|
16718
16864
|
* @license
|
|
16719
16865
|
* Copyright 2025 Google LLC
|
|
@@ -16819,6 +16965,37 @@ const FallbackEncoder = ({ headers, body }) => {
|
|
|
16819
16965
|
};
|
|
16820
16966
|
};
|
|
16821
16967
|
|
|
16968
|
+
/**
|
|
16969
|
+
* @license
|
|
16970
|
+
* Copyright 2025 Google LLC
|
|
16971
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16972
|
+
*/
|
|
16973
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
16974
|
+
/**
|
|
16975
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
16976
|
+
*/
|
|
16977
|
+
function stringifyQuery(query) {
|
|
16978
|
+
return Object.entries(query)
|
|
16979
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
16980
|
+
.map(([key, value]) => {
|
|
16981
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
16982
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
16983
|
+
}
|
|
16984
|
+
if (value === null) {
|
|
16985
|
+
return `${encodeURIComponent(key)}=`;
|
|
16986
|
+
}
|
|
16987
|
+
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.`);
|
|
16988
|
+
})
|
|
16989
|
+
.join('&');
|
|
16990
|
+
}
|
|
16991
|
+
|
|
16992
|
+
/**
|
|
16993
|
+
* @license
|
|
16994
|
+
* Copyright 2025 Google LLC
|
|
16995
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16996
|
+
*/
|
|
16997
|
+
const VERSION = '0.0.1';
|
|
16998
|
+
|
|
16822
16999
|
/**
|
|
16823
17000
|
* @license
|
|
16824
17001
|
* Copyright 2025 Google LLC
|
|
@@ -17157,8 +17334,10 @@ class LineDecoder {
|
|
|
17157
17334
|
constructor() {
|
|
17158
17335
|
this.buffer = new Uint8Array();
|
|
17159
17336
|
this.carriageReturnIndex = null;
|
|
17337
|
+
this.searchIndex = 0;
|
|
17160
17338
|
}
|
|
17161
17339
|
decode(chunk) {
|
|
17340
|
+
var _a;
|
|
17162
17341
|
if (chunk == null) {
|
|
17163
17342
|
return [];
|
|
17164
17343
|
}
|
|
@@ -17168,7 +17347,7 @@ class LineDecoder {
|
|
|
17168
17347
|
this.buffer = concatBytes([this.buffer, binaryChunk]);
|
|
17169
17348
|
const lines = [];
|
|
17170
17349
|
let patternIndex;
|
|
17171
|
-
while ((patternIndex = findNewlineIndex(this.buffer, this.carriageReturnIndex)) != null) {
|
|
17350
|
+
while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
|
|
17172
17351
|
if (patternIndex.carriage && this.carriageReturnIndex == null) {
|
|
17173
17352
|
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
17174
17353
|
this.carriageReturnIndex = patternIndex.index;
|
|
@@ -17180,6 +17359,7 @@ class LineDecoder {
|
|
|
17180
17359
|
lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
|
|
17181
17360
|
this.buffer = this.buffer.subarray(this.carriageReturnIndex);
|
|
17182
17361
|
this.carriageReturnIndex = null;
|
|
17362
|
+
this.searchIndex = 0;
|
|
17183
17363
|
continue;
|
|
17184
17364
|
}
|
|
17185
17365
|
const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
@@ -17187,7 +17367,9 @@ class LineDecoder {
|
|
|
17187
17367
|
lines.push(line);
|
|
17188
17368
|
this.buffer = this.buffer.subarray(patternIndex.index);
|
|
17189
17369
|
this.carriageReturnIndex = null;
|
|
17370
|
+
this.searchIndex = 0;
|
|
17190
17371
|
}
|
|
17372
|
+
this.searchIndex = Math.max(0, this.buffer.length - 1);
|
|
17191
17373
|
return lines;
|
|
17192
17374
|
}
|
|
17193
17375
|
flush() {
|
|
@@ -17212,41 +17394,23 @@ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
|
17212
17394
|
function findNewlineIndex(buffer, startIndex) {
|
|
17213
17395
|
const newline = 0x0a; // \n
|
|
17214
17396
|
const carriage = 0x0d; // \r
|
|
17215
|
-
|
|
17216
|
-
|
|
17217
|
-
|
|
17218
|
-
|
|
17219
|
-
|
|
17220
|
-
return { preceding: i, index: i + 1, carriage: true };
|
|
17221
|
-
}
|
|
17397
|
+
const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
|
|
17398
|
+
const nextNewline = buffer.indexOf(newline, start);
|
|
17399
|
+
const nextCarriage = buffer.indexOf(carriage, start);
|
|
17400
|
+
if (nextNewline === -1 && nextCarriage === -1) {
|
|
17401
|
+
return null;
|
|
17222
17402
|
}
|
|
17223
|
-
|
|
17224
|
-
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
17233
|
-
// \n\n
|
|
17234
|
-
return i + 2;
|
|
17235
|
-
}
|
|
17236
|
-
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
17237
|
-
// \r\r
|
|
17238
|
-
return i + 2;
|
|
17239
|
-
}
|
|
17240
|
-
if (buffer[i] === carriage &&
|
|
17241
|
-
buffer[i + 1] === newline &&
|
|
17242
|
-
i + 3 < buffer.length &&
|
|
17243
|
-
buffer[i + 2] === carriage &&
|
|
17244
|
-
buffer[i + 3] === newline) {
|
|
17245
|
-
// \r\n\r\n
|
|
17246
|
-
return i + 4;
|
|
17247
|
-
}
|
|
17403
|
+
let i;
|
|
17404
|
+
if (nextNewline !== -1 && nextCarriage !== -1) {
|
|
17405
|
+
i = Math.min(nextNewline, nextCarriage);
|
|
17406
|
+
}
|
|
17407
|
+
else {
|
|
17408
|
+
i = nextNewline !== -1 ? nextNewline : nextCarriage;
|
|
17409
|
+
}
|
|
17410
|
+
if (buffer[i] === newline) {
|
|
17411
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
17248
17412
|
}
|
|
17249
|
-
return
|
|
17413
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
17250
17414
|
}
|
|
17251
17415
|
|
|
17252
17416
|
/**
|
|
@@ -17557,7 +17721,7 @@ function _iterSSEMessages(response, controller) {
|
|
|
17557
17721
|
const lineDecoder = new LineDecoder();
|
|
17558
17722
|
const iter = ReadableStreamToAsyncIterable(response.body);
|
|
17559
17723
|
try {
|
|
17560
|
-
for (var _d = true, _e = __asyncValues(
|
|
17724
|
+
for (var _d = true, _e = __asyncValues(iterBinaryChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
17561
17725
|
_c = _f.value;
|
|
17562
17726
|
_d = false;
|
|
17563
17727
|
const sseChunk = _c;
|
|
@@ -17583,13 +17747,12 @@ function _iterSSEMessages(response, controller) {
|
|
|
17583
17747
|
});
|
|
17584
17748
|
}
|
|
17585
17749
|
/**
|
|
17586
|
-
* Given an async iterable iterator,
|
|
17587
|
-
*
|
|
17750
|
+
* Given an async iterable iterator, normalizes each chunk to a
|
|
17751
|
+
* Uint8Array and yields it.
|
|
17588
17752
|
*/
|
|
17589
|
-
function
|
|
17590
|
-
return __asyncGenerator(this, arguments, function*
|
|
17753
|
+
function iterBinaryChunks(iterator) {
|
|
17754
|
+
return __asyncGenerator(this, arguments, function* iterBinaryChunks_1() {
|
|
17591
17755
|
var _a, e_5, _b, _c;
|
|
17592
|
-
let data = new Uint8Array();
|
|
17593
17756
|
try {
|
|
17594
17757
|
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) {
|
|
17595
17758
|
_c = iterator_3_1.value;
|
|
@@ -17601,15 +17764,7 @@ function iterSSEChunks(iterator) {
|
|
|
17601
17764
|
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
17602
17765
|
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
|
17603
17766
|
: chunk;
|
|
17604
|
-
|
|
17605
|
-
newData.set(data);
|
|
17606
|
-
newData.set(binaryChunk, data.length);
|
|
17607
|
-
data = newData;
|
|
17608
|
-
let patternIndex;
|
|
17609
|
-
while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
|
|
17610
|
-
yield yield __await(data.slice(0, patternIndex));
|
|
17611
|
-
data = data.slice(patternIndex);
|
|
17612
|
-
}
|
|
17767
|
+
yield yield __await(binaryChunk);
|
|
17613
17768
|
}
|
|
17614
17769
|
}
|
|
17615
17770
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -17619,9 +17774,6 @@ function iterSSEChunks(iterator) {
|
|
|
17619
17774
|
}
|
|
17620
17775
|
finally { if (e_5) throw e_5.error; }
|
|
17621
17776
|
}
|
|
17622
|
-
if (data.length > 0) {
|
|
17623
|
-
yield yield __await(data);
|
|
17624
|
-
}
|
|
17625
17777
|
});
|
|
17626
17778
|
}
|
|
17627
17779
|
class SSEDecoder {
|
|
@@ -17980,18 +18132,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
17980
18132
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
17981
18133
|
*/
|
|
17982
18134
|
stringifyQuery(query) {
|
|
17983
|
-
return
|
|
17984
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
17985
|
-
.map(([key, value]) => {
|
|
17986
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
17987
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
17988
|
-
}
|
|
17989
|
-
if (value === null) {
|
|
17990
|
-
return `${encodeURIComponent(key)}=`;
|
|
17991
|
-
}
|
|
17992
|
-
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.`);
|
|
17993
|
-
})
|
|
17994
|
-
.join('&');
|
|
18135
|
+
return stringifyQuery(query);
|
|
17995
18136
|
}
|
|
17996
18137
|
getUserAgent() {
|
|
17997
18138
|
return `${this.constructor.name}/JS ${VERSION}`;
|
|
@@ -18008,8 +18149,9 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18008
18149
|
new URL(path)
|
|
18009
18150
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
18010
18151
|
const defaultQuery = this.defaultQuery();
|
|
18011
|
-
|
|
18012
|
-
|
|
18152
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
18153
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
18154
|
+
query = Object.assign(Object.assign(Object.assign({}, pathQuery), defaultQuery), query);
|
|
18013
18155
|
}
|
|
18014
18156
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
18015
18157
|
url.search = this.stringifyQuery(query);
|
|
@@ -18230,9 +18372,9 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18230
18372
|
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
18231
18373
|
}
|
|
18232
18374
|
}
|
|
18233
|
-
// If the API asks us to wait a certain amount of time
|
|
18234
|
-
//
|
|
18235
|
-
if (
|
|
18375
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
18376
|
+
// says, but otherwise calculate a default
|
|
18377
|
+
if (timeoutMillis === undefined) {
|
|
18236
18378
|
const maxRetries = (_b = options.maxRetries) !== null && _b !== void 0 ? _b : this.maxRetries;
|
|
18237
18379
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
18238
18380
|
}
|
|
@@ -18273,7 +18415,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
18273
18415
|
const authHeaders = await this.authHeaders(options);
|
|
18274
18416
|
let headers = buildHeaders([
|
|
18275
18417
|
idempotencyHeaders,
|
|
18276
|
-
|
|
18418
|
+
{ Accept: 'application/json', 'User-Agent': this.getUserAgent() },
|
|
18277
18419
|
this._options.defaultHeaders,
|
|
18278
18420
|
bodyHeaders,
|
|
18279
18421
|
options.headers,
|
|
@@ -19296,10 +19438,28 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19296
19438
|
if (fromCustomBaseModel != null) {
|
|
19297
19439
|
setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
|
|
19298
19440
|
}
|
|
19441
|
+
const fromEvaluateDatasetRuns = getValueByPath(fromObject, [
|
|
19442
|
+
'evaluateDatasetRuns',
|
|
19443
|
+
]);
|
|
19444
|
+
if (fromEvaluateDatasetRuns != null) {
|
|
19445
|
+
let transformedList = fromEvaluateDatasetRuns;
|
|
19446
|
+
if (Array.isArray(transformedList)) {
|
|
19447
|
+
transformedList = transformedList.map((item) => {
|
|
19448
|
+
return item;
|
|
19449
|
+
});
|
|
19450
|
+
}
|
|
19451
|
+
setValueByPath(toObject, ['evaluateDatasetRuns'], transformedList);
|
|
19452
|
+
}
|
|
19299
19453
|
const fromExperiment = getValueByPath(fromObject, ['experiment']);
|
|
19300
19454
|
if (fromExperiment != null) {
|
|
19301
19455
|
setValueByPath(toObject, ['experiment'], fromExperiment);
|
|
19302
19456
|
}
|
|
19457
|
+
const fromFullFineTuningSpec = getValueByPath(fromObject, [
|
|
19458
|
+
'fullFineTuningSpec',
|
|
19459
|
+
]);
|
|
19460
|
+
if (fromFullFineTuningSpec != null) {
|
|
19461
|
+
setValueByPath(toObject, ['fullFineTuningSpec'], fromFullFineTuningSpec);
|
|
19462
|
+
}
|
|
19303
19463
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
19304
19464
|
if (fromLabels != null) {
|
|
19305
19465
|
setValueByPath(toObject, ['labels'], fromLabels);
|
|
@@ -19324,6 +19484,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19324
19484
|
if (fromTunedModelDisplayName != null) {
|
|
19325
19485
|
setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
|
|
19326
19486
|
}
|
|
19487
|
+
const fromTuningJobState = getValueByPath(fromObject, [
|
|
19488
|
+
'tuningJobState',
|
|
19489
|
+
]);
|
|
19490
|
+
if (fromTuningJobState != null) {
|
|
19491
|
+
setValueByPath(toObject, ['tuningJobState'], fromTuningJobState);
|
|
19492
|
+
}
|
|
19327
19493
|
const fromVeoTuningSpec = getValueByPath(fromObject, [
|
|
19328
19494
|
'veoTuningSpec',
|
|
19329
19495
|
]);
|
|
@@ -20176,7 +20342,7 @@ class GoogleGenAI {
|
|
|
20176
20342
|
this.project = (_d = options.project) !== null && _d !== void 0 ? _d : envProject;
|
|
20177
20343
|
this.location = (_e = options.location) !== null && _e !== void 0 ? _e : envLocation;
|
|
20178
20344
|
if (!this.vertexai && !this.apiKey) {
|
|
20179
|
-
|
|
20345
|
+
console.warn('API key should be set when using the Gemini API.');
|
|
20180
20346
|
}
|
|
20181
20347
|
// Handle when to use Vertex AI in express mode (api key)
|
|
20182
20348
|
if (options.vertexai) {
|
|
@@ -20271,5 +20437,5 @@ function getApiKeyFromEnv() {
|
|
|
20271
20437
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
20272
20438
|
}
|
|
20273
20439
|
|
|
20274
|
-
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
20440
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
20275
20441
|
//# sourceMappingURL=index.mjs.map
|