@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.
@@ -445,18 +445,6 @@ exports.ApiSpec = void 0;
445
445
  */
446
446
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
447
447
  })(exports.ApiSpec || (exports.ApiSpec = {}));
448
- /** Required. The environment being operated. */
449
- exports.Environment = void 0;
450
- (function (Environment) {
451
- /**
452
- * Defaults to browser.
453
- */
454
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
455
- /**
456
- * Operates in a web browser.
457
- */
458
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
459
- })(exports.Environment || (exports.Environment = {}));
460
448
  /** Status of the url retrieval. */
461
449
  exports.UrlRetrievalStatus = void 0;
462
450
  (function (UrlRetrievalStatus) {
@@ -724,6 +712,22 @@ exports.JobState = void 0;
724
712
  */
725
713
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
726
714
  })(exports.JobState || (exports.JobState = {}));
715
+ /** Tuning mode. */
716
+ exports.TuningMode = void 0;
717
+ (function (TuningMode) {
718
+ /**
719
+ * Tuning mode is unspecified.
720
+ */
721
+ TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
722
+ /**
723
+ * Full fine-tuning mode.
724
+ */
725
+ TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
726
+ /**
727
+ * PEFT adapter tuning mode.
728
+ */
729
+ TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
730
+ })(exports.TuningMode || (exports.TuningMode = {}));
727
731
  /** Optional. Adapter size for tuning. */
728
732
  exports.AdapterSize = void 0;
729
733
  (function (AdapterSize) {
@@ -792,6 +796,18 @@ exports.DynamicRetrievalConfigMode = void 0;
792
796
  */
793
797
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
794
798
  })(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
799
+ /** The environment being operated. */
800
+ exports.Environment = void 0;
801
+ (function (Environment) {
802
+ /**
803
+ * Defaults to browser.
804
+ */
805
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
806
+ /**
807
+ * Operates in a web browser.
808
+ */
809
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
810
+ })(exports.Environment || (exports.Environment = {}));
795
811
  /** Config for the function calling config mode. */
796
812
  exports.FunctionCallingConfigMode = void 0;
797
813
  (function (FunctionCallingConfigMode) {
@@ -2898,6 +2914,9 @@ function googleSearchToMldev$4(fromObject) {
2898
2914
  if (fromTimeRangeFilter != null) {
2899
2915
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$4(fromTimeRangeFilter));
2900
2916
  }
2917
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
2918
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
2919
+ }
2901
2920
  return toObject;
2902
2921
  }
2903
2922
  function dynamicRetrievalConfigToMldev$4(fromObject) {
@@ -2928,6 +2947,14 @@ function urlContextToMldev$4() {
2928
2947
  const toObject = {};
2929
2948
  return toObject;
2930
2949
  }
2950
+ function toolComputerUseToMldev$4(fromObject) {
2951
+ const toObject = {};
2952
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
2953
+ if (fromEnvironment != null) {
2954
+ setValueByPath(toObject, ['environment'], fromEnvironment);
2955
+ }
2956
+ return toObject;
2957
+ }
2931
2958
  function toolToMldev$4(fromObject) {
2932
2959
  const toObject = {};
2933
2960
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -2965,16 +2992,16 @@ function toolToMldev$4(fromObject) {
2965
2992
  if (fromUrlContext != null) {
2966
2993
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$4());
2967
2994
  }
2995
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2996
+ if (fromComputerUse != null) {
2997
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$4(fromComputerUse));
2998
+ }
2968
2999
  const fromCodeExecution = getValueByPath(fromObject, [
2969
3000
  'codeExecution',
2970
3001
  ]);
2971
3002
  if (fromCodeExecution != null) {
2972
3003
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2973
3004
  }
2974
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2975
- if (fromComputerUse != null) {
2976
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
2977
- }
2978
3005
  return toObject;
2979
3006
  }
2980
3007
  function functionCallingConfigToMldev$2(fromObject) {
@@ -4828,6 +4855,9 @@ function googleSearchToMldev$3(fromObject) {
4828
4855
  if (fromTimeRangeFilter != null) {
4829
4856
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(fromTimeRangeFilter));
4830
4857
  }
4858
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4859
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4860
+ }
4831
4861
  return toObject;
4832
4862
  }
