@google/genai 1.13.0 → 1.14.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.cjs CHANGED
@@ -389,18 +389,6 @@ exports.ApiSpec = void 0;
389
389
  */
390
390
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
391
391
  })(exports.ApiSpec || (exports.ApiSpec = {}));
392
- /** Required. The environment being operated. */
393
- exports.Environment = void 0;
394
- (function (Environment) {
395
- /**
396
- * Defaults to browser.
397
- */
398
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
399
- /**
400
- * Operates in a web browser.
401
- */
402
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
403
- })(exports.Environment || (exports.Environment = {}));
404
392
  /** Status of the url retrieval. */
405
393
  exports.UrlRetrievalStatus = void 0;
406
394
  (function (UrlRetrievalStatus) {
@@ -668,6 +656,22 @@ exports.JobState = void 0;
668
656
  */
669
657
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
670
658
  })(exports.JobState || (exports.JobState = {}));
659
+ /** Tuning mode. */
660
+ exports.TuningMode = void 0;
661
+ (function (TuningMode) {
662
+ /**
663
+ * Tuning mode is unspecified.
664
+ */
665
+ TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
666
+ /**
667
+ * Full fine-tuning mode.
668
+ */
669
+ TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
670
+ /**
671
+ * PEFT adapter tuning mode.
672
+ */
673
+ TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
674
+ })(exports.TuningMode || (exports.TuningMode = {}));
671
675
  /** Optional. Adapter size for tuning. */
672
676
  exports.AdapterSize = void 0;
673
677
  (function (AdapterSize) {
@@ -736,6 +740,18 @@ exports.DynamicRetrievalConfigMode = void 0;
736
740
  */
737
741
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
738
742
  })(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
743
+ /** The environment being operated. */
744
+ exports.Environment = void 0;
745
+ (function (Environment) {
746
+ /**
747
+ * Defaults to browser.
748
+ */
749
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
750
+ /**
751
+ * Operates in a web browser.
752
+ */
753
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
754
+ })(exports.Environment || (exports.Environment = {}));
739
755
  /** Config for the function calling config mode. */
740
756
  exports.FunctionCallingConfigMode = void 0;
741
757
  (function (FunctionCallingConfigMode) {
@@ -2842,6 +2858,9 @@ function googleSearchToMldev$4(fromObject) {
2842
2858
  if (fromTimeRangeFilter != null) {
2843
2859
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$4(fromTimeRangeFilter));
2844
2860
  }
2861
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
2862
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
2863
+ }
2845
2864
  return toObject;
2846
2865
  }
2847
2866
  function dynamicRetrievalConfigToMldev$4(fromObject) {
@@ -2872,6 +2891,14 @@ function urlContextToMldev$4() {
2872
2891
  const toObject = {};
2873
2892
  return toObject;
2874
2893
  }
2894
+ function toolComputerUseToMldev$4(fromObject) {
2895
+ const toObject = {};
2896
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
2897
+ if (fromEnvironment != null) {
2898
+ setValueByPath(toObject, ['environment'], fromEnvironment);
2899
+ }
2900
+ return toObject;
2901
+ }
2875
2902
  function toolToMldev$4(fromObject) {
2876
2903
  const toObject = {};
2877
2904
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -2909,16 +2936,16 @@ function toolToMldev$4(fromObject) {
2909
2936
  if (fromUrlContext != null) {
2910
2937
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$4());
2911
2938
  }
2939
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2940
+ if (fromComputerUse != null) {
2941
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$4(fromComputerUse));
2942
+ }
2912
2943
  const fromCodeExecution = getValueByPath(fromObject, [
2913
2944
  'codeExecution',
2914
2945
  ]);
2915
2946
  if (fromCodeExecution != null) {
2916
2947
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2917
2948
  }
2918
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2919
- if (fromComputerUse != null) {
2920
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
2921
- }
2922
2949
  return toObject;
2923
2950
  }
2924
2951
  function functionCallingConfigToMldev$2(fromObject) {
@@ -4772,6 +4799,9 @@ function googleSearchToMldev$3(fromObject) {
4772
4799
  if (fromTimeRangeFilter != null) {
4773
4800
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(fromTimeRangeFilter));
4774
4801
  }
4802
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4803
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4804
+ }
4775
4805
  return toObject;
4776
4806
  }
