@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.
@@ -681,18 +681,6 @@ var Type;
681
681
  */
682
682
  Type["NULL"] = "NULL";
683
683
  })(Type || (Type = {}));
684
- /** The mode of the predictor to be used in dynamic retrieval. */
685
- var Mode;
686
- (function (Mode) {
687
- /**
688
- * Always trigger retrieval.
689
- */
690
- Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
691
- /**
692
- * Run retrieval only when system decides it is necessary.
693
- */
694
- Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
695
- })(Mode || (Mode = {}));
696
684
  /** The API spec that the external API implements. This enum is not supported in Gemini API. */
697
685
  var ApiSpec;
698
686
  (function (ApiSpec) {
@@ -795,6 +783,58 @@ var PhishBlockThreshold;
795
783
  */
796
784
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
797
785
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
786
+ /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
787
+ var Behavior;
788
+ (function (Behavior) {
789
+ /**
790
+ * This value is unused.
791
+ */
792
+ Behavior["UNSPECIFIED"] = "UNSPECIFIED";
793
+ /**
794
+ * If set, the system will wait to receive the function response before continuing the conversation.
795
+ */
796
+ Behavior["BLOCKING"] = "BLOCKING";
797
+ /**
798
+ * 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.
799
+ */
800
+ Behavior["NON_BLOCKING"] = "NON_BLOCKING";
801
+ })(Behavior || (Behavior = {}));
802
+ /** The mode of the predictor to be used in dynamic retrieval. */
803
+ var DynamicRetrievalConfigMode;
804
+ (function (DynamicRetrievalConfigMode) {
805
+ /**
806
+ * Always trigger retrieval.
807
+ */
808
+ DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
809
+ /**
810
+ * Run retrieval only when system decides it is necessary.
811
+ */
812
+ DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
813
+ })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
814
+ /** Function calling mode. */
815
+ var FunctionCallingConfigMode;
816
+ (function (FunctionCallingConfigMode) {
817
+ /**
818
+ * Unspecified function calling mode. This value should not be used.
819
+ */
820
+ FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
821
+ /**
822
+ * Default model behavior, model decides to predict either function calls or natural language response.
823
+ */
824
+ FunctionCallingConfigMode["AUTO"] = "AUTO";
825
+ /**
826
+ * 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".
827
+ */
828
+ FunctionCallingConfigMode["ANY"] = "ANY";
829
+ /**
830
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
831
+ */
832
+ FunctionCallingConfigMode["NONE"] = "NONE";
833
+ /**
834
+ * 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".
835
+ */
836
+ FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
837
+ })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
798
838
  /** The number of thoughts tokens that the model should generate. */
799
839
  var ThinkingLevel;
800
840
  (function (ThinkingLevel) {
@@ -1301,34 +1341,6 @@ var FeatureSelectionPreference;
1301
1341
  FeatureSelectionPreference["BALANCED"] = "BALANCED";
1302
1342
  FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1303
1343
  })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1304
- /** Defines the function behavior. Defaults to `BLOCKING`. */
1305
- var Behavior;
1306
- (function (Behavior) {
1307
- /**
1308
- * This value is unused.
1309
- */
1310
- Behavior["UNSPECIFIED"] = "UNSPECIFIED";
1311
- /**
1312
- * If set, the system will wait to receive the function response before continuing the conversation.
1313
- */
1314
- Behavior["BLOCKING"] = "BLOCKING";
1315
- /**
1316
- * 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.
1317
- */
1318
- Behavior["NON_BLOCKING"] = "NON_BLOCKING";
1319
- })(Behavior || (Behavior = {}));
1320
- /** Config for the dynamic retrieval config mode. */
1321
- var DynamicRetrievalConfigMode;
1322
- (function (DynamicRetrievalConfigMode) {
1323
- /**
1324
- * Always trigger retrieval.
1325
- */
1326
- DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
1327
- /**
1328
- * Run retrieval only when system decides it is necessary.
1329
- */
1330
- DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
1331
- })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
1332
1344
  /** The environment being operated. */
1333
1345
  var Environment;
1334
1346
  (function (Environment) {
@@ -1341,30 +1353,6 @@ var Environment;
1341
1353
  */
1342
1354
  Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1343
1355
  })(Environment || (Environment = {}));
1344
- /** Config for the function calling config mode. */
1345
- var FunctionCallingConfigMode;
1346
- (function (FunctionCallingConfigMode) {
1347
- /**
1348
- * The function calling config mode is unspecified. Should not be used.
1349
- */
1350
- FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
1351
- /**
1352
- * Default model behavior, model decides to predict either function calls or natural language response.
1353
- */
1354
- FunctionCallingConfigMode["AUTO"] = "AUTO";
1355
- /**
1356
- * 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".
1357
- */
1358
- FunctionCallingConfigMode["ANY"] = "ANY";
1359
- /**
1360
- * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
1361
- */
1362
- FunctionCallingConfigMode["NONE"] = "NONE";
1363
- /**
1364
- * 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".
1365
- */
1366
- FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
1367
- })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
1368
1356
  /** Enum that controls the safety filter level for objectionable content. */
1369
1357
  var SafetyFilterLevel;
1370
1358
  (function (SafetyFilterLevel) {
@@ -1561,6 +1549,7 @@ var FileSource;
1561
1549
  FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
1562
1550
  FileSource["UPLOADED"] = "UPLOADED";
1563
1551
  FileSource["GENERATED"] = "GENERATED";
1552
+ FileSource["REGISTERED"] = "REGISTERED";
1564
1553
  })(FileSource || (FileSource = {}));
1565
1554
  /** The reason why the turn is complete. */
1566
1555
  var TurnCompleteReason;
@@ -1626,6 +1615,22 @@ var VadSignalType;
1626
1615
  */
1627
1616
  VadSignalType["VAD_SIGNAL_TYPE_EOS"] = "VAD_SIGNAL_TYPE_EOS";
1628
1617
  })(VadSignalType || (VadSignalType = {}));
