@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.
@@ -638,7 +638,7 @@ var FunctionResponseScheduling;
638
638
  */
639
639
  FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
640
640
  })(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
641
- /** The type of the data. */
641
+ /** Data type of the schema field. */
642
642
  var Type;
643
643
  (function (Type) {
644
644
  /**
@@ -706,22 +706,6 @@ var PhishBlockThreshold;
706
706
  */
707
707
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
708
708
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
709
- /** The API spec that the external API implements. This enum is not supported in Gemini API. */
710
- var ApiSpec;
711
- (function (ApiSpec) {
712
- /**
713
- * Unspecified API spec. This value should not be used.
714
- */
715
- ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
716
- /**
717
- * Simple search API spec.
718
- */
719
- ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
720
- /**
721
- * Elastic search API spec.
722
- */
723
- ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
724
- })(ApiSpec || (ApiSpec = {}));
725
709
  /** Type of auth scheme. This enum is not supported in Gemini API. */
726
710
  var AuthType;
727
711
  (function (AuthType) {
@@ -776,6 +760,22 @@ var HttpElementLocation;
776
760
  */
777
761
  HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
778
762
  })(HttpElementLocation || (HttpElementLocation = {}));
763
+ /** The API spec that the external API implements. This enum is not supported in Gemini API. */
764
+ var ApiSpec;
765
+ (function (ApiSpec) {
766
+ /**
767
+ * Unspecified API spec. This value should not be used.
768
+ */
769
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
770
+ /**
771
+ * Simple search API spec.
772
+ */
773
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
774
+ /**
775
+ * Elastic search API spec.
776
+ */
777
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
778
+ })(ApiSpec || (ApiSpec = {}));
779
779
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
780
780
  var Behavior;
781
781
  (function (Behavior) {
@@ -852,27 +852,43 @@ var ThinkingLevel;
852
852
  */
853
853
  ThinkingLevel["MINIMAL"] = "MINIMAL";
854
854
  })(ThinkingLevel || (ThinkingLevel = {}));
855
- /** Harm category. */
855
+ /** Enum that controls the generation of people. */
856
+ var PersonGeneration;
857
+ (function (PersonGeneration) {
858
+ /**
859
+ * Block generation of images of people.
860
+ */
861
+ PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
862
+ /**
863
+ * Generate images of adults, but not children.
864
+ */
865
+ PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
866
+ /**
867
+ * Generate images that include adults and children.
868
+ */
869
+ PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
870
+ })(PersonGeneration || (PersonGeneration = {}));
871
+ /** The harm category to be blocked. */
856
872
  var HarmCategory;
857
873
  (function (HarmCategory) {
858
874
  /**
859
- * The harm category is unspecified.
875
+ * Default value. This value is unused.
860
876
  */
861
877
  HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
862
878
  /**
863
- * The harm category is harassment.
879
+ * Abusive, threatening, or content intended to bully, torment, or ridicule.
864
880
  */
865
881
  HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
866
882
  /**
867
- * The harm category is hate speech.
883
+ * Content that promotes violence or incites hatred against individuals or groups based on certain attributes.
868
884
  */
869
885
  HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
870
886
  /**
871
- * The harm category is sexually explicit content.
887
+ * Content that contains sexually explicit material.
872
888
  */
873
889
  HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
874
890
  /**
875
- * The harm category is dangerous content.
891
+ * Content that promotes, facilitates, or enables dangerous activities.
876
892
  */
877
893
  HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
878
894
  /**
@@ -880,27 +896,27 @@ var HarmCategory;
880
896
  */
881
897
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
882
898
  /**
883
- * The harm category is image hate. This enum value is not supported in Gemini API.
899
+ * Images that contain hate speech. This enum value is not supported in Gemini API.
884
900
  */
885
901
  HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
886
902
  /**
887
- * The harm category is image dangerous content. This enum value is not supported in Gemini API.
903
+ * Images that contain dangerous content. This enum value is not supported in Gemini API.
888
904
  */
889
905
  HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
890
906
  /**
891
- * The harm category is image harassment. This enum value is not supported in Gemini API.
907
+ * Images that contain harassment. This enum value is not supported in Gemini API.
892
908
  */
893
909
  HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
894
910
  /**
895
- * The harm category is image sexually explicit content. This enum value is not supported in Gemini API.
911
+ * Images that contain sexually explicit content. This enum value is not supported in Gemini API.
896
912
  */
897
913
  HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
898
914
  /**
899
- * The harm category is for jailbreak prompts. This enum value is not supported in Gemini API.
915
+ * Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.
900
916
  */
901
917
  HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
902
918
  })(HarmCategory || (HarmCategory = {}));
903
- /** Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. This enum is not supported in Gemini API. */
919
+ /** 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. */
904
920
  var HarmBlockMethod;
905
921
  (function (HarmBlockMethod) {
906
922
  /**
@@ -916,31 +932,31 @@ var HarmBlockMethod;
916
932
  */
917
933
  HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
918
934
  })(HarmBlockMethod || (HarmBlockMethod = {}));
919
- /** The harm block threshold. */
935
+ /** The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked. */
920
936
  var HarmBlockThreshold;
921
937
  (function (HarmBlockThreshold) {
922
938
  /**
923
- * Unspecified harm block threshold.
939
+ * The harm block threshold is unspecified.
924
940
  */
925
941
  HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
926
942
  /**
927
- * Block low threshold and above (i.e. block more).
943
+ * Block content with a low harm probability or higher.
928
944
  */
929
945
  HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
930
946
  /**
931
- * Block medium threshold and above.
947
+ * Block content with a medium harm probability or higher.
932
948
  */
933
949
  HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
934
950
  /**
935
- * Block only high threshold (i.e. block less).
951
+ * Block content with a high harm probability.
936
952
  */
937
953
  HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
938
954
  /**
939
- * Block none.
955
+ * Do not block any content, regardless of its harm probability.
940
956
  */
941
957
  HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE";
942
958
  /**
943
- * Turn off the safety filter.
959
+ * Turn off the safety filter entirely.
944
960
  */
945
961
  HarmBlockThreshold["OFF"] = "OFF";
946
962
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
@@ -1018,55 +1034,55 @@ var FinishReason;
1018
1034
  */
1019
1035
  FinishReason["IMAGE_OTHER"] = "IMAGE_OTHER";
1020
1036
  })(FinishReason || (FinishReason = {}));
1021
- /** Output only. Harm probability levels in the content. */
1037
+ /** Output only. The probability of harm for this category. */
1022
1038
  var HarmProbability;
1023
1039
  (function (HarmProbability) {
1024
1040
  /**
1025
- * Harm probability unspecified.
1041
+ * The harm probability is unspecified.
1026
1042
  */
1027
1043
  HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED";
1028
1044
  /**
1029
- * Negligible level of harm.
1045
+ * The harm probability is negligible.
1030
1046
  */
1031
1047
  HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE";
1032
1048
  /**
1033
- * Low level of harm.
1049
+ * The harm probability is low.
1034
1050
  */
1035
1051
  HarmProbability["LOW"] = "LOW";
1036
1052
  /**
1037
- * Medium level of harm.
1053
+ * The harm probability is medium.
1038
1054
  */
1039
1055
  HarmProbability["MEDIUM"] = "MEDIUM";
1040
1056
  /**
1041
- * High level of harm.
1057
+ * The harm probability is high.
1042
1058
  */
1043
1059
  HarmProbability["HIGH"] = "HIGH";
1044
1060
  })(HarmProbability || (HarmProbability = {}));
1045
- /** Output only. Harm severity levels in the content. This enum is not supported in Gemini API. */
1061
+ /** Output only. The severity of harm for this category. This enum is not supported in Gemini API. */
1046
1062
  var HarmSeverity;
1047
1063
  (function (HarmSeverity) {
1048
1064
  /**
1049
- * Harm severity unspecified.
1065
+ * The harm severity is unspecified.
1050
1066
  */
1051
1067
  HarmSeverity["HARM_SEVERITY_UNSPECIFIED"] = "HARM_SEVERITY_UNSPECIFIED";
1052
1068
  /**
1053
- * Negligible level of harm severity.
1069
+ * The harm severity is negligible.
1054
1070
  */
1055
1071
  HarmSeverity["HARM_SEVERITY_NEGLIGIBLE"] = "HARM_SEVERITY_NEGLIGIBLE";
1056
1072
  /**
1057
- * Low level of harm severity.
1073
+ * The harm severity is low.
1058
1074
  */
1059
1075
  HarmSeverity["HARM_SEVERITY_LOW"] = "HARM_SEVERITY_LOW";
1060
1076
  /**
1061
- * Medium level of harm severity.
1077
+ * The harm severity is medium.
1062
1078
  */
1063
1079
  HarmSeverity["HARM_SEVERITY_MEDIUM"] = "HARM_SEVERITY_MEDIUM";
1064
1080
  /**
1065
- * High level of harm severity.
1081
+ * The harm severity is high.
1066
1082
  */
1067
1083
  HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
1068
1084
  })(HarmSeverity || (HarmSeverity = {}));
1069
- /** Status of the url retrieval. */
1085
+ /** The status of the URL retrieval. */
1070
1086
  var UrlRetrievalStatus;
1071
1087
  (function (UrlRetrievalStatus) {
1072
1088
  /**
@@ -1074,11 +1090,11 @@ var UrlRetrievalStatus;
1074
1090
  */
1075
1091
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
1076
1092
  /**
1077
- * Url retrieval is successful.
1093
+ * The URL was retrieved successfully.
1078
1094
  */
1079
1095
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
1080
1096
  /**
1081
- * Url retrieval is failed due to error.
1097
+ * The URL retrieval failed.
1082
1098
  */
1083
1099
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
1084
1100
  /**
@@ -1137,6 +1153,14 @@ var TrafficType;
1137
1153
  * The request was processed using Pay-As-You-Go quota.
1138
1154
  */
1139
1155
  TrafficType["ON_DEMAND"] = "ON_DEMAND";
1156
+ /**
1157
+ * Type for Priority Pay-As-You-Go traffic.
1158
+ */
1159
+ TrafficType["ON_DEMAND_PRIORITY"] = "ON_DEMAND_PRIORITY";
1160
+ /**
1161
+ * Type for Flex traffic.
1162
+ */
1163
+ TrafficType["ON_DEMAND_FLEX"] = "ON_DEMAND_FLEX";
1140
1164
  /**
1141
1165
  * Type for Provisioned Throughput traffic.
1142
1166
  */
@@ -1282,6 +1306,102 @@ var JobState;
1282
1306
  */
1283
1307
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
1284
1308
  })(JobState || (JobState = {}));
1309
+ /** Output only. The detail state of the tuning job (while the overall `JobState` is running). This enum is not supported in Gemini API. */
1310
+ var TuningJobState;
1311
+ (function (TuningJobState) {
1312
+ /**
1313
+ * Default tuning job state.
1314
+ */
1315
+ TuningJobState["TUNING_JOB_STATE_UNSPECIFIED"] = "TUNING_JOB_STATE_UNSPECIFIED";
1316
+ /**
1317
+ * Tuning job is waiting for job quota.
1318
+ */
1319
+ TuningJobState["TUNING_JOB_STATE_WAITING_FOR_QUOTA"] = "TUNING_JOB_STATE_WAITING_FOR_QUOTA";
1320
+ /**
1321
+ * Tuning job is validating the dataset.
1322
+ */
1323
+ TuningJobState["TUNING_JOB_STATE_PROCESSING_DATASET"] = "TUNING_JOB_STATE_PROCESSING_DATASET";
1324
+ /**
1325
+ * Tuning job is waiting for hardware capacity.
1326
+ */
1327
+ TuningJobState["TUNING_JOB_STATE_WAITING_FOR_CAPACITY"] = "TUNING_JOB_STATE_WAITING_FOR_CAPACITY";
1328
+ /**
1329
+ * Tuning job is running.
1330
+ */
1331
+ TuningJobState["TUNING_JOB_STATE_TUNING"] = "TUNING_JOB_STATE_TUNING";
1332
+ /**
1333
+ * Tuning job is doing some post processing steps.
1334
+ */
1335
+ TuningJobState["TUNING_JOB_STATE_POST_PROCESSING"] = "TUNING_JOB_STATE_POST_PROCESSING";
1336
+ })(TuningJobState || (TuningJobState = {}));
1337
+ /** Aggregation metric. This enum is not supported in Gemini API. */
1338
+ var AggregationMetric;
1339
+ (function (AggregationMetric) {
1340
+ /**
1341
+ * Unspecified aggregation metric.
1342
+ */
1343
+ AggregationMetric["AGGREGATION_METRIC_UNSPECIFIED"] = "AGGREGATION_METRIC_UNSPECIFIED";
1344
+ /**
1345
+ * Average aggregation metric. Not supported for Pairwise metric.
1346
+ */
1347
+ AggregationMetric["AVERAGE"] = "AVERAGE";
1348
+ /**
1349
+ * Mode aggregation metric.
1350
+ */
1351
+ AggregationMetric["MODE"] = "MODE";
1352
+ /**
1353
+ * Standard deviation aggregation metric. Not supported for pairwise metric.
1354
+ */
1355
+ AggregationMetric["STANDARD_DEVIATION"] = "STANDARD_DEVIATION";
1356
+ /**
1357
+ * Variance aggregation metric. Not supported for pairwise metric.
1358
+ */
1359
+ AggregationMetric["VARIANCE"] = "VARIANCE";
1360
+ /**
1361
+ * Minimum aggregation metric. Not supported for pairwise metric.
1362
+ */
1363
+ AggregationMetric["MINIMUM"] = "MINIMUM";
1364
+ /**
1365
+ * Maximum aggregation metric. Not supported for pairwise metric.
1366
+ */
1367
+ AggregationMetric["MAXIMUM"] = "MAXIMUM";
1368
+ /**
1369
+ * Median aggregation metric. Not supported for pairwise metric.
1370
+ */
1371
+ AggregationMetric["MEDIAN"] = "MEDIAN";
1372
+ /**
1373
+ * 90th percentile aggregation metric. Not supported for pairwise metric.
1374
+ */
1375
+ AggregationMetric["PERCENTILE_P90"] = "PERCENTILE_P90";
1376
+ /**
1377
+ * 95th percentile aggregation metric. Not supported for pairwise metric.
1378
+ */
1379
+ AggregationMetric["PERCENTILE_P95"] = "PERCENTILE_P95";
1380
+ /**
1381
+ * 99th percentile aggregation metric. Not supported for pairwise metric.
1382
+ */
1383
+ AggregationMetric["PERCENTILE_P99"] = "PERCENTILE_P99";
1384
+ })(AggregationMetric || (AggregationMetric = {}));
1385
+ /** Output only. Pairwise metric choice. This enum is not supported in Gemini API. */
1386
+ var PairwiseChoice;
1387
+ (function (PairwiseChoice) {
1388
+ /**
1389
+ * Unspecified prediction choice.
1390
+ */
1391
+ PairwiseChoice["PAIRWISE_CHOICE_UNSPECIFIED"] = "PAIRWISE_CHOICE_UNSPECIFIED";
1392
+ /**
1393
+ * Baseline prediction wins
1394
+ */
1395
+ PairwiseChoice["BASELINE"] = "BASELINE";
1396
+ /**
1397
+ * Candidate prediction wins
1398
+ */
1399
+ PairwiseChoice["CANDIDATE"] = "CANDIDATE";
1400
+ /**
1401
+ * Winner cannot be determined
1402
+ */
1403
+ PairwiseChoice["TIE"] = "TIE";
1404
+ })(PairwiseChoice || (PairwiseChoice = {}));
1285
1405
  /** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
1286
1406
  var TuningTask;
1287
1407
  (function (TuningTask) {
@@ -1394,22 +1514,6 @@ var SafetyFilterLevel;
1394
1514
  SafetyFilterLevel["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
1395
1515
  SafetyFilterLevel["BLOCK_NONE"] = "BLOCK_NONE";
1396
1516
  })(SafetyFilterLevel || (SafetyFilterLevel = {}));
1397
- /** Enum that controls the generation of people. */
1398
- var PersonGeneration;
1399
- (function (PersonGeneration) {
1400
- /**
1401
- * Block generation of images of people.
1402
- */
1403
- PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
1404
- /**
1405
- * Generate images of adults, but not children.
1406
- */
1407
- PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
1408
- /**
1409
- * Generate images that include adults and children.
1410
- */
1411
- PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
1412
- })(PersonGeneration || (PersonGeneration = {}));
1413
1517
  /** Enum that specifies the language of the text in the prompt. */
1414
1518
  var ImagePromptLanguage;
1415
1519
  (function (ImagePromptLanguage) {
@@ -2308,6 +2412,9 @@ class GenerateVideosOperation {
2308
2412
  return operation;
2309
2413
  }
2310
2414
  }
2415
+ /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
2416
+ class EvaluateDatasetResponse {
2417
+ }
2311
2418
  /** Response for the list tuning jobs method. */
2312
2419
  class ListTuningJobsResponse {
2313
2420
  }
@@ -3427,6 +3534,33 @@ function tIsVertexEmbedContentModel(model) {
3427
3534
  * Copyright 2025 Google LLC
3428
3535
  * SPDX-License-Identifier: Apache-2.0
3429
3536
  */
3537
+ function authConfigToMldev$4(fromObject) {
3538
+ const toObject = {};
3539
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
3540
+ if (fromApiKey != null) {
3541
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
3542
+ }
3543
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
3544
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
3545
+ }
3546
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
3547
+ throw new Error('authType parameter is not supported in Gemini API.');
3548
+ }
3549
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
3550
+ undefined) {
3551
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
3552
+ }
3553
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
3554
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
3555
+ }
3556
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
3557
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
3558
+ }
3559
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
3560
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
3561
+ }
3562
+ return toObject;
3563
+ }
3430
3564
  function batchJobDestinationFromMldev(fromObject) {
3431
3565
  const toObject = {};
3432
3566
  const fromFileName = getValueByPath(fromObject, ['responsesFile']);
@@ -4276,8 +4410,9 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
4276
4410
  }