4833
4863
  function dynamicRetrievalConfigToMldev$3(fromObject) {
@@ -4858,6 +4888,14 @@ function urlContextToMldev$3() {
4858
4888
  const toObject = {};
4859
4889
  return toObject;
4860
4890
  }
4891
+ function toolComputerUseToMldev$3(fromObject) {
4892
+ const toObject = {};
4893
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
4894
+ if (fromEnvironment != null) {
4895
+ setValueByPath(toObject, ['environment'], fromEnvironment);
4896
+ }
4897
+ return toObject;
4898
+ }
4861
4899
  function toolToMldev$3(fromObject) {
4862
4900
  const toObject = {};
4863
4901
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -4895,16 +4933,16 @@ function toolToMldev$3(fromObject) {
4895
4933
  if (fromUrlContext != null) {
4896
4934
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
4897
4935
  }
4936
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4937
+ if (fromComputerUse != null) {
4938
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$3(fromComputerUse));
4939
+ }
4898
4940
  const fromCodeExecution = getValueByPath(fromObject, [
4899
4941
  'codeExecution',
4900
4942
  ]);
4901
4943
  if (fromCodeExecution != null) {
4902
4944
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4903
4945
  }
4904
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4905
- if (fromComputerUse != null) {
4906
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
4907
- }
4908
4946
  return toObject;
4909
4947
  }
4910
4948
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5265,6 +5303,12 @@ function googleSearchToVertex$2(fromObject) {
5265
5303
  if (fromTimeRangeFilter != null) {
5266
5304
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$2(fromTimeRangeFilter));
5267
5305
  }
5306
+ const fromExcludeDomains = getValueByPath(fromObject, [
5307
+ 'excludeDomains',
5308
+ ]);
5309
+ if (fromExcludeDomains != null) {
5310
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5311
+ }
5268
5312
  return toObject;
5269
5313
  }
5270
5314
  function dynamicRetrievalConfigToVertex$2(fromObject) {
@@ -5291,8 +5335,14 @@ function googleSearchRetrievalToVertex$2(fromObject) {
5291
5335
  }
5292
5336
  return toObject;
5293
5337
  }
5294
- function enterpriseWebSearchToVertex$2() {
5338
+ function enterpriseWebSearchToVertex$2(fromObject) {
5295
5339
  const toObject = {};
5340
+ const fromExcludeDomains = getValueByPath(fromObject, [
5341
+ 'excludeDomains',
5342
+ ]);
5343
+ if (fromExcludeDomains != null) {
5344
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5345
+ }
5296
5346
  return toObject;
5297
5347
  }
5298
5348
  function apiKeyConfigToVertex$2(fromObject) {
@@ -5347,6 +5397,14 @@ function urlContextToVertex$2() {
5347
5397
  const toObject = {};
5348
5398
  return toObject;
5349
5399
  }
5400
+ function toolComputerUseToVertex$2(fromObject) {
5401
+ const toObject = {};
5402
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
5403
+ if (fromEnvironment != null) {
5404
+ setValueByPath(toObject, ['environment'], fromEnvironment);
5405
+ }
5406
+ return toObject;
5407
+ }
5350
5408
  function toolToVertex$2(fromObject) {
5351
5409
  const toObject = {};
5352
5410
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -5379,7 +5437,7 @@ function toolToVertex$2(fromObject) {
5379
5437
  'enterpriseWebSearch',
5380
5438
  ]);
5381
5439
  if (fromEnterpriseWebSearch != null) {
5382
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2());
5440
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2(fromEnterpriseWebSearch));
5383
5441
  }
5384
5442
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5385
5443
  if (fromGoogleMaps != null) {
@@ -5389,16 +5447,16 @@ function toolToVertex$2(fromObject) {
5389
5447
  if (fromUrlContext != null) {
5390
5448
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$2());
5391
5449
  }
5450
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5451
+ if (fromComputerUse != null) {
5452
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$2(fromComputerUse));
5453
+ }
5392
5454
  const fromCodeExecution = getValueByPath(fromObject, [
5393
5455
  'codeExecution',
5394
5456
  ]);