1618
+ /** The type of the voice activity signal. */
1619
+ var VoiceActivityType;
1620
+ (function (VoiceActivityType) {
1621
+ /**
1622
+ * The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
1623
+ */
1624
+ VoiceActivityType["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
1625
+ /**
1626
+ * Start of sentence signal.
1627
+ */
1628
+ VoiceActivityType["ACTIVITY_START"] = "ACTIVITY_START";
1629
+ /**
1630
+ * End of sentence signal.
1631
+ */
1632
+ VoiceActivityType["ACTIVITY_END"] = "ACTIVITY_END";
1633
+ })(VoiceActivityType || (VoiceActivityType = {}));
1629
1634
  /** Start of speech sensitivity. */
1630
1635
  var StartSensitivity;
1631
1636
  (function (StartSensitivity) {
@@ -3990,16 +3995,16 @@ function functionCallToMldev$4(fromObject) {
3990
3995
  }
3991
3996
  function functionCallingConfigToMldev$2(fromObject) {
3992
3997
  const toObject = {};
3993
- const fromMode = getValueByPath(fromObject, ['mode']);
3994
- if (fromMode != null) {
3995
- setValueByPath(toObject, ['mode'], fromMode);
3996
- }
3997
3998
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
3998
3999
  'allowedFunctionNames',
3999
4000
  ]);
4000
4001
  if (fromAllowedFunctionNames != null) {
4001
4002
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
4002
4003
  }
4004
+ const fromMode = getValueByPath(fromObject, ['mode']);
4005
+ if (fromMode != null) {
4006
+ setValueByPath(toObject, ['mode'], fromMode);
4007
+ }
4003
4008
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
4004
4009
  undefined) {
4005
4010
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -4259,6 +4264,9 @@ function imageConfigToMldev$1(fromObject) {
4259
4264
  if (fromImageSize != null) {
4260
4265
  setValueByPath(toObject, ['imageSize'], fromImageSize);
4261
4266
  }
4267
+ if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
4268
+ throw new Error('personGeneration parameter is not supported in Gemini API.');
4269
+ }
4262
4270
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
4263
4271
  throw new Error('outputMimeType parameter is not supported in Gemini API.');
4264
4272
  }
@@ -4484,43 +4492,25 @@ function safetySettingToMldev$1(fromObject) {
4484
4492
  }
4485
4493
  function toolConfigToMldev$2(fromObject) {
4486
4494
  const toObject = {};
4487
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
4488
- 'functionCallingConfig',
4489
- ]);
4490
- if (fromFunctionCallingConfig != null) {
4491
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4492
- }
4493
4495
  const fromRetrievalConfig = getValueByPath(fromObject, [
4494
4496
  'retrievalConfig',
4495
4497
  ]);
4496
4498
  if (fromRetrievalConfig != null) {
4497
4499
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
4498
4500
  }
4501
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
4502
+ 'functionCallingConfig',
4503
+ ]);
4504
+ if (fromFunctionCallingConfig != null) {
4505
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4506
+ }
4499
4507
  return toObject;
4500
4508
  }
