@google/genai 1.34.0 → 1.36.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
@@ -642,18 +642,6 @@ var Type;
642
642
  */
643
643
  Type["NULL"] = "NULL";
644
644
  })(Type || (Type = {}));
645
- /** The mode of the predictor to be used in dynamic retrieval. */
646
- var Mode;
647
- (function (Mode) {
648
- /**
649
- * Always trigger retrieval.
650
- */
651
- Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
652
- /**
653
- * Run retrieval only when system decides it is necessary.
654
- */
655
- Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
656
- })(Mode || (Mode = {}));
657
645
  /** The API spec that the external API implements. This enum is not supported in Gemini API. */
658
646
  var ApiSpec;
659
647
  (function (ApiSpec) {
@@ -756,6 +744,58 @@ var PhishBlockThreshold;
756
744
  */
757
745
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
758
746
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
747
+ /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
748
+ var Behavior;
749
+ (function (Behavior) {
750
+ /**
751
+ * This value is unused.
752
+ */
753
+ Behavior["UNSPECIFIED"] = "UNSPECIFIED";
754
+ /**
755
+ * If set, the system will wait to receive the function response before continuing the conversation.
756
+ */
757
+ Behavior["BLOCKING"] = "BLOCKING";
758
+ /**
759
+ * If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
760
+ */
761
+ Behavior["NON_BLOCKING"] = "NON_BLOCKING";
762
+ })(Behavior || (Behavior = {}));
763
+ /** The mode of the predictor to be used in dynamic retrieval. */
764
+ var DynamicRetrievalConfigMode;
765
+ (function (DynamicRetrievalConfigMode) {
766
+ /**
767
+ * Always trigger retrieval.
768
+ */
769
+ DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
770
+ /**
771
+ * Run retrieval only when system decides it is necessary.
772
+ */
773
+ DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
774
+ })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
775
+ /** Function calling mode. */
776
+ var FunctionCallingConfigMode;
777
+ (function (FunctionCallingConfigMode) {
778
+ /**
779
+ * Unspecified function calling mode. This value should not be used.
780
+ */
781
+ FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
782
+ /**
783
+ * Default model behavior, model decides to predict either function calls or natural language response.
784
+ */
785
+ FunctionCallingConfigMode["AUTO"] = "AUTO";
786
+ /**
787
+ * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
788
+ */
789
+ FunctionCallingConfigMode["ANY"] = "ANY";
790
+ /**
791
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
792
+ */
793
+ FunctionCallingConfigMode["NONE"] = "NONE";
794
+ /**
795
+ * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
796
+ */
797
+ FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
798
+ })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
759
799
  /** The number of thoughts tokens that the model should generate. */
760
800
  var ThinkingLevel;
761
801
  (function (ThinkingLevel) {
@@ -1262,34 +1302,6 @@ var FeatureSelectionPreference;
1262
1302
  FeatureSelectionPreference["BALANCED"] = "BALANCED";
1263
1303
  FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1264
1304
  })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1265
- /** Defines the function behavior. Defaults to `BLOCKING`. */
1266
- var Behavior;
1267
- (function (Behavior) {
1268
- /**
1269
- * This value is unused.
1270
- */
1271
- Behavior["UNSPECIFIED"] = "UNSPECIFIED";
1272
- /**
1273
- * If set, the system will wait to receive the function response before continuing the conversation.
1274
- */
1275
- Behavior["BLOCKING"] = "BLOCKING";
1276
- /**
1277
- * If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
1278
- */
1279
- Behavior["NON_BLOCKING"] = "NON_BLOCKING";
1280
- })(Behavior || (Behavior = {}));
1281
- /** Config for the dynamic retrieval config mode. */
1282
- var DynamicRetrievalConfigMode;
1283
- (function (DynamicRetrievalConfigMode) {
1284
- /**
1285
- * Always trigger retrieval.
1286
- */
1287
- DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
1288
- /**
1289
- * Run retrieval only when system decides it is necessary.
1290
- */
1291
- DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
1292
- })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
1293
1305
  /** The environment being operated. */
1294
1306
  var Environment;
1295
1307
  (function (Environment) {
@@ -1302,30 +1314,6 @@ var Environment;
1302
1314
  */
1303
1315
  Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1304
1316
  })(Environment || (Environment = {}));
1305
- /** Config for the function calling config mode. */
1306
- var FunctionCallingConfigMode;
1307
- (function (FunctionCallingConfigMode) {
1308
- /**
1309
- * The function calling config mode is unspecified. Should not be used.
1310
- */
1311
- FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
1312
- /**
1313
- * Default model behavior, model decides to predict either function calls or natural language response.
1314
- */
1315
- FunctionCallingConfigMode["AUTO"] = "AUTO";
1316
- /**
1317
- * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
1318
- */
1319
- FunctionCallingConfigMode["ANY"] = "ANY";
1320
- /**
1321
- * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
1322
- */
1323
- FunctionCallingConfigMode["NONE"] = "NONE";
1324
- /**
1325
- * Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations".
1326
- */
1327
- FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
1328
- })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
1329
1317
  /** Enum that controls the safety filter level for objectionable content. */
1330
1318
  var SafetyFilterLevel;
1331
1319
  (function (SafetyFilterLevel) {
@@ -1522,6 +1510,7 @@ var FileSource;
1522
1510
  FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
1523
1511
  FileSource["UPLOADED"] = "UPLOADED";
1524
1512
  FileSource["GENERATED"] = "GENERATED";
1513
+ FileSource["REGISTERED"] = "REGISTERED";
1525
1514
  })(FileSource || (FileSource = {}));
1526
1515
  /** The reason why the turn is complete. */
1527
1516
  var TurnCompleteReason;
@@ -1587,6 +1576,22 @@ var VadSignalType;
1587
1576
  */
1588
1577
  VadSignalType["VAD_SIGNAL_TYPE_EOS"] = "VAD_SIGNAL_TYPE_EOS";
1589
1578
  })(VadSignalType || (VadSignalType = {}));