5395
5457
  if (fromCodeExecution != null) {
5396
5458
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5397
5459
  }
5398
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5399
- if (fromComputerUse != null) {
5400
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
5401
- }
5402
5460
  return toObject;
5403
5461
  }
5404
5462
  function functionCallingConfigToVertex$1(fromObject) {
@@ -7284,6 +7342,9 @@ function googleSearchToMldev$2(fromObject) {
7284
7342
  if (fromTimeRangeFilter != null) {
7285
7343
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(fromTimeRangeFilter));
7286
7344
  }
7345
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7346
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
7347
+ }
7287
7348
  return toObject;
7288
7349
  }
7289
7350
  function dynamicRetrievalConfigToMldev$2(fromObject) {
@@ -7314,6 +7375,14 @@ function urlContextToMldev$2() {
7314
7375
  const toObject = {};
7315
7376
  return toObject;
7316
7377
  }
7378
+ function toolComputerUseToMldev$2(fromObject) {
7379
+ const toObject = {};
7380
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
7381
+ if (fromEnvironment != null) {
7382
+ setValueByPath(toObject, ['environment'], fromEnvironment);
7383
+ }
7384
+ return toObject;
7385
+ }
7317
7386
  function toolToMldev$2(fromObject) {
7318
7387
  const toObject = {};
7319
7388
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7351,16 +7420,16 @@ function toolToMldev$2(fromObject) {
7351
7420
  if (fromUrlContext != null) {
7352
7421
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
7353
7422
  }
7423
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7424
+ if (fromComputerUse != null) {
7425
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$2(fromComputerUse));
7426
+ }
7354
7427
  const fromCodeExecution = getValueByPath(fromObject, [
7355
7428
  'codeExecution',
7356
7429
  ]);
7357
7430
  if (fromCodeExecution != null) {
7358
7431
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7359
7432
  }
7360
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7361
- if (fromComputerUse != null) {
7362
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7363
- }
7364
7433
  return toObject;
7365
7434
  }
7366
7435
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7976,6 +8045,12 @@ function googleSearchToVertex$1(fromObject) {
7976
8045
  if (fromTimeRangeFilter != null) {
7977
8046
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7978
8047
  }
8048
+ const fromExcludeDomains = getValueByPath(fromObject, [
8049
+ 'excludeDomains',
8050
+ ]);
8051
+ if (fromExcludeDomains != null) {
8052
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8053
+ }
7979
8054
  return toObject;
7980
8055
  }
7981
8056
  function dynamicRetrievalConfigToVertex$1(fromObject) {
@@ -8002,8 +8077,14 @@ function googleSearchRetrievalToVertex$1(fromObject) {
8002
8077
  }
8003
8078
  return toObject;
8004
8079
  }
8005
- function enterpriseWebSearchToVertex$1() {
8080
+ function enterpriseWebSearchToVertex$1(fromObject) {
8006
8081
  const toObject = {};
8082
+ const fromExcludeDomains = getValueByPath(fromObject, [
8083
+ 'excludeDomains',
8084
+ ]);
8085
+ if (fromExcludeDomains != null) {
8086
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8087
+ }
8007
8088
  return toObject;
8008
8089
  }
8009
8090
  function apiKeyConfigToVertex$1(fromObject) {
@@ -8058,6 +8139,14 @@ function urlContextToVertex$1() {
8058
8139
  const toObject = {};
8059
8140
  return toObject;
8060
8141
  }
8142
+ function toolComputerUseToVertex$1(fromObject) {
8143
+ const toObject = {};
8144
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
8145
+ if (fromEnvironment != null) {
8146
+ setValueByPath(toObject, ['environment'], fromEnvironment);
8147
+ }
8148
+ return toObject;
8149
+ }
8061
8150
  function toolToVertex$1(fromObject) {
8062
8151
  const toObject = {};
8063
8152
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -8090,7 +8179,7 @@ function toolToVertex$1(fromObject) {
8090
8179
  'enterpriseWebSearch',
8091
8180
  ]);
8092
8181
  if (fromEnterpriseWebSearch != null) {
8093
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8182
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1(fromEnterpriseWebSearch));
8094
8183
  }
8095
8184
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8096
8185
  if (fromGoogleMaps != null) {
@@ -8100,16 +8189,16 @@ function toolToVertex$1(fromObject) {
8100
8189
  if (fromUrlContext != null) {
8101
8190
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8102
8191
  }
8192
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8193
+ if (fromComputerUse != null) {
8194
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$1(fromComputerUse));
8195
+ }
8103
8196
  const fromCodeExecution = getValueByPath(fromObject, [
8104
8197
  'codeExecution',
8105
8198
  ]);
8106
8199
  if (fromCodeExecution != null) {
8107
8200
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8108
8201
  }
8109
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8110
- if (fromComputerUse != null) {
8111
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8112
- }
8113
8202
  return toObject;
8114
8203
  }
8115
8204
  function sessionResumptionConfigToVertex(fromObject) {
@@ -9637,6 +9726,9 @@ function googleSearchToMldev$1(fromObject) {
9637
9726
  if (fromTimeRangeFilter != null) {
9638
9727
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(fromTimeRangeFilter));
9639
9728
  }
9729
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9730
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
9731
+ }
9640
9732
  return toObject;
9641
9733
  }
9642
9734
  function dynamicRetrievalConfigToMldev$1(fromObject) {
@@ -9667,6 +9759,14 @@ function urlContextToMldev$1() {
9667
9759
  const toObject = {};
9668
9760
  return toObject;
9669
9761
  }
9762
+ function toolComputerUseToMldev$1(fromObject) {
9763
+ const toObject = {};
9764
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
9765
+ if (fromEnvironment != null) {
9766
+ setValueByPath(toObject, ['environment'], fromEnvironment);
9767
+ }
9768
+ return toObject;
9769
+ }
9670
9770
  function toolToMldev$1(fromObject) {
9671
9771
  const toObject = {};
9672
9772
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -9704,16 +9804,16 @@ function toolToMldev$1(fromObject) {
9704
9804
  if (fromUrlContext != null) {
9705
9805
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
9706
9806
  }
9807
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9808
+ if (fromComputerUse != null) {
9809
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$1(fromComputerUse));
9810
+ }
9707
9811
  const fromCodeExecution = getValueByPath(fromObject, [
9708
9812
  'codeExecution',
9709
9813
  ]);
9710
9814
  if (fromCodeExecution != null) {
9711
9815
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
9712
9816
  }
9713
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9714
- if (fromComputerUse != null) {
9715
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
9716
- }
9717
9817
  return toObject;
9718
9818
  }
9719
9819
  function functionCallingConfigToMldev(fromObject) {
@@ -10677,6 +10777,12 @@ function googleSearchToVertex(fromObject) {
10677
10777
  if (fromTimeRangeFilter != null) {
10678
10778
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex(fromTimeRangeFilter));
10679
10779
  }
10780
+ const fromExcludeDomains = getValueByPath(fromObject, [
10781
+ 'excludeDomains',
10782
+ ]);
10783
+ if (fromExcludeDomains != null) {
10784
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10785
+ }
10680
10786
  return toObject;
10681
10787
  }
10682
10788
  function dynamicRetrievalConfigToVertex(fromObject) {
@@ -10703,8 +10809,14 @@ function googleSearchRetrievalToVertex(fromObject) {
10703
10809
  }
10704
10810
  return toObject;
10705
10811
  }
10706
- function enterpriseWebSearchToVertex() {
10812
+ function enterpriseWebSearchToVertex(fromObject) {
10707
10813
  const toObject = {};
10814
+ const fromExcludeDomains = getValueByPath(fromObject, [
10815
+ 'excludeDomains',
10816
+ ]);
10817
+ if (fromExcludeDomains != null) {
10818
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10819
+ }
10708
10820
  return toObject;
10709
10821
  }
10710
10822
  function apiKeyConfigToVertex(fromObject) {
@@ -10759,6 +10871,14 @@ function urlContextToVertex() {
10759
10871
  const toObject = {};
10760
10872
  return toObject;
10761
10873
  }
10874
+ function toolComputerUseToVertex(fromObject) {
10875
+ const toObject = {};
10876
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
10877
+ if (fromEnvironment != null) {
10878
+ setValueByPath(toObject, ['environment'], fromEnvironment);
10879
+ }
10880
+ return toObject;
10881
+ }
10762
10882
  function toolToVertex(fromObject) {
10763
10883
  const toObject = {};
10764
10884
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -10791,7 +10911,7 @@ function toolToVertex(fromObject) {
10791
10911
  'enterpriseWebSearch',
10792
10912
  ]);
10793
10913
  if (fromEnterpriseWebSearch != null) {
10794
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex());
10914
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex(fromEnterpriseWebSearch));
10795
10915
  }
10796
10916
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10797
10917
  if (fromGoogleMaps != null) {
@@ -10801,16 +10921,16 @@ function toolToVertex(fromObject) {
10801
10921
  if (fromUrlContext != null) {
10802
10922
  setValueByPath(toObject, ['urlContext'], urlContextToVertex());
10803
10923
  }
10924
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10925
+ if (fromComputerUse != null) {
10926
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex(fromComputerUse));
10927
+ }
10804
10928
  const fromCodeExecution = getValueByPath(fromObject, [
10805
10929
  'codeExecution',
10806
10930
  ]);
10807
10931
  if (fromCodeExecution != null) {
10808
10932
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10809
10933
  }
10810
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10811
- if (fromComputerUse != null) {
10812
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
10813
- }
10814
10934
  return toObject;
10815
10935
  }
10816
10936
  function functionCallingConfigToVertex(fromObject) {
@@ -13170,7 +13290,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
13170
13290
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
13171
13291
  const USER_AGENT_HEADER = 'User-Agent';
13172
13292
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
13173
- const SDK_VERSION = '1.13.0'; // x-release-please-version
13293
+ const SDK_VERSION = '1.14.0'; // x-release-please-version
13174
13294
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
13175
13295
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
13176
13296
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -16577,6 +16697,9 @@ function googleSearchToMldev(fromObject) {
16577
16697
  if (fromTimeRangeFilter != null) {
16578
16698
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(fromTimeRangeFilter));
16579
16699
  }
16700
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16701
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
16702
+ }
16580
16703
  return toObject;
16581
16704
  }
16582
16705
  function dynamicRetrievalConfigToMldev(fromObject) {
@@ -16607,6 +16730,14 @@ function urlContextToMldev() {
16607
16730
  const toObject = {};
16608
16731
  return toObject;
16609
16732
  }
16733
+ function toolComputerUseToMldev(fromObject) {
16734
+ const toObject = {};
16735
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
16736
+ if (fromEnvironment != null) {
16737
+ setValueByPath(toObject, ['environment'], fromEnvironment);
16738
+ }
16739
+ return toObject;
16740
+ }
16610
16741
  function toolToMldev(fromObject) {
16611
16742
  const toObject = {};
16612
16743
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -16644,16 +16775,16 @@ function toolToMldev(fromObject) {
16644
16775
  if (fromUrlContext != null) {
16645
16776
  setValueByPath(toObject, ['urlContext'], urlContextToMldev());
16646
16777
  }
16778
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16779
+ if (fromComputerUse != null) {
16780
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev(fromComputerUse));
16781
+ }
16647
16782
  const fromCodeExecution = getValueByPath(fromObject, [
16648
16783
  'codeExecution',
16649
16784
  ]);
16650
16785
  if (fromCodeExecution != null) {
16651
16786
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16652
16787
  }
16653
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16654
- if (fromComputerUse != null) {
16655
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
16656
- }
16657
16788
  return toObject;
16658
16789
  }
16659
16790
  function sessionResumptionConfigToMldev(fromObject) {
@@ -17467,6 +17598,10 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17467
17598
  undefined) {
17468
17599
  throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
17469
17600
  }
17601
+ if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
17602
+ undefined) {
17603
+ throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
17604
+ }
17470
17605
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
17471
17606
  throw new Error('adapterSize parameter is not supported in Gemini API.');
17472
17607
  }