4777
4807
  function dynamicRetrievalConfigToMldev$3(fromObject) {
@@ -4802,6 +4832,14 @@ function urlContextToMldev$3() {
4802
4832
  const toObject = {};
4803
4833
  return toObject;
4804
4834
  }
4835
+ function toolComputerUseToMldev$3(fromObject) {
4836
+ const toObject = {};
4837
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
4838
+ if (fromEnvironment != null) {
4839
+ setValueByPath(toObject, ['environment'], fromEnvironment);
4840
+ }
4841
+ return toObject;
4842
+ }
4805
4843
  function toolToMldev$3(fromObject) {
4806
4844
  const toObject = {};
4807
4845
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -4839,16 +4877,16 @@ function toolToMldev$3(fromObject) {
4839
4877
  if (fromUrlContext != null) {
4840
4878
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
4841
4879
  }
4880
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4881
+ if (fromComputerUse != null) {
4882
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$3(fromComputerUse));
4883
+ }
4842
4884
  const fromCodeExecution = getValueByPath(fromObject, [
4843
4885
  'codeExecution',
4844
4886
  ]);
4845
4887
  if (fromCodeExecution != null) {
4846
4888
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4847
4889
  }
4848
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4849
- if (fromComputerUse != null) {
4850
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
4851
- }
4852
4890
  return toObject;
4853
4891
  }
4854
4892
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5209,6 +5247,12 @@ function googleSearchToVertex$2(fromObject) {
5209
5247
  if (fromTimeRangeFilter != null) {
5210
5248
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$2(fromTimeRangeFilter));
5211
5249
  }
5250
+ const fromExcludeDomains = getValueByPath(fromObject, [
5251
+ 'excludeDomains',
5252
+ ]);
5253
+ if (fromExcludeDomains != null) {
5254
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5255
+ }
5212
5256
  return toObject;
5213
5257
  }
5214
5258
  function dynamicRetrievalConfigToVertex$2(fromObject) {
@@ -5235,8 +5279,14 @@ function googleSearchRetrievalToVertex$2(fromObject) {
5235
5279
  }
5236
5280
  return toObject;
5237
5281
  }
5238
- function enterpriseWebSearchToVertex$2() {
5282
+ function enterpriseWebSearchToVertex$2(fromObject) {
5239
5283
  const toObject = {};
5284
+ const fromExcludeDomains = getValueByPath(fromObject, [
5285
+ 'excludeDomains',
5286
+ ]);
5287
+ if (fromExcludeDomains != null) {
5288
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5289
+ }
5240
5290
  return toObject;
5241
5291
  }
5242
5292
  function apiKeyConfigToVertex$2(fromObject) {
@@ -5291,6 +5341,14 @@ function urlContextToVertex$2() {
5291
5341
  const toObject = {};
5292
5342
  return toObject;
5293
5343
  }
5344
+ function toolComputerUseToVertex$2(fromObject) {
5345
+ const toObject = {};
5346
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
5347
+ if (fromEnvironment != null) {
5348
+ setValueByPath(toObject, ['environment'], fromEnvironment);
5349
+ }
5350
+ return toObject;
5351
+ }
5294
5352
  function toolToVertex$2(fromObject) {
5295
5353
  const toObject = {};
5296
5354
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -5323,7 +5381,7 @@ function toolToVertex$2(fromObject) {
5323
5381
  'enterpriseWebSearch',
5324
5382
  ]);
5325
5383
  if (fromEnterpriseWebSearch != null) {
5326
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2());
5384
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2(fromEnterpriseWebSearch));
5327
5385
  }
5328
5386
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5329
5387
  if (fromGoogleMaps != null) {
@@ -5333,16 +5391,16 @@ function toolToVertex$2(fromObject) {
5333
5391
  if (fromUrlContext != null) {
5334
5392
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$2());
5335
5393
  }
5394
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5395
+ if (fromComputerUse != null) {
5396
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$2(fromComputerUse));
5397
+ }
5336
5398
  const fromCodeExecution = getValueByPath(fromObject, [
5337
5399
  'codeExecution',
5338
5400
  ]);