4277
4411
  function googleMapsToMldev$4(fromObject) {
4278
4412
  const toObject = {};
4279
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
4280
- throw new Error('authConfig parameter is not supported in Gemini API.');
4413
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
4414
+ if (fromAuthConfig != null) {
4415
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$4(fromAuthConfig));
4281
4416
  }
4282
4417
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
4283
4418
  if (fromEnableWidget != null) {
@@ -4291,12 +4426,12 @@ function googleSearchToMldev$4(fromObject) {
4291
4426
  if (fromSearchTypes != null) {
4292
4427
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
4293
4428
  }
4294
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4295
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
4296
- }
4297
4429
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
4298
4430
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
4299
4431
  }
4432
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4433
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4434
+ }
4300
4435
  const fromTimeRangeFilter = getValueByPath(fromObject, [
4301
4436
  'timeRangeFilter',
4302
4437
  ]);
@@ -4328,6 +4463,9 @@ function imageConfigToMldev$1(fromObject) {
4328
4463
  undefined) {
4329
4464
  throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
4330
4465
  }
4466
+ if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
4467
+ throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
4468
+ }
4331
4469
  return toObject;
4332
4470
  }
4333
4471
  function inlinedRequestToMldev(apiClient, fromObject) {
@@ -4581,6 +4719,10 @@ function toolToMldev$4(fromObject) {
4581
4719
  if (fromGoogleSearch != null) {
4582
4720
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4583
4721
  }
4722
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4723
+ if (fromGoogleMaps != null) {
4724
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4725
+ }
4584
4726
  const fromCodeExecution = getValueByPath(fromObject, [
4585
4727
  'codeExecution',
4586
4728
  ]);
@@ -4602,16 +4744,15 @@ function toolToMldev$4(fromObject) {
4602
4744
  }
4603
4745
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
4604
4746
  }
4605
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4606
- if (fromGoogleMaps != null) {
4607
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4608
- }
4609
4747
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4610
4748
  'googleSearchRetrieval',
4611
4749
  ]);