1579
+ /** The type of the voice activity signal. */
1580
+ var VoiceActivityType;
1581
+ (function (VoiceActivityType) {
1582
+ /**
1583
+ * The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
1584
+ */
1585
+ VoiceActivityType["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
1586
+ /**
1587
+ * Start of sentence signal.
1588
+ */
1589
+ VoiceActivityType["ACTIVITY_START"] = "ACTIVITY_START";
1590
+ /**
1591
+ * End of sentence signal.
1592
+ */
1593
+ VoiceActivityType["ACTIVITY_END"] = "ACTIVITY_END";
1594
+ })(VoiceActivityType || (VoiceActivityType = {}));
1590
1595
  /** Start of speech sensitivity. */
1591
1596
  var StartSensitivity;
1592
1597
  (function (StartSensitivity) {
@@ -3951,16 +3956,16 @@ function functionCallToMldev$4(fromObject) {
3951
3956
  }
3952
3957
  function functionCallingConfigToMldev$2(fromObject) {
3953
3958
  const toObject = {};
3954
- const fromMode = getValueByPath(fromObject, ['mode']);
3955
- if (fromMode != null) {
3956
- setValueByPath(toObject, ['mode'], fromMode);
3957
- }
3958
3959
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
3959
3960
  'allowedFunctionNames',
3960
3961
  ]);
3961
3962
  if (fromAllowedFunctionNames != null) {
3962
3963
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
3963
3964
  }
3965
+ const fromMode = getValueByPath(fromObject, ['mode']);
3966
+ if (fromMode != null) {
3967
+ setValueByPath(toObject, ['mode'], fromMode);
3968
+ }
3964
3969
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
3965
3970
  undefined) {
3966
3971
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -4220,6 +4225,9 @@ function imageConfigToMldev$1(fromObject) {
4220
4225
  if (fromImageSize != null) {
4221
4226
  setValueByPath(toObject, ['imageSize'], fromImageSize);
4222
4227
  }
4228
+ if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
4229
+ throw new Error('personGeneration parameter is not supported in Gemini API.');
4230
+ }
4223
4231
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
4224
4232
  throw new Error('outputMimeType parameter is not supported in Gemini API.');
4225
4233
  }
@@ -4445,43 +4453,25 @@ function safetySettingToMldev$1(fromObject) {
4445
4453
  }
4446
4454
  function toolConfigToMldev$2(fromObject) {
4447
4455
  const toObject = {};
4448
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
4449
- 'functionCallingConfig',
4450
- ]);
4451
- if (fromFunctionCallingConfig != null) {
4452
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4453
- }
4454
4456
  const fromRetrievalConfig = getValueByPath(fromObject, [
4455
4457
  'retrievalConfig',
4456
4458
  ]);
4457
4459
  if (fromRetrievalConfig != null) {
4458
4460
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
4459
4461
  }
4462
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
4463
+ 'functionCallingConfig',
4464
+ ]);
4465
+ if (fromFunctionCallingConfig != null) {
4466
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4467
+ }
4460
4468
  return toObject;
4461
4469
  }
