@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/index.mjs CHANGED
@@ -608,7 +608,7 @@ var FunctionResponseScheduling;
608
608
  */
609
609
  FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
610
610
  })(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
611
- /** The type of the data. */
611
+ /** Data type of the schema field. */
612
612
  var Type;
613
613
  (function (Type) {
614
614
  /**
@@ -676,22 +676,6 @@ var PhishBlockThreshold;
676
676
  */
677
677
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
678
678
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
679
- /** The API spec that the external API implements. This enum is not supported in Gemini API. */
680
- var ApiSpec;
681
- (function (ApiSpec) {
682
- /**
683
- * Unspecified API spec. This value should not be used.
684
- */
685
- ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
686
- /**
687
- * Simple search API spec.
688
- */
689
- ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
690
- /**
691
- * Elastic search API spec.
692
- */
693
- ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
694
- })(ApiSpec || (ApiSpec = {}));
695
679
  /** Type of auth scheme. This enum is not supported in Gemini API. */
696
680
  var AuthType;
697
681
  (function (AuthType) {
@@ -746,6 +730,22 @@ var HttpElementLocation;
746
730
  */
747
731
  HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
748
732
  })(HttpElementLocation || (HttpElementLocation = {}));
733
+ /** The API spec that the external API implements. This enum is not supported in Gemini API. */
734
+ var ApiSpec;
735
+ (function (ApiSpec) {
736
+ /**
737
+ * Unspecified API spec. This value should not be used.
738
+ */
739
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
740
+ /**
741
+ * Simple search API spec.
742
+ */
743
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
744
+ /**
745
+ * Elastic search API spec.
746
+ */
747
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
748
+ })(ApiSpec || (ApiSpec = {}));
749
749
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
750
750
  var Behavior;
751
751
  (function (Behavior) {
@@ -822,27 +822,43 @@ var ThinkingLevel;
822
822
  */
823
823
  ThinkingLevel["MINIMAL"] = "MINIMAL";
824
824
  })(ThinkingLevel || (ThinkingLevel = {}));
825
- /** Harm category. */
825
+ /** Enum that controls the generation of people. */
826
+ var PersonGeneration;
827
+ (function (PersonGeneration) {
828
+ /**
829
+ * Block generation of images of people.
830
+ */
831
+ PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
832
+ /**
833
+ * Generate images of adults, but not children.
834
+ */
835
+ PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
836
+ /**
837
+ * Generate images that include adults and children.
838
+ */
839
+ PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
840
+ })(PersonGeneration || (PersonGeneration = {}));
841
+ /** The harm category to be blocked. */
826
842
  var HarmCategory;
827
843
  (function (HarmCategory) {
828
844
  /**
829
- * The harm category is unspecified.
845
+ * Default value. This value is unused.
830
846
  */
831
847
  HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
832
848
  /**
833
- * The harm category is harassment.
849
+ * Abusive, threatening, or content intended to bully, torment, or ridicule.
834
850
  */
835
851
  HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
836
852
  /**
837
- * The harm category is hate speech.
853
+ * Content that promotes violence or incites hatred against individuals or groups based on certain attributes.
838
854
  */
839
855
  HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
840
856
  /**
841
- * The harm category is sexually explicit content.
857
+ * Content that contains sexually explicit material.
842
858
  */
843
859
  HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
844
860
  /**
845
- * The harm category is dangerous content.
861
+ * Content that promotes, facilitates, or enables dangerous activities.
846
862
  */
847
863
  HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
848
864
  /**
@@ -850,27 +866,27 @@ var HarmCategory;
850
866
  */
851
867
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
852
868
  /**
853
- * The harm category is image hate. This enum value is not supported in Gemini API.
869
+ * Images that contain hate speech. This enum value is not supported in Gemini API.
854
870
  */
855
871
  HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
856
872
  /**
857
- * The harm category is image dangerous content. This enum value is not supported in Gemini API.
873
+ * Images that contain dangerous content. This enum value is not supported in Gemini API.
858
874
  */
859
875
  HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
860
876
  /**
861
- * The harm category is image harassment. This enum value is not supported in Gemini API.
877
+ * Images that contain harassment. This enum value is not supported in Gemini API.
862
878
  */
863
879
  HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
864
880
  /**
865
- * The harm category is image sexually explicit content. This enum value is not supported in Gemini API.
881
+ * Images that contain sexually explicit content. This enum value is not supported in Gemini API.
866
882
  */
867
883
  HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
868
884
  /**
869
- * The harm category is for jailbreak prompts. This enum value is not supported in Gemini API.
885
+ * Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.
870
886
  */
871
887
  HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
872
888
  })(HarmCategory || (HarmCategory = {}));
873
- /** 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. */
889
+ /** 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. */
874
890
  var HarmBlockMethod;
875
891
  (function (HarmBlockMethod) {
876
892
  /**
@@ -886,31 +902,31 @@ var HarmBlockMethod;
886
902
  */
887
903
  HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
888
904
  })(HarmBlockMethod || (HarmBlockMethod = {}));
889
- /** The harm block threshold. */
905
+ /** The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked. */
890
906
  var HarmBlockThreshold;
891
907
  (function (HarmBlockThreshold) {
892
908
  /**
893
- * Unspecified harm block threshold.
909
+ * The harm block threshold is unspecified.
894
910
  */
895
911
  HarmBlockThreshold["HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
896
912
  /**
897
- * Block low threshold and above (i.e. block more).
913
+ * Block content with a low harm probability or higher.
898
914
  */
899
915
  HarmBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
900
916
  /**
901
- * Block medium threshold and above.
917
+ * Block content with a medium harm probability or higher.
902
918
  */
903
919
  HarmBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
904
920
  /**
905
- * Block only high threshold (i.e. block less).
921
+ * Block content with a high harm probability.
906
922
  */
907
923
  HarmBlockThreshold["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
908
924
  /**
909
- * Block none.
925
+ * Do not block any content, regardless of its harm probability.
910
926
  */
911
927
  HarmBlockThreshold["BLOCK_NONE"] = "BLOCK_NONE";
912
928
  /**
913
- * Turn off the safety filter.
929
+ * Turn off the safety filter entirely.
914
930
  */
915
931
  HarmBlockThreshold["OFF"] = "OFF";
916
932
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
@@ -988,55 +1004,55 @@ var FinishReason;
988
1004
  */
989
1005
  FinishReason["IMAGE_OTHER"] = "IMAGE_OTHER";
990
1006
  })(FinishReason || (FinishReason = {}));
991
- /** Output only. Harm probability levels in the content. */
1007
+ /** Output only. The probability of harm for this category. */
992
1008
  var HarmProbability;
993
1009
  (function (HarmProbability) {
994
1010
  /**
995
- * Harm probability unspecified.
1011
+ * The harm probability is unspecified.
996
1012
  */
997
1013
  HarmProbability["HARM_PROBABILITY_UNSPECIFIED"] = "HARM_PROBABILITY_UNSPECIFIED";
998
1014
  /**
999
- * Negligible level of harm.
1015
+ * The harm probability is negligible.
1000
1016
  */
1001
1017
  HarmProbability["NEGLIGIBLE"] = "NEGLIGIBLE";
1002
1018
  /**
1003
- * Low level of harm.
1019
+ * The harm probability is low.
1004
1020
  */
1005
1021
  HarmProbability["LOW"] = "LOW";
1006
1022
  /**
1007
- * Medium level of harm.
1023
+ * The harm probability is medium.
1008
1024
  */
1009
1025
  HarmProbability["MEDIUM"] = "MEDIUM";
1010
1026
  /**
1011
- * High level of harm.
1027
+ * The harm probability is high.
1012
1028
  */
1013
1029
  HarmProbability["HIGH"] = "HIGH";
1014
1030
  })(HarmProbability || (HarmProbability = {}));
1015
- /** Output only. Harm severity levels in the content. This enum is not supported in Gemini API. */
1031
+ /** Output only. The severity of harm for this category. This enum is not supported in Gemini API. */
1016
1032
  var HarmSeverity;
1017
1033
  (function (HarmSeverity) {
1018
1034
  /**
1019
- * Harm severity unspecified.
1035
+ * The harm severity is unspecified.
1020
1036
  */
1021
1037
  HarmSeverity["HARM_SEVERITY_UNSPECIFIED"] = "HARM_SEVERITY_UNSPECIFIED";
1022
1038
  /**
1023
- * Negligible level of harm severity.
1039
+ * The harm severity is negligible.
1024
1040
  */
1025
1041
  HarmSeverity["HARM_SEVERITY_NEGLIGIBLE"] = "HARM_SEVERITY_NEGLIGIBLE";
1026
1042
  /**
1027
- * Low level of harm severity.
1043
+ * The harm severity is low.
1028
1044
  */
1029
1045
  HarmSeverity["HARM_SEVERITY_LOW"] = "HARM_SEVERITY_LOW";
1030
1046
  /**
1031
- * Medium level of harm severity.
1047
+ * The harm severity is medium.
1032
1048
  */
1033
1049
  HarmSeverity["HARM_SEVERITY_MEDIUM"] = "HARM_SEVERITY_MEDIUM";
1034
1050
  /**
1035
- * High level of harm severity.
1051
+ * The harm severity is high.
1036
1052
  */
1037
1053
  HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
1038
1054
  })(HarmSeverity || (HarmSeverity = {}));
1039
- /** Status of the url retrieval. */
1055
+ /** The status of the URL retrieval. */
1040
1056
  var UrlRetrievalStatus;
1041
1057
  (function (UrlRetrievalStatus) {
1042
1058
  /**
@@ -1044,11 +1060,11 @@ var UrlRetrievalStatus;
1044
1060
  */
1045
1061
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
1046
1062
  /**
1047
- * Url retrieval is successful.
1063
+ * The URL was retrieved successfully.
1048
1064
  */
1049
1065
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
1050
1066
  /**
1051
- * Url retrieval is failed due to error.
1067
+ * The URL retrieval failed.
1052
1068
  */
1053
1069
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
1054
1070
  /**
@@ -1107,6 +1123,14 @@ var TrafficType;
1107
1123
  * The request was processed using Pay-As-You-Go quota.
1108
1124
  */
1109
1125
  TrafficType["ON_DEMAND"] = "ON_DEMAND";
1126
+ /**
1127
+ * Type for Priority Pay-As-You-Go traffic.
1128
+ */
1129
+ TrafficType["ON_DEMAND_PRIORITY"] = "ON_DEMAND_PRIORITY";
1130
+ /**
1131
+ * Type for Flex traffic.
1132
+ */
1133
+ TrafficType["ON_DEMAND_FLEX"] = "ON_DEMAND_FLEX";
1110
1134
  /**
1111
1135
  * Type for Provisioned Throughput traffic.
1112
1136
  */
@@ -1252,6 +1276,102 @@ var JobState;
1252
1276
  */
1253
1277
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
1254
1278
  })(JobState || (JobState = {}));
1279
+ /** Output only. The detail state of the tuning job (while the overall `JobState` is running). This enum is not supported in Gemini API. */
1280
+ var TuningJobState;
1281
+ (function (TuningJobState) {
1282
+ /**
1283
+ * Default tuning job state.
1284
+ */
1285
+ TuningJobState["TUNING_JOB_STATE_UNSPECIFIED"] = "TUNING_JOB_STATE_UNSPECIFIED";
1286
+ /**
1287
+ * Tuning job is waiting for job quota.
1288
+ */
1289
+ TuningJobState["TUNING_JOB_STATE_WAITING_FOR_QUOTA"] = "TUNING_JOB_STATE_WAITING_FOR_QUOTA";
1290
+ /**
1291
+ * Tuning job is validating the dataset.
1292
+ */
1293
+ TuningJobState["TUNING_JOB_STATE_PROCESSING_DATASET"] = "TUNING_JOB_STATE_PROCESSING_DATASET";
1294
+ /**
1295
+ * Tuning job is waiting for hardware capacity.
1296
+ */
1297
+ TuningJobState["TUNING_JOB_STATE_WAITING_FOR_CAPACITY"] = "TUNING_JOB_STATE_WAITING_FOR_CAPACITY";
1298
+ /**
1299
+ * Tuning job is running.
1300
+ */
1301
+ TuningJobState["TUNING_JOB_STATE_TUNING"] = "TUNING_JOB_STATE_TUNING";
1302
+ /**
1303
+ * Tuning job is doing some post processing steps.
1304
+ */
1305
+ TuningJobState["TUNING_JOB_STATE_POST_PROCESSING"] = "TUNING_JOB_STATE_POST_PROCESSING";
1306
+ })(TuningJobState || (TuningJobState = {}));
1307
+ /** Aggregation metric. This enum is not supported in Gemini API. */
1308
+ var AggregationMetric;
1309
+ (function (AggregationMetric) {
1310
+ /**
1311
+ * Unspecified aggregation metric.
1312
+ */
1313
+ AggregationMetric["AGGREGATION_METRIC_UNSPECIFIED"] = "AGGREGATION_METRIC_UNSPECIFIED";
1314
+ /**
1315
+ * Average aggregation metric. Not supported for Pairwise metric.
1316
+ */
1317
+ AggregationMetric["AVERAGE"] = "AVERAGE";
1318
+ /**
1319
+ * Mode aggregation metric.
1320
+ */
1321
+ AggregationMetric["MODE"] = "MODE";
1322
+ /**
1323
+ * Standard deviation aggregation metric. Not supported for pairwise metric.
1324
+ */
1325
+ AggregationMetric["STANDARD_DEVIATION"] = "STANDARD_DEVIATION";
1326
+ /**
1327
+ * Variance aggregation metric. Not supported for pairwise metric.
1328
+ */
1329
+ AggregationMetric["VARIANCE"] = "VARIANCE";
1330
+ /**
1331
+ * Minimum aggregation metric. Not supported for pairwise metric.
1332
+ */
1333
+ AggregationMetric["MINIMUM"] = "MINIMUM";
1334
+ /**
1335
+ * Maximum aggregation metric. Not supported for pairwise metric.
1336
+ */
1337
+ AggregationMetric["MAXIMUM"] = "MAXIMUM";
1338
+ /**
1339
+ * Median aggregation metric. Not supported for pairwise metric.
1340
+ */
1341
+ AggregationMetric["MEDIAN"] = "MEDIAN";
1342
+ /**
1343
+ * 90th percentile aggregation metric. Not supported for pairwise metric.
1344
+ */
1345
+ AggregationMetric["PERCENTILE_P90"] = "PERCENTILE_P90";
1346
+ /**
1347
+ * 95th percentile aggregation metric. Not supported for pairwise metric.
1348
+ */
1349
+ AggregationMetric["PERCENTILE_P95"] = "PERCENTILE_P95";
1350
+ /**
1351
+ * 99th percentile aggregation metric. Not supported for pairwise metric.
1352
+ */
1353
+ AggregationMetric["PERCENTILE_P99"] = "PERCENTILE_P99";
1354
+ })(AggregationMetric || (AggregationMetric = {}));
1355
+ /** Output only. Pairwise metric choice. This enum is not supported in Gemini API. */
1356
+ var PairwiseChoice;
1357
+ (function (PairwiseChoice) {
1358
+ /**
1359
+ * Unspecified prediction choice.
1360
+ */
1361
+ PairwiseChoice["PAIRWISE_CHOICE_UNSPECIFIED"] = "PAIRWISE_CHOICE_UNSPECIFIED";
1362
+ /**
1363
+ * Baseline prediction wins
1364
+ */
1365
+ PairwiseChoice["BASELINE"] = "BASELINE";
1366
+ /**
1367
+ * Candidate prediction wins
1368
+ */
1369
+ PairwiseChoice["CANDIDATE"] = "CANDIDATE";
1370
+ /**
1371
+ * Winner cannot be determined
1372
+ */
1373
+ PairwiseChoice["TIE"] = "TIE";
1374
+ })(PairwiseChoice || (PairwiseChoice = {}));
1255
1375
  /** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
1256
1376
  var TuningTask;
1257
1377
  (function (TuningTask) {
@@ -1364,22 +1484,6 @@ var SafetyFilterLevel;
1364
1484
  SafetyFilterLevel["BLOCK_ONLY_HIGH"] = "BLOCK_ONLY_HIGH";
1365
1485
  SafetyFilterLevel["BLOCK_NONE"] = "BLOCK_NONE";
1366
1486
  })(SafetyFilterLevel || (SafetyFilterLevel = {}));
1367
- /** Enum that controls the generation of people. */
1368
- var PersonGeneration;
1369
- (function (PersonGeneration) {
1370
- /**
1371
- * Block generation of images of people.
1372
- */
1373
- PersonGeneration["DONT_ALLOW"] = "DONT_ALLOW";
1374
- /**
1375
- * Generate images of adults, but not children.
1376
- */
1377
- PersonGeneration["ALLOW_ADULT"] = "ALLOW_ADULT";
1378
- /**
1379
- * Generate images that include adults and children.
1380
- */
1381
- PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
1382
- })(PersonGeneration || (PersonGeneration = {}));
1383
1487
  /** Enum that specifies the language of the text in the prompt. */
1384
1488
  var ImagePromptLanguage;
1385
1489
  (function (ImagePromptLanguage) {
@@ -2278,6 +2382,9 @@ class GenerateVideosOperation {
2278
2382
  return operation;
2279
2383
  }
2280
2384
  }
2385
+ /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
2386
+ class EvaluateDatasetResponse {
2387
+ }
2281
2388
  /** Response for the list tuning jobs method. */
2282
2389
  class ListTuningJobsResponse {
2283
2390
  }
@@ -3397,6 +3504,33 @@ function tIsVertexEmbedContentModel(model) {
3397
3504
  * Copyright 2025 Google LLC
3398
3505
  * SPDX-License-Identifier: Apache-2.0
3399
3506
  */
3507
+ function authConfigToMldev$4(fromObject) {
3508
+ const toObject = {};
3509
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
3510
+ if (fromApiKey != null) {
3511
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
3512
+ }
3513
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
3514
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
3515
+ }
3516
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
3517
+ throw new Error('authType parameter is not supported in Gemini API.');
3518
+ }
3519
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
3520
+ undefined) {
3521
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
3522
+ }
3523
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
3524
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
3525
+ }
3526
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
3527
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
3528
+ }
3529
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
3530
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
3531
+ }
3532
+ return toObject;
3533
+ }
3400
3534
  function batchJobDestinationFromMldev(fromObject) {
3401
3535
  const toObject = {};
3402
3536
  const fromFileName = getValueByPath(fromObject, ['responsesFile']);
@@ -4246,8 +4380,9 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
4246
4380
  }
4247
4381
  function googleMapsToMldev$4(fromObject) {
4248
4382
  const toObject = {};
4249
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
4250
- throw new Error('authConfig parameter is not supported in Gemini API.');
4383
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
4384
+ if (fromAuthConfig != null) {
4385
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$4(fromAuthConfig));
4251
4386
  }
4252
4387
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
4253
4388
  if (fromEnableWidget != null) {
@@ -4261,12 +4396,12 @@ function googleSearchToMldev$4(fromObject) {
4261
4396
  if (fromSearchTypes != null) {
4262
4397
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
4263
4398
  }
4264
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4265
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
4266
- }
4267
4399
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
4268
4400
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
4269
4401
  }
4402
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4403
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4404
+ }
4270
4405
  const fromTimeRangeFilter = getValueByPath(fromObject, [
4271
4406
  'timeRangeFilter',
4272
4407
  ]);
