@google/genai 1.12.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.
@@ -417,18 +417,6 @@ var ApiSpec;
417
417
  */
418
418
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
419
419
  })(ApiSpec || (ApiSpec = {}));
420
- /** Required. The environment being operated. */
421
- var Environment;
422
- (function (Environment) {
423
- /**
424
- * Defaults to browser.
425
- */
426
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
427
- /**
428
- * Operates in a web browser.
429
- */
430
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
431
- })(Environment || (Environment = {}));
432
420
  /** Status of the url retrieval. */
433
421
  var UrlRetrievalStatus;
434
422
  (function (UrlRetrievalStatus) {
@@ -444,6 +432,14 @@ var UrlRetrievalStatus;
444
432
  * Url retrieval is failed due to error.
445
433
  */
446
434
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
435
+ /**
436
+ * Url retrieval is failed because the content is behind paywall.
437
+ */
438
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
439
+ /**
440
+ * Url retrieval is failed because the content is unsafe.
441
+ */
442
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
447
443
  })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
448
444
  /** Output only. The reason why the model stopped generating tokens.
449
445
 
@@ -688,6 +684,22 @@ var JobState;
688
684
  */
689
685
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
690
686
  })(JobState || (JobState = {}));
687
+ /** Tuning mode. */
688
+ var TuningMode;
689
+ (function (TuningMode) {
690
+ /**
691
+ * Tuning mode is unspecified.
692
+ */
693
+ TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
694
+ /**
695
+ * Full fine-tuning mode.
696
+ */
697
+ TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
698
+ /**
699
+ * PEFT adapter tuning mode.
700
+ */
701
+ TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
702
+ })(TuningMode || (TuningMode = {}));
691
703
  /** Optional. Adapter size for tuning. */
692
704
  var AdapterSize;
693
705
  (function (AdapterSize) {
@@ -756,6 +768,18 @@ var DynamicRetrievalConfigMode;
756
768
  */
757
769
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
758
770
  })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
771
+ /** The environment being operated. */
772
+ var Environment;
773
+ (function (Environment) {
774
+ /**
775
+ * Defaults to browser.
776
+ */
777
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
778
+ /**
779
+ * Operates in a web browser.
780
+ */
781
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
782
+ })(Environment || (Environment = {}));
759
783
  /** Config for the function calling config mode. */
760
784
  var FunctionCallingConfigMode;
761
785
  (function (FunctionCallingConfigMode) {
@@ -1070,6 +1094,29 @@ var Scale;
1070
1094
  */
1071
1095
  Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
1072
1096
  })(Scale || (Scale = {}));
1097
+ /** The mode of music generation. */
1098
+ var MusicGenerationMode;
1099
+ (function (MusicGenerationMode) {
1100
+ /**
1101
+ * Rely on the server default generation mode.
1102
+ */
1103
+ MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
1104
+ /**
1105
+ * Steer text prompts to regions of latent space with higher quality
1106
+ music.
1107
+ */
1108
+ MusicGenerationMode["QUALITY"] = "QUALITY";
1109
+ /**
1110
+ * Steer text prompts to regions of latent space with a larger
1111
+ diversity of music.
1112
+ */
1113
+ MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
1114
+ /**
1115
+ * Steer text prompts to regions of latent space more likely to
1116
+ generate music with vocals.
1117
+ */
1118
+ MusicGenerationMode["VOCALIZATION"] = "VOCALIZATION";
1119
+ })(MusicGenerationMode || (MusicGenerationMode = {}));
1073
1120
  /** The playback control signal to apply to the music generation. */
1074
1121
  var LiveMusicPlaybackControl;