4462
4470
  function toolToMldev$4(fromObject) {
4463
4471
  const toObject = {};
4464
- const fromFunctionDeclarations = getValueByPath(fromObject, [
4465
- 'functionDeclarations',
4466
- ]);
4467
- if (fromFunctionDeclarations != null) {
4468
- let transformedList = fromFunctionDeclarations;
4469
- if (Array.isArray(transformedList)) {
4470
- transformedList = transformedList.map((item) => {
4471
- return item;
4472
- });
4473
- }
4474
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
4475
- }
4476
4472
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
4477
4473
  throw new Error('retrieval parameter is not supported in Gemini API.');
4478
4474
  }
4479
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4480
- 'googleSearchRetrieval',
4481
- ]);
4482
- if (fromGoogleSearchRetrieval != null) {
4483
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4484
- }
4485
4475
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4486
4476
  if (fromComputerUse != null) {
4487
4477
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -4499,6 +4489,18 @@ function toolToMldev$4(fromObject) {
4499
4489
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4500
4490
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4501
4491
  }
4492
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
4493
+ 'functionDeclarations',
4494
+ ]);
4495
+ if (fromFunctionDeclarations != null) {
4496
+ let transformedList = fromFunctionDeclarations;
4497
+ if (Array.isArray(transformedList)) {
4498
+ transformedList = transformedList.map((item) => {
4499
+ return item;
4500
+ });
4501
+ }
4502
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
4503
+ }
4502
4504
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4503
4505
  if (fromGoogleMaps != null) {
4504
4506
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
@@ -4507,6 +4509,12 @@ function toolToMldev$4(fromObject) {
4507
4509
  if (fromGoogleSearch != null) {
4508
4510
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4509
4511
  }
4512
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4513
+ 'googleSearchRetrieval',
4514
+ ]);
4515
+ if (fromGoogleSearchRetrieval != null) {
4516
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4517
+ }
4510
4518
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4511
4519
  if (fromUrlContext != null) {
4512
4520
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5437,16 +5445,16 @@ function functionCallToMldev$3(fromObject) {
5437
5445
  }
5438
5446
  function functionCallingConfigToMldev$1(fromObject) {
5439
5447
  const toObject = {};
5440
- const fromMode = getValueByPath(fromObject, ['mode']);
5441
- if (fromMode != null) {
5442
- setValueByPath(toObject, ['mode'], fromMode);
5443
- }
5444
5448
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
5445
5449
  'allowedFunctionNames',
5446
5450
  ]);
5447
5451
  if (fromAllowedFunctionNames != null) {
5448
5452
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
5449
5453
  }
5454
+ const fromMode = getValueByPath(fromObject, ['mode']);
5455
+ if (fromMode != null) {
5456
+ setValueByPath(toObject, ['mode'], fromMode);
5457
+ }
5450
5458
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
5451
5459
  undefined) {
5452
5460
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -5455,9 +5463,6 @@ function functionCallingConfigToMldev$1(fromObject) {
5455
5463
  }
5456
5464
  function functionDeclarationToVertex$2(fromObject) {
5457
5465
  const toObject = {};
5458
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
5459
- throw new Error('behavior parameter is not supported in Vertex AI.');
5460
- }
5461
5466
  const fromDescription = getValueByPath(fromObject, ['description']);
5462
5467
  if (fromDescription != null) {
5463
5468
  setValueByPath(toObject, ['description'], fromDescription);
@@ -5486,6 +5491,9 @@ function functionDeclarationToVertex$2(fromObject) {
5486
5491
  if (fromResponseJsonSchema != null) {
5487
5492
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
5488
5493
  }
5494
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
5495
+ throw new Error('behavior parameter is not supported in Vertex AI.');
5496
+ }
5489
5497
  return toObject;
5490
5498
  }
5491
5499
  function getCachedContentParametersToMldev(apiClient, fromObject) {
@@ -5689,43 +5697,25 @@ function partToMldev$3(fromObject) {
5689
5697
  }
5690
5698
  function toolConfigToMldev$1(fromObject) {
5691
5699
  const toObject = {};
5692
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
5693
- 'functionCallingConfig',
5694
- ]);
5695
- if (fromFunctionCallingConfig != null) {
5696
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
5697
- }
5698
5700
  const fromRetrievalConfig = getValueByPath(fromObject, [
5699
5701
  'retrievalConfig',
5700
5702
  ]);
5701
5703
  if (fromRetrievalConfig != null) {
5702
5704
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
5703
5705
  }
5706
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
5707
+ 'functionCallingConfig',
5708
+ ]);
5709
+ if (fromFunctionCallingConfig != null) {
5710
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
5711
+ }
5704
5712
  return toObject;