@@ -4298,6 +4433,9 @@ function imageConfigToMldev$1(fromObject) {
4298
4433
  undefined) {
4299
4434
  throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
4300
4435
  }
4436
+ if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
4437
+ throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
4438
+ }
4301
4439
  return toObject;
4302
4440
  }
4303
4441
  function inlinedRequestToMldev(apiClient, fromObject) {
@@ -4551,6 +4689,10 @@ function toolToMldev$4(fromObject) {
4551
4689
  if (fromGoogleSearch != null) {
4552
4690
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4553
4691
  }
4692
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4693
+ if (fromGoogleMaps != null) {
4694
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4695
+ }
4554
4696
  const fromCodeExecution = getValueByPath(fromObject, [
4555
4697
  'codeExecution',
4556
4698
  ]);
@@ -4572,16 +4714,15 @@ function toolToMldev$4(fromObject) {
4572
4714
  }
4573
4715
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
4574
4716
  }
4575
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4576
- if (fromGoogleMaps != null) {
4577
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4578
- }
4579
4717
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4580
4718
  'googleSearchRetrieval',
4581
4719
  ]);
4582
4720
  if (fromGoogleSearchRetrieval != null) {
4583
4721
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4584
4722
  }
4723
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
4724
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
4725
+ }
4585
4726
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4586
4727
  if (fromUrlContext != null) {
4587
4728
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5291,6 +5432,33 @@ class Batches extends BaseModule {
5291
5432
  * Copyright 2025 Google LLC
5292
5433
  * SPDX-License-Identifier: Apache-2.0
5293
5434
  */
5435
+ function authConfigToMldev$3(fromObject) {
5436
+ const toObject = {};
5437
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
5438
+ if (fromApiKey != null) {
5439
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
5440
+ }
5441
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
5442
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
5443
+ }
5444
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
5445
+ throw new Error('authType parameter is not supported in Gemini API.');
5446
+ }
5447
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
5448
+ undefined) {
5449
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
5450
+ }
5451
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
5452
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
5453
+ }
5454
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
5455
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
5456
+ }
5457
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
5458
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
5459
+ }
5460
+ return toObject;
5461
+ }
5294
5462
  function blobToMldev$3(fromObject) {
5295
5463
  const toObject = {};
5296
5464
  const fromData = getValueByPath(fromObject, ['data']);
@@ -5591,8 +5759,9 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
5591
5759
  }