4612
4750
  if (fromGoogleSearchRetrieval != null) {
4613
4751
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4614
4752
  }
4753
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
4754
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
4755
+ }
4615
4756
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4616
4757
  if (fromUrlContext != null) {
4617
4758
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5321,6 +5462,33 @@ class Batches extends BaseModule {
5321
5462
  * Copyright 2025 Google LLC
5322
5463
  * SPDX-License-Identifier: Apache-2.0
5323
5464
  */
5465
+ function authConfigToMldev$3(fromObject) {
5466
+ const toObject = {};
5467
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
5468
+ if (fromApiKey != null) {
5469
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
5470
+ }
5471
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
5472
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
5473
+ }
5474
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
5475
+ throw new Error('authType parameter is not supported in Gemini API.');
5476
+ }
5477
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
5478
+ undefined) {
5479
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
5480
+ }
5481
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
5482
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
5483
+ }
5484
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
5485
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
5486
+ }
5487
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
5488
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
5489
+ }
5490
+ return toObject;
5491
+ }
5324
5492
  function blobToMldev$3(fromObject) {
5325
5493
  const toObject = {};
5326
5494
  const fromData = getValueByPath(fromObject, ['data']);
@@ -5621,8 +5789,9 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
5621
5789
  }
5622
5790
  function googleMapsToMldev$3(fromObject) {
5623
5791
  const toObject = {};
5624
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
5625
- throw new Error('authConfig parameter is not supported in Gemini API.');
5792
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
5793
+ if (fromAuthConfig != null) {
5794
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$3(fromAuthConfig));
5626
5795
  }
5627
5796
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
5628
5797
  if (fromEnableWidget != null) {
@@ -5636,12 +5805,12 @@ function googleSearchToMldev$3(fromObject) {
5636
5805
  if (fromSearchTypes != null) {
5637
5806
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
5638
5807
  }
5639
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5640
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
5641
- }
5642
5808
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
5643
5809
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
5644
5810
  }
5811
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5812
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
5813
+ }
5645
5814
  const fromTimeRangeFilter = getValueByPath(fromObject, [
5646
5815
  'timeRangeFilter',
5647
5816
  ]);