4501
4509
  function toolToMldev$4(fromObject) {
4502
4510
  const toObject = {};
4503
- const fromFunctionDeclarations = getValueByPath(fromObject, [
4504
- 'functionDeclarations',
4505
- ]);
4506
- if (fromFunctionDeclarations != null) {
4507
- let transformedList = fromFunctionDeclarations;
4508
- if (Array.isArray(transformedList)) {
4509
- transformedList = transformedList.map((item) => {
4510
- return item;
4511
- });
4512
- }
4513
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
4514
- }
4515
4511
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
4516
4512
  throw new Error('retrieval parameter is not supported in Gemini API.');
4517
4513
  }
4518
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4519
- 'googleSearchRetrieval',
4520
- ]);
4521
- if (fromGoogleSearchRetrieval != null) {
4522
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4523
- }
4524
4514
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4525
4515
  if (fromComputerUse != null) {
4526
4516
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -4538,6 +4528,18 @@ function toolToMldev$4(fromObject) {
4538
4528
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4539
4529
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4540
4530
  }
4531
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
4532
+ 'functionDeclarations',
4533
+ ]);
4534
+ if (fromFunctionDeclarations != null) {
4535
+ let transformedList = fromFunctionDeclarations;
4536
+ if (Array.isArray(transformedList)) {
4537
+ transformedList = transformedList.map((item) => {
4538
+ return item;
4539
+ });
4540
+ }
4541
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
4542
+ }
4541
4543
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4542
4544
  if (fromGoogleMaps != null) {
4543
4545
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
@@ -4546,6 +4548,12 @@ function toolToMldev$4(fromObject) {
4546
4548
  if (fromGoogleSearch != null) {
4547
4549
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4548
4550
  }
4551
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4552
+ 'googleSearchRetrieval',
4553
+ ]);
4554
+ if (fromGoogleSearchRetrieval != null) {
4555
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4556
+ }
4549
4557
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4550
4558
  if (fromUrlContext != null) {
4551
4559
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5476,16 +5484,16 @@ function functionCallToMldev$3(fromObject) {
5476
5484
  }
5477
5485
  function functionCallingConfigToMldev$1(fromObject) {
5478
5486
  const toObject = {};
5479
- const fromMode = getValueByPath(fromObject, ['mode']);
5480
- if (fromMode != null) {
5481
- setValueByPath(toObject, ['mode'], fromMode);
5482
- }
5483
5487
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
5484
5488
  'allowedFunctionNames',
5485
5489
  ]);
5486
5490
  if (fromAllowedFunctionNames != null) {
5487
5491
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
5488
5492
  }
5493
+ const fromMode = getValueByPath(fromObject, ['mode']);
5494
+ if (fromMode != null) {
5495
+ setValueByPath(toObject, ['mode'], fromMode);
5496
+ }
5489
5497
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
5490
5498
  undefined) {
5491
5499
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -5494,9 +5502,6 @@ function functionCallingConfigToMldev$1(fromObject) {
5494
5502
  }
5495
5503
  function functionDeclarationToVertex$2(fromObject) {
5496
5504
  const toObject = {};
5497
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
5498
- throw new Error('behavior parameter is not supported in Vertex AI.');
5499
- }
5500
5505
  const fromDescription = getValueByPath(fromObject, ['description']);
5501
5506
  if (fromDescription != null) {
5502
5507
  setValueByPath(toObject, ['description'], fromDescription);
@@ -5525,6 +5530,9 @@ function functionDeclarationToVertex$2(fromObject) {
5525
5530
  if (fromResponseJsonSchema != null) {
5526
5531
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
5527
5532
  }
5533
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
5534
+ throw new Error('behavior parameter is not supported in Vertex AI.');
5535
+ }
5528
5536
  return toObject;
5529
5537
  }
5530
5538
  function getCachedContentParametersToMldev(apiClient, fromObject) {
@@ -5728,43 +5736,25 @@ function partToMldev$3(fromObject) {
5728
5736
  }
5729
5737
  function toolConfigToMldev$1(fromObject) {
5730
5738
  const toObject = {};
5731
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
5732
- 'functionCallingConfig',
5733
- ]);
5734
- if (fromFunctionCallingConfig != null) {
5735
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
5736
- }
5737
5739
  const fromRetrievalConfig = getValueByPath(fromObject, [
5738
5740
  'retrievalConfig',
5739
5741
  ]);
5740
5742
  if (fromRetrievalConfig != null) {
5741
5743
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
5742
5744
  }
5745
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
5746
+ 'functionCallingConfig',
5747
+ ]);
5748
+ if (fromFunctionCallingConfig != null) {
5749
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
5750
+ }
5743
5751
  return toObject;
