@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.
@@ -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) {
@@ -472,6 +460,14 @@ exports.UrlRetrievalStatus = void 0;
472
460
  * Url retrieval is failed due to error.
473
461
  */
474
462
  UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
463
+ /**
464
+ * Url retrieval is failed because the content is behind paywall.
465
+ */
466
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
467
+ /**
468
+ * Url retrieval is failed because the content is unsafe.
469
+ */
470
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
475
471
  })(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
476
472
  /** Output only. The reason why the model stopped generating tokens.
477
473
 
@@ -716,6 +712,22 @@ exports.JobState = void 0;
716
712
  */
717
713
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
718
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 = {}));
719
731
  /** Optional. Adapter size for tuning. */
720
732
  exports.AdapterSize = void 0;
721
733
  (function (AdapterSize) {
@@ -784,6 +796,18 @@ exports.DynamicRetrievalConfigMode = void 0;
784
796
  */
785
797
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
786
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 = {}));
787
811
  /** Config for the function calling config mode. */
788
812
  exports.FunctionCallingConfigMode = void 0;
789
813
  (function (FunctionCallingConfigMode) {
@@ -1098,6 +1122,29 @@ exports.Scale = void 0;
1098
1122
  */
1099
1123
  Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
1100
1124
  })(exports.Scale || (exports.Scale = {}));
1125
+ /** The mode of music generation. */
1126
+ exports.MusicGenerationMode = void 0;
1127
+ (function (MusicGenerationMode) {
1128
+ /**
1129
+ * Rely on the server default generation mode.
1130
+ */
1131
+ MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
1132
+ /**
1133
+ * Steer text prompts to regions of latent space with higher quality
1134
+ music.
1135
+ */
1136
+ MusicGenerationMode["QUALITY"] = "QUALITY";
1137
+ /**
1138
+ * Steer text prompts to regions of latent space with a larger
1139
+ diversity of music.
1140
+ */
1141
+ MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
1142
+ /**
1143
+ * Steer text prompts to regions of latent space more likely to
1144
+ generate music with vocals.
1145
+ */
1146
+ MusicGenerationMode["VOCALIZATION"] = "VOCALIZATION";
1147
+ })(exports.MusicGenerationMode || (exports.MusicGenerationMode = {}));
1101
1148
  /** The playback control signal to apply to the music generation. */
1102
1149
  exports.LiveMusicPlaybackControl = void 0;