@@ -5839,6 +6008,10 @@ function toolToMldev$3(fromObject) {
5839
6008
  if (fromGoogleSearch != null) {
5840
6009
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5841
6010
  }
6011
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
6012
+ if (fromGoogleMaps != null) {
6013
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
6014
+ }
5842
6015
  const fromCodeExecution = getValueByPath(fromObject, [
5843
6016
  'codeExecution',
5844
6017
  ]);
@@ -5860,16 +6033,15 @@ function toolToMldev$3(fromObject) {
5860
6033
  }
5861
6034
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
5862
6035
  }
5863
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5864
- if (fromGoogleMaps != null) {
5865
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5866
- }
5867
6036
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5868
6037
  'googleSearchRetrieval',
5869
6038
  ]);
5870
6039
  if (fromGoogleSearchRetrieval != null) {
5871
6040
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5872
6041
  }
6042
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
6043
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
6044
+ }
5873
6045
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5874
6046
  if (fromUrlContext != null) {
5875
6047
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5903,6 +6075,10 @@ function toolToVertex$2(fromObject) {
5903
6075
  if (fromGoogleSearch != null) {
5904
6076
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5905
6077
  }
6078
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
6079
+ if (fromGoogleMaps != null) {
6080
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
6081
+ }
5906
6082
  const fromCodeExecution = getValueByPath(fromObject, [
5907
6083
  'codeExecution',
5908
6084
  ]);
@@ -5927,16 +6103,18 @@ function toolToVertex$2(fromObject) {
5927
6103
  }
5928
6104
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
5929
6105
  }
5930
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5931
- if (fromGoogleMaps != null) {
5932
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
5933
- }
5934
6106
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5935
6107
  'googleSearchRetrieval',
5936
6108
  ]);
5937
6109
  if (fromGoogleSearchRetrieval != null) {
5938
6110
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5939
6111
  }
6112
+ const fromParallelAiSearch = getValueByPath(fromObject, [
6113
+ 'parallelAiSearch',
6114
+ ]);
6115
+ if (fromParallelAiSearch != null) {
6116
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
6117
+ }
5940
6118
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5941
6119
  if (fromUrlContext != null) {
5942
6120
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -7231,6 +7409,40 @@ class Files extends BaseModule {
7231
7409
  * Copyright 2025 Google LLC
7232
7410
  * SPDX-License-Identifier: Apache-2.0
7233
7411
  */
7412
+ function audioTranscriptionConfigToMldev$1(fromObject) {
7413
+ const toObject = {};
7414
+ if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
7415
+ throw new Error('languageCodes parameter is not supported in Gemini API.');
7416
+ }
7417
+ return toObject;
7418
+ }
7419
+ function authConfigToMldev$2(fromObject) {
7420
+ const toObject = {};
7421
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
7422
+ if (fromApiKey != null) {
7423
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
7424
+ }
7425
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
7426
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
7427
+ }
7428
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
7429
+ throw new Error('authType parameter is not supported in Gemini API.');
7430
+ }
7431
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
7432
+ undefined) {
7433
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
7434
+ }
7435
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
7436
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
7437
+ }
7438
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
7439
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
7440
+ }
7441
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
7442
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
7443
+ }
7444
+ return toObject;
7445
+ }
7234
7446
  function blobToMldev$2(fromObject) {
7235
7447
  const toObject = {};
7236
7448
  const fromData = getValueByPath(fromObject, ['data']);
@@ -7466,8 +7678,9 @@ function generationConfigToVertex$1(fromObject) {
7466
7678
  }
7467
7679
  function googleMapsToMldev$2(fromObject) {
7468
7680
  const toObject = {};
7469
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
7470
- throw new Error('authConfig parameter is not supported in Gemini API.');
7681
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7682
+ if (fromAuthConfig != null) {
7683
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$2(fromAuthConfig));
7471
7684
  }
7472
7685
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
7473
7686
  if (fromEnableWidget != null) {
@@ -7481,12 +7694,12 @@ function googleSearchToMldev$2(fromObject) {
7481
7694
  if (fromSearchTypes != null) {
7482
7695
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
7483
7696
  }
7484
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7485
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
7486
- }
7487
7697
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
7488
7698
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
7489
7699
  }
7700
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7701
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
7702
+ }
7490
7703
  const fromTimeRangeFilter = getValueByPath(fromObject, [
7491
7704
  'timeRangeFilter',
7492
7705
  ]);
@@ -7579,13 +7792,13 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
7579
7792
  'inputAudioTranscription',
7580
7793
  ]);
7581
7794
  if (parentObject !== undefined && fromInputAudioTranscription != null) {
7582
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
7795
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromInputAudioTranscription));
7583
7796
  }
7584
7797
  const fromOutputAudioTranscription = getValueByPath(fromObject, [
7585
7798
  'outputAudioTranscription',
7586
7799
  ]);
7587
7800
  if (parentObject !== undefined && fromOutputAudioTranscription != null) {
7588
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
7801
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromOutputAudioTranscription));
7589
7802
  }
7590
7803
  const fromRealtimeInputConfig = getValueByPath(fromObject, [
7591
7804
  'realtimeInputConfig',
@@ -8000,6 +8213,10 @@ function toolToMldev$2(fromObject) {
8000
8213
  if (fromGoogleSearch != null) {
8001
8214
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
8002
8215
  }
8216
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8217
+ if (fromGoogleMaps != null) {
8218
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
8219
+ }
8003
8220
  const fromCodeExecution = getValueByPath(fromObject, [
8004
8221
  'codeExecution',
8005
8222
  ]);
@@ -8021,16 +8238,15 @@ function toolToMldev$2(fromObject) {
8021
8238
  }
8022
8239
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
8023
8240
  }
8024
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8025
- if (fromGoogleMaps != null) {
8026
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
8027
- }
8028
8241
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8029
8242
  'googleSearchRetrieval',
8030
8243
  ]);
8031
8244
  if (fromGoogleSearchRetrieval != null) {
8032
8245
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
8033
8246
  }
8247
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
8248
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
8249
+ }
8034
8250
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8035
8251
  if (fromUrlContext != null) {
8036
8252
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -8064,6 +8280,10 @@ function toolToVertex$1(fromObject) {
8064
8280
  if (fromGoogleSearch != null) {
8065
8281
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
8066
8282
  }
8283
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8284
+ if (fromGoogleMaps != null) {
8285
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
8286
+ }
8067
8287
  const fromCodeExecution = getValueByPath(fromObject, [
8068
8288
  'codeExecution',
8069
8289
  ]);
@@ -8088,16 +8308,18 @@ function toolToVertex$1(fromObject) {
8088
8308
  }
8089
8309
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
8090
8310
  }
8091
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8092
- if (fromGoogleMaps != null) {
8093
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
8094
- }
8095
8311
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8096
8312
  'googleSearchRetrieval',
8097
8313
  ]);
8098
8314
  if (fromGoogleSearchRetrieval != null) {
8099
8315
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
8100
8316
  }
8317
+ const fromParallelAiSearch = getValueByPath(fromObject, [
8318
+ 'parallelAiSearch',
8319
+ ]);
8320
+ if (fromParallelAiSearch != null) {
8321
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
8322
+ }
8101
8323
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8102
8324
  if (fromUrlContext != null) {
8103
8325
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -8213,6 +8435,33 @@ function voiceActivityFromVertex(fromObject) {
8213
8435
  * Copyright 2025 Google LLC
8214
8436
  * SPDX-License-Identifier: Apache-2.0
8215
8437
  */
8438
+ function authConfigToMldev$1(fromObject, _rootObject) {
8439
+ const toObject = {};
8440
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
8441
+ if (fromApiKey != null) {
8442
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
8443
+ }
8444
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
8445
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
8446
+ }
8447
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
8448
+ throw new Error('authType parameter is not supported in Gemini API.');
8449
+ }
8450
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
8451
+ undefined) {
8452
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
8453
+ }
8454
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
8455
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
8456
+ }
8457
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
8458
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
8459
+ }
8460
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
8461
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
8462
+ }
8463
+ return toObject;
8464
+ }
8216
8465
  function blobToMldev$1(fromObject, _rootObject) {
8217
8466
  const toObject = {};
8218
8467
  const fromData = getValueByPath(fromObject, ['data']);
@@ -10361,10 +10610,11 @@ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
10361
10610
  }