5744
5752
  }
5745
5753
  function toolToMldev$3(fromObject) {
5746
5754
  const toObject = {};
5747
- const fromFunctionDeclarations = getValueByPath(fromObject, [
5748
- 'functionDeclarations',
5749
- ]);
5750
- if (fromFunctionDeclarations != null) {
5751
- let transformedList = fromFunctionDeclarations;
5752
- if (Array.isArray(transformedList)) {
5753
- transformedList = transformedList.map((item) => {
5754
- return item;
5755
- });
5756
- }
5757
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
5758
- }
5759
5755
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5760
5756
  throw new Error('retrieval parameter is not supported in Gemini API.');
5761
5757
  }
5762
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5763
- 'googleSearchRetrieval',
5764
- ]);
5765
- if (fromGoogleSearchRetrieval != null) {
5766
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5767
- }
5768
5758
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5769
5759
  if (fromComputerUse != null) {
5770
5760
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5782,6 +5772,18 @@ function toolToMldev$3(fromObject) {
5782
5772
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5783
5773
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5784
5774
  }
5775
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
5776
+ 'functionDeclarations',
5777
+ ]);
5778
+ if (fromFunctionDeclarations != null) {
5779
+ let transformedList = fromFunctionDeclarations;
5780
+ if (Array.isArray(transformedList)) {
5781
+ transformedList = transformedList.map((item) => {
5782
+ return item;
5783
+ });
5784
+ }
5785
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
5786
+ }
5785
5787
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5786
5788
  if (fromGoogleMaps != null) {
5787
5789
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
@@ -5790,6 +5792,12 @@ function toolToMldev$3(fromObject) {
5790
5792
  if (fromGoogleSearch != null) {
5791
5793
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5792
5794
  }
5795
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5796
+ 'googleSearchRetrieval',
5797
+ ]);
5798
+ if (fromGoogleSearchRetrieval != null) {
5799
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5800
+ }
5793
5801
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5794
5802
  if (fromUrlContext != null) {
5795
5803
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -5798,28 +5806,10 @@ function toolToMldev$3(fromObject) {
5798
5806
  }
5799
5807
  function toolToVertex$2(fromObject) {
5800
5808
  const toObject = {};
5801
- const fromFunctionDeclarations = getValueByPath(fromObject, [
5802
- 'functionDeclarations',
5803
- ]);
5804
- if (fromFunctionDeclarations != null) {
5805
- let transformedList = fromFunctionDeclarations;
5806
- if (Array.isArray(transformedList)) {
5807
- transformedList = transformedList.map((item) => {
5808
- return functionDeclarationToVertex$2(item);
5809
- });
5810
- }
5811
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
5812
- }
5813
5809
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
5814
5810
  if (fromRetrieval != null) {
5815
5811
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
5816
5812
  }
5817
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5818
- 'googleSearchRetrieval',
5819
- ]);
5820
- if (fromGoogleSearchRetrieval != null) {
5821
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5822
- }
5823
5813
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5824
5814
  if (fromComputerUse != null) {
5825
5815
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5839,6 +5829,18 @@ function toolToVertex$2(fromObject) {
5839
5829
  if (fromEnterpriseWebSearch != null) {
5840
5830
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5841
5831
  }
5832
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
5833
+ 'functionDeclarations',
5834
+ ]);
5835
+ if (fromFunctionDeclarations != null) {
5836
+ let transformedList = fromFunctionDeclarations;
5837
+ if (Array.isArray(transformedList)) {
5838
+ transformedList = transformedList.map((item) => {
5839
+ return functionDeclarationToVertex$2(item);
5840
+ });
5841
+ }
5842
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
5843
+ }
5842
5844
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5843
5845
  if (fromGoogleMaps != null) {
5844
5846
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -5847,6 +5849,12 @@ function toolToVertex$2(fromObject) {
5847
5849
  if (fromGoogleSearch != null) {
5848
5850
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5849
5851
  }
5852
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5853
+ 'googleSearchRetrieval',
5854
+ ]);
5855
+ if (fromGoogleSearchRetrieval != null) {
5856
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5857
+ }
5850
5858
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5851
5859
  if (fromUrlContext != null) {
5852
5860
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -7138,9 +7146,6 @@ function functionCallToMldev$2(fromObject) {
7138
7146
  }
7139
7147
  function functionDeclarationToVertex$1(fromObject) {
7140
7148
  const toObject = {};
7141
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7142
- throw new Error('behavior parameter is not supported in Vertex AI.');
7143
- }
7144
7149
  const fromDescription = getValueByPath(fromObject, ['description']);
7145
7150
  if (fromDescription != null) {
7146
7151
  setValueByPath(toObject, ['description'], fromDescription);
@@ -7169,6 +7174,9 @@ function functionDeclarationToVertex$1(fromObject) {
7169
7174
  if (fromResponseJsonSchema != null) {
7170
7175
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7171
7176
  }
7177
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7178
+ throw new Error('behavior parameter is not supported in Vertex AI.');
7179
+ }
7172
7180
  return toObject;
7173
7181
  }
7174
7182
  function generationConfigToVertex$1(fromObject) {
@@ -7735,6 +7743,12 @@ function liveServerMessageFromVertex(fromObject) {
7735
7743
  if (fromVoiceActivityDetectionSignal != null) {
7736
7744
  setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
7737
7745
  }
7746
+ const fromVoiceActivity = getValueByPath(fromObject, [
7747
+ 'voiceActivity',
7748
+ ]);
7749
+ if (fromVoiceActivity != null) {
7750
+ setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
7751
+ }
7738
7752
  return toObject;
7739
7753
  }
7740
7754
  function partToMldev$2(fromObject) {
@@ -7810,27 +7824,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7810
7824
  }
7811
7825
  function toolToMldev$2(fromObject) {
7812
7826
  const toObject = {};
7813
- const fromFunctionDeclarations = getValueByPath(fromObject, [
7814
- 'functionDeclarations',
7815
- ]);
7816
- if (fromFunctionDeclarations != null) {
7817
- let transformedList = fromFunctionDeclarations;
7818
- if (Array.isArray(transformedList)) {
7819
- transformedList = transformedList.map((item) => {
7820
- return item;
7821
- });
7822
- }
7823
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
7824
- }
7825
7827
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
7826
7828
  throw new Error('retrieval parameter is not supported in Gemini API.');
7827
7829
  }
7828
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7829
- 'googleSearchRetrieval',
7830
- ]);
7831
- if (fromGoogleSearchRetrieval != null) {
7832
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7833
- }
7834
7830
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7835
7831
  if (fromComputerUse != null) {
7836
7832
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7848,6 +7844,18 @@ function toolToMldev$2(fromObject) {
7848
7844
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7849
7845
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7850
7846
  }
7847
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
7848
+ 'functionDeclarations',
7849
+ ]);
7850
+ if (fromFunctionDeclarations != null) {
7851
+ let transformedList = fromFunctionDeclarations;
7852
+ if (Array.isArray(transformedList)) {
7853
+ transformedList = transformedList.map((item) => {
7854
+ return item;
7855
+ });
7856
+ }
7857
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
7858
+ }
7851
7859
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7852
7860
  if (fromGoogleMaps != null) {
7853
7861
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
@@ -7856,6 +7864,12 @@ function toolToMldev$2(fromObject) {
7856
7864
  if (fromGoogleSearch != null) {
7857
7865
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
7858
7866
  }
7867
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7868
+ 'googleSearchRetrieval',
7869
+ ]);
7870
+ if (fromGoogleSearchRetrieval != null) {
7871
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7872
+ }
7859
7873
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7860
7874
  if (fromUrlContext != null) {
7861
7875
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -7864,28 +7878,10 @@ function toolToMldev$2(fromObject) {
7864
7878
  }
7865
7879
  function toolToVertex$1(fromObject) {
7866
7880
  const toObject = {};
7867
- const fromFunctionDeclarations = getValueByPath(fromObject, [
7868
- 'functionDeclarations',
7869
- ]);
7870
- if (fromFunctionDeclarations != null) {
7871
- let transformedList = fromFunctionDeclarations;
7872
- if (Array.isArray(transformedList)) {
7873
- transformedList = transformedList.map((item) => {
7874
- return functionDeclarationToVertex$1(item);
7875
- });
7876
- }
7877
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
7878
- }
7879
7881
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7880
7882
  if (fromRetrieval != null) {
7881
7883
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
7882
7884
  }
7883
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7884
- 'googleSearchRetrieval',
7885
- ]);
7886
- if (fromGoogleSearchRetrieval != null) {
7887
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7888
- }
7889
7885
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7890
7886
  if (fromComputerUse != null) {
7891
7887
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7905,6 +7901,18 @@ function toolToVertex$1(fromObject) {
7905
7901
  if (fromEnterpriseWebSearch != null) {
7906
7902
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
7907
7903
  }
7904
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
7905
+ 'functionDeclarations',
7906
+ ]);
7907
+ if (fromFunctionDeclarations != null) {
7908
+ let transformedList = fromFunctionDeclarations;
7909
+ if (Array.isArray(transformedList)) {
7910
+ transformedList = transformedList.map((item) => {
7911
+ return functionDeclarationToVertex$1(item);
7912
+ });
7913
+ }
7914
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
7915
+ }
7908
7916
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7909
7917
  if (fromGoogleMaps != null) {
7910
7918
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -7913,6 +7921,12 @@ function toolToVertex$1(fromObject) {
7913
7921
  if (fromGoogleSearch != null) {
7914
7922
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
7915
7923
  }
7924
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7925
+ 'googleSearchRetrieval',
7926
+ ]);
7927
+ if (fromGoogleSearchRetrieval != null) {
7928
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7929
+ }
7916
7930
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7917
7931
  if (fromUrlContext != null) {
7918
7932
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -8011,6 +8025,14 @@ function usageMetadataFromVertex(fromObject) {
8011
8025
  }
8012
8026
  return toObject;
8013
8027
  }