5592
5760
  function googleMapsToMldev$3(fromObject) {
5593
5761
  const toObject = {};
5594
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
5595
- throw new Error('authConfig parameter is not supported in Gemini API.');
5762
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
5763
+ if (fromAuthConfig != null) {
5764
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$3(fromAuthConfig));
5596
5765
  }
5597
5766
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
5598
5767
  if (fromEnableWidget != null) {
@@ -5606,12 +5775,12 @@ function googleSearchToMldev$3(fromObject) {
5606
5775
  if (fromSearchTypes != null) {
5607
5776
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
5608
5777
  }
5609
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5610
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
5611
- }
5612
5778
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
5613
5779
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
5614
5780
  }
5781
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5782
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
5783
+ }
5615
5784
  const fromTimeRangeFilter = getValueByPath(fromObject, [
5616
5785
  'timeRangeFilter',
5617
5786
  ]);
@@ -5809,6 +5978,10 @@ function toolToMldev$3(fromObject) {
5809
5978
  if (fromGoogleSearch != null) {
5810
5979
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5811
5980
  }
5981
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5982
+ if (fromGoogleMaps != null) {
5983
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5984
+ }
5812
5985
  const fromCodeExecution = getValueByPath(fromObject, [
5813
5986
  'codeExecution',
5814
5987
  ]);
@@ -5830,16 +6003,15 @@ function toolToMldev$3(fromObject) {
5830
6003
  }
5831
6004
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
5832
6005
  }