5705
5713
  }
5706
5714
  function toolToMldev$3(fromObject) {
5707
5715
  const toObject = {};
5708
- const fromFunctionDeclarations = getValueByPath(fromObject, [
5709
- 'functionDeclarations',
5710
- ]);
5711
- if (fromFunctionDeclarations != null) {
5712
- let transformedList = fromFunctionDeclarations;
5713
- if (Array.isArray(transformedList)) {
5714
- transformedList = transformedList.map((item) => {
5715
- return item;
5716
- });
5717
- }
5718
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
5719
- }
5720
5716
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5721
5717
  throw new Error('retrieval parameter is not supported in Gemini API.');
5722
5718
  }
5723
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5724
- 'googleSearchRetrieval',
5725
- ]);
5726
- if (fromGoogleSearchRetrieval != null) {
5727
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5728
- }
5729
5719
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5730
5720
  if (fromComputerUse != null) {
5731
5721
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5743,6 +5733,18 @@ function toolToMldev$3(fromObject) {
5743
5733
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5744
5734
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5745
5735
  }
5736
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
5737
+ 'functionDeclarations',
5738
+ ]);
5739
+ if (fromFunctionDeclarations != null) {
5740
+ let transformedList = fromFunctionDeclarations;
5741
+ if (Array.isArray(transformedList)) {
5742
+ transformedList = transformedList.map((item) => {
5743
+ return item;
5744
+ });
5745
+ }
5746
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
5747
+ }
5746
5748
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5747
5749
  if (fromGoogleMaps != null) {
5748
5750
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
@@ -5751,6 +5753,12 @@ function toolToMldev$3(fromObject) {
5751
5753
  if (fromGoogleSearch != null) {
5752
5754
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5753
5755
  }
5756
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5757
+ 'googleSearchRetrieval',
5758
+ ]);
5759
+ if (fromGoogleSearchRetrieval != null) {
5760
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5761
+ }
5754
5762
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5755
5763
  if (fromUrlContext != null) {
5756
5764
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5759,28 +5767,10 @@ function toolToMldev$3(fromObject) {
5759
5767
  }
5760
5768
  function toolToVertex$2(fromObject) {
5761
5769
  const toObject = {};
5762
- const fromFunctionDeclarations = getValueByPath(fromObject, [
5763
- 'functionDeclarations',
5764
- ]);
5765
- if (fromFunctionDeclarations != null) {
5766
- let transformedList = fromFunctionDeclarations;
5767
- if (Array.isArray(transformedList)) {
5768
- transformedList = transformedList.map((item) => {
5769
- return functionDeclarationToVertex$2(item);
5770
- });
5771
- }
5772
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
5773
- }
5774
5770
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
5775
5771
  if (fromRetrieval != null) {
5776
5772
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
5777
5773
  }
5778
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5779
- 'googleSearchRetrieval',
5780
- ]);
5781
- if (fromGoogleSearchRetrieval != null) {
5782
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5783
- }
5784
5774
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5785
5775
  if (fromComputerUse != null) {
5786
5776
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5800,6 +5790,18 @@ function toolToVertex$2(fromObject) {
5800
5790
  if (fromEnterpriseWebSearch != null) {
5801
5791
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5802
5792
  }
5793
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
5794
+ 'functionDeclarations',
5795
+ ]);
5796
+ if (fromFunctionDeclarations != null) {
5797
+ let transformedList = fromFunctionDeclarations;
5798
+ if (Array.isArray(transformedList)) {
5799
+ transformedList = transformedList.map((item) => {
5800
+ return functionDeclarationToVertex$2(item);
5801
+ });
5802
+ }
5803
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
5804
+ }
5803
5805
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5804
5806
  if (fromGoogleMaps != null) {
5805
5807
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -5808,6 +5810,12 @@ function toolToVertex$2(fromObject) {
5808
5810
  if (fromGoogleSearch != null) {
5809
5811
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5810
5812
  }
5813
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5814
+ 'googleSearchRetrieval',
5815
+ ]);
5816
+ if (fromGoogleSearchRetrieval != null) {
5817
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5818
+ }
5811
5819
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5812
5820
  if (fromUrlContext != null) {
5813
5821
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -6895,7 +6903,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6895
6903
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6896
6904
  const USER_AGENT_HEADER = 'User-Agent';
6897
6905
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6898
- const SDK_VERSION = '1.34.0'; // x-release-please-version
6906
+ const SDK_VERSION = '1.36.0'; // x-release-please-version
6899
6907
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6900
6908
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6901
6909
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10605,9 +10613,6 @@ function functionCallToMldev$2(fromObject) {
10605
10613
  }
10606
10614
  function functionDeclarationToVertex$1(fromObject) {
10607
10615
  const toObject = {};
10608
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
10609
- throw new Error('behavior parameter is not supported in Vertex AI.');
10610
- }
10611
10616
  const fromDescription = getValueByPath(fromObject, ['description']);
10612
10617
  if (fromDescription != null) {
10613
10618
  setValueByPath(toObject, ['description'], fromDescription);
@@ -10636,6 +10641,9 @@ function functionDeclarationToVertex$1(fromObject) {
10636
10641
  if (fromResponseJsonSchema != null) {
10637
10642
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
10638
10643
  }
10644
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
10645
+ throw new Error('behavior parameter is not supported in Vertex AI.');
10646
+ }
10639
10647
  return toObject;
10640
10648
  }
10641
10649
  function generationConfigToVertex$1(fromObject) {
@@ -11202,6 +11210,12 @@ function liveServerMessageFromVertex(fromObject) {
11202
11210
  if (fromVoiceActivityDetectionSignal != null) {
11203
11211
  setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
11204
11212
  }
11213
+ const fromVoiceActivity = getValueByPath(fromObject, [
11214
+ 'voiceActivity',
11215
+ ]);
11216
+ if (fromVoiceActivity != null) {
11217
+ setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
11218
+ }
11205
11219
  return toObject;
11206
11220
  }
11207
11221
  function partToMldev$2(fromObject) {
@@ -11277,27 +11291,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
11277
11291
  }
11278
11292
  function toolToMldev$2(fromObject) {
11279
11293
  const toObject = {};
11280
- const fromFunctionDeclarations = getValueByPath(fromObject, [
11281
- 'functionDeclarations',
11282
- ]);
11283
- if (fromFunctionDeclarations != null) {
11284
- let transformedList = fromFunctionDeclarations;
11285
- if (Array.isArray(transformedList)) {
11286
- transformedList = transformedList.map((item) => {
11287
- return item;
11288
- });
11289
- }
11290
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
11291
- }
11292
11294
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
11293
11295
  throw new Error('retrieval parameter is not supported in Gemini API.');
11294
11296
  }
11295
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11296
- 'googleSearchRetrieval',
11297
- ]);
11298
- if (fromGoogleSearchRetrieval != null) {
11299
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11300
- }
11301
11297
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11302
11298
  if (fromComputerUse != null) {
11303
11299
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -11315,6 +11311,18 @@ function toolToMldev$2(fromObject) {
11315
11311
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
11316
11312
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
11317
11313
  }
11314
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
11315
+ 'functionDeclarations',
11316
+ ]);
11317
+ if (fromFunctionDeclarations != null) {
11318
+ let transformedList = fromFunctionDeclarations;
11319
+ if (Array.isArray(transformedList)) {
11320
+ transformedList = transformedList.map((item) => {
11321
+ return item;
11322
+ });
11323
+ }
11324
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
11325
+ }
11318
11326
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11319
11327
  if (fromGoogleMaps != null) {
11320
11328
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
@@ -11323,6 +11331,12 @@ function toolToMldev$2(fromObject) {
11323
11331
  if (fromGoogleSearch != null) {
11324
11332
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
11325
11333
  }
11334
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11335
+ 'googleSearchRetrieval',
11336
+ ]);
11337
+ if (fromGoogleSearchRetrieval != null) {
11338
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11339
+ }
11326
11340
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11327
11341
  if (fromUrlContext != null) {
11328
11342
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11331,28 +11345,10 @@ function toolToMldev$2(fromObject) {
11331
11345
  }
11332
11346
  function toolToVertex$1(fromObject) {
11333
11347
  const toObject = {};
11334
- const fromFunctionDeclarations = getValueByPath(fromObject, [
11335
- 'functionDeclarations',
11336
- ]);
11337
- if (fromFunctionDeclarations != null) {
11338
- let transformedList = fromFunctionDeclarations;
11339
- if (Array.isArray(transformedList)) {
11340
- transformedList = transformedList.map((item) => {
11341
- return functionDeclarationToVertex$1(item);
11342
- });
11343
- }
11344
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
11345
- }
11346
11348
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
11347
11349
  if (fromRetrieval != null) {
11348
11350
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
11349
11351
  }
11350
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11351
- 'googleSearchRetrieval',
11352
- ]);
11353
- if (fromGoogleSearchRetrieval != null) {
11354
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11355
- }
11356
11352
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11357
11353
  if (fromComputerUse != null) {
11358
11354
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -11372,6 +11368,18 @@ function toolToVertex$1(fromObject) {
11372
11368
  if (fromEnterpriseWebSearch != null) {
11373
11369
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
11374
11370
  }
11371
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
11372
+ 'functionDeclarations',
11373
+ ]);
11374
+ if (fromFunctionDeclarations != null) {
11375
+ let transformedList = fromFunctionDeclarations;
11376
+ if (Array.isArray(transformedList)) {
11377
+ transformedList = transformedList.map((item) => {
11378
+ return functionDeclarationToVertex$1(item);
11379
+ });
11380
+ }
11381
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
11382
+ }
11375
11383
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11376
11384
  if (fromGoogleMaps != null) {
11377
11385
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -11380,6 +11388,12 @@ function toolToVertex$1(fromObject) {
11380
11388
  if (fromGoogleSearch != null) {
11381
11389
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
11382
11390
  }
11391
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
11392
+ 'googleSearchRetrieval',
11393
+ ]);
11394
+ if (fromGoogleSearchRetrieval != null) {
11395
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
11396
+ }
11383
11397
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
11384
11398
  if (fromUrlContext != null) {
11385
11399
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11478,6 +11492,14 @@ function usageMetadataFromVertex(fromObject) {
11478
11492
  }
11479
11493
  return toObject;
11480
11494
  }