10362
10611
  return toObject;
10363
10612
  }
10364
- function googleMapsToMldev$1(fromObject, _rootObject) {
10613
+ function googleMapsToMldev$1(fromObject, rootObject) {
10365
10614
  const toObject = {};
10366
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
10367
- throw new Error('authConfig parameter is not supported in Gemini API.');
10615
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
10616
+ if (fromAuthConfig != null) {
10617
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$1(fromAuthConfig));
10368
10618
  }
10369
10619
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
10370
10620
  if (fromEnableWidget != null) {
@@ -10378,12 +10628,12 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
10378
10628
  if (fromSearchTypes != null) {
10379
10629
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
10380
10630
  }
10381
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
10382
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
10383
- }
10384
10631
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
10385
10632
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
10386
10633
  }
10634
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
10635
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
10636
+ }
10387
10637
  const fromTimeRangeFilter = getValueByPath(fromObject, [
10388
10638
  'timeRangeFilter',
10389
10639
  ]);
@@ -10415,6 +10665,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
10415
10665
  undefined) {
10416
10666
  throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
10417
10667
  }
10668
+ if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
10669
+ throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
10670
+ }
10418
10671
  return toObject;
10419
10672
  }
10420
10673
  function imageConfigToVertex(fromObject, _rootObject) {
@@ -10451,6 +10704,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
10451
10704
  if (fromOutputCompressionQuality != null) {
10452
10705
  setValueByPath(toObject, ['imageOutputOptions', 'compressionQuality'], fromOutputCompressionQuality);
10453
10706
  }
10707
+ const fromImageOutputOptions = getValueByPath(fromObject, [
10708
+ 'imageOutputOptions',
10709
+ ]);
10710
+ if (fromImageOutputOptions != null) {
10711
+ setValueByPath(toObject, ['imageOutputOptions'], fromImageOutputOptions);
10712
+ }
10454
10713
  return toObject;
10455
10714
  }
10456
10715
  function imageFromMldev(fromObject, _rootObject) {
@@ -11170,6 +11429,10 @@ function toolToMldev$1(fromObject, rootObject) {
11170
11429
  if (fromGoogleSearch != null) {
11171
11430
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
11172
11431
  }
11432
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11433
+ if (fromGoogleMaps != null) {
11434
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
11435
+ }
11173
11436
  const fromCodeExecution = getValueByPath(fromObject, [
11174
11437
  'codeExecution',
11175
11438
  ]);
@@ -11191,16 +11454,15 @@ function toolToMldev$1(fromObject, rootObject) {
11191
11454
  }
11192
11455
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
11193
11456
  }
11194
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11195
- if (fromGoogleMaps != null) {
11196
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
11197
- }
11198
11457
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11199
11458
  'googleSearchRetrieval',
11200
11459
  ]);
11201
11460
  if (fromGoogleSearchRetrieval != null) {
11202
11461
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11203
11462
  }
11463
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
11464
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
11465
+ }
11204
11466
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11205
11467
  if (fromUrlContext != null) {
11206
11468
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11234,6 +11496,10 @@ function toolToVertex(fromObject, rootObject) {
11234
11496
  if (fromGoogleSearch != null) {
11235
11497
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
11236
11498
  }
11499
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11500
+ if (fromGoogleMaps != null) {
11501
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
11502
+ }
11237
11503
  const fromCodeExecution = getValueByPath(fromObject, [
11238
11504
  'codeExecution',
11239
11505
  ]);
@@ -11258,16 +11524,18 @@ function toolToVertex(fromObject, rootObject) {
11258
11524
  }
11259
11525
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
11260
11526
  }
11261
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11262
- if (fromGoogleMaps != null) {
11263
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
11264
- }
11265
11527
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11266
11528
  'googleSearchRetrieval',
11267
11529
  ]);
11268
11530
  if (fromGoogleSearchRetrieval != null) {
11269
11531
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11270
11532
  }
11533
+ const fromParallelAiSearch = getValueByPath(fromObject, [
11534
+ 'parallelAiSearch',
11535
+ ]);
11536
+ if (fromParallelAiSearch != null) {
11537
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
11538
+ }
11271
11539
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11272
11540
  if (fromUrlContext != null) {
11273
11541
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11831,7 +12099,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
11831
12099
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
11832
12100
  const USER_AGENT_HEADER = 'User-Agent';
11833
12101
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
11834
- const SDK_VERSION = '1.43.0'; // x-release-please-version
12102
+ const SDK_VERSION = '1.45.0'; // x-release-please-version
11835
12103
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
11836
12104
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
11837
12105
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -11850,6 +12118,9 @@ const DEFAULT_RETRY_HTTP_STATUS_CODES = [
11850
12118
  /**
11851
12119
  * The ApiClient class is used to send requests to the Gemini API or Vertex AI
11852
12120
  * endpoints.
12121
+ *
12122
+ * WARNING: This is an internal API and may change without notice. Direct usage
12123
+ * is not supported and may break your application.
11853
12124
  */
11854
12125
  class ApiClient {
11855
12126
  constructor(opts) {
@@ -11897,10 +12168,7 @@ class ApiClient {
11897
12168
  else {
11898
12169
  // Gemini API
11899
12170
  if (!this.clientOptions.apiKey) {
11900
- throw new ApiError({
11901
- message: 'API key must be set when using the Gemini API.',
11902
- status: 403,
11903
- });
12171
+ console.warn('API key should be set when using the Gemini API.');
11904
12172
  }
11905
12173
  initHttpOptions.apiVersion =
11906
12174
  (_c = this.clientOptions.apiVersion) !== null && _c !== void 0 ? _c : GOOGLE_AI_API_DEFAULT_VERSION;
@@ -15163,6 +15431,40 @@ class Operations extends BaseModule {
15163
15431
  * Copyright 2025 Google LLC
15164
15432
  * SPDX-License-Identifier: Apache-2.0
15165
15433
  */
15434
+ function audioTranscriptionConfigToMldev(fromObject) {
15435
+ const toObject = {};
15436
+ if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
15437
+ throw new Error('languageCodes parameter is not supported in Gemini API.');
15438
+ }
15439
+ return toObject;
15440
+ }
15441
+ function authConfigToMldev(fromObject) {
15442
+ const toObject = {};
15443
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
15444
+ if (fromApiKey != null) {
15445
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
15446
+ }
15447
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
15448
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
15449
+ }
15450
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
15451
+ throw new Error('authType parameter is not supported in Gemini API.');
15452
+ }
15453
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
15454
+ undefined) {
15455
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
15456
+ }
15457
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
15458
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
15459
+ }
15460
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
15461
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
15462
+ }
15463
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
15464
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
15465
+ }
15466
+ return toObject;
15467
+ }
15166
15468
  function blobToMldev(fromObject) {
15167
15469
  const toObject = {};
15168
15470
  const fromData = getValueByPath(fromObject, ['data']);
@@ -15273,8 +15575,9 @@ function functionCallToMldev(fromObject) {
15273
15575
  }
15274
15576
  function googleMapsToMldev(fromObject) {
15275
15577
  const toObject = {};
15276
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
15277
- throw new Error('authConfig parameter is not supported in Gemini API.');
15578
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
15579
+ if (fromAuthConfig != null) {
15580
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev(fromAuthConfig));
15278
15581
  }
15279
15582
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
15280
15583
  if (fromEnableWidget != null) {
@@ -15288,12 +15591,12 @@ function googleSearchToMldev(fromObject) {
15288
15591
  if (fromSearchTypes != null) {
15289
15592
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
15290
15593
  }
15291
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
15292
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
15293
- }
15294
15594
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
15295
15595
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
15296
15596
  }
15597
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
15598
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
15599
+ }
15297
15600
  const fromTimeRangeFilter = getValueByPath(fromObject, [
15298
15601
  'timeRangeFilter',
15299
15602
  ]);