5833
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5834
- if (fromGoogleMaps != null) {
5835
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5836
- }
5837
6006
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5838
6007
  'googleSearchRetrieval',
5839
6008
  ]);
5840
6009
  if (fromGoogleSearchRetrieval != null) {
5841
6010
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5842
6011
  }
6012
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
6013
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
6014
+ }
5843
6015
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5844
6016
  if (fromUrlContext != null) {
5845
6017
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5873,6 +6045,10 @@ function toolToVertex$2(fromObject) {
5873
6045
  if (fromGoogleSearch != null) {
5874
6046
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5875
6047
  }
6048
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
6049
+ if (fromGoogleMaps != null) {
6050
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
6051
+ }
5876
6052
  const fromCodeExecution = getValueByPath(fromObject, [
5877
6053
  'codeExecution',
5878
6054
  ]);
@@ -5897,16 +6073,18 @@ function toolToVertex$2(fromObject) {
5897
6073
  }
5898
6074
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
5899
6075
  }
5900
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5901
- if (fromGoogleMaps != null) {
5902
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
5903
- }
5904
6076
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5905
6077
  'googleSearchRetrieval',
5906
6078
  ]);
5907
6079
  if (fromGoogleSearchRetrieval != null) {
5908
6080
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5909
6081
  }
6082
+ const fromParallelAiSearch = getValueByPath(fromObject, [
6083
+ 'parallelAiSearch',
6084
+ ]);
6085
+ if (fromParallelAiSearch != null) {
6086
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
6087
+ }
5910
6088
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5911
6089
  if (fromUrlContext != null) {
5912
6090
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -6997,7 +7175,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6997
7175
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6998
7176
  const USER_AGENT_HEADER = 'User-Agent';
6999
7177
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7000
- const SDK_VERSION = '1.43.0'; // x-release-please-version
7178
+ const SDK_VERSION = '1.45.0'; // x-release-please-version
7001
7179
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7002
7180
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7003
7181
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7016,6 +7194,9 @@ const DEFAULT_RETRY_HTTP_STATUS_CODES = [
7016
7194
  /**
7017
7195
  * The ApiClient class is used to send requests to the Gemini API or Vertex AI
7018
7196
  * endpoints.
7197
+ *
7198
+ * WARNING: This is an internal API and may change without notice. Direct usage
7199
+ * is not supported and may break your application.
7019
7200
  */
7020
7201
  class ApiClient {
7021
7202
  constructor(opts) {
@@ -7063,10 +7244,7 @@ class ApiClient {
7063
7244
  else {
7064
7245
  // Gemini API
7065
7246
  if (!this.clientOptions.apiKey) {
7066
- throw new ApiError({
7067
- message: 'API key must be set when using the Gemini API.',
7068
- status: 403,
7069
- });
7247
+ console.warn('API key should be set when using the Gemini API.');
7070
7248
  }
7071
7249
  initHttpOptions.apiVersion =
7072
7250
  (_c = this.clientOptions.apiVersion) !== null && _c !== void 0 ? _c : GOOGLE_AI_API_DEFAULT_VERSION;
@@ -8967,166 +9145,6 @@ const safeJSON = (text) => {
8967
9145
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8968
9146
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8969
9147
 
8970
- /**
8971
- * @license
8972
- * Copyright 2025 Google LLC
8973
- * SPDX-License-Identifier: Apache-2.0
8974
- */
8975
- const VERSION = '0.0.1';
8976
-
8977
- /**
8978
- * @license
8979
- * Copyright 2025 Google LLC
8980
- * SPDX-License-Identifier: Apache-2.0
8981
- */
8982
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8983
- /**
8984
- * Note this does not detect 'browser'; for that, use getBrowserInfo().
8985
- */
8986
- function getDetectedPlatform() {
8987
- if (typeof Deno !== 'undefined' && Deno.build != null) {
8988
- return 'deno';
8989
- }
8990
- if (typeof EdgeRuntime !== 'undefined') {
8991
- return 'edge';
8992
- }
8993
- if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {
8994
- return 'node';
8995
- }
8996
- return 'unknown';
8997
- }
8998
- const getPlatformProperties = () => {
8999
- var _a, _b, _c, _d, _e;
9000
- const detectedPlatform = getDetectedPlatform();
9001
- if (detectedPlatform === 'deno') {
9002
- return {
9003
- 'X-Stainless-Lang': 'js',
9004
- 'X-Stainless-Package-Version': VERSION,
9005
- 'X-Stainless-OS': normalizePlatform(Deno.build.os),
9006
- 'X-Stainless-Arch': normalizeArch(Deno.build.arch),
9007
- 'X-Stainless-Runtime': 'deno',
9008
- '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',
9009
- };
9010
- }
9011
- if (typeof EdgeRuntime !== 'undefined') {
9012
- return {
9013
- 'X-Stainless-Lang': 'js',
9014
- 'X-Stainless-Package-Version': VERSION,
9015
- 'X-Stainless-OS': 'Unknown',
9016
- 'X-Stainless-Arch': `other:${EdgeRuntime}`,
9017
- 'X-Stainless-Runtime': 'edge',
9018
- 'X-Stainless-Runtime-Version': globalThis.process.version,
9019
- };
9020
- }
9021
- // Check if Node.js
9022
- if (detectedPlatform === 'node') {
9023
- return {
9024
- 'X-Stainless-Lang': 'js',
9025
- 'X-Stainless-Package-Version': VERSION,
9026
- 'X-Stainless-OS': normalizePlatform((_c = globalThis.process.platform) !== null && _c !== void 0 ? _c : 'unknown'),
9027
- 'X-Stainless-Arch': normalizeArch((_d = globalThis.process.arch) !== null && _d !== void 0 ? _d : 'unknown'),
9028
- 'X-Stainless-Runtime': 'node',
9029
- 'X-Stainless-Runtime-Version': (_e = globalThis.process.version) !== null && _e !== void 0 ? _e : 'unknown',
9030
- };
9031
- }
9032
- const browserInfo = getBrowserInfo();
9033
- if (browserInfo) {
9034
- return {
9035
- 'X-Stainless-Lang': 'js',
9036
- 'X-Stainless-Package-Version': VERSION,
9037
- 'X-Stainless-OS': 'Unknown',
9038
- 'X-Stainless-Arch': 'unknown',
9039
- 'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
9040
- 'X-Stainless-Runtime-Version': browserInfo.version,
9041
- };
9042
- }
9043
- // TODO add support for Cloudflare workers, etc.
9044
- return {
9045
- 'X-Stainless-Lang': 'js',
9046
- 'X-Stainless-Package-Version': VERSION,
9047
- 'X-Stainless-OS': 'Unknown',
9048
- 'X-Stainless-Arch': 'unknown',
9049
- 'X-Stainless-Runtime': 'unknown',
9050
- 'X-Stainless-Runtime-Version': 'unknown',
9051
- };
9052
- };
9053
- // Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
9054
- function getBrowserInfo() {
9055
- if (typeof navigator === 'undefined' || !navigator) {
9056
- return null;
9057
- }
9058
- // NOTE: The order matters here!
9059
- const browserPatterns = [
9060
- { key: 'edge', pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
9061
- { key: 'ie', pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
9062
- { key: 'ie', pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
9063
- { key: 'chrome', pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
9064
- { key: 'firefox', pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
9065
- { key: 'safari', pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
9066
- ];
9067
- // Find the FIRST matching browser
9068
- for (const { key, pattern } of browserPatterns) {
9069
- const match = pattern.exec(navigator.userAgent);
9070
- if (match) {
9071
- const major = match[1] || 0;
9072
- const minor = match[2] || 0;
9073
- const patch = match[3] || 0;
9074
- return { browser: key, version: `${major}.${minor}.${patch}` };
9075
- }
9076
- }
9077
- return null;
9078
- }
9079
- const normalizeArch = (arch) => {
9080
- // Node docs:
9081
- // - https://nodejs.org/api/process.html#processarch
9082
- // Deno docs:
9083
- // - https://doc.deno.land/deno/stable/~/Deno.build
9084
- if (arch === 'x32')
9085
- return 'x32';
9086
- if (arch === 'x86_64' || arch === 'x64')
9087
- return 'x64';
9088
- if (arch === 'arm')
9089
- return 'arm';
9090
- if (arch === 'aarch64' || arch === 'arm64')
9091
- return 'arm64';
9092
- if (arch)
9093
- return `other:${arch}`;
9094
- return 'unknown';
9095
- };
9096
- const normalizePlatform = (platform) => {
9097
- // Node platforms:
9098
- // - https://nodejs.org/api/process.html#processplatform
9099
- // Deno platforms:
9100
- // - https://doc.deno.land/deno/stable/~/Deno.build
9101
- // - https://github.com/denoland/deno/issues/14799
9102
- platform = platform.toLowerCase();
9103
- // NOTE: this iOS check is untested and may not work
9104
- // Node does not work natively on IOS, there is a fork at
9105
- // https://github.com/nodejs-mobile/nodejs-mobile
9106
- // however it is unknown at the time of writing how to detect if it is running
9107
- if (platform.includes('ios'))
9108
- return 'iOS';
9109
- if (platform === 'android')
9110
- return 'Android';
9111
- if (platform === 'darwin')
9112
- return 'MacOS';
9113
- if (platform === 'win32')
9114
- return 'Windows';
9115
- if (platform === 'freebsd')
9116
- return 'FreeBSD';
9117
- if (platform === 'openbsd')
9118
- return 'OpenBSD';
9119
- if (platform === 'linux')
9120
- return 'Linux';
9121
- if (platform)
9122
- return `Other:${platform}`;
9123
- return 'Unknown';
9124
- };
9125
- let _platformHeaders;
9126
- const getPlatformHeaders = () => {
9127
- return (_platformHeaders !== null && _platformHeaders !== void 0 ? _platformHeaders : (_platformHeaders = getPlatformProperties()));
9128
- };
9129
-
9130
9148
  /**
9131
9149
  * @license
9132
9150
  * Copyright 2025 Google LLC
@@ -9232,6 +9250,37 @@ const FallbackEncoder = ({ headers, body }) => {
9232
9250
  };
9233
9251
  };
9234
9252
 
9253
+ /**
9254
+ * @license
9255
+ * Copyright 2025 Google LLC
9256
+ * SPDX-License-Identifier: Apache-2.0
9257
+ */
9258
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
9259
+ /**
9260
+ * Basic re-implementation of `qs.stringify` for primitive types.
9261
+ */
9262
+ function stringifyQuery(query) {
9263
+ return Object.entries(query)
9264
+ .filter(([_, value]) => typeof value !== 'undefined')
9265
+ .map(([key, value]) => {
9266
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
9267
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
9268
+ }
9269
+ if (value === null) {
9270
+ return `${encodeURIComponent(key)}=`;
9271
+ }
9272
+ 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.`);
9273
+ })
9274
+ .join('&');
9275
+ }
9276
+
9277
+ /**
9278
+ * @license
9279
+ * Copyright 2025 Google LLC
9280
+ * SPDX-License-Identifier: Apache-2.0
9281
+ */
9282
+ const VERSION = '0.0.1';
9283
+
9235
9284
  /**
9236
9285
  * @license
9237
9286
  * Copyright 2025 Google LLC
@@ -9570,8 +9619,10 @@ class LineDecoder {
9570
9619
  constructor() {
9571
9620
  this.buffer = new Uint8Array();
9572
9621
  this.carriageReturnIndex = null;
9622
+ this.searchIndex = 0;
9573
9623
  }
9574
9624
  decode(chunk) {
9625
+ var _a;
9575
9626
  if (chunk == null) {
9576
9627
  return [];
9577
9628
  }
@@ -9581,7 +9632,7 @@ class LineDecoder {
9581
9632
  this.buffer = concatBytes([this.buffer, binaryChunk]);
9582
9633
  const lines = [];
9583
9634
  let patternIndex;
9584
- while ((patternIndex = findNewlineIndex(this.buffer, this.carriageReturnIndex)) != null) {
9635
+ while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
9585
9636
  if (patternIndex.carriage && this.carriageReturnIndex == null) {
9586
9637
  // skip until we either get a corresponding `\n`, a new `\r` or nothing
9587
9638
  this.carriageReturnIndex = patternIndex.index;
@@ -9593,6 +9644,7 @@ class LineDecoder {
9593
9644
  lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
9594
9645
  this.buffer = this.buffer.subarray(this.carriageReturnIndex);
9595
9646
  this.carriageReturnIndex = null;
9647
+ this.searchIndex = 0;
9596
9648
  continue;
9597
9649
  }
9598
9650
  const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
@@ -9600,7 +9652,9 @@ class LineDecoder {
9600
9652
  lines.push(line);
9601
9653
  this.buffer = this.buffer.subarray(patternIndex.index);
9602
9654
  this.carriageReturnIndex = null;
9655
+ this.searchIndex = 0;
9603
9656
  }
9657
+ this.searchIndex = Math.max(0, this.buffer.length - 1);
9604
9658
  return lines;
9605
9659
  }
9606
9660
  flush() {
@@ -9625,41 +9679,23 @@ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
9625
9679
  function findNewlineIndex(buffer, startIndex) {
9626
9680
  const newline = 0x0a; // \n
9627
9681
  const carriage = 0x0d; // \r
9628
- for (let i = startIndex !== null && startIndex !== void 0 ? startIndex : 0; i < buffer.length; i++) {
9629
- if (buffer[i] === newline) {
9630
- return { preceding: i, index: i + 1, carriage: false };
9631
- }
9632
- if (buffer[i] === carriage) {
9633
- return { preceding: i, index: i + 1, carriage: true };
9634
- }
9682
+ const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
9683
+ const nextNewline = buffer.indexOf(newline, start);
9684
+ const nextCarriage = buffer.indexOf(carriage, start);
9685
+ if (nextNewline === -1 && nextCarriage === -1) {
9686
+ return null;
9635
9687
  }
9636
- return null;
9637
- }
9638
- function findDoubleNewlineIndex(buffer) {
9639
- // This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
9640
- // and returns the index right after the first occurrence of any pattern,
9641
- // or -1 if none of the patterns are found.
9642
- const newline = 0x0a; // \n
9643
- const carriage = 0x0d; // \r
9644
- for (let i = 0; i < buffer.length - 1; i++) {
9645
- if (buffer[i] === newline && buffer[i + 1] === newline) {
9646
- // \n\n
9647
- return i + 2;
9648
- }
9649
- if (buffer[i] === carriage && buffer[i + 1] === carriage) {
9650
- // \r\r
9651
- return i + 2;
9652
- }
9653
- if (buffer[i] === carriage &&
9654
- buffer[i + 1] === newline &&
9655
- i + 3 < buffer.length &&
9656
- buffer[i + 2] === carriage &&
9657
- buffer[i + 3] === newline) {
9658
- // \r\n\r\n
9659
- return i + 4;
9660
- }
9688
+ let i;
9689
+ if (nextNewline !== -1 && nextCarriage !== -1) {
9690
+ i = Math.min(nextNewline, nextCarriage);
9691
+ }
9692
+ else {
9693
+ i = nextNewline !== -1 ? nextNewline : nextCarriage;
9694
+ }
9695
+ if (buffer[i] === newline) {
9696
+ return { preceding: i, index: i + 1, carriage: false };
9661
9697
  }
9662
- return -1;
9698
+ return { preceding: i, index: i + 1, carriage: true };
9663
9699
  }
9664
9700
 
9665
9701
  /**
@@ -9970,7 +10006,7 @@ function _iterSSEMessages(response, controller) {
9970
10006
  const lineDecoder = new LineDecoder();
9971
10007
  const iter = ReadableStreamToAsyncIterable(response.body);
9972
10008
  try {
9973
- for (var _d = true, _e = __asyncValues(iterSSEChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
10009
+ for (var _d = true, _e = __asyncValues(iterBinaryChunks(iter)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
9974
10010
  _c = _f.value;
9975
10011
  _d = false;
9976
10012
  const sseChunk = _c;
@@ -9996,13 +10032,12 @@ function _iterSSEMessages(response, controller) {
9996
10032
  });
9997
10033
  }
9998
10034
  /**
9999
- * Given an async iterable iterator, iterates over it and yields full
10000
- * SSE chunks, i.e. yields when a double new-line is encountered.
10035
+ * Given an async iterable iterator, normalizes each chunk to a
10036
+ * Uint8Array and yields it.
10001
10037
  */
10002
- function iterSSEChunks(iterator) {
10003
- return __asyncGenerator(this, arguments, function* iterSSEChunks_1() {
10038
+ function iterBinaryChunks(iterator) {
10039
+ return __asyncGenerator(this, arguments, function* iterBinaryChunks_1() {
10004
10040
  var _a, e_5, _b, _c;
10005
- let data = new Uint8Array();
10006
10041
  try {
10007
10042
  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) {
10008
10043
  _c = iterator_3_1.value;
@@ -10014,15 +10049,7 @@ function iterSSEChunks(iterator) {
10014
10049
  const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
10015
10050
  : typeof chunk === 'string' ? encodeUTF8(chunk)
10016
10051
  : chunk;
10017
- let newData = new Uint8Array(data.length + binaryChunk.length);
10018
- newData.set(data);
10019
- newData.set(binaryChunk, data.length);
10020
- data = newData;
10021
- let patternIndex;
10022
- while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
10023
- yield yield __await(data.slice(0, patternIndex));
10024
- data = data.slice(patternIndex);
10025
- }
10052
+ yield yield __await(binaryChunk);
10026
10053
  }
10027
10054
  }
10028
10055
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
@@ -10032,9 +10059,6 @@ function iterSSEChunks(iterator) {
10032
10059
  }
10033
10060
  finally { if (e_5) throw e_5.error; }
10034
10061
  }
10035
- if (data.length > 0) {
10036
- yield yield __await(data);
10037
- }
10038
10062
  });
10039
10063
  }
10040
10064
  class SSEDecoder {
@@ -10393,18 +10417,7 @@ class BaseGeminiNextGenAPIClient {
10393
10417
  * Basic re-implementation of `qs.stringify` for primitive types.
10394
10418
  */
10395
10419
  stringifyQuery(query) {
10396
- return Object.entries(query)
10397
- .filter(([_, value]) => typeof value !== 'undefined')
10398
- .map(([key, value]) => {
10399
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
10400
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
10401
- }
10402
- if (value === null) {
10403
- return `${encodeURIComponent(key)}=`;
10404
- }
10405
- 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.`);
10406
- })
10407
- .join('&');
10420
+ return stringifyQuery(query);
10408
10421
  }
10409
10422
  getUserAgent() {
10410
10423
  return `${this.constructor.name}/JS ${VERSION}`;
@@ -10421,8 +10434,9 @@ class BaseGeminiNextGenAPIClient {
10421
10434
  new URL(path)
10422
10435
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
10423
10436
  const defaultQuery = this.defaultQuery();
10424
- if (!isEmptyObj(defaultQuery)) {
10425
- query = Object.assign(Object.assign({}, defaultQuery), query);
10437
+ const pathQuery = Object.fromEntries(url.searchParams);
10438
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
10439
+ query = Object.assign(Object.assign(Object.assign({}, pathQuery), defaultQuery), query);
10426
10440
  }
10427
10441
  if (typeof query === 'object' && query && !Array.isArray(query)) {
10428
10442
  url.search = this.stringifyQuery(query);
@@ -10643,9 +10657,9 @@ class BaseGeminiNextGenAPIClient {
10643
10657
  timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
10644
10658
  }
10645
10659
  }
10646
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
10647
- // just do what it says, but otherwise calculate a default
10648
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
10660
+ // If the API asks us to wait a certain amount of time, just do what it
10661
+ // says, but otherwise calculate a default
10662
+ if (timeoutMillis === undefined) {
10649
10663
  const maxRetries = (_b = options.maxRetries) !== null && _b !== void 0 ? _b : this.maxRetries;
10650
10664
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
10651
10665
  }
@@ -10686,7 +10700,7 @@ class BaseGeminiNextGenAPIClient {
10686
10700
  const authHeaders = await this.authHeaders(options);
10687
10701
  let headers = buildHeaders([
10688
10702
  idempotencyHeaders,
10689
- 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()),
10703
+ { Accept: 'application/json', 'User-Agent': this.getUserAgent() },
10690
10704
  this._options.defaultHeaders,
10691
10705
  bodyHeaders,
10692
10706
  options.headers,
@@ -10773,6 +10787,40 @@ GeminiNextGenAPIClient.Interactions = Interactions;
10773
10787
  * Copyright 2025 Google LLC
10774
10788
  * SPDX-License-Identifier: Apache-2.0
10775
10789
  */
10790
+ function audioTranscriptionConfigToMldev$1(fromObject) {
10791
+ const toObject = {};
10792
+ if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
10793
+ throw new Error('languageCodes parameter is not supported in Gemini API.');
10794
+ }
10795
+ return toObject;
10796
+ }
10797
+ function authConfigToMldev$2(fromObject) {
10798
+ const toObject = {};
10799
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
10800
+ if (fromApiKey != null) {
10801
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
10802
+ }
10803
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
10804
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
10805
+ }
10806
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
10807
+ throw new Error('authType parameter is not supported in Gemini API.');
10808
+ }
10809
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
10810
+ undefined) {
10811
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
10812
+ }
10813
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
10814
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
10815
+ }
10816
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
10817
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
10818
+ }
10819
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
10820
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
10821
+ }
10822
+ return toObject;
10823
+ }
10776
10824
  function blobToMldev$2(fromObject) {
10777
10825
  const toObject = {};
10778
10826
  const fromData = getValueByPath(fromObject, ['data']);
@@ -11008,8 +11056,9 @@ function generationConfigToVertex$1(fromObject) {
11008
11056
  }
11009
11057
  function googleMapsToMldev$2(fromObject) {
11010
11058
  const toObject = {};
11011
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
11012
- throw new Error('authConfig parameter is not supported in Gemini API.');
11059
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
11060
+ if (fromAuthConfig != null) {
11061
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$2(fromAuthConfig));
11013
11062
  }
11014
11063
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
11015
11064
  if (fromEnableWidget != null) {
@@ -11023,12 +11072,12 @@ function googleSearchToMldev$2(fromObject) {
11023
11072
  if (fromSearchTypes != null) {
11024
11073
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
11025
11074
  }
11026
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
11027
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
11028
- }
11029
11075
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
11030
11076
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
11031
11077
  }
11078
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
11079
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
11080
+ }
11032
11081
  const fromTimeRangeFilter = getValueByPath(fromObject, [
11033
11082
  'timeRangeFilter',
11034
11083
  ]);
@@ -11121,13 +11170,13 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
11121
11170
  'inputAudioTranscription',
11122
11171
  ]);
11123
11172
  if (parentObject !== undefined && fromInputAudioTranscription != null) {
11124
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
11173
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromInputAudioTranscription));
11125
11174
  }
11126
11175
  const fromOutputAudioTranscription = getValueByPath(fromObject, [
11127
11176
  'outputAudioTranscription',
11128
11177
  ]);
11129
11178
  if (parentObject !== undefined && fromOutputAudioTranscription != null) {
11130
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
11179
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1(fromOutputAudioTranscription));
11131
11180
  }
11132
11181
  const fromRealtimeInputConfig = getValueByPath(fromObject, [
11133
11182
  'realtimeInputConfig',
@@ -11542,6 +11591,10 @@ function toolToMldev$2(fromObject) {
11542
11591
  if (fromGoogleSearch != null) {
11543
11592
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
11544
11593
  }
11594
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11595
+ if (fromGoogleMaps != null) {
11596
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
11597
+ }
11545
11598
  const fromCodeExecution = getValueByPath(fromObject, [
11546
11599
  'codeExecution',
11547
11600
  ]);
@@ -11563,16 +11616,15 @@ function toolToMldev$2(fromObject) {
11563
11616
  }
11564
11617
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
11565
11618
  }
11566
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11567
- if (fromGoogleMaps != null) {
11568
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
11569
- }
11570
11619
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11571
11620
  'googleSearchRetrieval',
11572
11621
  ]);
11573
11622
  if (fromGoogleSearchRetrieval != null) {
11574
11623
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11575
11624
  }
11625
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
11626
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
11627
+ }
11576
11628
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11577
11629
  if (fromUrlContext != null) {
11578
11630
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11606,6 +11658,10 @@ function toolToVertex$1(fromObject) {
11606
11658
  if (fromGoogleSearch != null) {
11607
11659
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
11608
11660
  }
11661
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11662
+ if (fromGoogleMaps != null) {
11663
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
11664
+ }
11609
11665
  const fromCodeExecution = getValueByPath(fromObject, [
11610
11666
  'codeExecution',
11611
11667
  ]);
@@ -11630,16 +11686,18 @@ function toolToVertex$1(fromObject) {
11630
11686
  }
11631
11687
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
11632
11688
  }
11633
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11634
- if (fromGoogleMaps != null) {
11635
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
11636
- }
11637
11689
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11638
11690
  'googleSearchRetrieval',
11639
11691
  ]);
11640
11692
  if (fromGoogleSearchRetrieval != null) {
11641
11693
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11642
11694
  }
11695
+ const fromParallelAiSearch = getValueByPath(fromObject, [
11696
+ 'parallelAiSearch',
11697
+ ]);
11698
+ if (fromParallelAiSearch != null) {
11699
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
11700
+ }
11643
11701
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11644
11702
  if (fromUrlContext != null) {
11645
11703
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11755,6 +11813,33 @@ function voiceActivityFromVertex(fromObject) {
11755
11813
  * Copyright 2025 Google LLC
11756
11814
  * SPDX-License-Identifier: Apache-2.0
11757
11815
  */
11816
+ function authConfigToMldev$1(fromObject, _rootObject) {
11817
+ const toObject = {};
11818
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
11819
+ if (fromApiKey != null) {
11820
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
11821
+ }
11822
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
11823
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
11824
+ }
11825
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
11826
+ throw new Error('authType parameter is not supported in Gemini API.');
11827
+ }
11828
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
11829
+ undefined) {
11830
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
11831
+ }
11832
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
11833
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
11834
+ }
11835
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
11836
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
11837
+ }
11838
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
11839
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
11840
+ }
11841
+ return toObject;
11842
+ }
11758
11843
  function blobToMldev$1(fromObject, _rootObject) {
11759
11844
  const toObject = {};
11760
11845
  const fromData = getValueByPath(fromObject, ['data']);
@@ -13903,10 +13988,11 @@ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
13903
13988
  }