5339
5401
  if (fromCodeExecution != null) {
5340
5402
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5341
5403
  }
5342
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5343
- if (fromComputerUse != null) {
5344
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
5345
- }
5346
5404
  return toObject;
5347
5405
  }
5348
5406
  function functionCallingConfigToVertex$1(fromObject) {
@@ -6454,7 +6512,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6454
6512
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6455
6513
  const USER_AGENT_HEADER = 'User-Agent';
6456
6514
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6457
- const SDK_VERSION = '1.13.0'; // x-release-please-version
6515
+ const SDK_VERSION = '1.14.0'; // x-release-please-version
6458
6516
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6459
6517
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6460
6518
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7925,6 +7983,9 @@ function googleSearchToMldev$2(fromObject) {
7925
7983
  if (fromTimeRangeFilter != null) {
7926
7984
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(fromTimeRangeFilter));
7927
7985
  }
7986
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7987
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
7988
+ }
7928
7989
  return toObject;
7929
7990
  }
7930
7991
  function dynamicRetrievalConfigToMldev$2(fromObject) {
@@ -7955,6 +8016,14 @@ function urlContextToMldev$2() {
7955
8016
  const toObject = {};
7956
8017
  return toObject;
7957
8018
  }
8019
+ function toolComputerUseToMldev$2(fromObject) {
8020
+ const toObject = {};
8021
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
8022
+ if (fromEnvironment != null) {
8023
+ setValueByPath(toObject, ['environment'], fromEnvironment);
8024
+ }
8025
+ return toObject;
8026
+ }
7958
8027
  function toolToMldev$2(fromObject) {
7959
8028
  const toObject = {};
7960
8029
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7992,16 +8061,16 @@ function toolToMldev$2(fromObject) {
7992
8061
  if (fromUrlContext != null) {
7993
8062
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
7994
8063
  }
8064
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8065
+ if (fromComputerUse != null) {
8066
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$2(fromComputerUse));
8067
+ }
7995
8068
  const fromCodeExecution = getValueByPath(fromObject, [
7996
8069
  'codeExecution',
7997
8070
  ]);
7998
8071
  if (fromCodeExecution != null) {
7999
8072
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8000
8073
  }
8001
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8002
- if (fromComputerUse != null) {
8003
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8004
- }
8005
8074
  return toObject;
8006
8075
  }
8007
8076
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -8617,6 +8686,12 @@ function googleSearchToVertex$1(fromObject) {
8617
8686
  if (fromTimeRangeFilter != null) {
8618
8687
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
8619
8688
  }
8689
+ const fromExcludeDomains = getValueByPath(fromObject, [
8690
+ 'excludeDomains',
8691
+ ]);
8692
+ if (fromExcludeDomains != null) {
8693
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8694
+ }
8620
8695
  return toObject;
8621
8696
  }
8622
8697
  function dynamicRetrievalConfigToVertex$1(fromObject) {
@@ -8643,8 +8718,14 @@ function googleSearchRetrievalToVertex$1(fromObject) {
8643
8718
  }
8644
8719
  return toObject;
8645
8720
  }
8646
- function enterpriseWebSearchToVertex$1() {
8721
+ function enterpriseWebSearchToVertex$1(fromObject) {
8647
8722
  const toObject = {};
8723
+ const fromExcludeDomains = getValueByPath(fromObject, [
8724
+ 'excludeDomains',
8725
+ ]);
8726
+ if (fromExcludeDomains != null) {
8727
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8728
+ }
8648
8729
  return toObject;
8649
8730
  }
8650
8731
  function apiKeyConfigToVertex$1(fromObject) {
@@ -8699,6 +8780,14 @@ function urlContextToVertex$1() {
8699
8780
  const toObject = {};
8700
8781
  return toObject;
8701
8782
  }
8783
+ function toolComputerUseToVertex$1(fromObject) {
8784
+ const toObject = {};
8785
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
8786
+ if (fromEnvironment != null) {
8787
+ setValueByPath(toObject, ['environment'], fromEnvironment);
8788
+ }
8789
+ return toObject;
8790
+ }
8702
8791
  function toolToVertex$1(fromObject) {
8703
8792
  const toObject = {};
8704
8793
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -8731,7 +8820,7 @@ function toolToVertex$1(fromObject) {
8731
8820
  'enterpriseWebSearch',
8732
8821
  ]);
8733
8822
  if (fromEnterpriseWebSearch != null) {
8734
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8823
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1(fromEnterpriseWebSearch));
8735
8824
  }
8736
8825
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8737
8826
  if (fromGoogleMaps != null) {
@@ -8741,16 +8830,16 @@ function toolToVertex$1(fromObject) {
8741
8830
  if (fromUrlContext != null) {
8742
8831
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8743
8832
  }
8833
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8834
+ if (fromComputerUse != null) {
8835
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$1(fromComputerUse));
8836
+ }
8744
8837
  const fromCodeExecution = getValueByPath(fromObject, [
8745
8838
  'codeExecution',
8746
8839
  ]);
8747
8840
  if (fromCodeExecution != null) {
8748
8841
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8749
8842
  }
8750
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8751
- if (fromComputerUse != null) {
8752
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8753
- }
8754
8843
  return toObject;
8755
8844
  }
8756
8845
  function sessionResumptionConfigToVertex(fromObject) {
@@ -10278,6 +10367,9 @@ function googleSearchToMldev$1(fromObject) {
10278
10367
  if (fromTimeRangeFilter != null) {
10279
10368
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(fromTimeRangeFilter));
10280
10369
  }
10370
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
10371
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
10372
+ }
10281
10373
  return toObject;
10282
10374
  }
10283
10375
  function dynamicRetrievalConfigToMldev$1(fromObject) {
@@ -10308,6 +10400,14 @@ function urlContextToMldev$1() {
10308
10400
  const toObject = {};
10309
10401
  return toObject;
10310
10402
  }
10403
+ function toolComputerUseToMldev$1(fromObject) {
10404
+ const toObject = {};
10405
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
10406
+ if (fromEnvironment != null) {
10407
+ setValueByPath(toObject, ['environment'], fromEnvironment);
10408
+ }
10409
+ return toObject;
10410
+ }
10311
10411
  function toolToMldev$1(fromObject) {
10312
10412
  const toObject = {};
10313
10413
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -10345,16 +10445,16 @@ function toolToMldev$1(fromObject) {
10345
10445
  if (fromUrlContext != null) {
10346
10446
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
10347
10447
  }
10448
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10449
+ if (fromComputerUse != null) {
10450
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$1(fromComputerUse));
10451
+ }
10348
10452
  const fromCodeExecution = getValueByPath(fromObject, [
10349
10453
  'codeExecution',
10350
10454
  ]);
10351
10455
  if (fromCodeExecution != null) {
10352
10456
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10353
10457
  }
10354
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10355
- if (fromComputerUse != null) {
10356
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
10357
- }
10358
10458
  return toObject;
10359
10459
  }
10360
10460
  function functionCallingConfigToMldev(fromObject) {
@@ -11318,6 +11418,12 @@ function googleSearchToVertex(fromObject) {
11318
11418
  if (fromTimeRangeFilter != null) {
11319
11419
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex(fromTimeRangeFilter));
11320
11420
  }
11421
+ const fromExcludeDomains = getValueByPath(fromObject, [
11422
+ 'excludeDomains',
11423
+ ]);
11424
+ if (fromExcludeDomains != null) {
11425
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
11426
+ }
11321
11427
  return toObject;
11322
11428
  }
11323
11429
  function dynamicRetrievalConfigToVertex(fromObject) {
@@ -11344,8 +11450,14 @@ function googleSearchRetrievalToVertex(fromObject) {
11344
11450
  }
11345
11451
  return toObject;
11346
11452
  }
11347
- function enterpriseWebSearchToVertex() {
11453
+ function enterpriseWebSearchToVertex(fromObject) {
11348
11454
  const toObject = {};
11455
+ const fromExcludeDomains = getValueByPath(fromObject, [
11456
+ 'excludeDomains',
11457
+ ]);
11458
+ if (fromExcludeDomains != null) {
11459
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
11460
+ }
11349
11461
  return toObject;
11350
11462
  }
11351
11463
  function apiKeyConfigToVertex(fromObject) {
@@ -11400,6 +11512,14 @@ function urlContextToVertex() {
11400
11512
  const toObject = {};
11401
11513
  return toObject;
11402
11514
  }
11515
+ function toolComputerUseToVertex(fromObject) {
11516
+ const toObject = {};
11517
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
11518
+ if (fromEnvironment != null) {
11519
+ setValueByPath(toObject, ['environment'], fromEnvironment);
11520
+ }
11521
+ return toObject;
11522
+ }
11403
11523
  function toolToVertex(fromObject) {
11404
11524
  const toObject = {};
11405
11525
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -11432,7 +11552,7 @@ function toolToVertex(fromObject) {
11432
11552
  'enterpriseWebSearch',
11433
11553
  ]);
11434
11554
  if (fromEnterpriseWebSearch != null) {
11435
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex());
11555
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex(fromEnterpriseWebSearch));
11436
11556
  }
11437
11557
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
11438
11558
  if (fromGoogleMaps != null) {
@@ -11442,16 +11562,16 @@ function toolToVertex(fromObject) {
11442
11562
  if (fromUrlContext != null) {
11443
11563
  setValueByPath(toObject, ['urlContext'], urlContextToVertex());
11444
11564
  }
11565
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11566
+ if (fromComputerUse != null) {
11567
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex(fromComputerUse));
11568
+ }
11445
11569
  const fromCodeExecution = getValueByPath(fromObject, [
11446
11570
  'codeExecution',
11447
11571
  ]);
11448
11572
  if (fromCodeExecution != null) {
11449
11573
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
11450
11574
  }
11451
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11452
- if (fromComputerUse != null) {
11453
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
11454
- }
11455
11575
  return toObject;
11456
11576
  }
11457
11577
  function functionCallingConfigToVertex(fromObject) {
@@ -16644,6 +16764,9 @@ function googleSearchToMldev(fromObject) {
16644
16764
  if (fromTimeRangeFilter != null) {
16645
16765
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(fromTimeRangeFilter));
16646
16766
  }
16767
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16768
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
16769
+ }
16647
16770
  return toObject;
16648
16771
  }
16649
16772
  function dynamicRetrievalConfigToMldev(fromObject) {
@@ -16674,6 +16797,14 @@ function urlContextToMldev() {
16674
16797
  const toObject = {};
16675
16798
  return toObject;
16676
16799
  }
16800
+ function toolComputerUseToMldev(fromObject) {
16801
+ const toObject = {};
16802
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
16803
+ if (fromEnvironment != null) {
16804
+ setValueByPath(toObject, ['environment'], fromEnvironment);
16805
+ }
16806
+ return toObject;
16807
+ }
16677
16808
  function toolToMldev(fromObject) {
16678
16809
  const toObject = {};
16679
16810
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -16711,16 +16842,16 @@ function toolToMldev(fromObject) {
16711
16842
  if (fromUrlContext != null) {
16712
16843
  setValueByPath(toObject, ['urlContext'], urlContextToMldev());
16713
16844
  }
16845
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16846
+ if (fromComputerUse != null) {
16847
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev(fromComputerUse));
16848
+ }
16714
16849
  const fromCodeExecution = getValueByPath(fromObject, [
16715
16850
  'codeExecution',
16716
16851
  ]);
16717
16852
  if (fromCodeExecution != null) {
16718
16853
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16719
16854
  }
16720
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16721
- if (fromComputerUse != null) {
16722
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
16723
- }
16724
16855
  return toObject;
16725
16856
  }
16726
16857
  function sessionResumptionConfigToMldev(fromObject) {
@@ -17360,6 +17491,10 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17360
17491
  undefined) {
17361
17492
  throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
17362
17493
  }
17494
+ if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
17495
+ undefined) {
17496
+ throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
17497
+ }
17363
17498
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
17364
17499
  throw new Error('adapterSize parameter is not supported in Gemini API.');
17365
17500
  }