@@ -17480,12 +17615,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17480
17615
  }
17481
17616
  return toObject;
17482
17617
  }
17483
- function createTuningJobParametersToMldev(fromObject) {
17618
+ function createTuningJobParametersPrivateToMldev(fromObject) {
17484
17619
  const toObject = {};
17485
17620
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17486
17621
  if (fromBaseModel != null) {
17487
17622
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17488
17623
  }
17624
+ const fromPreTunedModel = getValueByPath(fromObject, [
17625
+ 'preTunedModel',
17626
+ ]);
17627
+ if (fromPreTunedModel != null) {
17628
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17629
+ }
17489
17630
  const fromTrainingDataset = getValueByPath(fromObject, [
17490
17631
  'trainingDataset',
17491
17632
  ]);
@@ -17599,6 +17740,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17599
17740
  if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
17600
17741
  setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
17601
17742
  }
17743
+ const fromPreTunedModelCheckpointId = getValueByPath(fromObject, [
17744
+ 'preTunedModelCheckpointId',
17745
+ ]);
17746
+ if (fromPreTunedModelCheckpointId != null) {
17747
+ setValueByPath(toObject, ['preTunedModel', 'checkpointId'], fromPreTunedModelCheckpointId);
17748
+ }
17602
17749
  const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
17603
17750
  if (parentObject !== undefined && fromAdapterSize != null) {
17604
17751
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
@@ -17611,12 +17758,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17611
17758
  }
17612
17759
  return toObject;
17613
17760
  }