13904
13989
  return toObject;
13905
13990
  }
13906
- function googleMapsToMldev$1(fromObject, _rootObject) {
13991
+ function googleMapsToMldev$1(fromObject, rootObject) {
13907
13992
  const toObject = {};
13908
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
13909
- throw new Error('authConfig parameter is not supported in Gemini API.');
13993
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
13994
+ if (fromAuthConfig != null) {
13995
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev$1(fromAuthConfig));
13910
13996
  }
13911
13997
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
13912
13998
  if (fromEnableWidget != null) {
@@ -13920,12 +14006,12 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
13920
14006
  if (fromSearchTypes != null) {
13921
14007
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
13922
14008
  }
13923
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13924
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
13925
- }
13926
14009
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
13927
14010
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
13928
14011
  }
14012
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
14013
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
14014
+ }
13929
14015
  const fromTimeRangeFilter = getValueByPath(fromObject, [
13930
14016
  'timeRangeFilter',
13931
14017
  ]);
@@ -13957,6 +14043,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
13957
14043
  undefined) {
13958
14044
  throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
13959
14045
  }
14046
+ if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
14047
+ throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
14048
+ }
13960
14049
  return toObject;
13961
14050
  }
13962
14051
  function imageConfigToVertex(fromObject, _rootObject) {
@@ -13993,6 +14082,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
13993
14082
  if (fromOutputCompressionQuality != null) {
13994
14083
  setValueByPath(toObject, ['imageOutputOptions', 'compressionQuality'], fromOutputCompressionQuality);
13995
14084
  }
14085
+ const fromImageOutputOptions = getValueByPath(fromObject, [
14086
+ 'imageOutputOptions',
14087
+ ]);
14088
+ if (fromImageOutputOptions != null) {
14089
+ setValueByPath(toObject, ['imageOutputOptions'], fromImageOutputOptions);
14090
+ }
13996
14091
  return toObject;
13997
14092
  }