8028
+ function voiceActivityFromVertex(fromObject) {
8029
+ const toObject = {};
8030
+ const fromVoiceActivityType = getValueByPath(fromObject, ['type']);
8031
+ if (fromVoiceActivityType != null) {
8032
+ setValueByPath(toObject, ['voiceActivityType'], fromVoiceActivityType);
8033
+ }
8034
+ return toObject;
8035
+ }
8014
8036
 
8015
8037
  /**
8016
8038
  * @license
@@ -8695,16 +8717,16 @@ function functionCallToMldev$1(fromObject) {
8695
8717
  }
8696
8718
  function functionCallingConfigToMldev(fromObject) {
8697
8719
  const toObject = {};
8698
- const fromMode = getValueByPath(fromObject, ['mode']);
8699
- if (fromMode != null) {
8700
- setValueByPath(toObject, ['mode'], fromMode);
8701
- }
8702
8720
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
8703
8721
  'allowedFunctionNames',
8704
8722
  ]);
8705
8723
  if (fromAllowedFunctionNames != null) {
8706
8724
  setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
8707
8725
  }
8726
+ const fromMode = getValueByPath(fromObject, ['mode']);
8727
+ if (fromMode != null) {
8728
+ setValueByPath(toObject, ['mode'], fromMode);
8729
+ }
8708
8730
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
8709
8731
  undefined) {
8710
8732
  throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
@@ -8713,9 +8735,6 @@ function functionCallingConfigToMldev(fromObject) {
8713
8735
  }
8714
8736
  function functionDeclarationToVertex(fromObject) {
8715
8737
  const toObject = {};
8716
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8717
- throw new Error('behavior parameter is not supported in Vertex AI.');
8718
- }
8719
8738
  const fromDescription = getValueByPath(fromObject, ['description']);
8720
8739
  if (fromDescription != null) {
8721
8740
  setValueByPath(toObject, ['description'], fromDescription);
@@ -8744,6 +8763,9 @@ function functionDeclarationToVertex(fromObject) {
8744
8763
  if (fromResponseJsonSchema != null) {
8745
8764
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
8746
8765
  }
8766
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8767
+ throw new Error('behavior parameter is not supported in Vertex AI.');
8768
+ }
8747
8769
  return toObject;
8748
8770
  }
8749
8771
  function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
@@ -10081,6 +10103,9 @@ function imageConfigToMldev(fromObject) {
10081
10103
  if (fromImageSize != null) {
10082
10104
  setValueByPath(toObject, ['imageSize'], fromImageSize);
10083
10105
  }
10106
+ if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
10107
+ throw new Error('personGeneration parameter is not supported in Gemini API.');
10108
+ }
10084
10109
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
10085
10110
  throw new Error('outputMimeType parameter is not supported in Gemini API.');
10086
10111
  }
@@ -10100,6 +10125,12 @@ function imageConfigToVertex(fromObject) {
10100
10125
  if (fromImageSize != null) {
10101
10126
  setValueByPath(toObject, ['imageSize'], fromImageSize);
10102
10127
  }
10128
+ const fromPersonGeneration = getValueByPath(fromObject, [
10129
+ 'personGeneration',
10130
+ ]);
10131
+ if (fromPersonGeneration != null) {
10132
+ setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
10133
+ }
10103
10134
  const fromOutputMimeType = getValueByPath(fromObject, [
10104
10135
  'outputMimeType',
10105
10136
  ]);
@@ -10800,43 +10831,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
10800
10831
  }
10801
10832
  function toolConfigToMldev(fromObject) {
10802
10833
  const toObject = {};
10803
- const fromFunctionCallingConfig = getValueByPath(fromObject, [
10804
- 'functionCallingConfig',
10805
- ]);
10806
- if (fromFunctionCallingConfig != null) {
10807
- setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
10808
- }
10809
10834
  const fromRetrievalConfig = getValueByPath(fromObject, [
10810
10835
  'retrievalConfig',
10811
10836
  ]);
10812
10837
  if (fromRetrievalConfig != null) {
10813
10838
  setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
10814
10839
  }
10840
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
10841
+ 'functionCallingConfig',
10842
+ ]);
10843
+ if (fromFunctionCallingConfig != null) {
10844
+ setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
10845
+ }
10815
10846
  return toObject;
10816
10847
  }
10817
10848
  function toolToMldev$1(fromObject) {
10818
10849
  const toObject = {};
10819
- const fromFunctionDeclarations = getValueByPath(fromObject, [
10820
- 'functionDeclarations',
10821
- ]);
10822
- if (fromFunctionDeclarations != null) {
10823
- let transformedList = fromFunctionDeclarations;
10824
- if (Array.isArray(transformedList)) {
10825
- transformedList = transformedList.map((item) => {
10826
- return item;
10827
- });
10828
- }
10829
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
10830
- }
10831
10850
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
10832
10851
  throw new Error('retrieval parameter is not supported in Gemini API.');
10833
10852
  }
10834
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10835
- 'googleSearchRetrieval',
10836
- ]);
10837
- if (fromGoogleSearchRetrieval != null) {
10838
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10839
- }
10840
10853
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10841
10854
  if (fromComputerUse != null) {
10842
10855
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10854,6 +10867,18 @@ function toolToMldev$1(fromObject) {
10854
10867
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10855
10868
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10856
10869
  }
10870
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
10871
+ 'functionDeclarations',
10872
+ ]);
10873
+ if (fromFunctionDeclarations != null) {
10874
+ let transformedList = fromFunctionDeclarations;
10875
+ if (Array.isArray(transformedList)) {
10876
+ transformedList = transformedList.map((item) => {
10877
+ return item;
10878
+ });
10879
+ }
10880
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
10881
+ }
10857
10882
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10858
10883
  if (fromGoogleMaps != null) {
10859
10884
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
@@ -10862,6 +10887,12 @@ function toolToMldev$1(fromObject) {
10862
10887
  if (fromGoogleSearch != null) {
10863
10888
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
10864
10889
  }
10890
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10891
+ 'googleSearchRetrieval',
10892
+ ]);
10893
+ if (fromGoogleSearchRetrieval != null) {
10894
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10895
+ }
10865
10896
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10866
10897
  if (fromUrlContext != null) {
10867
10898
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -10870,28 +10901,10 @@ function toolToMldev$1(fromObject) {
10870
10901
  }
10871
10902
  function toolToVertex(fromObject) {
10872
10903
  const toObject = {};
10873
- const fromFunctionDeclarations = getValueByPath(fromObject, [
10874
- 'functionDeclarations',
10875
- ]);
10876
- if (fromFunctionDeclarations != null) {
10877
- let transformedList = fromFunctionDeclarations;
10878
- if (Array.isArray(transformedList)) {
10879
- transformedList = transformedList.map((item) => {
10880
- return functionDeclarationToVertex(item);
10881
- });
10882
- }
10883
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
10884
- }
10885
10904
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
10886
10905
  if (fromRetrieval != null) {
10887
10906
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
10888
10907
  }
10889
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10890
- 'googleSearchRetrieval',
10891
- ]);
10892
- if (fromGoogleSearchRetrieval != null) {
10893
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10894
- }
10895
10908
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10896
10909
  if (fromComputerUse != null) {
10897
10910
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10911,6 +10924,18 @@ function toolToVertex(fromObject) {
10911
10924
  if (fromEnterpriseWebSearch != null) {
10912
10925
  setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
10913
10926
  }
10927
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
10928
+ 'functionDeclarations',
10929
+ ]);
10930
+ if (fromFunctionDeclarations != null) {
10931
+ let transformedList = fromFunctionDeclarations;
10932
+ if (Array.isArray(transformedList)) {
10933
+ transformedList = transformedList.map((item) => {
10934
+ return functionDeclarationToVertex(item);
10935
+ });
10936
+ }
10937
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
10938
+ }
10914
10939
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10915
10940
  if (fromGoogleMaps != null) {
10916
10941
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
@@ -10919,6 +10944,12 @@ function toolToVertex(fromObject) {
10919
10944
  if (fromGoogleSearch != null) {
10920
10945
  setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
10921
10946
  }
10947
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10948
+ 'googleSearchRetrieval',
10949
+ ]);
10950
+ if (fromGoogleSearchRetrieval != null) {
10951
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10952
+ }
10922
10953
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10923
10954
  if (fromUrlContext != null) {
10924
10955
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -11479,7 +11510,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
11479
11510
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
11480
11511
  const USER_AGENT_HEADER = 'User-Agent';
11481
11512
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
11482
- const SDK_VERSION = '1.34.0'; // x-release-please-version
11513
+ const SDK_VERSION = '1.36.0'; // x-release-please-version
11483
11514
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
11484
11515
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
11485
11516
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13193,7 +13224,7 @@ class Models extends BaseModule {
13193
13224
  * @example
13194
13225
  * ```ts
13195
13226
  * const response = await client.models.generateImages({
13196
- * model: 'imagen-3.0-generate-002',
13227
+ * model: 'imagen-4.0-generate-001',
13197
13228
  * prompt: 'Robot holding a red skateboard',
13198
13229
  * config: {
13199
13230
  * numberOfImages: 1,
@@ -13302,7 +13333,7 @@ class Models extends BaseModule {
13302
13333
  * @example
13303
13334
  * ```ts
13304
13335
  * const response = await client.models.upscaleImage({
13305
- * model: 'imagen-3.0-generate-002',
13336
+ * model: 'imagen-4.0-upscale-preview',
13306
13337
  * image: image,
13307
13338
  * upscaleFactor: 'x2',
13308
13339
  * config: {
@@ -13964,7 +13995,7 @@ class Models extends BaseModule {
13964
13995
  * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
13965
13996
  *
13966
13997
  * const response2 = await ai.models.recontextImage({
13967
- * model: 'virtual-try-on-preview-08-04',
13998
+ * model: 'virtual-try-on-001',
13968
13999
  * source: {
13969
14000
  * personImage: personImage,
13970
14001
  * productImages: [productImage],
@@ -15046,27 +15077,9 @@ function sessionResumptionConfigToMldev(fromObject) {
15046
15077
  }
15047
15078
  function toolToMldev(fromObject) {
15048
15079
  const toObject = {};
15049
- const fromFunctionDeclarations = getValueByPath(fromObject, [
15050
- 'functionDeclarations',
15051
- ]);
15052
- if (fromFunctionDeclarations != null) {
15053
- let transformedList = fromFunctionDeclarations;
15054
- if (Array.isArray(transformedList)) {
15055
- transformedList = transformedList.map((item) => {
15056
- return item;
15057
- });
15058
- }
15059
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
15060
- }
15061
15080
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
15062
15081
  throw new Error('retrieval parameter is not supported in Gemini API.');
15063
15082
  }
15064
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
15065
- 'googleSearchRetrieval',
15066
- ]);
15067
- if (fromGoogleSearchRetrieval != null) {
15068
- setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
15069
- }
15070
15083
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
15071
15084
  if (fromComputerUse != null) {
15072
15085
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -15084,6 +15097,18 @@ function toolToMldev(fromObject) {
15084
15097
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
15085
15098
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
15086
15099
  }
15100
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
15101
+ 'functionDeclarations',
15102
+ ]);
15103
+ if (fromFunctionDeclarations != null) {
15104
+ let transformedList = fromFunctionDeclarations;
15105
+ if (Array.isArray(transformedList)) {
15106
+ transformedList = transformedList.map((item) => {
15107
+ return item;
15108
+ });
15109
+ }
15110
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
15111
+ }
15087
15112
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
15088
15113
  if (fromGoogleMaps != null) {
15089
15114
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
@@ -15092,6 +15117,12 @@ function toolToMldev(fromObject) {
15092
15117
  if (fromGoogleSearch != null) {
15093
15118
  setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
15094
15119
  }
15120
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
15121
+ 'googleSearchRetrieval',
15122
+ ]);
15123
+ if (fromGoogleSearchRetrieval != null) {
15124
+ setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
15125
+ }
15095
15126
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
15096
15127
  if (fromUrlContext != null) {
15097
15128
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
@@ -19581,5 +19612,5 @@ function getApiKeyFromEnv() {
19581
19612
  return envGoogleApiKey || envGeminiApiKey || undefined;
19582
19613
  }
19583
19614
 
19584
- 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 };
19615
+ 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 };
19585
19616
  //# sourceMappingURL=index.mjs.map