17614
- function createTuningJobParametersToVertex(fromObject) {
17761
+ function createTuningJobParametersPrivateToVertex(fromObject) {
17615
17762
  const toObject = {};
17616
17763
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17617
17764
  if (fromBaseModel != null) {
17618
17765
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17619
17766
  }
17767
+ const fromPreTunedModel = getValueByPath(fromObject, [
17768
+ 'preTunedModel',
17769
+ ]);
17770
+ if (fromPreTunedModel != null) {
17771
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17772
+ }
17620
17773
  const fromTrainingDataset = getValueByPath(fromObject, [
17621
17774
  'trainingDataset',
17622
17775
  ]);
@@ -17691,11 +17844,11 @@ function tuningJobFromMldev(fromObject) {
17691
17844
  if (fromTunedModel != null) {
17692
17845
  setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
17693
17846
  }
17694
- const fromDistillationSpec = getValueByPath(fromObject, [
17695
- 'distillationSpec',
17847
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17848
+ 'customBaseModel',
17696
17849
  ]);
17697
- if (fromDistillationSpec != null) {
17698
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17850
+ if (fromCustomBaseModel != null) {
17851
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17699
17852
  }
17700
17853
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17701
17854
  if (fromExperiment != null) {
@@ -17705,18 +17858,14 @@ function tuningJobFromMldev(fromObject) {
17705
17858
  if (fromLabels != null) {
17706
17859
  setValueByPath(toObject, ['labels'], fromLabels);
17707
17860
  }
17861
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17862
+ if (fromOutputUri != null) {
17863
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17864
+ }
17708
17865
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17709
17866
  if (fromPipelineJob != null) {
17710
17867
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17711
17868
  }
17712
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17713
- if (fromSatisfiesPzi != null) {
17714
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17715
- }
17716
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17717
- if (fromSatisfiesPzs != null) {
17718
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17719
- }
17720
17869
  const fromServiceAccount = getValueByPath(fromObject, [
17721
17870
  'serviceAccount',
17722
17871
  ]);
@@ -17873,6 +18022,12 @@ function tuningJobFromVertex(fromObject) {
17873
18022
  if (fromTunedModel != null) {
17874
18023
  setValueByPath(toObject, ['tunedModel'], tunedModelFromVertex(fromTunedModel));
17875
18024
  }
18025
+ const fromPreTunedModel = getValueByPath(fromObject, [
18026
+ 'preTunedModel',
18027
+ ]);
18028
+ if (fromPreTunedModel != null) {
18029
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
18030
+ }
17876
18031
  const fromSupervisedTuningSpec = getValueByPath(fromObject, [
17877
18032
  'supervisedTuningSpec',
17878
18033
  ]);
@@ -17897,11 +18052,11 @@ function tuningJobFromVertex(fromObject) {
17897
18052
  if (fromPartnerModelTuningSpec != null) {
17898
18053
  setValueByPath(toObject, ['partnerModelTuningSpec'], fromPartnerModelTuningSpec);
17899
18054
  }
17900
- const fromDistillationSpec = getValueByPath(fromObject, [
17901
- 'distillationSpec',
18055
+ const fromCustomBaseModel = getValueByPath(fromObject, [
18056
+ 'customBaseModel',
17902
18057
  ]);
17903
- if (fromDistillationSpec != null) {
17904
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
18058
+ if (fromCustomBaseModel != null) {
18059
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17905
18060
  }
17906
18061
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17907
18062
  if (fromExperiment != null) {
@@ -17911,18 +18066,14 @@ function tuningJobFromVertex(fromObject) {
17911
18066
  if (fromLabels != null) {
17912
18067
  setValueByPath(toObject, ['labels'], fromLabels);
17913
18068
  }
18069
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
18070
+ if (fromOutputUri != null) {
18071
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
18072
+ }
17914
18073
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17915
18074
  if (fromPipelineJob != null) {
17916
18075
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17917
18076
  }
17918
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17919
- if (fromSatisfiesPzi != null) {
17920
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17921
- }
17922
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17923
- if (fromSatisfiesPzs != null) {
17924
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17925
- }
17926
18077
  const fromServiceAccount = getValueByPath(fromObject, [
17927
18078
  'serviceAccount',
17928
18079
  ]);
@@ -18008,10 +18159,22 @@ class Tunings extends BaseModule {
18008
18159
  */
18009
18160
  this.tune = async (params) => {
18010
18161
  if (this.apiClient.isVertexAI()) {
18011
- return await this.tuneInternal(params);
18162
+ if (params.baseModel.startsWith('projects/')) {
18163
+ const preTunedModel = {
18164
+ tunedModelName: params.baseModel,
18165
+ };
18166
+ const paramsPrivate = Object.assign(Object.assign({}, params), { preTunedModel: preTunedModel });
18167
+ paramsPrivate.baseModel = undefined;
18168
+ return await this.tuneInternal(paramsPrivate);
18169
+ }
18170
+ else {
18171
+ const paramsPrivate = Object.assign({}, params);
18172
+ return await this.tuneInternal(paramsPrivate);
18173
+ }
18012
18174
  }
18013
18175
  else {
18014
- const operation = await this.tuneMldevInternal(params);
18176
+ const paramsPrivate = Object.assign({}, params);
18177
+ const operation = await this.tuneMldevInternal(paramsPrivate);
18015
18178
  let tunedModelName = '';
18016
18179
  if (operation['metadata'] !== undefined &&
18017
18180
  operation['metadata']['tunedModel'] !== undefined) {
@@ -18171,7 +18334,7 @@ class Tunings extends BaseModule {
18171
18334
  let path = '';
18172
18335
  let queryParams = {};
18173
18336
  if (this.apiClient.isVertexAI()) {
18174
- const body = createTuningJobParametersToVertex(params);
18337
+ const body = createTuningJobParametersPrivateToVertex(params);
18175
18338
  path = formatMap('tuningJobs', body['_url']);
18176
18339
  queryParams = body['_query'];
18177
18340
  delete body['config'];
@@ -18213,7 +18376,7 @@ class Tunings extends BaseModule {
18213
18376
  throw new Error('This method is only supported by the Gemini Developer API.');
18214
18377
  }
18215
18378
  else {
18216
- const body = createTuningJobParametersToMldev(params);
18379
+ const body = createTuningJobParametersPrivateToMldev(params);
18217
18380
  path = formatMap('tunedModels', body['_url']);
18218
18381
  queryParams = body['_query'];
18219
18382
  delete body['config'];