1103
1150
  (function (LiveMusicPlaybackControl) {
@@ -1521,6 +1568,9 @@ class EditImageResponse {
1521
1568
  }
1522
1569
  class UpscaleImageResponse {
1523
1570
  }
1571
+ /** The output images response. */
1572
+ class RecontextImageResponse {
1573
+ }
1524
1574
  class ListModelsResponse {
1525
1575
  }
1526
1576
  class DeleteModelResponse {
@@ -2864,6 +2914,9 @@ function googleSearchToMldev$4(fromObject) {
2864
2914
  if (fromTimeRangeFilter != null) {
2865
2915
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$4(fromTimeRangeFilter));
2866
2916
  }
2917
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
2918
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
2919
+ }
2867
2920
  return toObject;
2868
2921
  }
2869
2922
  function dynamicRetrievalConfigToMldev$4(fromObject) {
@@ -2894,6 +2947,14 @@ function urlContextToMldev$4() {
2894
2947
  const toObject = {};
2895
2948
  return toObject;
2896
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
+ }
2897
2958
  function toolToMldev$4(fromObject) {
2898
2959
  const toObject = {};
2899
2960
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -2931,16 +2992,16 @@ function toolToMldev$4(fromObject) {
2931
2992
  if (fromUrlContext != null) {
2932
2993
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$4());
2933
2994
  }
2995
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2996
+ if (fromComputerUse != null) {
2997
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$4(fromComputerUse));
2998
+ }
2934
2999
  const fromCodeExecution = getValueByPath(fromObject, [
2935
3000
  'codeExecution',
2936
3001
  ]);
2937
3002
  if (fromCodeExecution != null) {
2938
3003
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2939
3004
  }
2940
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2941
- if (fromComputerUse != null) {
2942
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
2943
- }
2944
3005
  return toObject;
2945
3006
  }
2946
3007
  function functionCallingConfigToMldev$2(fromObject) {
@@ -3726,6 +3787,10 @@ function generateContentResponseFromMldev$1(fromObject) {
3726
3787
  if (fromPromptFeedback != null) {
3727
3788
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
3728
3789
  }
3790
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
3791
+ if (fromResponseId != null) {
3792
+ setValueByPath(toObject, ['responseId'], fromResponseId);
3793
+ }
3729
3794
  const fromUsageMetadata = getValueByPath(fromObject, [
3730
3795
  'usageMetadata',
3731
3796
  ]);
@@ -3859,6 +3924,12 @@ function listBatchJobsResponseFromMldev(fromObject) {
3859
3924
  }
3860
3925
  function deleteResourceJobFromMldev(fromObject) {
3861
3926
  const toObject = {};
3927
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3928
+ 'sdkHttpResponse',
3929
+ ]);
3930
+ if (fromSdkHttpResponse != null) {
3931
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3932
+ }
3862
3933
  const fromName = getValueByPath(fromObject, ['name']);
3863
3934
  if (fromName != null) {
3864
3935
  setValueByPath(toObject, ['name'], fromName);
@@ -4008,6 +4079,12 @@ function listBatchJobsResponseFromVertex(fromObject) {
4008
4079
  }
4009
4080
  function deleteResourceJobFromVertex(fromObject) {
4010
4081
  const toObject = {};
4082
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
4083
+ 'sdkHttpResponse',
4084
+ ]);
4085
+ if (fromSdkHttpResponse != null) {
4086
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
4087
+ }
4011
4088
  const fromName = getValueByPath(fromObject, ['name']);
4012
4089
  if (fromName != null) {
4013
4090
  setValueByPath(toObject, ['name'], fromName);
@@ -4553,7 +4630,13 @@ class Batches extends BaseModule {
4553
4630
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4554
4631
  })
4555
4632
  .then((httpResponse) => {
4556
- return httpResponse.json();
4633
+ return httpResponse.json().then((jsonResponse) => {
4634
+ const response = jsonResponse;
4635
+ response.sdkHttpResponse = {
4636
+ headers: httpResponse.headers,
4637
+ };
4638
+ return response;
4639
+ });
4557
4640
  });
4558
4641
  return response.then((apiResponse) => {
4559
4642
  const resp = deleteResourceJobFromVertex(apiResponse);
@@ -4577,7 +4660,13 @@ class Batches extends BaseModule {
4577
4660
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4578
4661
  })
4579
4662
  .then((httpResponse) => {
4580
- return httpResponse.json();
4663
+ return httpResponse.json().then((jsonResponse) => {
4664
+ const response = jsonResponse;
4665
+ response.sdkHttpResponse = {
4666
+ headers: httpResponse.headers,
4667
+ };
4668
+ return response;
4669
+ });
4581
4670
  });
4582
4671
  return response.then((apiResponse) => {
4583
4672
  const resp = deleteResourceJobFromMldev(apiResponse);
@@ -4766,6 +4855,9 @@ function googleSearchToMldev$3(fromObject) {
4766
4855
  if (fromTimeRangeFilter != null) {
4767
4856
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(fromTimeRangeFilter));
4768
4857
  }
4858
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4859
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
4860
+ }
4769
4861
  return toObject;
4770
4862
  }
4771
4863
  function dynamicRetrievalConfigToMldev$3(fromObject) {
@@ -4796,6 +4888,14 @@ function urlContextToMldev$3() {
4796
4888
  const toObject = {};
4797
4889
  return toObject;
4798
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
+ }
4799
4899
  function toolToMldev$3(fromObject) {
4800
4900
  const toObject = {};
4801
4901
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -4833,16 +4933,16 @@ function toolToMldev$3(fromObject) {
4833
4933
  if (fromUrlContext != null) {
4834
4934
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
4835
4935
  }
4936
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4937
+ if (fromComputerUse != null) {
4938
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$3(fromComputerUse));
4939
+ }
4836
4940
  const fromCodeExecution = getValueByPath(fromObject, [
4837
4941
  'codeExecution',
4838
4942
  ]);
4839
4943
  if (fromCodeExecution != null) {
4840
4944
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4841
4945
  }
4842
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4843
- if (fromComputerUse != null) {
4844
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
4845
- }
4846
4946
  return toObject;
4847
4947
  }
4848
4948
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5203,6 +5303,12 @@ function googleSearchToVertex$2(fromObject) {
5203
5303
  if (fromTimeRangeFilter != null) {
5204
5304
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$2(fromTimeRangeFilter));
5205
5305
  }
5306
+ const fromExcludeDomains = getValueByPath(fromObject, [
5307
+ 'excludeDomains',
5308
+ ]);
5309
+ if (fromExcludeDomains != null) {
5310
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5311
+ }
5206
5312
  return toObject;
5207
5313
  }
5208
5314
  function dynamicRetrievalConfigToVertex$2(fromObject) {
@@ -5229,8 +5335,14 @@ function googleSearchRetrievalToVertex$2(fromObject) {
5229
5335
  }
5230
5336
  return toObject;
5231
5337
  }
5232
- function enterpriseWebSearchToVertex$2() {
5338
+ function enterpriseWebSearchToVertex$2(fromObject) {
5233
5339
  const toObject = {};
5340
+ const fromExcludeDomains = getValueByPath(fromObject, [
5341
+ 'excludeDomains',
5342
+ ]);
5343
+ if (fromExcludeDomains != null) {
5344
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
5345
+ }
5234
5346
  return toObject;
5235
5347
  }
5236
5348
  function apiKeyConfigToVertex$2(fromObject) {
@@ -5285,6 +5397,14 @@ function urlContextToVertex$2() {
5285
5397
  const toObject = {};
5286
5398
  return toObject;
5287
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
+ }
5288
5408
  function toolToVertex$2(fromObject) {
5289
5409
  const toObject = {};
5290
5410
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -5317,7 +5437,7 @@ function toolToVertex$2(fromObject) {
5317
5437
  'enterpriseWebSearch',
5318
5438
  ]);
5319
5439
  if (fromEnterpriseWebSearch != null) {
5320
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2());
5440
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$2(fromEnterpriseWebSearch));
5321
5441
  }
5322
5442
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5323
5443
  if (fromGoogleMaps != null) {
@@ -5327,16 +5447,16 @@ function toolToVertex$2(fromObject) {
5327
5447
  if (fromUrlContext != null) {
5328
5448
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$2());
5329
5449
  }
5450
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5451
+ if (fromComputerUse != null) {
5452
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$2(fromComputerUse));
5453
+ }
5330
5454
  const fromCodeExecution = getValueByPath(fromObject, [
5331
5455
  'codeExecution',
5332
5456
  ]);
5333
5457
  if (fromCodeExecution != null) {
5334
5458
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5335
5459
  }
5336
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5337
- if (fromComputerUse != null) {
5338
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
5339
- }
5340
5460
  return toObject;
5341
5461
  }
5342
5462
  function functionCallingConfigToVertex$1(fromObject) {
@@ -7222,6 +7342,9 @@ function googleSearchToMldev$2(fromObject) {
7222
7342
  if (fromTimeRangeFilter != null) {
7223
7343
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(fromTimeRangeFilter));
7224
7344
  }
7345
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
7346
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
7347
+ }
7225
7348
  return toObject;
7226
7349
  }
7227
7350
  function dynamicRetrievalConfigToMldev$2(fromObject) {
@@ -7252,6 +7375,14 @@ function urlContextToMldev$2() {
7252
7375
  const toObject = {};
7253
7376
  return toObject;
7254
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
+ }
7255
7386
  function toolToMldev$2(fromObject) {
7256
7387
  const toObject = {};
7257
7388
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7289,16 +7420,16 @@ function toolToMldev$2(fromObject) {
7289
7420
  if (fromUrlContext != null) {
7290
7421
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
7291
7422
  }
7423
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7424
+ if (fromComputerUse != null) {
7425
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$2(fromComputerUse));
7426
+ }
7292
7427
  const fromCodeExecution = getValueByPath(fromObject, [
7293
7428
  'codeExecution',
7294
7429
  ]);
7295
7430
  if (fromCodeExecution != null) {
7296
7431
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7297
7432
  }
7298
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7299
- if (fromComputerUse != null) {
7300
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7301
- }
7302
7433
  return toObject;
7303
7434
  }
7304
7435
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7638,6 +7769,12 @@ function liveMusicGenerationConfigToMldev(fromObject) {
7638
7769
  if (fromOnlyBassAndDrums != null) {
7639
7770
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
7640
7771
  }
7772
+ const fromMusicGenerationMode = getValueByPath(fromObject, [
7773
+ 'musicGenerationMode',
7774
+ ]);
7775
+ if (fromMusicGenerationMode != null) {
7776
+ setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
7777
+ }
7641
7778
  return toObject;
7642
7779
  }
7643
7780
  function liveMusicSetConfigParametersToMldev(fromObject) {
@@ -7908,6 +8045,12 @@ function googleSearchToVertex$1(fromObject) {
7908
8045
  if (fromTimeRangeFilter != null) {
7909
8046
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7910
8047
  }
8048
+ const fromExcludeDomains = getValueByPath(fromObject, [
8049
+ 'excludeDomains',
8050
+ ]);
8051
+ if (fromExcludeDomains != null) {
8052
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8053
+ }
7911
8054
  return toObject;
7912
8055
  }
7913
8056
  function dynamicRetrievalConfigToVertex$1(fromObject) {
@@ -7934,8 +8077,14 @@ function googleSearchRetrievalToVertex$1(fromObject) {
7934
8077
  }
7935
8078
  return toObject;
7936
8079
  }
7937
- function enterpriseWebSearchToVertex$1() {
8080
+ function enterpriseWebSearchToVertex$1(fromObject) {
7938
8081
  const toObject = {};
8082
+ const fromExcludeDomains = getValueByPath(fromObject, [
8083
+ 'excludeDomains',
8084
+ ]);
8085
+ if (fromExcludeDomains != null) {
8086
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
8087
+ }
7939
8088
  return toObject;
7940
8089
  }
7941
8090
  function apiKeyConfigToVertex$1(fromObject) {
@@ -7990,6 +8139,14 @@ function urlContextToVertex$1() {
7990
8139
  const toObject = {};
7991
8140
  return toObject;
7992
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
+ }
7993
8150
  function toolToVertex$1(fromObject) {
7994
8151
  const toObject = {};
7995
8152
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -8022,7 +8179,7 @@ function toolToVertex$1(fromObject) {
8022
8179
  'enterpriseWebSearch',
8023
8180
  ]);
8024
8181
  if (fromEnterpriseWebSearch != null) {
8025
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8182
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1(fromEnterpriseWebSearch));
8026
8183
  }
8027
8184
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8028
8185
  if (fromGoogleMaps != null) {
@@ -8032,16 +8189,16 @@ function toolToVertex$1(fromObject) {
8032
8189
  if (fromUrlContext != null) {
8033
8190
  setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8034
8191
  }
8192
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8193
+ if (fromComputerUse != null) {
8194
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex$1(fromComputerUse));
8195
+ }
8035
8196
  const fromCodeExecution = getValueByPath(fromObject, [
8036
8197
  'codeExecution',
8037
8198
  ]);
8038
8199
  if (fromCodeExecution != null) {
8039
8200
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8040
8201
  }
8041
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8042
- if (fromComputerUse != null) {
8043
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8044
- }
8045
8202
  return toObject;
8046
8203
  }
8047
8204
  function sessionResumptionConfigToVertex(fromObject) {
@@ -8796,6 +8953,12 @@ function liveMusicGenerationConfigFromMldev(fromObject) {
8796
8953
  if (fromOnlyBassAndDrums != null) {
8797
8954
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
8798
8955
  }
8956
+ const fromMusicGenerationMode = getValueByPath(fromObject, [
8957
+ 'musicGenerationMode',
8958
+ ]);
8959
+ if (fromMusicGenerationMode != null) {
8960
+ setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
8961
+ }
8799
8962
  return toObject;
8800
8963
  }
8801
8964
  function liveMusicSourceMetadataFromMldev(fromObject) {
@@ -9563,6 +9726,9 @@ function googleSearchToMldev$1(fromObject) {
9563
9726
  if (fromTimeRangeFilter != null) {
9564
9727
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(fromTimeRangeFilter));
9565
9728
  }
9729
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9730
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
9731
+ }
9566
9732
  return toObject;
9567
9733
  }
9568
9734
  function dynamicRetrievalConfigToMldev$1(fromObject) {
@@ -9593,6 +9759,14 @@ function urlContextToMldev$1() {
9593
9759
  const toObject = {};
9594
9760
  return toObject;
9595
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
+ }
9596
9770
  function toolToMldev$1(fromObject) {
9597
9771
  const toObject = {};
9598
9772
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -9630,16 +9804,16 @@ function toolToMldev$1(fromObject) {
9630
9804
  if (fromUrlContext != null) {
9631
9805
  setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
9632
9806
  }
9807
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9808
+ if (fromComputerUse != null) {
9809
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev$1(fromComputerUse));
9810
+ }
9633
9811
  const fromCodeExecution = getValueByPath(fromObject, [
9634
9812
  'codeExecution',
9635
9813
  ]);
9636
9814
  if (fromCodeExecution != null) {
9637
9815
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
9638
9816
  }
9639
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9640
- if (fromComputerUse != null) {
9641
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
9642
- }
9643
9817
  return toObject;
9644
9818
  }
9645
9819
  function functionCallingConfigToMldev(fromObject) {
@@ -10062,8 +10236,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
10062
10236
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
10063
10237
  throw new Error('addWatermark parameter is not supported in Gemini API.');
10064
10238
  }
10065
- if (getValueByPath(fromObject, ['imageSize']) !== undefined) {
10066
- throw new Error('imageSize parameter is not supported in Gemini API.');
10239
+ const fromImageSize = getValueByPath(fromObject, ['imageSize']);
10240
+ if (parentObject !== undefined && fromImageSize != null) {
10241
+ setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
10067
10242
  }
10068
10243
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
10069
10244
  throw new Error('enhancePrompt parameter is not supported in Gemini API.');
@@ -10602,6 +10777,12 @@ function googleSearchToVertex(fromObject) {
10602
10777
  if (fromTimeRangeFilter != null) {
10603
10778
  setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex(fromTimeRangeFilter));
10604
10779
  }
10780
+ const fromExcludeDomains = getValueByPath(fromObject, [
10781
+ 'excludeDomains',
10782
+ ]);
10783
+ if (fromExcludeDomains != null) {
10784
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10785
+ }
10605
10786
  return toObject;
10606
10787
  }
10607
10788
  function dynamicRetrievalConfigToVertex(fromObject) {
@@ -10628,8 +10809,14 @@ function googleSearchRetrievalToVertex(fromObject) {
10628
10809
  }
10629
10810
  return toObject;
10630
10811
  }
10631
- function enterpriseWebSearchToVertex() {
10812
+ function enterpriseWebSearchToVertex(fromObject) {
10632
10813
  const toObject = {};
10814
+ const fromExcludeDomains = getValueByPath(fromObject, [
10815
+ 'excludeDomains',
10816
+ ]);
10817
+ if (fromExcludeDomains != null) {
10818
+ setValueByPath(toObject, ['excludeDomains'], fromExcludeDomains);
10819
+ }
10633
10820
  return toObject;
10634
10821
  }
10635
10822
  function apiKeyConfigToVertex(fromObject) {
@@ -10684,6 +10871,14 @@ function urlContextToVertex() {
10684
10871
  const toObject = {};
10685
10872
  return toObject;
10686
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
+ }
10687
10882
  function toolToVertex(fromObject) {
10688
10883
  const toObject = {};
10689
10884
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -10716,7 +10911,7 @@ function toolToVertex(fromObject) {
10716
10911
  'enterpriseWebSearch',
10717
10912
  ]);
10718
10913
  if (fromEnterpriseWebSearch != null) {
10719
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex());
10914
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex(fromEnterpriseWebSearch));
10720
10915
  }
10721
10916
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10722
10917
  if (fromGoogleMaps != null) {
@@ -10726,16 +10921,16 @@ function toolToVertex(fromObject) {
10726
10921
  if (fromUrlContext != null) {
10727
10922
  setValueByPath(toObject, ['urlContext'], urlContextToVertex());
10728
10923
  }
10924
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10925
+ if (fromComputerUse != null) {
10926
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToVertex(fromComputerUse));
10927
+ }
10729
10928
  const fromCodeExecution = getValueByPath(fromObject, [
10730
10929
  'codeExecution',
10731
10930
  ]);
10732
10931
  if (fromCodeExecution != null) {
10733
10932
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10734
10933
  }
10735
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10736
- if (fromComputerUse != null) {
10737
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
10738
- }
10739
10934
  return toObject;
10740
10935
  }
10741
10936
  function functionCallingConfigToVertex(fromObject) {
@@ -11465,6 +11660,106 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11465
11660
  }
11466
11661
  return toObject;
11467
11662
  }
11663
+ function productImageToVertex(fromObject) {
11664
+ const toObject = {};
11665
+ const fromProductImage = getValueByPath(fromObject, ['productImage']);
11666
+ if (fromProductImage != null) {
11667
+ setValueByPath(toObject, ['image'], imageToVertex(fromProductImage));
11668
+ }
11669
+ return toObject;
11670
+ }
11671
+ function recontextImageSourceToVertex(fromObject, parentObject) {
11672
+ const toObject = {};
11673
+ const fromPrompt = getValueByPath(fromObject, ['prompt']);
11674
+ if (parentObject !== undefined && fromPrompt != null) {
11675
+ setValueByPath(parentObject, ['instances[0]', 'prompt'], fromPrompt);
11676
+ }
11677
+ const fromPersonImage = getValueByPath(fromObject, ['personImage']);
11678
+ if (parentObject !== undefined && fromPersonImage != null) {
11679
+ setValueByPath(parentObject, ['instances[0]', 'personImage', 'image'], imageToVertex(fromPersonImage));
11680
+ }
11681
+ const fromProductImages = getValueByPath(fromObject, [
11682
+ 'productImages',
11683
+ ]);
11684
+ if (parentObject !== undefined && fromProductImages != null) {
11685
+ let transformedList = fromProductImages;
11686
+ if (Array.isArray(transformedList)) {
11687
+ transformedList = transformedList.map((item) => {
11688
+ return productImageToVertex(item);
11689
+ });
11690
+ }
11691
+ setValueByPath(parentObject, ['instances[0]', 'productImages'], transformedList);
11692
+ }
11693
+ return toObject;
11694
+ }
11695
+ function recontextImageConfigToVertex(fromObject, parentObject) {
11696
+ const toObject = {};
11697
+ const fromNumberOfImages = getValueByPath(fromObject, [
11698
+ 'numberOfImages',
11699
+ ]);
11700
+ if (parentObject !== undefined && fromNumberOfImages != null) {
11701
+ setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfImages);
11702
+ }
11703
+ const fromBaseSteps = getValueByPath(fromObject, ['baseSteps']);
11704
+ if (parentObject !== undefined && fromBaseSteps != null) {
11705
+ setValueByPath(parentObject, ['parameters', 'editConfig', 'baseSteps'], fromBaseSteps);
11706
+ }
11707
+ const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
11708
+ if (parentObject !== undefined && fromOutputGcsUri != null) {
11709
+ setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
11710
+ }
11711
+ const fromSeed = getValueByPath(fromObject, ['seed']);
11712
+ if (parentObject !== undefined && fromSeed != null) {
11713
+ setValueByPath(parentObject, ['parameters', 'seed'], fromSeed);
11714
+ }
11715
+ const fromSafetyFilterLevel = getValueByPath(fromObject, [
11716
+ 'safetyFilterLevel',
11717
+ ]);
11718
+ if (parentObject !== undefined && fromSafetyFilterLevel != null) {
11719
+ setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
11720
+ }
11721
+ const fromPersonGeneration = getValueByPath(fromObject, [
11722
+ 'personGeneration',
11723
+ ]);
11724
+ if (parentObject !== undefined && fromPersonGeneration != null) {
11725
+ setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
11726
+ }
11727
+ const fromOutputMimeType = getValueByPath(fromObject, [
11728
+ 'outputMimeType',
11729
+ ]);
11730
+ if (parentObject !== undefined && fromOutputMimeType != null) {
11731
+ setValueByPath(parentObject, ['parameters', 'outputOptions', 'mimeType'], fromOutputMimeType);
11732
+ }
11733
+ const fromOutputCompressionQuality = getValueByPath(fromObject, [
11734
+ 'outputCompressionQuality',
11735
+ ]);
11736
+ if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11737
+ setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11738
+ }
11739
+ const fromEnhancePrompt = getValueByPath(fromObject, [
11740
+ 'enhancePrompt',
11741
+ ]);
11742
+ if (parentObject !== undefined && fromEnhancePrompt != null) {
11743
+ setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
11744
+ }
11745
+ return toObject;
11746
+ }
11747
+ function recontextImageParametersToVertex(apiClient, fromObject) {
11748
+ const toObject = {};
11749
+ const fromModel = getValueByPath(fromObject, ['model']);
11750
+ if (fromModel != null) {
11751
+ setValueByPath(toObject, ['_url', 'model'], tModel(apiClient, fromModel));
11752
+ }
11753
+ const fromSource = getValueByPath(fromObject, ['source']);
11754
+ if (fromSource != null) {
11755
+ setValueByPath(toObject, ['config'], recontextImageSourceToVertex(fromSource, toObject));
11756
+ }
11757
+ const fromConfig = getValueByPath(fromObject, ['config']);
11758
+ if (fromConfig != null) {
11759
+ setValueByPath(toObject, ['config'], recontextImageConfigToVertex(fromConfig, toObject));
11760
+ }
11761
+ return toObject;
11762
+ }
11468
11763
  function getModelParametersToVertex(apiClient, fromObject) {
11469
11764
  const toObject = {};
11470
11765
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -11961,6 +12256,10 @@ function generateContentResponseFromMldev(fromObject) {
11961
12256
  if (fromPromptFeedback != null) {
11962
12257
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
11963
12258
  }
12259
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
12260
+ if (fromResponseId != null) {
12261
+ setValueByPath(toObject, ['responseId'], fromResponseId);
12262
+ }
11964
12263
  const fromUsageMetadata = getValueByPath(fromObject, [
11965
12264
  'usageMetadata',
11966
12265
  ]);
@@ -12511,10 +12810,6 @@ function generateContentResponseFromVertex(fromObject) {
12511
12810
  if (fromCreateTime != null) {
12512
12811
  setValueByPath(toObject, ['createTime'], fromCreateTime);
12513
12812
  }
12514
- const fromResponseId = getValueByPath(fromObject, ['responseId']);
12515
- if (fromResponseId != null) {
12516
- setValueByPath(toObject, ['responseId'], fromResponseId);
12517
- }
12518
12813
  const fromModelVersion = getValueByPath(fromObject, ['modelVersion']);
12519
12814
  if (fromModelVersion != null) {
12520
12815
  setValueByPath(toObject, ['modelVersion'], fromModelVersion);
@@ -12525,6 +12820,10 @@ function generateContentResponseFromVertex(fromObject) {
12525
12820
  if (fromPromptFeedback != null) {
12526
12821
  setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
12527
12822
  }
12823
+ const fromResponseId = getValueByPath(fromObject, ['responseId']);
12824
+ if (fromResponseId != null) {
12825
+ setValueByPath(toObject, ['responseId'], fromResponseId);
12826
+ }
12528
12827
  const fromUsageMetadata = getValueByPath(fromObject, [
12529
12828
  'usageMetadata',
12530
12829
  ]);
@@ -12728,6 +13027,22 @@ function upscaleImageResponseFromVertex(fromObject) {
12728
13027
  }
12729
13028
  return toObject;
12730
13029
  }
13030
+ function recontextImageResponseFromVertex(fromObject) {
13031
+ const toObject = {};
13032
+ const fromGeneratedImages = getValueByPath(fromObject, [
13033
+ 'predictions',
13034
+ ]);
13035
+ if (fromGeneratedImages != null) {
13036
+ let transformedList = fromGeneratedImages;
13037
+ if (Array.isArray(transformedList)) {
13038
+ transformedList = transformedList.map((item) => {
13039
+ return generatedImageFromVertex(item);
13040
+ });
13041
+ }
13042
+ setValueByPath(toObject, ['generatedImages'], transformedList);
13043
+ }
13044
+ return toObject;
13045
+ }
12731
13046
  function endpointFromVertex(fromObject) {
12732
13047
  const toObject = {};
12733
13048
  const fromName = getValueByPath(fromObject, ['endpoint']);
@@ -12975,7 +13290,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12975
13290
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12976
13291
  const USER_AGENT_HEADER = 'User-Agent';
12977
13292
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12978
- const SDK_VERSION = '1.12.0'; // x-release-please-version
13293
+ const SDK_VERSION = '1.14.0'; // x-release-please-version
12979
13294
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12980
13295
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12981
13296
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -15345,6 +15660,79 @@ class Models extends BaseModule {
15345
15660
  throw new Error('This method is only supported by the Vertex AI.');
15346
15661
  }
15347
15662
  }
15663
+ /**
15664
+ * Recontextualizes an image.
15665
+ *
15666
+ * There are two types of recontextualization currently supported:
15667
+ * 1) Imagen Product Recontext - Generate images of products in new scenes
15668
+ * and contexts.
15669
+ * 2) Virtual Try-On: Generate images of persons modeling fashion products.
15670
+ *
15671
+ * @param params - The parameters for recontextualizing an image.
15672
+ * @return The response from the API.
15673
+ *
15674
+ * @example
15675
+ * ```ts
15676
+ * const response1 = await ai.models.recontextImage({
15677
+ * model: 'imagen-product-recontext-preview-06-30',
15678
+ * source: {
15679
+ * prompt: 'In a modern kitchen setting.',
15680
+ * productImages: [productImage],
15681
+ * },
15682
+ * config: {
15683
+ * numberOfImages: 1,
15684
+ * },
15685
+ * });
15686
+ * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
15687
+ *
15688
+ * const response2 = await ai.models.recontextImage({
15689
+ * model: 'virtual-try-on-preview-08-04',
15690
+ * source: {
15691
+ * personImage: personImage,
15692
+ * productImages: [productImage],
15693
+ * },
15694
+ * config: {
15695
+ * numberOfImages: 1,
15696
+ * },
15697
+ * });
15698
+ * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
15699
+ * ```
15700
+ */
15701
+ async recontextImage(params) {
15702
+ var _a, _b;
15703
+ let response;
15704
+ let path = '';
15705
+ let queryParams = {};
15706
+ if (this.apiClient.isVertexAI()) {
15707
+ const body = recontextImageParametersToVertex(this.apiClient, params);
15708
+ path = formatMap('{model}:predict', body['_url']);
15709
+ queryParams = body['_query'];
15710
+ delete body['config'];
15711
+ delete body['_url'];
15712
+ delete body['_query'];
15713
+ response = this.apiClient
15714
+ .request({
15715
+ path: path,
15716
+ queryParams: queryParams,
15717
+ body: JSON.stringify(body),
15718
+ httpMethod: 'POST',
15719
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
15720
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
15721
+ })
15722
+ .then((httpResponse) => {
15723
+ return httpResponse.json();
15724
+ });
15725
+ return response.then((apiResponse) => {
15726
+ const resp = recontextImageResponseFromVertex(apiResponse);
15727
+ const typedResp = new RecontextImageResponse();
15728
+ Object.assign(typedResp, resp);
15729
+ return typedResp;
15730
+ });
15731
+ }
15732
+ else {
15733
+ throw new Error('This method is only supported by the Vertex AI.');
15734
+ }
15735
+ }
15348
15736
  /**
15349
15737
  * Fetches information about a model by name.
15350
15738
  *
@@ -16309,6 +16697,9 @@ function googleSearchToMldev(fromObject) {
16309
16697
  if (fromTimeRangeFilter != null) {
16310
16698
  setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(fromTimeRangeFilter));
16311
16699
  }
16700
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16701
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
16702
+ }
16312
16703
  return toObject;
16313
16704
  }
16314
16705
  function dynamicRetrievalConfigToMldev(fromObject) {
@@ -16339,6 +16730,14 @@ function urlContextToMldev() {
16339
16730
  const toObject = {};
16340
16731
  return toObject;
16341
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
+ }
16342
16741
  function toolToMldev(fromObject) {
16343
16742
  const toObject = {};
16344
16743
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -16376,16 +16775,16 @@ function toolToMldev(fromObject) {
16376
16775
  if (fromUrlContext != null) {
16377
16776
  setValueByPath(toObject, ['urlContext'], urlContextToMldev());
16378
16777
  }
16778
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16779
+ if (fromComputerUse != null) {
16780
+ setValueByPath(toObject, ['computerUse'], toolComputerUseToMldev(fromComputerUse));
16781
+ }
16379
16782
  const fromCodeExecution = getValueByPath(fromObject, [
16380
16783
  'codeExecution',
16381
16784
  ]);
16382
16785
  if (fromCodeExecution != null) {
16383
16786
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16384
16787
  }
16385
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16386
- if (fromComputerUse != null) {
16387
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
16388
- }
16389
16788
  return toObject;
16390
16789
  }
16391
16790
  function sessionResumptionConfigToMldev(fromObject) {
@@ -17199,6 +17598,10 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17199
17598
  undefined) {
17200
17599
  throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
17201
17600
  }
17601
+ if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
17602
+ undefined) {
17603
+ throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
17604
+ }
17202
17605
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
17203
17606
  throw new Error('adapterSize parameter is not supported in Gemini API.');
17204
17607
  }
@@ -17212,12 +17615,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
17212
17615
  }
17213
17616
  return toObject;
17214
17617
  }
17215
- function createTuningJobParametersToMldev(fromObject) {
17618
+ function createTuningJobParametersPrivateToMldev(fromObject) {
17216
17619
  const toObject = {};
17217
17620
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17218
17621
  if (fromBaseModel != null) {
17219
17622
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17220
17623
  }
17624
+ const fromPreTunedModel = getValueByPath(fromObject, [
17625
+ 'preTunedModel',
17626
+ ]);
17627
+ if (fromPreTunedModel != null) {
17628
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17629
+ }
17221
17630
  const fromTrainingDataset = getValueByPath(fromObject, [
17222
17631
  'trainingDataset',
17223
17632
  ]);
@@ -17331,6 +17740,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17331
17740
  if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
17332
17741
  setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
17333
17742
  }
17743
+ const fromPreTunedModelCheckpointId = getValueByPath(fromObject, [
17744
+ 'preTunedModelCheckpointId',
17745
+ ]);
17746
+ if (fromPreTunedModelCheckpointId != null) {
17747
+ setValueByPath(toObject, ['preTunedModel', 'checkpointId'], fromPreTunedModelCheckpointId);
17748
+ }
17334
17749
  const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
17335
17750
  if (parentObject !== undefined && fromAdapterSize != null) {
17336
17751
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
@@ -17343,12 +17758,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
17343
17758
  }
17344
17759
  return toObject;
17345
17760
  }
17346
- function createTuningJobParametersToVertex(fromObject) {
17761
+ function createTuningJobParametersPrivateToVertex(fromObject) {
17347
17762
  const toObject = {};
17348
17763
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
17349
17764
  if (fromBaseModel != null) {
17350
17765
  setValueByPath(toObject, ['baseModel'], fromBaseModel);
17351
17766
  }
17767
+ const fromPreTunedModel = getValueByPath(fromObject, [
17768
+ 'preTunedModel',
17769
+ ]);
17770
+ if (fromPreTunedModel != null) {
17771
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
17772
+ }
17352
17773
  const fromTrainingDataset = getValueByPath(fromObject, [
17353
17774
  'trainingDataset',
17354
17775
  ]);
@@ -17423,11 +17844,11 @@ function tuningJobFromMldev(fromObject) {
17423
17844
  if (fromTunedModel != null) {
17424
17845
  setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
17425
17846
  }
17426
- const fromDistillationSpec = getValueByPath(fromObject, [
17427
- 'distillationSpec',
17847
+ const fromCustomBaseModel = getValueByPath(fromObject, [
17848
+ 'customBaseModel',
17428
17849
  ]);
17429
- if (fromDistillationSpec != null) {
17430
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
17850
+ if (fromCustomBaseModel != null) {
17851
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17431
17852
  }
17432
17853
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17433
17854
  if (fromExperiment != null) {
@@ -17437,18 +17858,14 @@ function tuningJobFromMldev(fromObject) {
17437
17858
  if (fromLabels != null) {
17438
17859
  setValueByPath(toObject, ['labels'], fromLabels);
17439
17860
  }
17861
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
17862
+ if (fromOutputUri != null) {
17863
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
17864
+ }
17440
17865
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17441
17866
  if (fromPipelineJob != null) {
17442
17867
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17443
17868
  }
17444
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17445
- if (fromSatisfiesPzi != null) {
17446
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17447
- }
17448
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17449
- if (fromSatisfiesPzs != null) {
17450
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17451
- }
17452
17869
  const fromServiceAccount = getValueByPath(fromObject, [
17453
17870
  'serviceAccount',
17454
17871
  ]);
@@ -17605,6 +18022,12 @@ function tuningJobFromVertex(fromObject) {
17605
18022
  if (fromTunedModel != null) {
17606
18023
  setValueByPath(toObject, ['tunedModel'], tunedModelFromVertex(fromTunedModel));
17607
18024
  }
18025
+ const fromPreTunedModel = getValueByPath(fromObject, [
18026
+ 'preTunedModel',
18027
+ ]);
18028
+ if (fromPreTunedModel != null) {
18029
+ setValueByPath(toObject, ['preTunedModel'], fromPreTunedModel);
18030
+ }
17608
18031
  const fromSupervisedTuningSpec = getValueByPath(fromObject, [
17609
18032
  'supervisedTuningSpec',
17610
18033
  ]);
@@ -17629,11 +18052,11 @@ function tuningJobFromVertex(fromObject) {
17629
18052
  if (fromPartnerModelTuningSpec != null) {
17630
18053
  setValueByPath(toObject, ['partnerModelTuningSpec'], fromPartnerModelTuningSpec);
17631
18054
  }
17632
- const fromDistillationSpec = getValueByPath(fromObject, [
17633
- 'distillationSpec',
18055
+ const fromCustomBaseModel = getValueByPath(fromObject, [
18056
+ 'customBaseModel',
17634
18057
  ]);
17635
- if (fromDistillationSpec != null) {
17636
- setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
18058
+ if (fromCustomBaseModel != null) {
18059
+ setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
17637
18060
  }
17638
18061
  const fromExperiment = getValueByPath(fromObject, ['experiment']);
17639
18062
  if (fromExperiment != null) {
@@ -17643,18 +18066,14 @@ function tuningJobFromVertex(fromObject) {
17643
18066
  if (fromLabels != null) {
17644
18067
  setValueByPath(toObject, ['labels'], fromLabels);
17645
18068
  }
18069
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
18070
+ if (fromOutputUri != null) {
18071
+ setValueByPath(toObject, ['outputUri'], fromOutputUri);
18072
+ }
17646
18073
  const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
17647
18074
  if (fromPipelineJob != null) {
17648
18075
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17649
18076
  }
17650
- const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17651
- if (fromSatisfiesPzi != null) {
17652
- setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17653
- }
17654
- const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17655
- if (fromSatisfiesPzs != null) {
17656
- setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17657
- }
17658
18077
  const fromServiceAccount = getValueByPath(fromObject, [
17659
18078
  'serviceAccount',
17660
18079
  ]);
@@ -17740,10 +18159,22 @@ class Tunings extends BaseModule {
17740
18159
  */
17741
18160
  this.tune = async (params) => {
17742
18161
  if (this.apiClient.isVertexAI()) {
17743
- 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
+ }
17744
18174
  }
17745
18175
  else {
17746
- const operation = await this.tuneMldevInternal(params);
18176
+ const paramsPrivate = Object.assign({}, params);
18177
+ const operation = await this.tuneMldevInternal(paramsPrivate);
17747
18178
  let tunedModelName = '';
17748
18179
  if (operation['metadata'] !== undefined &&
17749
18180
  operation['metadata']['tunedModel'] !== undefined) {
@@ -17903,7 +18334,7 @@ class Tunings extends BaseModule {
17903
18334
  let path = '';
17904
18335
  let queryParams = {};
17905
18336
  if (this.apiClient.isVertexAI()) {
17906
- const body = createTuningJobParametersToVertex(params);
18337
+ const body = createTuningJobParametersPrivateToVertex(params);
17907
18338
  path = formatMap('tuningJobs', body['_url']);
17908
18339
  queryParams = body['_query'];
17909
18340
  delete body['config'];
@@ -17945,7 +18376,7 @@ class Tunings extends BaseModule {
17945
18376
  throw new Error('This method is only supported by the Gemini Developer API.');
17946
18377
  }
17947
18378
  else {
17948
- const body = createTuningJobParametersToMldev(params);
18379
+ const body = createTuningJobParametersPrivateToMldev(params);
17949
18380
  path = formatMap('tunedModels', body['_url']);
17950
18381
  queryParams = body['_query'];
17951
18382
  delete body['config'];
@@ -18423,6 +18854,7 @@ exports.Models = Models;
18423
18854
  exports.Operations = Operations;
18424
18855
  exports.Pager = Pager;
18425
18856
  exports.RawReferenceImage = RawReferenceImage;
18857
+ exports.RecontextImageResponse = RecontextImageResponse;
18426
18858
  exports.ReplayResponse = ReplayResponse;
18427
18859
  exports.Session = Session;
18428
18860
  exports.StyleReferenceImage = StyleReferenceImage;