13998
14093
  function imageFromMldev(fromObject, _rootObject) {
@@ -14712,6 +14807,10 @@ function toolToMldev$1(fromObject, rootObject) {
14712
14807
  if (fromGoogleSearch != null) {
14713
14808
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
14714
14809
  }
14810
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14811
+ if (fromGoogleMaps != null) {
14812
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
14813
+ }
14715
14814
  const fromCodeExecution = getValueByPath(fromObject, [
14716
14815
  'codeExecution',
14717
14816
  ]);
@@ -14733,16 +14832,15 @@ function toolToMldev$1(fromObject, rootObject) {
14733
14832
  }
14734
14833
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
14735
14834
  }
14736
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14737
- if (fromGoogleMaps != null) {
14738
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
14739
- }
14740
14835
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14741
14836
  'googleSearchRetrieval',
14742
14837
  ]);
14743
14838
  if (fromGoogleSearchRetrieval != null) {
14744
14839
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14745
14840
  }
14841
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
14842
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
14843
+ }
14746
14844
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14747
14845
  if (fromUrlContext != null) {
14748
14846
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -14776,6 +14874,10 @@ function toolToVertex(fromObject, rootObject) {
14776
14874
  if (fromGoogleSearch != null) {
14777
14875
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
14778
14876
  }
14877
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14878
+ if (fromGoogleMaps != null) {
14879
+ setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
14880
+ }
14779
14881
  const fromCodeExecution = getValueByPath(fromObject, [
14780
14882
  'codeExecution',
14781
14883
  ]);
@@ -14800,16 +14902,18 @@ function toolToVertex(fromObject, rootObject) {
14800
14902
  }
14801
14903
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
14802
14904
  }
14803
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14804
- if (fromGoogleMaps != null) {
14805
- setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
14806
- }
14807
14905
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14808
14906
  'googleSearchRetrieval',
14809
14907
  ]);