1075
1122
  (function (LiveMusicPlaybackControl) {
@@ -1493,6 +1540,9 @@ class EditImageResponse {
1493
1540
  }
1494
1541
  class UpscaleImageResponse {
1495
1542
  }
1543
+ /** The output images response. */
1544
+ class RecontextImageResponse {
1545
+ }
1496
1546
  class ListModelsResponse {
1497
1547
  }
1498
1548
  class DeleteModelResponse {
@@ -2836,6 +2886,9 @@ function googleSearchToMldev$4(fromObject) {
2836
2886
  if (fromTimeRangeFilter != null) {
2837
2887
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$4(fromTimeRangeFilter));
2838
2888
  }
2889
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
2890
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
2891
+ }
2839
2892
  return toObject;
2840
2893
  }
2841
2894
  function dynamicRetrievalConfigToMldev$4(fromObject) {
@@ -2866,6 +2919,14 @@ function urlContextToMldev$4() {
2866
2919
  const toObject = {};
2867
2920
  return toObject;
2868
2921
  }
2922
+ function toolComputerUseToMldev$4(fromObject) {
2923
+ const toObject = {};
2924
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
2925
+ if (fromEnvironment != null) {
2926
+ setValueByPath(toObject, ['environment'], fromEnvironment);
2927
+ }
2928
+ return toObject;
2929
+ }
2869
2930
  function toolToMldev$4(fromObject) {
2870
2931
  const toObject = {};
2871
2932
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -2903,16 +2964,16 @@ function toolToMldev$4(fromObject) {
2903
2964
  if (fromUrlContext != null) {
2904
2965
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$4());
2905
2966
  }
2967
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2968
+ if (fromComputerUse != null) {
2969
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$4(fromComputerUse));
2970
+ }
2906
2971
  const fromCodeExecution = getValueByPath(fromObject, [
2907
2972
  'codeExecution',
2908
2973
  ]);
2909
2974
  if (fromCodeExecution != null) {
2910
2975
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2911
2976
  }
2912
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2913
- if (fromComputerUse != null) {
2914
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
2915
- }
2916
2977
  return toObject;
2917
2978
  }
2918
2979
  function functionCallingConfigToMldev$2(fromObject) {
@@ -3698,6 +3759,10 @@ function generateContentResponseFromMldev$1(fromObject) {
3698
3759
  if (fromPromptFeedback != null) {
3699
3760
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
3700
3761
  }
3762
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
3763
+ if (fromResponseId != null) {
3764
+ setValueByPath(toObject, ['responseId'], fromResponseId);
3765
+ }
3701
3766
  const fromUsageMetadata = getValueByPath(fromObject, [
3702
3767
  'usageMetadata',
3703
3768
  ]);
@@ -3831,6 +3896,12 @@ function listBatchJobsResponseFromMldev(fromObject) {
3831
3896
  }
3832
3897
  function deleteResourceJobFromMldev(fromObject) {
3833
3898
  const toObject = {};
3899
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3900
+ 'sdkHttpResponse',
3901
+ ]);
3902
+ if (fromSdkHttpResponse != null) {
3903
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3904
+ }
3834
3905
  const fromName = getValueByPath(fromObject, ['name']);
3835
3906
  if (fromName != null) {
3836
3907
  setValueByPath(toObject, ['name'], fromName);
@@ -3980,6 +4051,12 @@ function listBatchJobsResponseFromVertex(fromObject) {
3980
4051
  }
3981
4052
  function deleteResourceJobFromVertex(fromObject) {
3982
4053
  const toObject = {};
4054
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
4055
+ 'sdkHttpResponse',
4056
+ ]);
4057
+ if (fromSdkHttpResponse != null) {
4058
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
4059
+ }
3983
4060
  const fromName = getValueByPath(fromObject, ['name']);
3984
4061
  if (fromName != null) {
3985
4062
  setValueByPath(toObject, ['name'], fromName);
@@ -4525,7 +4602,13 @@ class Batches extends BaseModule {
4525
4602
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4526
4603
  })
4527
4604
  .then((httpResponse) => {
4528
- return httpResponse.json();
4605
+ return httpResponse.json().then((jsonResponse) => {
4606
+ const response = jsonResponse;
4607
+ response.sdkHttpResponse = {
4608
+ headers: httpResponse.headers,
4609
+ };
4610
+ return response;
4611
+ });
4529
4612
  });
4530
4613
  return response.then((apiResponse) => {
4531
4614
  const resp = deleteResourceJobFromVertex(apiResponse);
@@ -4549,7 +4632,13 @@ class Batches extends BaseModule {
4549
4632
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4550
4633
  })
4551
4634
  .then((httpResponse) => {
4552
- return httpResponse.json();
4635
+ return httpResponse.json().then((jsonResponse) => {
4636
+ const response = jsonResponse;
4637
+ response.sdkHttpResponse = {
4638
+ headers: httpResponse.headers,
4639
+ };
4640
+ return response;
4641
+ });
4553
4642
  });
4554
4643
  return response.then((apiResponse) => {
4555
4644
  const resp = deleteResourceJobFromMldev(apiResponse);
@@ -4738,6 +4827,9 @@ function googleSearchToMldev$3(fromObject) {
4738
4827
  if (fromTimeRangeFilter != null) {
4739
4828
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(fromTimeRangeFilter));
4740
4829
  }
4830
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4831
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4832
+ }
4741
4833
  return toObject;
4742
4834
  }
4743
4835
  function dynamicRetrievalConfigToMldev$3(fromObject) {
@@ -4768,6 +4860,14 @@ function urlContextToMldev$3() {
4768
4860
  const toObject = {};
4769
4861
  return toObject;
4770
4862
  }
4863
+ function toolComputerUseToMldev$3(fromObject) {
4864
+ const toObject = {};
4865
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
4866
+ if (fromEnvironment != null) {
4867
+ setValueByPath(toObject, ['environment'], fromEnvironment);
4868
+ }
4869
+ return toObject;
4870
+ }
4771
4871
  function toolToMldev$3(fromObject) {
4772
4872
  const toObject = {};
4773
4873
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -4805,16 +4905,16 @@ function toolToMldev$3(fromObject) {
4805
4905
  if (fromUrlContext != null) {
4806
4906
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
4807
4907
  }
4908
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4909
+ if (fromComputerUse != null) {
4910
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$3(fromComputerUse));
4911
+ }
4808
4912
  const fromCodeExecution = getValueByPath(fromObject, [
4809
4913
  'codeExecution',
4810
4914
  ]);
4811
4915
  if (fromCodeExecution != null) {
4812
4916
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4813
4917
  }
4814
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4815
- if (fromComputerUse != null) {
4816
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
4817
- }
4818
4918
  return toObject;
4819
4919
  }
4820
4920
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5175,6 +5275,12 @@ function googleSearchToVertex$2(fromObject) {
5175
5275
  if (fromTimeRangeFilter != null) {
5176
5276
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$2(fromTimeRangeFilter));
5177
5277
  }
5278
+ const fromExcludeDomains = getValueByPath(fromObject, [
5279
+ 'excludeDomains',
5280
+ ]);
5281
+ if (fromExcludeDomains != null) {
5282
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5283
+ }
5178
5284
  return toObject;
5179
5285
  }
5180
5286
  function dynamicRetrievalConfigToVertex$2(fromObject) {
@@ -5201,8 +5307,14 @@ function googleSearchRetrievalToVertex$2(fromObject) {
5201
5307
  }
5202
5308
  return toObject;
5203
5309
  }
5204
- function enterpriseWebSearchToVertex$2() {
5310
+ function enterpriseWebSearchToVertex$2(fromObject) {
5205
5311
  const toObject = {};
5312
+ const fromExcludeDomains = getValueByPath(fromObject, [
5313
+ 'excludeDomains',
5314
+ ]);
5315
+ if (fromExcludeDomains != null) {
5316
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5317
+ }
5206
5318
  return toObject;
5207
5319
  }
5208
5320
  function apiKeyConfigToVertex$2(fromObject) {
@@ -5257,6 +5369,14 @@ function urlContextToVertex$2() {
5257
5369
  const toObject = {};
5258
5370
  return toObject;
5259
5371
  }
5372
+ function toolComputerUseToVertex$2(fromObject) {
5373
+ const toObject = {};
5374
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
5375
+ if (fromEnvironment != null) {
5376
+ setValueByPath(toObject, ['environment'], fromEnvironment);
5377
+ }
5378
+ return toObject;
5379
+ }
5260
5380
  function toolToVertex$2(fromObject) {
5261
5381
  const toObject = {};
5262
5382
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -5289,7 +5409,7 @@ function toolToVertex$2(fromObject) {
5289
5409
  'enterpriseWebSearch',
5290
5410
  ]);
5291
5411
  if (fromEnterpriseWebSearch != null) {
5292
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2());
5412
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2(fromEnterpriseWebSearch));
5293
5413
  }
5294
5414
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5295
5415
  if (fromGoogleMaps != null) {
@@ -5299,16 +5419,16 @@ function toolToVertex$2(fromObject) {
5299
5419
  if (fromUrlContext != null) {
5300
5420
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$2());
5301
5421
  }
5422
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5423
+ if (fromComputerUse != null) {
5424
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$2(fromComputerUse));
5425
+ }
5302
5426
  const fromCodeExecution = getValueByPath(fromObject, [
5303
5427
  'codeExecution',
5304
5428
  ]);
5305
5429
  if (fromCodeExecution != null) {
5306
5430
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5307
5431
  }
5308
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5309
- if (fromComputerUse != null) {
5310
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
5311
- }
5312
5432
  return toObject;
5313
5433
  }
5314
5434
  function functionCallingConfigToVertex$1(fromObject) {
@@ -7194,6 +7314,9 @@ function googleSearchToMldev$2(fromObject) {
7194
7314
  if (fromTimeRangeFilter != null) {
7195
7315
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(fromTimeRangeFilter));
7196
7316
  }
7317
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7318
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
7319
+ }
7197
7320
  return toObject;
7198
7321
  }
7199
7322
  function dynamicRetrievalConfigToMldev$2(fromObject) {
@@ -7224,6 +7347,14 @@ function urlContextToMldev$2() {
7224
7347
  const toObject = {};
7225
7348
  return toObject;
7226
7349
  }
7350
+ function toolComputerUseToMldev$2(fromObject) {
7351
+ const toObject = {};
7352
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
7353
+ if (fromEnvironment != null) {
7354
+ setValueByPath(toObject, ['environment'], fromEnvironment);
7355
+ }
7356
+ return toObject;
7357
+ }
7227
7358
  function toolToMldev$2(fromObject) {
7228
7359
  const toObject = {};
7229
7360
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7261,16 +7392,16 @@ function toolToMldev$2(fromObject) {
7261
7392
  if (fromUrlContext != null) {
7262
7393
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
7263
7394
  }
7395
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7396
+ if (fromComputerUse != null) {
7397
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$2(fromComputerUse));
7398
+ }
7264
7399
  const fromCodeExecution = getValueByPath(fromObject, [
7265
7400
  'codeExecution',
7266
7401
  ]);
7267
7402
  if (fromCodeExecution != null) {
7268
7403
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7269
7404
  }
7270
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7271
- if (fromComputerUse != null) {
7272
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7273
- }
7274
7405
  return toObject;
7275
7406
  }
7276
7407
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7610,6 +7741,12 @@ function liveMusicGenerationConfigToMldev(fromObject) {
7610
7741
  if (fromOnlyBassAndDrums != null) {
7611
7742
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
7612
7743
  }
7744
+ const fromMusicGenerationMode = getValueByPath(fromObject, [
7745
+ 'musicGenerationMode',
7746
+ ]);
7747
+ if (fromMusicGenerationMode != null) {
7748
+ setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
7749
+ }
7613
7750
  return toObject;
7614
7751
  }
7615
7752
  function liveMusicSetConfigParametersToMldev(fromObject) {
@@ -7880,6 +8017,12 @@ function googleSearchToVertex$1(fromObject) {
7880
8017
  if (fromTimeRangeFilter != null) {
7881
8018
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7882
8019
  }
8020
+ const fromExcludeDomains = getValueByPath(fromObject, [
8021
+ 'excludeDomains',
8022
+ ]);
8023
+ if (fromExcludeDomains != null) {
8024
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8025
+ }
7883
8026
  return toObject;
7884
8027
  }
7885
8028
  function dynamicRetrievalConfigToVertex$1(fromObject) {
@@ -7906,8 +8049,14 @@ function googleSearchRetrievalToVertex$1(fromObject) {
7906
8049
  }
7907
8050
  return toObject;
7908
8051
  }
7909
- function enterpriseWebSearchToVertex$1() {
8052
+ function enterpriseWebSearchToVertex$1(fromObject) {
7910
8053
  const toObject = {};
8054
+ const fromExcludeDomains = getValueByPath(fromObject, [
8055
+ 'excludeDomains',
8056
+ ]);
8057
+ if (fromExcludeDomains != null) {
8058
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8059
+ }
7911
8060
  return toObject;
7912
8061
  }
7913
8062
  function apiKeyConfigToVertex$1(fromObject) {
@@ -7962,6 +8111,14 @@ function urlContextToVertex$1() {
7962
8111
  const toObject = {};
7963
8112
  return toObject;
7964
8113
  }
8114
+ function toolComputerUseToVertex$1(fromObject) {
8115
+ const toObject = {};
8116
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
8117
+ if (fromEnvironment != null) {
8118
+ setValueByPath(toObject, ['environment'], fromEnvironment);
8119
+ }
8120
+ return toObject;
8121
+ }
7965
8122
  function toolToVertex$1(fromObject) {
7966
8123
  const toObject = {};
7967
8124
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7994,7 +8151,7 @@ function toolToVertex$1(fromObject) {
7994
8151
  'enterpriseWebSearch',
7995
8152
  ]);
7996
8153
  if (fromEnterpriseWebSearch != null) {
7997
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8154
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1(fromEnterpriseWebSearch));
7998
8155
  }
7999
8156
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8000
8157
  if (fromGoogleMaps != null) {
@@ -8004,16 +8161,16 @@ function toolToVertex$1(fromObject) {
8004
8161
  if (fromUrlContext != null) {
8005
8162
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8006
8163
  }
8164
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8165
+ if (fromComputerUse != null) {
8166
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$1(fromComputerUse));
8167
+ }
8007
8168
  const fromCodeExecution = getValueByPath(fromObject, [
8008
8169
  'codeExecution',
8009
8170
  ]);
8010
8171
  if (fromCodeExecution != null) {
8011
8172
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8012
8173
  }
8013
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8014
- if (fromComputerUse != null) {
8015
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8016
- }
8017
8174
  return toObject;
8018
8175
  }
8019
8176
  function sessionResumptionConfigToVertex(fromObject) {
@@ -8768,6 +8925,12 @@ function liveMusicGenerationConfigFromMldev(fromObject) {
8768
8925
  if (fromOnlyBassAndDrums != null) {
8769
8926
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
8770
8927
  }
8928
+ const fromMusicGenerationMode = getValueByPath(fromObject, [
8929
+ 'musicGenerationMode',
8930
+ ]);
8931
+ if (fromMusicGenerationMode != null) {
8932
+ setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
8933
+ }
8771
8934
  return toObject;
8772
8935
  }
8773
8936
  function liveMusicSourceMetadataFromMldev(fromObject) {
@@ -9535,6 +9698,9 @@ function googleSearchToMldev$1(fromObject) {
9535
9698
  if (fromTimeRangeFilter != null) {
9536
9699
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(fromTimeRangeFilter));
9537
9700
  }
9701
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9702
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
9703
+ }
9538
9704
  return toObject;
9539
9705
  }
9540
9706
  function dynamicRetrievalConfigToMldev$1(fromObject) {
@@ -9565,6 +9731,14 @@ function urlContextToMldev$1() {
9565
9731
  const toObject = {};
9566
9732
  return toObject;
9567
9733
  }
9734
+ function toolComputerUseToMldev$1(fromObject) {
9735
+ const toObject = {};
9736
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
9737
+ if (fromEnvironment != null) {
9738
+ setValueByPath(toObject, ['environment'], fromEnvironment);
9739
+ }
9740
+ return toObject;
9741
+ }
9568
9742
  function toolToMldev$1(fromObject) {
9569
9743
  const toObject = {};
9570
9744
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -9602,16 +9776,16 @@ function toolToMldev$1(fromObject) {
9602
9776
  if (fromUrlContext != null) {
9603
9777
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
9604
9778
  }
9779
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9780
+ if (fromComputerUse != null) {
9781
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$1(fromComputerUse));
9782
+ }
9605
9783
  const fromCodeExecution = getValueByPath(fromObject, [
9606
9784
  'codeExecution',
9607
9785
  ]);
9608
9786
  if (fromCodeExecution != null) {
9609
9787
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
9610
9788
  }
9611
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9612
- if (fromComputerUse != null) {
9613
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
9614
- }
9615
9789
  return toObject;
9616
9790
  }
9617
9791
  function functionCallingConfigToMldev(fromObject) {
@@ -10034,8 +10208,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
10034
10208
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
10035
10209
  throw new Error('addWatermark parameter is not supported in Gemini API.');
10036
10210
  }
10037
- if (getValueByPath(fromObject, ['imageSize']) !== undefined) {
10038
- throw new Error('imageSize parameter is not supported in Gemini API.');
10211
+ const fromImageSize = getValueByPath(fromObject, ['imageSize']);
10212
+ if (parentObject !== undefined && fromImageSize != null) {
10213
+ setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
10039
10214
  }
10040
10215
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
10041
10216
  throw new Error('enhancePrompt parameter is not supported in Gemini API.');
@@ -10574,6 +10749,12 @@ function googleSearchToVertex(fromObject) {
10574
10749
  if (fromTimeRangeFilter != null) {
10575
10750
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex(fromTimeRangeFilter));
10576
10751
  }
10752
+ const fromExcludeDomains = getValueByPath(fromObject, [
10753
+ 'excludeDomains',
10754
+ ]);
10755
+ if (fromExcludeDomains != null) {
10756
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10757
+ }
10577
10758
  return toObject;
10578
10759
  }
10579
10760
  function dynamicRetrievalConfigToVertex(fromObject) {
@@ -10600,8 +10781,14 @@ function googleSearchRetrievalToVertex(fromObject) {
10600
10781
  }
10601
10782
  return toObject;
10602
10783
  }
10603
- function enterpriseWebSearchToVertex() {
10784
+ function enterpriseWebSearchToVertex(fromObject) {
10604
10785
  const toObject = {};
10786
+ const fromExcludeDomains = getValueByPath(fromObject, [
10787
+ 'excludeDomains',
10788
+ ]);
10789
+ if (fromExcludeDomains != null) {
10790
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10791
+ }
10605
10792
  return toObject;
10606
10793
  }
10607
10794
  function apiKeyConfigToVertex(fromObject) {
@@ -10656,6 +10843,14 @@ function urlContextToVertex() {
10656
10843
  const toObject = {};
10657
10844
  return toObject;
10658
10845
  }
10846
+ function toolComputerUseToVertex(fromObject) {
10847
+ const toObject = {};
10848
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
10849
+ if (fromEnvironment != null) {
10850
+ setValueByPath(toObject, ['environment'], fromEnvironment);
10851
+ }
10852
+ return toObject;
10853
+ }
10659
10854
  function toolToVertex(fromObject) {
10660
10855
  const toObject = {};
10661
10856
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -10688,7 +10883,7 @@ function toolToVertex(fromObject) {
10688
10883
  'enterpriseWebSearch',
10689
10884
  ]);
10690
10885
  if (fromEnterpriseWebSearch != null) {
10691
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex());
10886
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex(fromEnterpriseWebSearch));
10692
10887
  }
10693
10888
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10694
10889
  if (fromGoogleMaps != null) {
@@ -10698,16 +10893,16 @@ function toolToVertex(fromObject) {
10698
10893
  if (fromUrlContext != null) {
10699
10894
  setValueByPath(toObject, ['urlContext'], urlContextToVertex());
10700
10895
  }
10896
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10897
+ if (fromComputerUse != null) {
10898
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex(fromComputerUse));
10899
+ }
10701
10900
  const fromCodeExecution = getValueByPath(fromObject, [
10702
10901
  'codeExecution',
10703
10902
  ]);
10704
10903
  if (fromCodeExecution != null) {
10705
10904
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10706
10905
  }
10707
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10708
- if (fromComputerUse != null) {
10709
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
10710
- }
10711
10906
  return toObject;
10712
10907
  }
10713
10908
  function functionCallingConfigToVertex(fromObject) {
@@ -11437,6 +11632,106 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11437
11632
  }
11438
11633
  return toObject;
11439
11634
  }
11635
+ function productImageToVertex(fromObject) {
11636
+ const toObject = {};
11637
+ const fromProductImage = getValueByPath(fromObject, ['productImage']);
11638
+ if (fromProductImage != null) {
11639
+ setValueByPath(toObject, ['image'], imageToVertex(fromProductImage));
11640
+ }
11641
+ return toObject;
11642
+ }
11643
+ function recontextImageSourceToVertex(fromObject, parentObject) {
11644
+ const toObject = {};
11645
+ const fromPrompt = getValueByPath(fromObject, ['prompt']);
11646
+ if (parentObject !== undefined && fromPrompt != null) {
11647
+ setValueByPath(parentObject, ['instances[0]', 'prompt'], fromPrompt);
11648
+ }
11649
+ const fromPersonImage = getValueByPath(fromObject, ['personImage']);
11650
+ if (parentObject !== undefined && fromPersonImage != null) {
11651
+ setValueByPath(parentObject, ['instances[0]', 'personImage', 'image'], imageToVertex(fromPersonImage));
11652
+ }
11653
+ const fromProductImages = getValueByPath(fromObject, [
11654
+ 'productImages',
11655
+ ]);
11656
+ if (parentObject !== undefined && fromProductImages != null) {
11657
+ let transformedList = fromProductImages;
11658
+ if (Array.isArray(transformedList)) {
11659
+ transformedList = transformedList.map((item) => {
11660
+ return productImageToVertex(item);
11661
+ });
11662
+ }
11663
+ setValueByPath(parentObject, ['instances[0]', 'productImages'], transformedList);
11664
+ }
11665
+ return toObject;
11666
+ }
11667
+ function recontextImageConfigToVertex(fromObject, parentObject) {
11668
+ const toObject = {};
11669
+ const fromNumberOfImages = getValueByPath(fromObject, [
11670
+ 'numberOfImages',
11671
+ ]);
11672
+ if (parentObject !== undefined && fromNumberOfImages != null) {
11673
+ setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfImages);
11674
+ }
11675
+ const fromBaseSteps = getValueByPath(fromObject, ['baseSteps']);
11676
+ if (parentObject !== undefined && fromBaseSteps != null) {
11677
+ setValueByPath(parentObject, ['parameters', 'editConfig', 'baseSteps'], fromBaseSteps);
11678
+ }
11679
+ const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
11680
+ if (parentObject !== undefined && fromOutputGcsUri != null) {
11681
+ setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
11682
+ }
11683
+ const fromSeed = getValueByPath(fromObject, ['seed']);
11684
+ if (parentObject !== undefined && fromSeed != null) {
11685
+ setValueByPath(parentObject, ['parameters', 'seed'], fromSeed);
11686
+ }
11687
+ const fromSafetyFilterLevel = getValueByPath(fromObject, [
11688
+ 'safetyFilterLevel',
11689
+ ]);
11690
+ if (parentObject !== undefined && fromSafetyFilterLevel != null) {
11691
+ setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
11692
+ }
11693
+ const fromPersonGeneration = getValueByPath(fromObject, [
11694
+ 'personGeneration',
11695
+ ]);
11696
+ if (parentObject !== undefined && fromPersonGeneration != null) {
11697
+ setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
11698
+ }
11699
+ const fromOutputMimeType = getValueByPath(fromObject, [
11700
+ 'outputMimeType',
11701
+ ]);
11702
+ if (parentObject !== undefined && fromOutputMimeType != null) {
11703
+ setValueByPath(parentObject, ['parameters', 'outputOptions', 'mimeType'], fromOutputMimeType);
11704
+ }
11705
+ const fromOutputCompressionQuality = getValueByPath(fromObject, [
11706
+ 'outputCompressionQuality',
11707
+ ]);
11708
+ if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11709
+ setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11710
+ }
11711
+ const fromEnhancePrompt = getValueByPath(fromObject, [
11712
+ 'enhancePrompt',
11713
+ ]);
11714
+ if (parentObject !== undefined && fromEnhancePrompt != null) {
11715
+ setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
11716
+ }
11717
+ return toObject;
11718
+ }
11719
+ function recontextImageParametersToVertex(apiClient, fromObject) {
11720
+ const toObject = {};
11721
+ const fromModel = getValueByPath(fromObject, ['model']);
11722
+ if (fromModel != null) {
11723
+ setValueByPath(toObject, ['_url', 'model'], tModel(apiClient, fromModel));
11724
+ }
11725
+ const fromSource = getValueByPath(fromObject, ['source']);
11726
+ if (fromSource != null) {
11727
+ setValueByPath(toObject, ['config'], recontextImageSourceToVertex(fromSource, toObject));
11728
+ }
11729
+ const fromConfig = getValueByPath(fromObject, ['config']);
11730
+ if (fromConfig != null) {
11731
+ setValueByPath(toObject, ['config'], recontextImageConfigToVertex(fromConfig, toObject));
11732
+ }
11733
+ return toObject;
11734
+ }
11440
11735
  function getModelParametersToVertex(apiClient, fromObject) {
11441
11736
  const toObject = {};
11442
11737
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -11933,6 +12228,10 @@ function generateContentResponseFromMldev(fromObject) {
11933
12228
  if (fromPromptFeedback != null) {
11934
12229
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
11935
12230
  }
12231
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
12232
+ if (fromResponseId != null) {
12233
+ setValueByPath(toObject, ['responseId'], fromResponseId);
12234
+ }
11936
12235
  const fromUsageMetadata = getValueByPath(fromObject, [
11937
12236
  'usageMetadata',
11938
12237
  ]);
@@ -12483,10 +12782,6 @@ function generateContentResponseFromVertex(fromObject) {
12483
12782
  if (fromCreateTime != null) {
12484
12783
  setValueByPath(toObject, ['createTime'], fromCreateTime);
12485
12784
  }
12486
- const fromResponseId = getValueByPath(fromObject, ['responseId']);
12487
- if (fromResponseId != null) {
12488
- setValueByPath(toObject, ['responseId'], fromResponseId);
12489
- }
12490
12785
  const fromModelVersion = getValueByPath(fromObject, ['modelVersion']);
12491
12786
  if (fromModelVersion != null) {
12492
12787
  setValueByPath(toObject, ['modelVersion'], fromModelVersion);
@@ -12497,6 +12792,10 @@ function generateContentResponseFromVertex(fromObject) {
12497
12792
  if (fromPromptFeedback != null) {
12498
12793
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
12499
12794
  }
12795
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
12796
+ if (fromResponseId != null) {
12797
+ setValueByPath(toObject, ['responseId'], fromResponseId);
12798
+ }
12500
12799
  const fromUsageMetadata = getValueByPath(fromObject, [
12501
12800
  'usageMetadata',
12502
12801
  ]);
@@ -12700,6 +12999,22 @@ function upscaleImageResponseFromVertex(fromObject) {
12700
12999
  }
12701
13000
  return toObject;
12702
13001
  }
13002
+ function recontextImageResponseFromVertex(fromObject) {
13003
+ const toObject = {};
13004
+ const fromGeneratedImages = getValueByPath(fromObject, [
13005
+ 'predictions',
13006
+ ]);
13007
+ if (fromGeneratedImages != null) {
13008
+ let transformedList = fromGeneratedImages;
13009
+ if (Array.isArray(transformedList)) {
13010
+ transformedList = transformedList.map((item) => {
13011
+ return generatedImageFromVertex(item);
13012
+ });
13013
+ }
13014
+ setValueByPath(toObject, ['generatedImages'], transformedList);
13015
+ }
13016
+ return toObject;
13017
+ }
12703
13018
  function endpointFromVertex(fromObject) {
12704
13019
  const toObject = {};
12705
13020
  const fromName = getValueByPath(fromObject, ['endpoint']);
@@ -12947,7 +13262,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12947
13262
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12948
13263
  const USER_AGENT_HEADER = 'User-Agent';
12949
13264
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12950
- const SDK_VERSION = '1.12.0'; // x-release-please-version
13265
+ const SDK_VERSION = '1.14.0'; // x-release-please-version
12951
13266
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12952
13267
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12953
13268
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -15317,6 +15632,79 @@ class Models extends BaseModule {
15317
15632
  throw new Error('This method is only supported by the Vertex AI.');
15318
15633
  }
15319
15634
  }
15635
+ /**
15636
+ * Recontextualizes an image.
15637
+ *
15638
+ * There are two types of recontextualization currently supported:
15639
+ * 1) Imagen Product Recontext - Generate images of products in new scenes
15640
+ * and contexts.
15641
+ * 2) Virtual Try-On: Generate images of persons modeling fashion products.
15642
+ *
15643
+ * @param params - The parameters for recontextualizing an image.
15644
+ * @return The response from the API.
15645
+ *
15646
+ * @example
15647
+ * ```ts
15648
+ * const response1 = await ai.models.recontextImage({
15649
+ * model: 'imagen-product-recontext-preview-06-30',
15650
+ * source: {
15651
+ * prompt: 'In a modern kitchen setting.',
15652
+ * productImages: [productImage],
15653
+ * },
15654
+ * config: {
15655
+ * numberOfImages: 1,
15656
+ * },
15657
+ * });
15658
+ * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
15659
+ *
15660
+ * const response2 = await ai.models.recontextImage({
15661
+ * model: 'virtual-try-on-preview-08-04',
15662
+ * source: {
15663
+ * personImage: personImage,
15664
+ * productImages: [productImage],
15665
+ * },
15666
+ * config: {
15667
+ * numberOfImages: 1,
15668
+ * },
15669
+ * });
15670
+ * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
15671
+ * ```
15672
+ */
15673
+ async recontextImage(params) {
15674
+ var _a, _b;
15675
+ let response;
15676
+ let path = '';
15677
+ let queryParams = {};
15678
+ if (this.apiClient.isVertexAI()) {
15679
+ const body = recontextImageParametersToVertex(this.apiClient, params);
15680
+ path = formatMap('{model}:predict', body['_url']);
15681
+ queryParams = body['_query'];
15682
+ delete body['config'];
15683
+ delete body['_url'];
15684
+ delete body['_query'];
15685
+ response = this.apiClient
15686
+ .request({
15687
+ path: path,
15688
+ queryParams: queryParams,
15689
+ body: JSON.stringify(body),
15690
+ httpMethod: 'POST',
15691
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
15692
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
15693
+ })
15694
+ .then((httpResponse) => {
15695
+ return httpResponse.json();
15696
+ });
15697
+ return response.then((apiResponse) => {
15698
+ const resp = recontextImageResponseFromVertex(apiResponse);
15699
+ const typedResp = new RecontextImageResponse();
15700
+ Object.assign(typedResp, resp);
15701
+ return typedResp;
15702
+ });
15703
+ }
15704
+ else {
15705
+ throw new Error('This method is only supported by the Vertex AI.');
15706
+ }
15707
+ }
15320
15708
  /**
15321
15709
  * Fetches information about a model by name.
15322
15710
  *
@@ -16281,6 +16669,9 @@ function googleSearchToMldev(fromObject) {
16281
16669
  if (fromTimeRangeFilter != null) {
16282
16670
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(fromTimeRangeFilter));
16283
16671
  }
16672
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16673
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
16674
+ }
16284
16675
  return toObject;
16285
16676
  }
16286
16677
  function dynamicRetrievalConfigToMldev(fromObject) {
@@ -16311,6 +16702,14 @@ function urlContextToMldev() {
16311
16702
  const toObject = {};
16312
16703
  return toObject;
16313
16704
  }
16705
+ function toolComputerUseToMldev(fromObject) {
16706
+ const toObject = {};
16707
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
16708
+ if (fromEnvironment != null) {
16709
+ setValueByPath(toObject, ['environment'], fromEnvironment);
16710
+ }
16711
+ return toObject;
16712
+ }
16314
16713
  function toolToMldev(fromObject) {
16315
16714
  const toObject = {};
16316
16715
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -16348,16 +16747,16 @@ function toolToMldev(fromObject) {
16348
16747
  if (fromUrlContext != null) {
16349
16748
  setValueByPath(toObject, ['urlContext'], urlContextToMldev());
16350
16749
  }
16750
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16751
+ if (fromComputerUse != null) {
16752
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev(fromComputerUse));
16753
+ }
16351
16754
  const fromCodeExecution = getValueByPath(fromObject, [
16352
16755
  'codeExecution',
16353
16756
  ]);
16354
16757
  if (fromCodeExecution != null) {
16355
16758
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16356
16759
  }
16357
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16358
- if (fromComputerUse != null) {
16359
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
16360
- }
16361
16760
  return toObject;
16362
16761
  }
16363
16762
  function sessionResumptionConfigToMldev(fromObject) {
@@ -16997,6 +17396,10 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
16997
17396
  undefined) {
16998
17397
  throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
16999
17398
  }
17399
+ if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
17400
+ undefined) {
17401
+ throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
17402
+ }
17000
17403
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
17001
17404
  throw new Error('adapterSize parameter is not supported in Gemini API.');
17002
17405
  }
@@ -17010,12 +17413,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17010
17413
  }
17011
17414
  return toObject;
17012
17415
  }
17013
- function createTuningJobParametersToMldev(fromObject) {
17416
+ function createTuningJobParametersPrivateToMldev(fromObject) {
17014
17417
  const toObject = {};
17015
17418
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17016
17419
  if (fromBaseModel != null) {
17017
17420
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17018
17421
  }
17422
+ const fromPreTunedModel = getValueByPath(fromObject, [
17423
+ 'preTunedModel',
17424
+ ]);
17425
+ if (fromPreTunedModel != null) {
17426
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17427
+ }
17019
17428
  const fromTrainingDataset = getValueByPath(fromObject, [
17020
17429
  'trainingDataset',
17021
17430
  ]);
@@ -17129,6 +17538,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17129
17538
  if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
17130
17539
  setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
17131
17540
  }
17541
+ const fromPreTunedModelCheckpointId = getValueByPath(fromObject, [
17542
+ 'preTunedModelCheckpointId',
17543
+ ]);
17544
+ if (fromPreTunedModelCheckpointId != null) {
17545
+ setValueByPath(toObject, ['preTunedModel', 'checkpointId'], fromPreTunedModelCheckpointId);
17546
+ }
17132
17547
  const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
17133
17548
  if (parentObject !== undefined && fromAdapterSize != null) {
17134
17549
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
@@ -17141,12 +17556,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17141
17556
  }
17142
17557
  return toObject;
17143
17558
  }
17144
- function createTuningJobParametersToVertex(fromObject) {
17559
+ function createTuningJobParametersPrivateToVertex(fromObject) {
17145
17560
  const toObject = {};
17146
17561
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17147
17562
  if (fromBaseModel != null) {
17148
17563
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17149
17564
  }
17565
+ const fromPreTunedModel = getValueByPath(fromObject, [
17566
+ 'preTunedModel',
17567
+ ]);
17568
+ if (fromPreTunedModel != null) {
17569
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17570
+ }
17150
17571
  const fromTrainingDataset = getValueByPath(fromObject, [
17151
17572
  'trainingDataset',
17152
17573
  ]);
@@ -17221,11 +17642,11 @@ function tuningJobFromMldev(fromObject) {
17221
17642
  if (fromTunedModel != null) {
17222
17643
  setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
17223
17644
  }
17224
- const fromDistillationSpec = getValueByPath(fromObject, [
17225
- 'distillationSpec',
17645
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17646
+ 'customBaseModel',
17226
17647
  ]);
17227
- if (fromDistillationSpec != null) {
17228
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17648
+ if (fromCustomBaseModel != null) {
17649
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17229
17650
  }
17230
17651
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17231
17652
  if (fromExperiment != null) {
@@ -17235,18 +17656,14 @@ function tuningJobFromMldev(fromObject) {
17235
17656
  if (fromLabels != null) {
17236
17657
  setValueByPath(toObject, ['labels'], fromLabels);
17237
17658
  }
17659
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17660
+ if (fromOutputUri != null) {
17661
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17662
+ }
17238
17663
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17239
17664
  if (fromPipelineJob != null) {
17240
17665
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17241
17666
  }
17242
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17243
- if (fromSatisfiesPzi != null) {
17244
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17245
- }
17246
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17247
- if (fromSatisfiesPzs != null) {
17248
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17249
- }
17250
17667
  const fromServiceAccount = getValueByPath(fromObject, [
17251
17668
  'serviceAccount',
17252
17669
  ]);
@@ -17403,6 +17820,12 @@ function tuningJobFromVertex(fromObject) {
17403
17820
  if (fromTunedModel != null) {
17404
17821
  setValueByPath(toObject, ['tunedModel'], tunedModelFromVertex(fromTunedModel));
17405
17822
  }
17823
+ const fromPreTunedModel = getValueByPath(fromObject, [
17824
+ 'preTunedModel',
17825
+ ]);
17826
+ if (fromPreTunedModel != null) {
17827
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17828
+ }
17406
17829
  const fromSupervisedTuningSpec = getValueByPath(fromObject, [
17407
17830
  'supervisedTuningSpec',
17408
17831
  ]);
@@ -17427,11 +17850,11 @@ function tuningJobFromVertex(fromObject) {
17427
17850
  if (fromPartnerModelTuningSpec != null) {
17428
17851
  setValueByPath(toObject, ['partnerModelTuningSpec'], fromPartnerModelTuningSpec);
17429
17852
  }
17430
- const fromDistillationSpec = getValueByPath(fromObject, [
17431
- 'distillationSpec',
17853
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17854
+ 'customBaseModel',
17432
17855
  ]);
17433
- if (fromDistillationSpec != null) {
17434
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17856
+ if (fromCustomBaseModel != null) {
17857
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17435
17858
  }
17436
17859
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17437
17860
  if (fromExperiment != null) {
@@ -17441,18 +17864,14 @@ function tuningJobFromVertex(fromObject) {
17441
17864
  if (fromLabels != null) {
17442
17865
  setValueByPath(toObject, ['labels'], fromLabels);
17443
17866
  }
17867
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17868
+ if (fromOutputUri != null) {
17869
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17870
+ }
17444
17871
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17445
17872
  if (fromPipelineJob != null) {
17446
17873
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17447
17874
  }
17448
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17449
- if (fromSatisfiesPzi != null) {
17450
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17451
- }
17452
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17453
- if (fromSatisfiesPzs != null) {
17454
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17455
- }
17456
17875
  const fromServiceAccount = getValueByPath(fromObject, [
17457
17876
  'serviceAccount',
17458
17877
  ]);
@@ -17538,10 +17957,22 @@ class Tunings extends BaseModule {
17538
17957
  */
17539
17958
  this.tune = async (params) => {
17540
17959
  if (this.apiClient.isVertexAI()) {
17541
- return await this.tuneInternal(params);
17960
+ if (params.baseModel.startsWith('projects/')) {
17961
+ const preTunedModel = {
17962
+ tunedModelName: params.baseModel,
17963
+ };
17964
+ const paramsPrivate = Object.assign(Object.assign({}, params), { preTunedModel: preTunedModel });
17965
+ paramsPrivate.baseModel = undefined;
17966
+ return await this.tuneInternal(paramsPrivate);
17967
+ }
17968
+ else {
17969
+ const paramsPrivate = Object.assign({}, params);
17970
+ return await this.tuneInternal(paramsPrivate);
17971
+ }
17542
17972
  }
17543
17973
  else {
17544
- const operation = await this.tuneMldevInternal(params);
17974
+ const paramsPrivate = Object.assign({}, params);
17975
+ const operation = await this.tuneMldevInternal(paramsPrivate);
17545
17976
  let tunedModelName = '';
17546
17977
  if (operation['metadata'] !== undefined &&
17547
17978
  operation['metadata']['tunedModel'] !== undefined) {
@@ -17701,7 +18132,7 @@ class Tunings extends BaseModule {
17701
18132
  let path = '';
17702
18133
  let queryParams = {};
17703
18134
  if (this.apiClient.isVertexAI()) {
17704
- const body = createTuningJobParametersToVertex(params);
18135
+ const body = createTuningJobParametersPrivateToVertex(params);
17705
18136
  path = formatMap('tuningJobs', body['_url']);
17706
18137
  queryParams = body['_query'];
17707
18138
  delete body['config'];
@@ -17743,7 +18174,7 @@ class Tunings extends BaseModule {
17743
18174
  throw new Error('This method is only supported by the Gemini Developer API.');
17744
18175
  }
17745
18176
  else {
17746
- const body = createTuningJobParametersToMldev(params);
18177
+ const body = createTuningJobParametersPrivateToMldev(params);
17747
18178
  path = formatMap('tunedModels', body['_url']);
17748
18179
  queryParams = body['_query'];
17749
18180
  delete body['config'];
@@ -18023,5 +18454,5 @@ class GoogleGenAI {
18023
18454
  }
18024
18455
  }
18025
18456
 
18026
- export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
18457
+ export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
18027
18458
  //# sourceMappingURL=index.mjs.map