@@ -15386,13 +15689,13 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
15386
15689
  'inputAudioTranscription',
15387
15690
  ]);
15388
15691
  if (parentObject !== undefined && fromInputAudioTranscription != null) {
15389
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
15692
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev(fromInputAudioTranscription));
15390
15693
  }
15391
15694
  const fromOutputAudioTranscription = getValueByPath(fromObject, [
15392
15695
  'outputAudioTranscription',
15393
15696
  ]);
15394
15697
  if (parentObject !== undefined && fromOutputAudioTranscription != null) {
15395
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
15698
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev(fromOutputAudioTranscription));
15396
15699
  }
15397
15700
  const fromRealtimeInputConfig = getValueByPath(fromObject, [
15398
15701
  'realtimeInputConfig',
@@ -15515,6 +15818,10 @@ function toolToMldev(fromObject) {
15515
15818
  if (fromGoogleSearch != null) {
15516
15819
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
15517
15820
  }
15821
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
15822
+ if (fromGoogleMaps != null) {
15823
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
15824
+ }
15518
15825
  const fromCodeExecution = getValueByPath(fromObject, [
15519
15826
  'codeExecution',
15520
15827
  ]);
@@ -15536,16 +15843,15 @@ function toolToMldev(fromObject) {
15536
15843
  }
15537
15844
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
15538
15845
  }
15539
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
15540
- if (fromGoogleMaps != null) {
15541
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
15542
- }
15543
15846
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
15544
15847
  'googleSearchRetrieval',
15545
15848
  ]);
15546
15849
  if (fromGoogleSearchRetrieval != null) {
15547
15850
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
15548
15851
  }