14810
14908
  if (fromGoogleSearchRetrieval != null) {
14811
14909
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14812
14910
  }
14911
+ const fromParallelAiSearch = getValueByPath(fromObject, [
14912
+ 'parallelAiSearch',
14913
+ ]);
14914
+ if (fromParallelAiSearch != null) {
14915
+ setValueByPath(toObject, ['parallelAiSearch'], fromParallelAiSearch);
14916
+ }
14813
14917
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14814
14918
  if (fromUrlContext != null) {
14815
14919
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -17795,6 +17899,40 @@ class Operations extends BaseModule {
17795
17899
  * Copyright 2025 Google LLC
17796
17900
  * SPDX-License-Identifier: Apache-2.0
17797
17901
  */
17902
+ function audioTranscriptionConfigToMldev(fromObject) {
17903
+ const toObject = {};
17904
+ if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
17905
+ throw new Error('languageCodes parameter is not supported in Gemini API.');
17906
+ }
17907
+ return toObject;
17908
+ }
17909
+ function authConfigToMldev(fromObject) {
17910
+ const toObject = {};
17911
+ const fromApiKey = getValueByPath(fromObject, ['apiKey']);
17912
+ if (fromApiKey != null) {
17913
+ setValueByPath(toObject, ['apiKey'], fromApiKey);
17914
+ }
17915
+ if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
17916
+ throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
17917
+ }
17918
+ if (getValueByPath(fromObject, ['authType']) !== undefined) {
17919
+ throw new Error('authType parameter is not supported in Gemini API.');
17920
+ }
17921
+ if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
17922
+ undefined) {
17923
+ throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
17924
+ }
17925
+ if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
17926
+ throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
17927
+ }
17928
+ if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
17929
+ throw new Error('oauthConfig parameter is not supported in Gemini API.');
17930
+ }
17931
+ if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
17932
+ throw new Error('oidcConfig parameter is not supported in Gemini API.');
17933
+ }
17934
+ return toObject;
17935
+ }
17798
17936
  function blobToMldev(fromObject) {
17799
17937
  const toObject = {};
17800
17938
  const fromData = getValueByPath(fromObject, ['data']);
@@ -17905,8 +18043,9 @@ function functionCallToMldev(fromObject) {
17905
18043
  }
17906
18044
  function googleMapsToMldev(fromObject) {
17907
18045
  const toObject = {};
17908
- if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
17909
- throw new Error('authConfig parameter is not supported in Gemini API.');
18046
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
18047
+ if (fromAuthConfig != null) {
18048
+ setValueByPath(toObject, ['authConfig'], authConfigToMldev(fromAuthConfig));
17910
18049
  }
17911
18050
  const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
17912
18051
  if (fromEnableWidget != null) {
@@ -17920,12 +18059,12 @@ function googleSearchToMldev(fromObject) {
17920
18059
  if (fromSearchTypes != null) {
17921
18060
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
17922
18061
  }
17923
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
17924
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
17925
- }
17926
18062
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
17927
18063
  throw new Error('blockingConfidence parameter is not supported in Gemini API.');
17928
18064
  }
18065
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
18066
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
18067
+ }
17929
18068
  const fromTimeRangeFilter = getValueByPath(fromObject, [
17930
18069
  'timeRangeFilter',
17931
18070
  ]);
@@ -18018,13 +18157,13 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
18018
18157
  'inputAudioTranscription',
18019
18158
  ]);