@@ -17373,12 +17508,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17373
17508
  }
17374
17509
  return toObject;
17375
17510
  }
17376
- function createTuningJobParametersToMldev(fromObject) {
17511
+ function createTuningJobParametersPrivateToMldev(fromObject) {
17377
17512
  const toObject = {};
17378
17513
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17379
17514
  if (fromBaseModel != null) {
17380
17515
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17381
17516
  }
17517
+ const fromPreTunedModel = getValueByPath(fromObject, [
17518
+ 'preTunedModel',
17519
+ ]);
17520
+ if (fromPreTunedModel != null) {
17521
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17522
+ }
17382
17523
  const fromTrainingDataset = getValueByPath(fromObject, [
17383
17524
  'trainingDataset',
17384
17525
  ]);
@@ -17492,6 +17633,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17492
17633
  if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
17493
17634
  setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
17494
17635
  }
17636
+ const fromPreTunedModelCheckpointId = getValueByPath(fromObject, [
17637
+ 'preTunedModelCheckpointId',
17638
+ ]);
17639
+ if (fromPreTunedModelCheckpointId != null) {
17640
+ setValueByPath(toObject, ['preTunedModel', 'checkpointId'], fromPreTunedModelCheckpointId);
17641
+ }
17495
17642
  const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
17496
17643
  if (parentObject !== undefined && fromAdapterSize != null) {
17497
17644
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
@@ -17504,12 +17651,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17504
17651
  }
17505
17652
  return toObject;
17506
17653
  }