15852
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
15853
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
15854
+ }
15549
15855
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
15550
15856
  if (fromUrlContext != null) {
15551
15857
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -16546,166 +16852,6 @@ const safeJSON = (text) => {
16546
16852
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
16547
16853
  const sleep$1 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
16548
16854
 
16549
- /**
16550
- * @license
16551
- * Copyright 2025 Google LLC
16552
- * SPDX-License-Identifier: Apache-2.0
16553
- */
16554
- const VERSION = '0.0.1';
16555
-
16556
- /**
16557
- * @license
16558
- * Copyright 2025 Google LLC
16559
- * SPDX-License-Identifier: Apache-2.0
16560
- */
16561
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
16562
- /**
16563
- * Note this does not detect 'browser'; for that, use getBrowserInfo().
16564
- */
16565
- function getDetectedPlatform() {
16566
- if (typeof Deno !== 'undefined' && Deno.build != null) {
16567
- return 'deno';
16568
- }
16569
- if (typeof EdgeRuntime !== 'undefined') {
16570
- return 'edge';
16571
- }
16572
- if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {
16573
- return 'node';
16574
- }
16575
- return 'unknown';
16576
- }
16577
- const getPlatformProperties = () => {
16578
- var _a, _b, _c, _d, _e;
16579
- const detectedPlatform = getDetectedPlatform();
16580
- if (detectedPlatform === 'deno') {
16581
- return {
16582
- 'X-Stainless-Lang': 'js',
16583
- 'X-Stainless-Package-Version': VERSION,
16584
- 'X-Stainless-OS': normalizePlatform(Deno.build.os),
16585
- 'X-Stainless-Arch': normalizeArch(Deno.build.arch),
16586
- 'X-Stainless-Runtime': 'deno',
16587
- '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',
16588
- };
16589
- }
16590
- if (typeof EdgeRuntime !== 'undefined') {
16591
- return {
16592
- 'X-Stainless-Lang': 'js',
16593
- 'X-Stainless-Package-Version': VERSION,
16594
- 'X-Stainless-OS': 'Unknown',
16595
- 'X-Stainless-Arch': `other:${EdgeRuntime}`,
16596
- 'X-Stainless-Runtime': 'edge',
16597
- 'X-Stainless-Runtime-Version': globalThis.process.version,
16598
- };
16599
- }
16600
- // Check if Node.js
16601
- if (detectedPlatform === 'node') {
16602
- return {
16603
- 'X-Stainless-Lang': 'js',
16604
- 'X-Stainless-Package-Version': VERSION,
16605
- 'X-Stainless-OS': normalizePlatform((_c = globalThis.process.platform) !== null && _c !== void 0 ? _c : 'unknown'),
16606
- 'X-Stainless-Arch': normalizeArch((_d = globalThis.process.arch) !== null && _d !== void 0 ? _d : 'unknown'),
16607
- 'X-Stainless-Runtime': 'node',
16608
- 'X-Stainless-Runtime-Version': (_e = globalThis.process.version) !== null && _e !== void 0 ? _e : 'unknown',
16609
- };
16610
- }
16611
- const browserInfo = getBrowserInfo();
16612
- if (browserInfo) {
16613
- return {
16614
- 'X-Stainless-Lang': 'js',
16615
- 'X-Stainless-Package-Version': VERSION,
16616
- 'X-Stainless-OS': 'Unknown',
16617
- 'X-Stainless-Arch': 'unknown',
16618
- 'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
16619
- 'X-Stainless-Runtime-Version': browserInfo.version,
16620
- };
16621
- }
16622
- // TODO add support for Cloudflare workers, etc.
16623
- return {
16624
- 'X-Stainless-Lang': 'js',
16625
- 'X-Stainless-Package-Version': VERSION,
16626
- 'X-Stainless-OS': 'Unknown',
16627
- 'X-Stainless-Arch': 'unknown',
16628
- 'X-Stainless-Runtime': 'unknown',
16629
- 'X-Stainless-Runtime-Version': 'unknown',
16630
- };
16631
- };
16632
- // Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
16633
- function getBrowserInfo() {
16634
- if (typeof navigator === 'undefined' || !navigator) {
16635
- return null;
16636
- }
16637
- // NOTE: The order matters here!
16638
- const browserPatterns = [
16639
- { key: 'edge', pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
16640
- { key: 'ie', pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
16641
- { key: 'ie', pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
16642
- { key: 'chrome', pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
16643
- { key: 'firefox', pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
16644
- { key: 'safari', pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
16645
- ];
16646
- // Find the FIRST matching browser
16647
- for (const { key, pattern } of browserPatterns) {
16648
- const match = pattern.exec(navigator.userAgent);
16649
- if (match) {
16650
- const major = match[1] || 0;
16651
- const minor = match[2] || 0;
16652
- const patch = match[3] || 0;
16653
- return { browser: key, version: `${major}.${minor}.${patch}` };
16654
- }
16655
- }
16656
- return null;
16657
- }
16658
- const normalizeArch = (arch) => {
16659
- // Node docs:
16660
- // - https://nodejs.org/api/process.html#processarch
16661
- // Deno docs:
16662
- // - https://doc.deno.land/deno/stable/~/Deno.build
16663
- if (arch === 'x32')
16664
- return 'x32';
16665
- if (arch === 'x86_64' || arch === 'x64')
16666
- return 'x64';
16667
- if (arch === 'arm')
16668
- return 'arm';
16669
- if (arch === 'aarch64' || arch === 'arm64')
16670
- return 'arm64';
16671
- if (arch)
16672
- return `other:${arch}`;
16673
- return 'unknown';
16674
- };
16675
- const normalizePlatform = (platform) => {
16676
- // Node platforms:
16677
- // - https://nodejs.org/api/process.html#processplatform
16678
- // Deno platforms:
16679
- // - https://doc.deno.land/deno/stable/~/Deno.build
16680
- // - https://github.com/denoland/deno/issues/14799
16681
- platform = platform.toLowerCase();
16682
- // NOTE: this iOS check is untested and may not work
16683
- // Node does not work natively on IOS, there is a fork at
16684
- // https://github.com/nodejs-mobile/nodejs-mobile
16685
- // however it is unknown at the time of writing how to detect if it is running
16686
- if (platform.includes('ios'))
16687
- return 'iOS';
16688
- if (platform === 'android')
16689
- return 'Android';
16690
- if (platform === 'darwin')
16691
- return 'MacOS';
16692
- if (platform === 'win32')
16693
- return 'Windows';
16694
- if (platform === 'freebsd')
16695
- return 'FreeBSD';
16696
- if (platform === 'openbsd')
16697
- return 'OpenBSD';
16698
- if (platform === 'linux')
16699
- return 'Linux';
16700
- if (platform)
16701
- return `Other:${platform}`;
16702
- return 'Unknown';
16703
- };
16704
- let _platformHeaders;
16705
- const getPlatformHeaders = () => {
16706
- return (_platformHeaders !== null && _platformHeaders !== void 0 ? _platformHeaders : (_platformHeaders = getPlatformProperties()));
16707
- };
16708
-
16709
16855
  /**
16710
16856
  * @license
16711
16857
  * Copyright 2025 Google LLC
@@ -16811,6 +16957,37 @@ const FallbackEncoder = ({ headers, body }) => {
16811
16957
  };
16812
16958
  };
16813
16959
 
16960
+ /**
16961
+ * @license
16962
+ * Copyright 2025 Google LLC
16963
+ * SPDX-License-Identifier: Apache-2.0
16964
+ */
16965
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
16966
+ /**
16967
+ * Basic re-implementation of `qs.stringify` for primitive types.
16968
+ */
16969
+ function stringifyQuery(query) {
16970
+ return Object.entries(query)
16971
+ .filter(([_, value]) => typeof value !== 'undefined')
16972
+ .map(([key, value]) => {
16973
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
16974
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
16975
+ }
16976
+ if (value === null) {
16977
+ return `${encodeURIComponent(key)}=`;
16978
+ }
16979
+ 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.`);
16980
+ })
16981
+ .join('&');
16982
+ }
16983
+
16984
+ /**
16985
+ * @license
16986
+ * Copyright 2025 Google LLC
16987
+ * SPDX-License-Identifier: Apache-2.0
16988
+ */
16989
+ const VERSION = '0.0.1';
16990
+
16814
16991
  /**
16815
16992
  * @license
16816
16993
  * Copyright 2025 Google LLC
@@ -17149,8 +17326,10 @@ class LineDecoder {
17149
17326
  constructor() {
17150
17327
  this.buffer = new Uint8Array();
17151
17328
  this.carriageReturnIndex = null;
17329
+ this.searchIndex = 0;
17152
17330
  }
17153
17331
  decode(chunk) {
17332
+ var _a;
17154
17333
  if (chunk == null) {
17155
17334
  return [];
17156
17335
  }
@@ -17160,7 +17339,7 @@ class LineDecoder {
17160
17339
  this.buffer = concatBytes([this.buffer, binaryChunk]);
17161
17340
  const lines = [];
17162
17341
  let patternIndex;
17163
- while ((patternIndex = findNewlineIndex(this.buffer, this.carriageReturnIndex)) != null) {
17342
+ while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
17164
17343
  if (patternIndex.carriage && this.carriageReturnIndex == null) {
17165
17344
  // skip until we either get a corresponding `\n`, a new `\r` or nothing
17166
17345
  this.carriageReturnIndex = patternIndex.index;
@@ -17172,6 +17351,7 @@ class LineDecoder {
17172
17351
  lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
17173
17352
  this.buffer = this.buffer.subarray(this.carriageReturnIndex);
17174
17353
  this.carriageReturnIndex = null;
17354
+ this.searchIndex = 0;
17175
17355
  continue;
17176
17356
  }
17177
17357
  const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
@@ -17179,7 +17359,9 @@ class LineDecoder {
17179
17359
  lines.push(line);
17180
17360
  this.buffer = this.buffer.subarray(patternIndex.index);
17181
17361
  this.carriageReturnIndex = null;
17362
+ this.searchIndex = 0;
17182
17363
  }
17364
+ this.searchIndex = Math.max(0, this.buffer.length - 1);
17183
17365
  return lines;
17184
17366
  }
17185
17367
  flush() {
@@ -17204,41 +17386,23 @@ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
17204
17386
  function findNewlineIndex(buffer, startIndex) {
17205
17387
  const newline = 0x0a; // \n
17206
17388
  const carriage = 0x0d; // \r
17207
- for (let i = startIndex !== null && startIndex !== void 0 ? startIndex : 0; i < buffer.length; i++) {
17208
- if (buffer[i] === newline) {
17209
- return { preceding: i, index: i + 1, carriage: false };
17210
- }
17211
- if (buffer[i] === carriage) {
17212
- return { preceding: i, index: i + 1, carriage: true };
17213
- }
17389
+ const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
17390
+ const nextNewline = buffer.indexOf(newline, start);
17391
+ const nextCarriage = buffer.indexOf(carriage, start);
17392
+ if (nextNewline === -1 && nextCarriage === -1) {
17393
+ return null;
17214
17394
  }
17215
- return null;
17216
- }
17217
- function findDoubleNewlineIndex(buffer) {
17218
- // This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
17219
- // and returns the index right after the first occurrence of any pattern,
17220
- // or -1 if none of the patterns are found.
17221
- const newline = 0x0a; // \n
17222
- const carriage = 0x0d; // \r
17223
- for (let i = 0; i < buffer.length - 1; i++) {
17224
- if (buffer[i] === newline && buffer[i + 1] === newline) {
17225
- // \n\n
17226
- return i + 2;
17227
- }
17228
- if (buffer[i] === carriage && buffer[i + 1] === carriage) {
17229
- // \r\r
17230
- return i + 2;
17231
- }
17232
- if (buffer[i] === carriage &&
17233
- buffer[i + 1] === newline &&
17234
- i + 3 < buffer.length &&
17235
- buffer[i + 2] === carriage &&
17236
- buffer[i + 3] === newline) {
17237
- // \r\n\r\n
17238
- return i + 4;
17239
- }
17395
+ let i;
17396
+ if (nextNewline !== -1 && nextCarriage !== -1) {
17397
+ i = Math.min(nextNewline, nextCarriage);
17398
+ }
17399
+ else {
17400
+ i = nextNewline !== -1 ? nextNewline : nextCarriage;
17401
+ }
17402
+ if (buffer[i] === newline) {
17403
+ return { preceding: i, index: i + 1, carriage: false };
17240
17404
  }
17241
- return -1;
17405
+ return { preceding: i, index: i + 1, carriage: true };
17242
17406
  }
17243
17407
 
17244
17408
  /**
@@ -17549,7 +17713,7 @@ function _iterSSEMessages(response, controller) {
17549
17713
  const lineDecoder = new LineDecoder();
17550
17714
  const iter = ReadableStreamToAsyncIterable(response.body);
17551
17715
  try {
17552
- for (var _d = true, _e = __asyncValues(iterSSEChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
17716
+ for (var _d = true, _e = __asyncValues(iterBinaryChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
17553
17717
  _c = _f.value;
17554
17718
  _d = false;
17555
17719
  const sseChunk = _c;
@@ -17575,13 +17739,12 @@ function _iterSSEMessages(response, controller) {
17575
17739
  });
17576
17740
  }
17577
17741
  /**
17578
- * Given an async iterable iterator, iterates over it and yields full
17579
- * SSE chunks, i.e. yields when a double new-line is encountered.
17742
+ * Given an async iterable iterator, normalizes each chunk to a
17743
+ * Uint8Array and yields it.
17580
17744
  */
17581
- function iterSSEChunks(iterator) {
17582
- return __asyncGenerator(this, arguments, function* iterSSEChunks_1() {
17745
+ function iterBinaryChunks(iterator) {
17746
+ return __asyncGenerator(this, arguments, function* iterBinaryChunks_1() {
17583
17747
  var _a, e_5, _b, _c;
17584
- let data = new Uint8Array();
17585
17748
  try {
17586
17749
  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) {
17587
17750
  _c = iterator_3_1.value;
@@ -17593,15 +17756,7 @@ function iterSSEChunks(iterator) {
17593
17756
  const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
17594
17757
  : typeof chunk === 'string' ? encodeUTF8(chunk)
17595
17758
  : chunk;
17596
- let newData = new Uint8Array(data.length + binaryChunk.length);
17597
- newData.set(data);
17598
- newData.set(binaryChunk, data.length);
17599
- data = newData;
17600
- let patternIndex;
17601
- while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
17602
- yield yield __await(data.slice(0, patternIndex));
17603
- data = data.slice(patternIndex);
17604
- }
17759
+ yield yield __await(binaryChunk);
17605
17760
  }
17606
17761
  }
17607
17762
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
@@ -17611,9 +17766,6 @@ function iterSSEChunks(iterator) {
17611
17766
  }
17612
17767
  finally { if (e_5) throw e_5.error; }
17613
17768
  }
17614
- if (data.length > 0) {
17615
- yield yield __await(data);
17616
- }
17617
17769
  });
17618
17770
  }
17619
17771
  class SSEDecoder {
@@ -17972,18 +18124,7 @@ class BaseGeminiNextGenAPIClient {
17972
18124
  * Basic re-implementation of `qs.stringify` for primitive types.
17973
18125
  */
17974
18126
  stringifyQuery(query) {
17975
- return Object.entries(query)
17976
- .filter(([_, value]) => typeof value !== 'undefined')
17977
- .map(([key, value]) => {
17978
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
17979
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
17980
- }
17981
- if (value === null) {
17982
- return `${encodeURIComponent(key)}=`;
17983
- }
17984
- 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.`);
17985
- })
17986
- .join('&');
18127
+ return stringifyQuery(query);
17987
18128
  }
17988
18129
  getUserAgent() {
17989
18130
  return `${this.constructor.name}/JS ${VERSION}`;
@@ -18000,8 +18141,9 @@ class BaseGeminiNextGenAPIClient {
18000
18141
  new URL(path)
18001
18142
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
18002
18143
  const defaultQuery = this.defaultQuery();
18003
- if (!isEmptyObj(defaultQuery)) {
18004
- query = Object.assign(Object.assign({}, defaultQuery), query);
18144
+ const pathQuery = Object.fromEntries(url.searchParams);
18145
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
18146
+ query = Object.assign(Object.assign(Object.assign({}, pathQuery), defaultQuery), query);
18005
18147
  }
18006
18148
  if (typeof query === 'object' && query && !Array.isArray(query)) {
18007
18149
  url.search = this.stringifyQuery(query);
@@ -18222,9 +18364,9 @@ class BaseGeminiNextGenAPIClient {
18222
18364
  timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
18223
18365
  }
18224
18366
  }
18225
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
18226
- // just do what it says, but otherwise calculate a default
18227
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
18367
+ // If the API asks us to wait a certain amount of time, just do what it
18368
+ // says, but otherwise calculate a default
18369
+ if (timeoutMillis === undefined) {
18228
18370
  const maxRetries = (_b = options.maxRetries) !== null && _b !== void 0 ? _b : this.maxRetries;
18229
18371
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
18230
18372
  }
@@ -18265,7 +18407,7 @@ class BaseGeminiNextGenAPIClient {
18265
18407
  const authHeaders = await this.authHeaders(options);
18266
18408
  let headers = buildHeaders([
18267
18409
  idempotencyHeaders,
18268
- Object.assign(Object.assign({ Accept: 'application/json', 'User-Agent': this.getUserAgent(), 'X-Stainless-Retry-Count': String(retryCount) }, (options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {})), getPlatformHeaders()),
18410
+ { Accept: 'application/json', 'User-Agent': this.getUserAgent() },
18269
18411
  this._options.defaultHeaders,
18270
18412
  bodyHeaders,
18271
18413
  options.headers,
@@ -19109,10 +19251,28 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19109
19251
  if (fromCustomBaseModel != null) {
19110
19252
  setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
19111
19253
  }
19254
+ const fromEvaluateDatasetRuns = getValueByPath(fromObject, [
19255
+ 'evaluateDatasetRuns',
19256
+ ]);
19257
+ if (fromEvaluateDatasetRuns != null) {
19258
+ let transformedList = fromEvaluateDatasetRuns;
19259
+ if (Array.isArray(transformedList)) {
19260
+ transformedList = transformedList.map((item) => {
19261
+ return item;
19262
+ });
19263
+ }
19264
+ setValueByPath(toObject, ['evaluateDatasetRuns'], transformedList);
19265
+ }
19112
19266
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
19113
19267
  if (fromExperiment != null) {
19114
19268
  setValueByPath(toObject, ['experiment'], fromExperiment);
19115
19269
  }
19270
+ const fromFullFineTuningSpec = getValueByPath(fromObject, [
19271
+ 'fullFineTuningSpec',
19272
+ ]);
19273
+ if (fromFullFineTuningSpec != null) {
19274
+ setValueByPath(toObject, ['fullFineTuningSpec'], fromFullFineTuningSpec);
19275
+ }
19116
19276
  const fromLabels = getValueByPath(fromObject, ['labels']);
19117
19277
  if (fromLabels != null) {
19118
19278
  setValueByPath(toObject, ['labels'], fromLabels);
@@ -19137,6 +19297,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19137
19297
  if (fromTunedModelDisplayName != null) {
19138
19298
  setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
19139
19299
  }
19300
+ const fromTuningJobState = getValueByPath(fromObject, [
19301
+ 'tuningJobState',
19302
+ ]);
19303
+ if (fromTuningJobState != null) {
19304
+ setValueByPath(toObject, ['tuningJobState'], fromTuningJobState);
19305
+ }
19140
19306
  const fromVeoTuningSpec = getValueByPath(fromObject, [
19141
19307
  'veoTuningSpec',
19142
19308
  ]);
@@ -19858,5 +20024,5 @@ class GoogleGenAI {
19858
20024
  }
19859
20025
  }
19860
20026
 
19861
- 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 };
20027
+ 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 };
19862
20028
  //# sourceMappingURL=index.mjs.map