18020
18159
  if (parentObject !== undefined && fromInputAudioTranscription != null) {
18021
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], fromInputAudioTranscription);
18160
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev(fromInputAudioTranscription));
18022
18161
  }
18023
18162
  const fromOutputAudioTranscription = getValueByPath(fromObject, [
18024
18163
  'outputAudioTranscription',
18025
18164
  ]);
18026
18165
  if (parentObject !== undefined && fromOutputAudioTranscription != null) {
18027
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], fromOutputAudioTranscription);
18166
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev(fromOutputAudioTranscription));
18028
18167
  }
18029
18168
  const fromRealtimeInputConfig = getValueByPath(fromObject, [
18030
18169
  'realtimeInputConfig',
@@ -18147,6 +18286,10 @@ function toolToMldev(fromObject) {
18147
18286
  if (fromGoogleSearch != null) {
18148
18287
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
18149
18288
  }
18289
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
18290
+ if (fromGoogleMaps != null) {
18291
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
18292
+ }
18150
18293
  const fromCodeExecution = getValueByPath(fromObject, [
18151
18294
  'codeExecution',
18152
18295
  ]);
@@ -18168,16 +18311,15 @@ function toolToMldev(fromObject) {
18168
18311
  }
18169
18312
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
18170
18313
  }
18171
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
18172
- if (fromGoogleMaps != null) {
18173
- setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
18174
- }
18175
18314
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
18176
18315
  'googleSearchRetrieval',
18177
18316
  ]);
18178
18317
  if (fromGoogleSearchRetrieval != null) {
18179
18318
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
18180
18319
  }
18320
+ if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
18321
+ throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
18322
+ }
18181
18323
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
18182
18324
  if (fromUrlContext != null) {
18183
18325
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -19227,10 +19369,28 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19227
19369
  if (fromCustomBaseModel != null) {
19228
19370
  setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
19229
19371
  }
19372
+ const fromEvaluateDatasetRuns = getValueByPath(fromObject, [
19373
+ 'evaluateDatasetRuns',
19374
+ ]);
19375
+ if (fromEvaluateDatasetRuns != null) {
19376
+ let transformedList = fromEvaluateDatasetRuns;
19377
+ if (Array.isArray(transformedList)) {
19378
+ transformedList = transformedList.map((item) => {
19379
+ return item;
19380
+ });
19381
+ }
19382
+ setValueByPath(toObject, ['evaluateDatasetRuns'], transformedList);
19383
+ }
19230
19384
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
19231
19385
  if (fromExperiment != null) {
19232
19386
  setValueByPath(toObject, ['experiment'], fromExperiment);
19233
19387
  }
19388
+ const fromFullFineTuningSpec = getValueByPath(fromObject, [
19389
+ 'fullFineTuningSpec',
19390
+ ]);
19391
+ if (fromFullFineTuningSpec != null) {
19392
+ setValueByPath(toObject, ['fullFineTuningSpec'], fromFullFineTuningSpec);
19393
+ }
19234
19394
  const fromLabels = getValueByPath(fromObject, ['labels']);
19235
19395
  if (fromLabels != null) {
19236
19396
  setValueByPath(toObject, ['labels'], fromLabels);
@@ -19255,6 +19415,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19255
19415
  if (fromTunedModelDisplayName != null) {
19256
19416
  setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
19257
19417
  }
19418
+ const fromTuningJobState = getValueByPath(fromObject, [
19419
+ 'tuningJobState',
19420
+ ]);
19421
+ if (fromTuningJobState != null) {
19422
+ setValueByPath(toObject, ['tuningJobState'], fromTuningJobState);
19423
+ }
19258
19424
  const fromVeoTuningSpec = getValueByPath(fromObject, [
19259
19425
  'veoTuningSpec',
19260
19426
  ]);
@@ -19803,5 +19969,5 @@ class GoogleGenAI {
19803
19969
  }
19804
19970
  }
19805
19971
 
19806
- 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 };
19972
+ 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 };
19807
19973
  //# sourceMappingURL=index.mjs.map