17507
- function createTuningJobParametersToVertex(fromObject) {
17654
+ function createTuningJobParametersPrivateToVertex(fromObject) {
17508
17655
  const toObject = {};
17509
17656
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17510
17657
  if (fromBaseModel != null) {
17511
17658
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17512
17659
  }
17660
+ const fromPreTunedModel = getValueByPath(fromObject, [
17661
+ 'preTunedModel',
17662
+ ]);
17663
+ if (fromPreTunedModel != null) {
17664
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17665
+ }
17513
17666
  const fromTrainingDataset = getValueByPath(fromObject, [
17514
17667
  'trainingDataset',
17515
17668
  ]);
@@ -17584,11 +17737,11 @@ function tuningJobFromMldev(fromObject) {
17584
17737
  if (fromTunedModel != null) {
17585
17738
  setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
17586
17739
  }
17587
- const fromDistillationSpec = getValueByPath(fromObject, [
17588
- 'distillationSpec',
17740
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17741
+ 'customBaseModel',
17589
17742
  ]);
17590
- if (fromDistillationSpec != null) {
17591
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17743
+ if (fromCustomBaseModel != null) {
17744
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17592
17745
  }
17593
17746
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17594
17747
  if (fromExperiment != null) {
@@ -17598,18 +17751,14 @@ function tuningJobFromMldev(fromObject) {
17598
17751
  if (fromLabels != null) {
17599
17752
  setValueByPath(toObject, ['labels'], fromLabels);
17600
17753
  }
17754
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17755
+ if (fromOutputUri != null) {
17756
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17757
+ }
17601
17758
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17602
17759
  if (fromPipelineJob != null) {
17603
17760
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17604
17761
  }
17605
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17606
- if (fromSatisfiesPzi != null) {
17607
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17608
- }
17609
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17610
- if (fromSatisfiesPzs != null) {
17611
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17612
- }
17613
17762
  const fromServiceAccount = getValueByPath(fromObject, [
17614
17763
  'serviceAccount',
17615
17764
  ]);
@@ -17766,6 +17915,12 @@ function tuningJobFromVertex(fromObject) {
17766
17915
  if (fromTunedModel != null) {
17767
17916
  setValueByPath(toObject, ['tunedModel'], tunedModelFromVertex(fromTunedModel));
17768
17917
  }
17918
+ const fromPreTunedModel = getValueByPath(fromObject, [
17919
+ 'preTunedModel',
17920
+ ]);
17921
+ if (fromPreTunedModel != null) {
17922
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17923
+ }
17769
17924
  const fromSupervisedTuningSpec = getValueByPath(fromObject, [
17770
17925
  'supervisedTuningSpec',
17771
17926
  ]);
@@ -17790,11 +17945,11 @@ function tuningJobFromVertex(fromObject) {
17790
17945
  if (fromPartnerModelTuningSpec != null) {
17791
17946
  setValueByPath(toObject, ['partnerModelTuningSpec'], fromPartnerModelTuningSpec);
17792
17947
  }
17793
- const fromDistillationSpec = getValueByPath(fromObject, [
17794
- 'distillationSpec',
17948
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17949
+ 'customBaseModel',
17795
17950
  ]);
17796
- if (fromDistillationSpec != null) {
17797
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17951
+ if (fromCustomBaseModel != null) {
17952
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17798
17953
  }
17799
17954
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17800
17955
  if (fromExperiment != null) {
@@ -17804,18 +17959,14 @@ function tuningJobFromVertex(fromObject) {
17804
17959
  if (fromLabels != null) {
17805
17960
  setValueByPath(toObject, ['labels'], fromLabels);
17806
17961
  }
17962
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17963
+ if (fromOutputUri != null) {
17964
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17965
+ }
17807
17966
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17808
17967
  if (fromPipelineJob != null) {
17809
17968
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17810
17969
  }
17811
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17812
- if (fromSatisfiesPzi != null) {
17813
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17814
- }
17815
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17816
- if (fromSatisfiesPzs != null) {
17817
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17818
- }
17819
17970
  const fromServiceAccount = getValueByPath(fromObject, [
17820
17971
  'serviceAccount',
17821
17972
  ]);
@@ -17901,10 +18052,22 @@ class Tunings extends BaseModule {
17901
18052
  */
17902
18053
  this.tune = async (params) => {
17903
18054
  if (this.apiClient.isVertexAI()) {
17904
- return await this.tuneInternal(params);
18055
+ if (params.baseModel.startsWith('projects/')) {
18056
+ const preTunedModel = {
18057
+ tunedModelName: params.baseModel,
18058
+ };
18059
+ const paramsPrivate = Object.assign(Object.assign({}, params), { preTunedModel: preTunedModel });
18060
+ paramsPrivate.baseModel = undefined;
18061
+ return await this.tuneInternal(paramsPrivate);
18062
+ }
18063
+ else {
18064
+ const paramsPrivate = Object.assign({}, params);
18065
+ return await this.tuneInternal(paramsPrivate);
18066
+ }
17905
18067
  }
17906
18068
  else {
17907
- const operation = await this.tuneMldevInternal(params);
18069
+ const paramsPrivate = Object.assign({}, params);
18070
+ const operation = await this.tuneMldevInternal(paramsPrivate);
17908
18071
  let tunedModelName = '';
17909
18072
  if (operation['metadata'] !== undefined &&
17910
18073
  operation['metadata']['tunedModel'] !== undefined) {
@@ -18064,7 +18227,7 @@ class Tunings extends BaseModule {
18064
18227
  let path = '';
18065
18228
  let queryParams = {};
18066
18229
  if (this.apiClient.isVertexAI()) {
18067
- const body = createTuningJobParametersToVertex(params);
18230
+ const body = createTuningJobParametersPrivateToVertex(params);
18068
18231
  path = formatMap('tuningJobs', body['_url']);
18069
18232
  queryParams = body['_query'];
18070
18233
  delete body['config'];
@@ -18106,7 +18269,7 @@ class Tunings extends BaseModule {
18106
18269
  throw new Error('This method is only supported by the Gemini Developer API.');
18107
18270
  }
18108
18271
  else {
18109
- const body = createTuningJobParametersToMldev(params);
18272
+ const body = createTuningJobParametersPrivateToMldev(params);
18110
18273
  path = formatMap('tunedModels', body['_url']);
18111
18274
  queryParams = body['_query'];
18112
18275
  delete body['config'];