11495
+ function voiceActivityFromVertex(fromObject) {
11496
+ const toObject = {};
11497
+ const fromVoiceActivityType = getValueByPath(fromObject, ['type']);
11498
+ if (fromVoiceActivityType != null) {
11499
+ setValueByPath(toObject, ['voiceActivityType'], fromVoiceActivityType);
11500
+ }
11501
+ return toObject;
11502
+ }
11481
11503
 
11482
11504
  /**
11483
11505
  * @license
@@ -12162,16 +12184,16 @@ function functionCallToMldev$1(fromObject) {
12162
12184
  }
12163
12185
  function functionCallingConfigToMldev(fromObject) {
12164
12186
  const toObject = {};
12165
- const fromMode = getValueByPath(fromObject, ['mode']);
12166
- if (fromMode != null) {
12167
- setValueByPath(toObject, ['mode'], fromMode);
12168
- }
12169
12187
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
12170
12188
  'allowedFunctionNames',
12171
12189
  ]);
12172
12190
  if (fromAllowedFunctionNames != null) {
12173
12191
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
12174
12192
  }
12193
+ const fromMode = getValueByPath(fromObject, ['mode']);
12194
+ if (fromMode != null) {
12195
+ setValueByPath(toObject, ['mode'], fromMode);
12196
+ }
12175
12197
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
12176
12198
  undefined) {
12177
12199
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -12180,9 +12202,6 @@ function functionCallingConfigToMldev(fromObject) {
12180
12202
  }
12181
12203
  function functionDeclarationToVertex(fromObject) {
12182
12204
  const toObject = {};
12183
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
12184
- throw new Error('behavior parameter is not supported in Vertex AI.');
12185
- }
12186
12205
  const fromDescription = getValueByPath(fromObject, ['description']);
12187
12206
  if (fromDescription != null) {
12188
12207
  setValueByPath(toObject, ['description'], fromDescription);
@@ -12211,6 +12230,9 @@ function functionDeclarationToVertex(fromObject) {
12211
12230
  if (fromResponseJsonSchema != null) {
12212
12231
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
12213
12232
  }
12233
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
12234
+ throw new Error('behavior parameter is not supported in Vertex AI.');
12235
+ }
12214
12236
  return toObject;
12215
12237
  }
12216
12238
  function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
@@ -13548,6 +13570,9 @@ function imageConfigToMldev(fromObject) {
13548
13570
  if (fromImageSize != null) {
13549
13571
  setValueByPath(toObject, ['imageSize'], fromImageSize);
13550
13572
  }
13573
+ if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
13574
+ throw new Error('personGeneration parameter is not supported in Gemini API.');
13575
+ }
13551
13576
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
13552
13577
  throw new Error('outputMimeType parameter is not supported in Gemini API.');
13553
13578
  }
@@ -13567,6 +13592,12 @@ function imageConfigToVertex(fromObject) {
13567
13592
  if (fromImageSize != null) {
13568
13593
  setValueByPath(toObject, ['imageSize'], fromImageSize);
13569
13594
  }
13595
+ const fromPersonGeneration = getValueByPath(fromObject, [
13596
+ 'personGeneration',
13597
+ ]);
13598
+ if (fromPersonGeneration != null) {
13599
+ setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
13600
+ }
13570
13601
  const fromOutputMimeType = getValueByPath(fromObject, [
13571
13602
  'outputMimeType',
13572
13603
  ]);
@@ -14267,43 +14298,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
14267
14298
  }
14268
14299
  function toolConfigToMldev(fromObject) {
14269
14300
  const toObject = {};
14270
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
14271
- 'functionCallingConfig',
14272
- ]);
14273
- if (fromFunctionCallingConfig != null) {
14274
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
14275
- }
14276
14301
  const fromRetrievalConfig = getValueByPath(fromObject, [
14277
14302
  'retrievalConfig',
14278
14303
  ]);
14279
14304
  if (fromRetrievalConfig != null) {
14280
14305
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
14281
14306
  }
14307
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
14308
+ 'functionCallingConfig',
14309
+ ]);
14310
+ if (fromFunctionCallingConfig != null) {
14311
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
14312
+ }
14282
14313
  return toObject;
14283
14314
  }
14284
14315
  function toolToMldev$1(fromObject) {
14285
14316
  const toObject = {};
14286
- const fromFunctionDeclarations = getValueByPath(fromObject, [
14287
- 'functionDeclarations',
14288
- ]);
14289
- if (fromFunctionDeclarations != null) {
14290
- let transformedList = fromFunctionDeclarations;
14291
- if (Array.isArray(transformedList)) {
14292
- transformedList = transformedList.map((item) => {
14293
- return item;
14294
- });
14295
- }
14296
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
14297
- }
14298
14317
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
14299
14318
  throw new Error('retrieval parameter is not supported in Gemini API.');
14300
14319
  }
14301
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14302
- 'googleSearchRetrieval',
14303
- ]);
14304
- if (fromGoogleSearchRetrieval != null) {
14305
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14306
- }
14307
14320
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
14308
14321
  if (fromComputerUse != null) {
14309
14322
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -14321,6 +14334,18 @@ function toolToMldev$1(fromObject) {
14321
14334
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
14322
14335
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
14323
14336
  }
14337
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
14338
+ 'functionDeclarations',
14339
+ ]);
14340
+ if (fromFunctionDeclarations != null) {
14341
+ let transformedList = fromFunctionDeclarations;
14342
+ if (Array.isArray(transformedList)) {
14343
+ transformedList = transformedList.map((item) => {
14344
+ return item;
14345
+ });
14346
+ }
14347
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
14348
+ }
14324
14349
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14325
14350
  if (fromGoogleMaps != null) {
14326
14351
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
@@ -14329,6 +14354,12 @@ function toolToMldev$1(fromObject) {
14329
14354
  if (fromGoogleSearch != null) {
14330
14355
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
14331
14356
  }
14357
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14358
+ 'googleSearchRetrieval',
14359
+ ]);
14360
+ if (fromGoogleSearchRetrieval != null) {
14361
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14362
+ }
14332
14363
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14333
14364
  if (fromUrlContext != null) {
14334
14365
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -14337,28 +14368,10 @@ function toolToMldev$1(fromObject) {
14337
14368
  }
14338
14369
  function toolToVertex(fromObject) {
14339
14370
  const toObject = {};
14340
- const fromFunctionDeclarations = getValueByPath(fromObject, [
14341
- 'functionDeclarations',
14342
- ]);
14343
- if (fromFunctionDeclarations != null) {
14344
- let transformedList = fromFunctionDeclarations;
14345
- if (Array.isArray(transformedList)) {
14346
- transformedList = transformedList.map((item) => {
14347
- return functionDeclarationToVertex(item);
14348
- });
14349
- }
14350
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
14351
- }
14352
14371
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
14353
14372
  if (fromRetrieval != null) {
14354
14373
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
14355
14374
  }
14356
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14357
- 'googleSearchRetrieval',
14358
- ]);
14359
- if (fromGoogleSearchRetrieval != null) {
14360
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14361
- }
14362
14375
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
14363
14376
  if (fromComputerUse != null) {
14364
14377
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -14378,6 +14391,18 @@ function toolToVertex(fromObject) {
14378
14391
  if (fromEnterpriseWebSearch != null) {
14379
14392
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
14380
14393
  }
14394
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
14395
+ 'functionDeclarations',
14396
+ ]);
14397
+ if (fromFunctionDeclarations != null) {
14398
+ let transformedList = fromFunctionDeclarations;
14399
+ if (Array.isArray(transformedList)) {
14400
+ transformedList = transformedList.map((item) => {
14401
+ return functionDeclarationToVertex(item);
14402
+ });
14403
+ }
14404
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
14405
+ }
14381
14406
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14382
14407
  if (fromGoogleMaps != null) {
14383
14408
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -14386,6 +14411,12 @@ function toolToVertex(fromObject) {
14386
14411
  if (fromGoogleSearch != null) {
14387
14412
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
14388
14413
  }
14414
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14415
+ 'googleSearchRetrieval',
14416
+ ]);
14417
+ if (fromGoogleSearchRetrieval != null) {
14418
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14419
+ }
14389
14420
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14390
14421
  if (fromUrlContext != null) {
14391
14422
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -15791,7 +15822,7 @@ class Models extends BaseModule {
15791
15822
  * @example
15792
15823
  * ```ts
15793
15824
  * const response = await client.models.generateImages({
15794
- * model: 'imagen-3.0-generate-002',
15825
+ * model: 'imagen-4.0-generate-001',
15795
15826
  * prompt: 'Robot holding a red skateboard',
15796
15827
  * config: {
15797
15828
  * numberOfImages: 1,
@@ -15900,7 +15931,7 @@ class Models extends BaseModule {
15900
15931
  * @example
15901
15932
  * ```ts
15902
15933
  * const response = await client.models.upscaleImage({
15903
- * model: 'imagen-3.0-generate-002',
15934
+ * model: 'imagen-4.0-upscale-preview',
15904
15935
  * image: image,
15905
15936
  * upscaleFactor: 'x2',
15906
15937
  * config: {
@@ -16562,7 +16593,7 @@ class Models extends BaseModule {
16562
16593
  * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
16563
16594
  *
16564
16595
  * const response2 = await ai.models.recontextImage({
16565
- * model: 'virtual-try-on-preview-08-04',
16596
+ * model: 'virtual-try-on-001',
16566
16597
  * source: {
16567
16598
  * personImage: personImage,
16568
16599
  * productImages: [productImage],
@@ -17644,27 +17675,9 @@ function sessionResumptionConfigToMldev(fromObject) {
17644
17675
  }
17645
17676
  function toolToMldev(fromObject) {
17646
17677
  const toObject = {};
17647
- const fromFunctionDeclarations = getValueByPath(fromObject, [
17648
- 'functionDeclarations',
17649
- ]);
17650
- if (fromFunctionDeclarations != null) {
17651
- let transformedList = fromFunctionDeclarations;
17652
- if (Array.isArray(transformedList)) {
17653
- transformedList = transformedList.map((item) => {
17654
- return item;
17655
- });
17656
- }
17657
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
17658
- }
17659
17678
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
17660
17679
  throw new Error('retrieval parameter is not supported in Gemini API.');
17661
17680
  }
17662
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
17663
- 'googleSearchRetrieval',
17664
- ]);
17665
- if (fromGoogleSearchRetrieval != null) {
17666
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
17667
- }
17668
17681
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
17669
17682
  if (fromComputerUse != null) {
17670
17683
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -17682,6 +17695,18 @@ function toolToMldev(fromObject) {
17682
17695
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
17683
17696
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
17684
17697
  }
17698
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
17699
+ 'functionDeclarations',
17700
+ ]);
17701
+ if (fromFunctionDeclarations != null) {
17702
+ let transformedList = fromFunctionDeclarations;
17703
+ if (Array.isArray(transformedList)) {
17704
+ transformedList = transformedList.map((item) => {
17705
+ return item;
17706
+ });
17707
+ }
17708
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
17709
+ }
17685
17710
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
17686
17711
  if (fromGoogleMaps != null) {
17687
17712
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
@@ -17690,6 +17715,12 @@ function toolToMldev(fromObject) {
17690
17715
  if (fromGoogleSearch != null) {
17691
17716
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
17692
17717
  }
17718
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
17719
+ 'googleSearchRetrieval',
17720
+ ]);
17721
+ if (fromGoogleSearchRetrieval != null) {
17722
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
17723
+ }
17693
17724
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
17694
17725
  if (fromUrlContext != null) {
17695
17726
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -19157,5 +19188,5 @@ class GoogleGenAI {
19157
19188
  }
19158
19189
  }
19159
19190
 
19160
- 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, 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, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, RawReferenceImage, RecontextImageResponse, ReplayResponse, 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, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
19191
+ 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, 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, RawReferenceImage, RecontextImageResponse, ReplayResponse, 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 };
19161
19192
  //# sourceMappingURL=index.mjs.map