@google/genai 1.38.0 → 1.40.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.
@@ -1560,6 +1560,10 @@ exports.TuningMethod = void 0;
1560
1560
  * Preference optimization tuning.
1561
1561
  */
1562
1562
  TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
1563
+ /**
1564
+ * Distillation tuning.
1565
+ */
1566
+ TuningMethod["DISTILLATION"] = "DISTILLATION";
1563
1567
  })(exports.TuningMethod || (exports.TuningMethod = {}));
1564
1568
  /** State for the lifecycle of a Document. */
1565
1569
  exports.DocumentState = void 0;
@@ -2351,6 +2355,9 @@ class CreateFileResponse {
2351
2355
  /** Response for the delete file method. */
2352
2356
  class DeleteFileResponse {
2353
2357
  }
2358
+ /** Response for the _register file method. */
2359
+ class RegisterFilesResponse {
2360
+ }
2354
2361
  /** Config for `inlined_responses` parameter. */
2355
2362
  class InlinedResponse {
2356
2363
  }
@@ -4345,6 +4352,10 @@ function inlinedResponseFromMldev(fromObject) {
4345
4352
  if (fromResponse != null) {
4346
4353
  setValueByPath(toObject, ['response'], generateContentResponseFromMldev$1(fromResponse));
4347
4354
  }
4355
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
4356
+ if (fromMetadata != null) {
4357
+ setValueByPath(toObject, ['metadata'], fromMetadata);
4358
+ }
4348
4359
  const fromError = getValueByPath(fromObject, ['error']);
4349
4360
  if (fromError != null) {
4350
4361
  setValueByPath(toObject, ['error'], fromError);
@@ -6785,6 +6796,14 @@ function getFileParametersToMldev(fromObject) {
6785
6796
  }
6786
6797
  return toObject;
6787
6798
  }
6799
+ function internalRegisterFilesParametersToMldev(fromObject) {
6800
+ const toObject = {};
6801
+ const fromUris = getValueByPath(fromObject, ['uris']);
6802
+ if (fromUris != null) {
6803
+ setValueByPath(toObject, ['uris'], fromUris);
6804
+ }
6805
+ return toObject;
6806
+ }
6788
6807
  function listFilesConfigToMldev(fromObject, parentObject) {
6789
6808
  const toObject = {};
6790
6809
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
@@ -6831,6 +6850,26 @@ function listFilesResponseFromMldev(fromObject) {
6831
6850
  }
6832
6851
  return toObject;
6833
6852
  }
6853
+ function registerFilesResponseFromMldev(fromObject) {
6854
+ const toObject = {};
6855
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6856
+ 'sdkHttpResponse',
6857
+ ]);
6858
+ if (fromSdkHttpResponse != null) {
6859
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6860
+ }
6861
+ const fromFiles = getValueByPath(fromObject, ['files']);
6862
+ if (fromFiles != null) {
6863
+ let transformedList = fromFiles;
6864
+ if (Array.isArray(transformedList)) {
6865
+ transformedList = transformedList.map((item) => {
6866
+ return item;
6867
+ });
6868
+ }
6869
+ setValueByPath(toObject, ['files'], transformedList);
6870
+ }
6871
+ return toObject;
6872
+ }
6834
6873
 
6835
6874
  /**
6836
6875
  * @license
@@ -6931,6 +6970,16 @@ class Files extends BaseModule {
6931
6970
  async download(params) {
6932
6971
  await this.apiClient.downloadFile(params);
6933
6972
  }
6973
+ /**
6974
+ * Registers Google Cloud Storage files for use with the API.
6975
+ * This method is only available in Node.js environments.
6976
+ */
6977
+ async registerFiles(params) {
6978
+ throw new Error('registerFiles is only supported in Node.js environments.');
6979
+ }
6980
+ async _registerFiles(params) {
6981
+ return this.registerFilesInternal(params);
6982
+ }
6934
6983
  async listInternal(params) {
6935
6984
  var _a, _b;
6936
6985
  let response;
@@ -7104,6 +7153,40 @@ class Files extends BaseModule {
7104
7153
  });
7105
7154
  }
7106
7155
  }
7156
+ async registerFilesInternal(params) {
7157
+ var _a, _b;
7158
+ let response;
7159
+ let path = '';
7160
+ let queryParams = {};
7161
+ if (this.apiClient.isVertexAI()) {
7162
+ throw new Error('This method is only supported by the Gemini Developer API.');
7163
+ }
7164
+ else {
7165
+ const body = internalRegisterFilesParametersToMldev(params);
7166
+ path = formatMap('files:register', body['_url']);
7167
+ queryParams = body['_query'];
7168
+ delete body['_url'];
7169
+ delete body['_query'];
7170
+ response = this.apiClient
7171
+ .request({
7172
+ path: path,
7173
+ queryParams: queryParams,
7174
+ body: JSON.stringify(body),
7175
+ httpMethod: 'POST',
7176
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
7177
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
7178
+ })
7179
+ .then((httpResponse) => {
7180
+ return httpResponse.json();
7181
+ });
7182
+ return response.then((apiResponse) => {
7183
+ const resp = registerFilesResponseFromMldev(apiResponse);
7184
+ const typedResp = new RegisterFilesResponse();
7185
+ Object.assign(typedResp, resp);
7186
+ return typedResp;
7187
+ });
7188
+ }
7189
+ }
7107
7190
  }
7108
7191
 
7109
7192
  /**
@@ -8076,7 +8159,7 @@ function voiceActivityFromVertex(fromObject) {
8076
8159
  * Copyright 2025 Google LLC
8077
8160
  * SPDX-License-Identifier: Apache-2.0
8078
8161
  */
8079
- function blobToMldev$1(fromObject) {
8162
+ function blobToMldev$1(fromObject, _rootObject) {
8080
8163
  const toObject = {};
8081
8164
  const fromData = getValueByPath(fromObject, ['data']);
8082
8165
  if (fromData != null) {
@@ -8091,7 +8174,7 @@ function blobToMldev$1(fromObject) {
8091
8174
  }
8092
8175
  return toObject;
8093
8176
  }
8094
- function candidateFromMldev(fromObject) {
8177
+ function candidateFromMldev(fromObject, rootObject) {
8095
8178
  const toObject = {};
8096
8179
  const fromContent = getValueByPath(fromObject, ['content']);
8097
8180
  if (fromContent != null) {
@@ -8151,7 +8234,7 @@ function candidateFromMldev(fromObject) {
8151
8234
  }
8152
8235
  return toObject;
8153
8236
  }
8154
- function citationMetadataFromMldev(fromObject) {
8237
+ function citationMetadataFromMldev(fromObject, _rootObject) {
8155
8238
  const toObject = {};
8156
8239
  const fromCitations = getValueByPath(fromObject, ['citationSources']);
8157
8240
  if (fromCitations != null) {
@@ -8165,7 +8248,7 @@ function citationMetadataFromMldev(fromObject) {
8165
8248
  }
8166
8249
  return toObject;
8167
8250
  }
8168
- function computeTokensParametersToVertex(apiClient, fromObject) {
8251
+ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
8169
8252
  const toObject = {};
8170
8253
  const fromModel = getValueByPath(fromObject, ['model']);
8171
8254
  if (fromModel != null) {
@@ -8183,7 +8266,7 @@ function computeTokensParametersToVertex(apiClient, fromObject) {
8183
8266
  }
8184
8267
  return toObject;
8185
8268
  }
8186
- function computeTokensResponseFromVertex(fromObject) {
8269
+ function computeTokensResponseFromVertex(fromObject, _rootObject) {
8187
8270
  const toObject = {};
8188
8271
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8189
8272
  'sdkHttpResponse',
@@ -8203,7 +8286,7 @@ function computeTokensResponseFromVertex(fromObject) {
8203
8286
  }
8204
8287
  return toObject;
8205
8288
  }
8206
- function contentEmbeddingFromVertex(fromObject) {
8289
+ function contentEmbeddingFromVertex(fromObject, rootObject) {
8207
8290
  const toObject = {};
8208
8291
  const fromValues = getValueByPath(fromObject, ['values']);
8209
8292
  if (fromValues != null) {
@@ -8215,7 +8298,7 @@ function contentEmbeddingFromVertex(fromObject) {
8215
8298
  }
8216
8299
  return toObject;
8217
8300
  }
8218
- function contentEmbeddingStatisticsFromVertex(fromObject) {
8301
+ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
8219
8302
  const toObject = {};
8220
8303
  const fromTruncated = getValueByPath(fromObject, ['truncated']);
8221
8304
  if (fromTruncated != null) {
@@ -8227,7 +8310,7 @@ function contentEmbeddingStatisticsFromVertex(fromObject) {
8227
8310
  }
8228
8311
  return toObject;
8229
8312
  }
8230
- function contentToMldev$1(fromObject) {
8313
+ function contentToMldev$1(fromObject, rootObject) {
8231
8314
  const toObject = {};
8232
8315
  const fromParts = getValueByPath(fromObject, ['parts']);
8233
8316
  if (fromParts != null) {
@@ -8245,7 +8328,7 @@ function contentToMldev$1(fromObject) {
8245
8328
  }
8246
8329
  return toObject;
8247
8330
  }
8248
- function controlReferenceConfigToVertex(fromObject) {
8331
+ function controlReferenceConfigToVertex(fromObject, _rootObject) {
8249
8332
  const toObject = {};
8250
8333
  const fromControlType = getValueByPath(fromObject, ['controlType']);
8251
8334
  if (fromControlType != null) {
@@ -8259,7 +8342,7 @@ function controlReferenceConfigToVertex(fromObject) {
8259
8342
  }
8260
8343
  return toObject;
8261
8344
  }
8262
- function countTokensConfigToMldev(fromObject) {
8345
+ function countTokensConfigToMldev(fromObject, _rootObject) {
8263
8346
  const toObject = {};
8264
8347
  if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
8265
8348
  throw new Error('systemInstruction parameter is not supported in Gemini API.');
@@ -8272,7 +8355,7 @@ function countTokensConfigToMldev(fromObject) {
8272
8355
  }
8273
8356
  return toObject;
8274
8357
  }
8275
- function countTokensConfigToVertex(fromObject, parentObject) {
8358
+ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
8276
8359
  const toObject = {};
8277
8360
  const fromSystemInstruction = getValueByPath(fromObject, [
8278
8361
  'systemInstruction',
@@ -8298,7 +8381,7 @@ function countTokensConfigToVertex(fromObject, parentObject) {
8298
8381
  }
8299
8382
  return toObject;
8300
8383
  }
8301
- function countTokensParametersToMldev(apiClient, fromObject) {
8384
+ function countTokensParametersToMldev(apiClient, fromObject, rootObject) {
8302
8385
  const toObject = {};
8303
8386
  const fromModel = getValueByPath(fromObject, ['model']);
8304
8387
  if (fromModel != null) {
@@ -8320,7 +8403,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
8320
8403
  }
8321
8404
  return toObject;
8322
8405
  }
8323
- function countTokensParametersToVertex(apiClient, fromObject) {
8406
+ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
8324
8407
  const toObject = {};
8325
8408
  const fromModel = getValueByPath(fromObject, ['model']);
8326
8409
  if (fromModel != null) {
@@ -8342,7 +8425,7 @@ function countTokensParametersToVertex(apiClient, fromObject) {
8342
8425
  }
8343
8426
  return toObject;
8344
8427
  }
8345
- function countTokensResponseFromMldev(fromObject) {
8428
+ function countTokensResponseFromMldev(fromObject, _rootObject) {
8346
8429
  const toObject = {};
8347
8430
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8348
8431
  'sdkHttpResponse',
@@ -8362,7 +8445,7 @@ function countTokensResponseFromMldev(fromObject) {
8362
8445
  }
8363
8446
  return toObject;
8364
8447
  }
8365
- function countTokensResponseFromVertex(fromObject) {
8448
+ function countTokensResponseFromVertex(fromObject, _rootObject) {
8366
8449
  const toObject = {};
8367
8450
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8368
8451
  'sdkHttpResponse',
@@ -8376,7 +8459,7 @@ function countTokensResponseFromVertex(fromObject) {
8376
8459
  }
8377
8460
  return toObject;
8378
8461
  }
8379
- function deleteModelParametersToMldev(apiClient, fromObject) {
8462
+ function deleteModelParametersToMldev(apiClient, fromObject, _rootObject) {
8380
8463
  const toObject = {};
8381
8464
  const fromModel = getValueByPath(fromObject, ['model']);
8382
8465
  if (fromModel != null) {
@@ -8384,7 +8467,7 @@ function deleteModelParametersToMldev(apiClient, fromObject) {
8384
8467
  }
8385
8468
  return toObject;
8386
8469
  }
8387
- function deleteModelParametersToVertex(apiClient, fromObject) {
8470
+ function deleteModelParametersToVertex(apiClient, fromObject, _rootObject) {
8388
8471
  const toObject = {};
8389
8472
  const fromModel = getValueByPath(fromObject, ['model']);
8390
8473
  if (fromModel != null) {
@@ -8392,7 +8475,7 @@ function deleteModelParametersToVertex(apiClient, fromObject) {
8392
8475
  }
8393
8476
  return toObject;
8394
8477
  }
8395
- function deleteModelResponseFromMldev(fromObject) {
8478
+ function deleteModelResponseFromMldev(fromObject, _rootObject) {
8396
8479
  const toObject = {};
8397
8480
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8398
8481
  'sdkHttpResponse',
@@ -8402,7 +8485,7 @@ function deleteModelResponseFromMldev(fromObject) {
8402
8485
  }
8403
8486
  return toObject;
8404
8487
  }
8405
- function deleteModelResponseFromVertex(fromObject) {
8488
+ function deleteModelResponseFromVertex(fromObject, _rootObject) {
8406
8489
  const toObject = {};
8407
8490
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8408
8491
  'sdkHttpResponse',
@@ -8412,7 +8495,7 @@ function deleteModelResponseFromVertex(fromObject) {
8412
8495
  }
8413
8496
  return toObject;
8414
8497
  }
8415
- function editImageConfigToVertex(fromObject, parentObject) {
8498
+ function editImageConfigToVertex(fromObject, parentObject, _rootObject) {
8416
8499
  const toObject = {};
8417
8500
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
8418
8501
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -8502,7 +8585,7 @@ function editImageConfigToVertex(fromObject, parentObject) {
8502
8585
  }
8503
8586
  return toObject;
8504
8587
  }
8505
- function editImageParametersInternalToVertex(apiClient, fromObject) {
8588
+ function editImageParametersInternalToVertex(apiClient, fromObject, rootObject) {
8506
8589
  const toObject = {};
8507
8590
  const fromModel = getValueByPath(fromObject, ['model']);
8508
8591
  if (fromModel != null) {
@@ -8530,7 +8613,7 @@ function editImageParametersInternalToVertex(apiClient, fromObject) {
8530
8613
  }
8531
8614
  return toObject;
8532
8615
  }
8533
- function editImageResponseFromVertex(fromObject) {
8616
+ function editImageResponseFromVertex(fromObject, rootObject) {
8534
8617
  const toObject = {};
8535
8618
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8536
8619
  'sdkHttpResponse',
@@ -8552,7 +8635,7 @@ function editImageResponseFromVertex(fromObject) {
8552
8635
  }
8553
8636
  return toObject;
8554
8637
  }
8555
- function embedContentConfigToMldev(fromObject, parentObject) {
8638
+ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
8556
8639
  const toObject = {};
8557
8640
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
8558
8641
  if (parentObject !== undefined && fromTaskType != null) {
@@ -8576,7 +8659,7 @@ function embedContentConfigToMldev(fromObject, parentObject) {
8576
8659
  }
8577
8660
  return toObject;
8578
8661
  }
8579
- function embedContentConfigToVertex(fromObject, parentObject) {
8662
+ function embedContentConfigToVertex(fromObject, parentObject, _rootObject) {
8580
8663
  const toObject = {};
8581
8664
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
8582
8665
  if (parentObject !== undefined && fromTaskType != null) {
@@ -8602,7 +8685,7 @@ function embedContentConfigToVertex(fromObject, parentObject) {
8602
8685
  }
8603
8686
  return toObject;
8604
8687
  }
8605
- function embedContentParametersToMldev(apiClient, fromObject) {
8688
+ function embedContentParametersToMldev(apiClient, fromObject, rootObject) {
8606
8689
  const toObject = {};
8607
8690
  const fromModel = getValueByPath(fromObject, ['model']);
8608
8691
  if (fromModel != null) {
@@ -8628,7 +8711,7 @@ function embedContentParametersToMldev(apiClient, fromObject) {
8628
8711
  }
8629
8712
  return toObject;
8630
8713
  }
8631
- function embedContentParametersToVertex(apiClient, fromObject) {
8714
+ function embedContentParametersToVertex(apiClient, fromObject, rootObject) {
8632
8715
  const toObject = {};
8633
8716
  const fromModel = getValueByPath(fromObject, ['model']);
8634
8717
  if (fromModel != null) {
@@ -8650,7 +8733,7 @@ function embedContentParametersToVertex(apiClient, fromObject) {
8650
8733
  }
8651
8734
  return toObject;
8652
8735
  }
8653
- function embedContentResponseFromMldev(fromObject) {
8736
+ function embedContentResponseFromMldev(fromObject, _rootObject) {
8654
8737
  const toObject = {};
8655
8738
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8656
8739
  'sdkHttpResponse',
@@ -8674,7 +8757,7 @@ function embedContentResponseFromMldev(fromObject) {
8674
8757
  }
8675
8758
  return toObject;
8676
8759
  }
8677
- function embedContentResponseFromVertex(fromObject) {
8760
+ function embedContentResponseFromVertex(fromObject, rootObject) {
8678
8761
  const toObject = {};
8679
8762
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8680
8763
  'sdkHttpResponse',
@@ -8701,7 +8784,7 @@ function embedContentResponseFromVertex(fromObject) {
8701
8784
  }
8702
8785
  return toObject;
8703
8786
  }
8704
- function endpointFromVertex(fromObject) {
8787
+ function endpointFromVertex(fromObject, _rootObject) {
8705
8788
  const toObject = {};
8706
8789
  const fromName = getValueByPath(fromObject, ['endpoint']);
8707
8790
  if (fromName != null) {
@@ -8715,7 +8798,7 @@ function endpointFromVertex(fromObject) {
8715
8798
  }
8716
8799
  return toObject;
8717
8800
  }
8718
- function fileDataToMldev$1(fromObject) {
8801
+ function fileDataToMldev$1(fromObject, _rootObject) {
8719
8802
  const toObject = {};
8720
8803
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
8721
8804
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -8730,7 +8813,7 @@ function fileDataToMldev$1(fromObject) {
8730
8813
  }
8731
8814
  return toObject;
8732
8815
  }
8733
- function functionCallToMldev$1(fromObject) {
8816
+ function functionCallToMldev$1(fromObject, _rootObject) {
8734
8817
  const toObject = {};
8735
8818
  const fromId = getValueByPath(fromObject, ['id']);
8736
8819
  if (fromId != null) {
@@ -8752,7 +8835,7 @@ function functionCallToMldev$1(fromObject) {
8752
8835
  }
8753
8836
  return toObject;
8754
8837
  }
8755
- function functionCallingConfigToMldev(fromObject) {
8838
+ function functionCallingConfigToMldev(fromObject, _rootObject) {
8756
8839
  const toObject = {};
8757
8840
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
8758
8841
  'allowedFunctionNames',
@@ -8770,7 +8853,7 @@ function functionCallingConfigToMldev(fromObject) {
8770
8853
  }
8771
8854
  return toObject;
8772
8855
  }
8773
- function functionDeclarationToVertex(fromObject) {
8856
+ function functionDeclarationToVertex(fromObject, _rootObject) {
8774
8857
  const toObject = {};
8775
8858
  const fromDescription = getValueByPath(fromObject, ['description']);
8776
8859
  if (fromDescription != null) {
@@ -8805,7 +8888,7 @@ function functionDeclarationToVertex(fromObject) {
8805
8888
  }
8806
8889
  return toObject;
8807
8890
  }
8808
- function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8891
+ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootObject) {
8809
8892
  const toObject = {};
8810
8893
  const fromSystemInstruction = getValueByPath(fromObject, [
8811
8894
  'systemInstruction',
@@ -8968,7 +9051,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8968
9051
  }
8969
9052
  return toObject;
8970
9053
  }
8971
- function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
9054
+ function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
8972
9055
  const toObject = {};
8973
9056
  const fromSystemInstruction = getValueByPath(fromObject, [
8974
9057
  'systemInstruction',
@@ -9142,7 +9225,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
9142
9225
  }
9143
9226
  return toObject;
9144
9227
  }
9145
- function generateContentParametersToMldev(apiClient, fromObject) {
9228
+ function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
9146
9229
  const toObject = {};
9147
9230
  const fromModel = getValueByPath(fromObject, ['model']);
9148
9231
  if (fromModel != null) {
@@ -9164,7 +9247,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
9164
9247
  }
9165
9248
  return toObject;
9166
9249
  }
9167
- function generateContentParametersToVertex(apiClient, fromObject) {
9250
+ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
9168
9251
  const toObject = {};
9169
9252
  const fromModel = getValueByPath(fromObject, ['model']);
9170
9253
  if (fromModel != null) {
@@ -9186,7 +9269,7 @@ function generateContentParametersToVertex(apiClient, fromObject) {
9186
9269
  }
9187
9270
  return toObject;
9188
9271
  }
9189
- function generateContentResponseFromMldev(fromObject) {
9272
+ function generateContentResponseFromMldev(fromObject, rootObject) {
9190
9273
  const toObject = {};
9191
9274
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9192
9275
  'sdkHttpResponse',
@@ -9226,7 +9309,7 @@ function generateContentResponseFromMldev(fromObject) {
9226
9309
  }
9227
9310
  return toObject;
9228
9311
  }
9229
- function generateContentResponseFromVertex(fromObject) {
9312
+ function generateContentResponseFromVertex(fromObject, _rootObject) {
9230
9313
  const toObject = {};
9231
9314
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9232
9315
  'sdkHttpResponse',
@@ -9270,7 +9353,7 @@ function generateContentResponseFromVertex(fromObject) {
9270
9353
  }
9271
9354
  return toObject;
9272
9355
  }
9273
- function generateImagesConfigToMldev(fromObject, parentObject) {
9356
+ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
9274
9357
  const toObject = {};
9275
9358
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
9276
9359
  throw new Error('outputGcsUri parameter is not supported in Gemini API.');
@@ -9352,7 +9435,7 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
9352
9435
  }
9353
9436
  return toObject;
9354
9437
  }
9355
- function generateImagesConfigToVertex(fromObject, parentObject) {
9438
+ function generateImagesConfigToVertex(fromObject, parentObject, _rootObject) {
9356
9439
  const toObject = {};
9357
9440
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
9358
9441
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -9444,7 +9527,7 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
9444
9527
  }
9445
9528
  return toObject;
9446
9529
  }
9447
- function generateImagesParametersToMldev(apiClient, fromObject) {
9530
+ function generateImagesParametersToMldev(apiClient, fromObject, rootObject) {
9448
9531
  const toObject = {};
9449
9532
  const fromModel = getValueByPath(fromObject, ['model']);
9450
9533
  if (fromModel != null) {
@@ -9460,7 +9543,7 @@ function generateImagesParametersToMldev(apiClient, fromObject) {
9460
9543
  }
9461
9544
  return toObject;
9462
9545
  }
9463
- function generateImagesParametersToVertex(apiClient, fromObject) {
9546
+ function generateImagesParametersToVertex(apiClient, fromObject, rootObject) {
9464
9547
  const toObject = {};
9465
9548
  const fromModel = getValueByPath(fromObject, ['model']);
9466
9549
  if (fromModel != null) {
@@ -9476,7 +9559,7 @@ function generateImagesParametersToVertex(apiClient, fromObject) {
9476
9559
  }
9477
9560
  return toObject;
9478
9561
  }
9479
- function generateImagesResponseFromMldev(fromObject) {
9562
+ function generateImagesResponseFromMldev(fromObject, rootObject) {
9480
9563
  const toObject = {};
9481
9564
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9482
9565
  'sdkHttpResponse',
@@ -9504,7 +9587,7 @@ function generateImagesResponseFromMldev(fromObject) {
9504
9587
  }
9505
9588
  return toObject;
9506
9589
  }
9507
- function generateImagesResponseFromVertex(fromObject) {
9590
+ function generateImagesResponseFromVertex(fromObject, rootObject) {
9508
9591
  const toObject = {};
9509
9592
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9510
9593
  'sdkHttpResponse',
@@ -9532,7 +9615,7 @@ function generateImagesResponseFromVertex(fromObject) {
9532
9615
  }
9533
9616
  return toObject;
9534
9617
  }
9535
- function generateVideosConfigToMldev(fromObject, parentObject) {
9618
+ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
9536
9619
  const toObject = {};
9537
9620
  const fromNumberOfVideos = getValueByPath(fromObject, [
9538
9621
  'numberOfVideos',
@@ -9611,7 +9694,7 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
9611
9694
  }
9612
9695
  return toObject;
9613
9696
  }
9614
- function generateVideosConfigToVertex(fromObject, parentObject) {
9697
+ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
9615
9698
  const toObject = {};
9616
9699
  const fromNumberOfVideos = getValueByPath(fromObject, [
9617
9700
  'numberOfVideos',
@@ -9701,7 +9784,7 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
9701
9784
  }
9702
9785
  return toObject;
9703
9786
  }
9704
- function generateVideosOperationFromMldev(fromObject) {
9787
+ function generateVideosOperationFromMldev(fromObject, rootObject) {
9705
9788
  const toObject = {};
9706
9789
  const fromName = getValueByPath(fromObject, ['name']);
9707
9790
  if (fromName != null) {
@@ -9728,7 +9811,7 @@ function generateVideosOperationFromMldev(fromObject) {
9728
9811
  }
9729
9812
  return toObject;
9730
9813
  }
9731
- function generateVideosOperationFromVertex(fromObject) {
9814
+ function generateVideosOperationFromVertex(fromObject, rootObject) {
9732
9815
  const toObject = {};
9733
9816
  const fromName = getValueByPath(fromObject, ['name']);
9734
9817
  if (fromName != null) {
@@ -9752,7 +9835,7 @@ function generateVideosOperationFromVertex(fromObject) {
9752
9835
  }
9753
9836
  return toObject;
9754
9837
  }
9755
- function generateVideosParametersToMldev(apiClient, fromObject) {
9838
+ function generateVideosParametersToMldev(apiClient, fromObject, rootObject) {
9756
9839
  const toObject = {};
9757
9840
  const fromModel = getValueByPath(fromObject, ['model']);
9758
9841
  if (fromModel != null) {
@@ -9780,7 +9863,7 @@ function generateVideosParametersToMldev(apiClient, fromObject) {
9780
9863
  }
9781
9864
  return toObject;
9782
9865
  }
9783
- function generateVideosParametersToVertex(apiClient, fromObject) {
9866
+ function generateVideosParametersToVertex(apiClient, fromObject, rootObject) {
9784
9867
  const toObject = {};
9785
9868
  const fromModel = getValueByPath(fromObject, ['model']);
9786
9869
  if (fromModel != null) {
@@ -9808,7 +9891,7 @@ function generateVideosParametersToVertex(apiClient, fromObject) {
9808
9891
  }
9809
9892
  return toObject;
9810
9893
  }
9811
- function generateVideosResponseFromMldev(fromObject) {
9894
+ function generateVideosResponseFromMldev(fromObject, rootObject) {
9812
9895
  const toObject = {};
9813
9896
  const fromGeneratedVideos = getValueByPath(fromObject, [
9814
9897
  'generatedSamples',
@@ -9836,7 +9919,7 @@ function generateVideosResponseFromMldev(fromObject) {
9836
9919
  }
9837
9920
  return toObject;
9838
9921
  }
9839
- function generateVideosResponseFromVertex(fromObject) {
9922
+ function generateVideosResponseFromVertex(fromObject, rootObject) {
9840
9923
  const toObject = {};
9841
9924
  const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
9842
9925
  if (fromGeneratedVideos != null) {
@@ -9862,7 +9945,7 @@ function generateVideosResponseFromVertex(fromObject) {
9862
9945
  }
9863
9946
  return toObject;
9864
9947
  }
9865
- function generateVideosSourceToMldev(fromObject, parentObject) {
9948
+ function generateVideosSourceToMldev(fromObject, parentObject, rootObject) {
9866
9949
  const toObject = {};
9867
9950
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
9868
9951
  if (parentObject !== undefined && fromPrompt != null) {
@@ -9878,7 +9961,7 @@ function generateVideosSourceToMldev(fromObject, parentObject) {
9878
9961
  }
9879
9962
  return toObject;
9880
9963
  }
9881
- function generateVideosSourceToVertex(fromObject, parentObject) {
9964
+ function generateVideosSourceToVertex(fromObject, parentObject, rootObject) {
9882
9965
  const toObject = {};
9883
9966
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
9884
9967
  if (parentObject !== undefined && fromPrompt != null) {
@@ -9894,7 +9977,7 @@ function generateVideosSourceToVertex(fromObject, parentObject) {
9894
9977
  }
9895
9978
  return toObject;
9896
9979
  }
9897
- function generatedImageFromMldev(fromObject) {
9980
+ function generatedImageFromMldev(fromObject, rootObject) {
9898
9981
  const toObject = {};
9899
9982
  const fromImage = getValueByPath(fromObject, ['_self']);
9900
9983
  if (fromImage != null) {
@@ -9912,7 +9995,7 @@ function generatedImageFromMldev(fromObject) {
9912
9995
  }
9913
9996
  return toObject;
9914
9997
  }
9915
- function generatedImageFromVertex(fromObject) {
9998
+ function generatedImageFromVertex(fromObject, rootObject) {
9916
9999
  const toObject = {};
9917
10000
  const fromImage = getValueByPath(fromObject, ['_self']);
9918
10001
  if (fromImage != null) {
@@ -9934,7 +10017,7 @@ function generatedImageFromVertex(fromObject) {
9934
10017
  }
9935
10018
  return toObject;
9936
10019
  }
9937
- function generatedImageMaskFromVertex(fromObject) {
10020
+ function generatedImageMaskFromVertex(fromObject, rootObject) {
9938
10021
  const toObject = {};
9939
10022
  const fromMask = getValueByPath(fromObject, ['_self']);
9940
10023
  if (fromMask != null) {
@@ -9952,7 +10035,7 @@ function generatedImageMaskFromVertex(fromObject) {
9952
10035
  }
9953
10036
  return toObject;
9954
10037
  }
9955
- function generatedVideoFromMldev(fromObject) {
10038
+ function generatedVideoFromMldev(fromObject, rootObject) {
9956
10039
  const toObject = {};
9957
10040
  const fromVideo = getValueByPath(fromObject, ['video']);
9958
10041
  if (fromVideo != null) {
@@ -9960,7 +10043,7 @@ function generatedVideoFromMldev(fromObject) {
9960
10043
  }
9961
10044
  return toObject;
9962
10045
  }
9963
- function generatedVideoFromVertex(fromObject) {
10046
+ function generatedVideoFromVertex(fromObject, rootObject) {
9964
10047
  const toObject = {};
9965
10048
  const fromVideo = getValueByPath(fromObject, ['_self']);
9966
10049
  if (fromVideo != null) {
@@ -9968,7 +10051,7 @@ function generatedVideoFromVertex(fromObject) {
9968
10051
  }
9969
10052
  return toObject;
9970
10053
  }
9971
- function generationConfigToVertex(fromObject) {
10054
+ function generationConfigToVertex(fromObject, _rootObject) {
9972
10055
  const toObject = {};
9973
10056
  const fromModelSelectionConfig = getValueByPath(fromObject, [
9974
10057
  'modelSelectionConfig',
@@ -10096,7 +10179,7 @@ function generationConfigToVertex(fromObject) {
10096
10179
  }
10097
10180
  return toObject;
10098
10181
  }
10099
- function getModelParametersToMldev(apiClient, fromObject) {
10182
+ function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
10100
10183
  const toObject = {};
10101
10184
  const fromModel = getValueByPath(fromObject, ['model']);
10102
10185
  if (fromModel != null) {
@@ -10104,7 +10187,7 @@ function getModelParametersToMldev(apiClient, fromObject) {
10104
10187
  }
10105
10188
  return toObject;
10106
10189
  }
10107
- function getModelParametersToVertex(apiClient, fromObject) {
10190
+ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
10108
10191
  const toObject = {};
10109
10192
  const fromModel = getValueByPath(fromObject, ['model']);
10110
10193
  if (fromModel != null) {
@@ -10112,7 +10195,7 @@ function getModelParametersToVertex(apiClient, fromObject) {
10112
10195
  }
10113
10196
  return toObject;
10114
10197
  }
10115
- function googleMapsToMldev$1(fromObject) {
10198
+ function googleMapsToMldev$1(fromObject, _rootObject) {
10116
10199
  const toObject = {};
10117
10200
  if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
10118
10201
  throw new Error('authConfig parameter is not supported in Gemini API.');
@@ -10123,7 +10206,7 @@ function googleMapsToMldev$1(fromObject) {
10123
10206
  }
10124
10207
  return toObject;
10125
10208
  }
10126
- function googleSearchToMldev$1(fromObject) {
10209
+ function googleSearchToMldev$1(fromObject, _rootObject) {
10127
10210
  const toObject = {};
10128
10211
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
10129
10212
  throw new Error('excludeDomains parameter is not supported in Gemini API.');
@@ -10139,7 +10222,7 @@ function googleSearchToMldev$1(fromObject) {
10139
10222
  }
10140
10223
  return toObject;
10141
10224
  }
10142
- function imageConfigToMldev(fromObject) {
10225
+ function imageConfigToMldev(fromObject, _rootObject) {
10143
10226
  const toObject = {};
10144
10227
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10145
10228
  if (fromAspectRatio != null) {
@@ -10161,7 +10244,7 @@ function imageConfigToMldev(fromObject) {
10161
10244
  }
10162
10245
  return toObject;
10163
10246
  }
10164
- function imageConfigToVertex(fromObject) {
10247
+ function imageConfigToVertex(fromObject, _rootObject) {
10165
10248
  const toObject = {};
10166
10249
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10167
10250
  if (fromAspectRatio != null) {
@@ -10191,7 +10274,7 @@ function imageConfigToVertex(fromObject) {
10191
10274
  }
10192
10275
  return toObject;
10193
10276
  }
10194
- function imageFromMldev(fromObject) {
10277
+ function imageFromMldev(fromObject, _rootObject) {
10195
10278
  const toObject = {};
10196
10279
  const fromImageBytes = getValueByPath(fromObject, [
10197
10280
  'bytesBase64Encoded',
@@ -10205,7 +10288,7 @@ function imageFromMldev(fromObject) {
10205
10288
  }
10206
10289
  return toObject;
10207
10290
  }
10208
- function imageFromVertex(fromObject) {
10291
+ function imageFromVertex(fromObject, _rootObject) {
10209
10292
  const toObject = {};
10210
10293
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
10211
10294
  if (fromGcsUri != null) {
@@ -10223,7 +10306,7 @@ function imageFromVertex(fromObject) {
10223
10306
  }
10224
10307
  return toObject;
10225
10308
  }
10226
- function imageToMldev(fromObject) {
10309
+ function imageToMldev(fromObject, _rootObject) {
10227
10310
  const toObject = {};
10228
10311
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
10229
10312
  throw new Error('gcsUri parameter is not supported in Gemini API.');
@@ -10238,7 +10321,7 @@ function imageToMldev(fromObject) {
10238
10321
  }
10239
10322
  return toObject;
10240
10323
  }
10241
- function imageToVertex(fromObject) {
10324
+ function imageToVertex(fromObject, _rootObject) {
10242
10325
  const toObject = {};
10243
10326
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
10244
10327
  if (fromGcsUri != null) {
@@ -10254,7 +10337,7 @@ function imageToVertex(fromObject) {
10254
10337
  }
10255
10338
  return toObject;
10256
10339
  }
10257
- function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
10340
+ function listModelsConfigToMldev(apiClient, fromObject, parentObject, _rootObject) {
10258
10341
  const toObject = {};
10259
10342
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
10260
10343
  if (parentObject !== undefined && fromPageSize != null) {
@@ -10274,7 +10357,7 @@ function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
10274
10357
  }
10275
10358
  return toObject;
10276
10359
  }
10277
- function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
10360
+ function listModelsConfigToVertex(apiClient, fromObject, parentObject, _rootObject) {
10278
10361
  const toObject = {};
10279
10362
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
10280
10363
  if (parentObject !== undefined && fromPageSize != null) {
@@ -10294,7 +10377,7 @@ function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
10294
10377
  }
10295
10378
  return toObject;
10296
10379
  }
10297
- function listModelsParametersToMldev(apiClient, fromObject) {
10380
+ function listModelsParametersToMldev(apiClient, fromObject, rootObject) {
10298
10381
  const toObject = {};
10299
10382
  const fromConfig = getValueByPath(fromObject, ['config']);
10300
10383
  if (fromConfig != null) {
@@ -10302,7 +10385,7 @@ function listModelsParametersToMldev(apiClient, fromObject) {
10302
10385
  }
10303
10386
  return toObject;
10304
10387
  }
10305
- function listModelsParametersToVertex(apiClient, fromObject) {
10388
+ function listModelsParametersToVertex(apiClient, fromObject, rootObject) {
10306
10389
  const toObject = {};
10307
10390
  const fromConfig = getValueByPath(fromObject, ['config']);
10308
10391
  if (fromConfig != null) {
@@ -10310,7 +10393,7 @@ function listModelsParametersToVertex(apiClient, fromObject) {
10310
10393
  }
10311
10394
  return toObject;
10312
10395
  }
10313
- function listModelsResponseFromMldev(fromObject) {
10396
+ function listModelsResponseFromMldev(fromObject, rootObject) {
10314
10397
  const toObject = {};
10315
10398
  const fromSdkHttpResponse = getValueByPath(fromObject, [
10316
10399
  'sdkHttpResponse',
@@ -10336,7 +10419,7 @@ function listModelsResponseFromMldev(fromObject) {
10336
10419
  }
10337
10420
  return toObject;
10338
10421
  }
10339
- function listModelsResponseFromVertex(fromObject) {
10422
+ function listModelsResponseFromVertex(fromObject, rootObject) {
10340
10423
  const toObject = {};
10341
10424
  const fromSdkHttpResponse = getValueByPath(fromObject, [
10342
10425
  'sdkHttpResponse',
@@ -10362,7 +10445,7 @@ function listModelsResponseFromVertex(fromObject) {
10362
10445
  }
10363
10446
  return toObject;
10364
10447
  }
10365
- function maskReferenceConfigToVertex(fromObject) {
10448
+ function maskReferenceConfigToVertex(fromObject, _rootObject) {
10366
10449
  const toObject = {};
10367
10450
  const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
10368
10451
  if (fromMaskMode != null) {
@@ -10380,7 +10463,7 @@ function maskReferenceConfigToVertex(fromObject) {
10380
10463
  }
10381
10464
  return toObject;
10382
10465
  }
10383
- function modelFromMldev(fromObject) {
10466
+ function modelFromMldev(fromObject, rootObject) {
10384
10467
  const toObject = {};
10385
10468
  const fromName = getValueByPath(fromObject, ['name']);
10386
10469
  if (fromName != null) {
@@ -10444,7 +10527,7 @@ function modelFromMldev(fromObject) {
10444
10527
  }
10445
10528
  return toObject;
10446
10529
  }
10447
- function modelFromVertex(fromObject) {
10530
+ function modelFromVertex(fromObject, rootObject) {
10448
10531
  const toObject = {};
10449
10532
  const fromName = getValueByPath(fromObject, ['name']);
10450
10533
  if (fromName != null) {
@@ -10498,7 +10581,7 @@ function modelFromVertex(fromObject) {
10498
10581
  }
10499
10582
  return toObject;
10500
10583
  }
10501
- function partToMldev$1(fromObject) {
10584
+ function partToMldev$1(fromObject, rootObject) {
10502
10585
  const toObject = {};
10503
10586
  const fromMediaResolution = getValueByPath(fromObject, [
10504
10587
  'mediaResolution',
@@ -10558,7 +10641,7 @@ function partToMldev$1(fromObject) {
10558
10641
  }
10559
10642
  return toObject;
10560
10643
  }
10561
- function productImageToVertex(fromObject) {
10644
+ function productImageToVertex(fromObject, rootObject) {
10562
10645
  const toObject = {};
10563
10646
  const fromProductImage = getValueByPath(fromObject, ['productImage']);
10564
10647
  if (fromProductImage != null) {
@@ -10566,7 +10649,7 @@ function productImageToVertex(fromObject) {
10566
10649
  }
10567
10650
  return toObject;
10568
10651
  }
10569
- function recontextImageConfigToVertex(fromObject, parentObject) {
10652
+ function recontextImageConfigToVertex(fromObject, parentObject, _rootObject) {
10570
10653
  const toObject = {};
10571
10654
  const fromNumberOfImages = getValueByPath(fromObject, [
10572
10655
  'numberOfImages',
@@ -10626,7 +10709,7 @@ function recontextImageConfigToVertex(fromObject, parentObject) {
10626
10709
  }
10627
10710
  return toObject;
10628
10711
  }
10629
- function recontextImageParametersToVertex(apiClient, fromObject) {
10712
+ function recontextImageParametersToVertex(apiClient, fromObject, rootObject) {
10630
10713
  const toObject = {};
10631
10714
  const fromModel = getValueByPath(fromObject, ['model']);
10632
10715
  if (fromModel != null) {
@@ -10642,7 +10725,7 @@ function recontextImageParametersToVertex(apiClient, fromObject) {
10642
10725
  }
10643
10726
  return toObject;
10644
10727
  }
10645
- function recontextImageResponseFromVertex(fromObject) {
10728
+ function recontextImageResponseFromVertex(fromObject, rootObject) {
10646
10729
  const toObject = {};
10647
10730
  const fromGeneratedImages = getValueByPath(fromObject, [
10648
10731
  'predictions',
@@ -10658,7 +10741,7 @@ function recontextImageResponseFromVertex(fromObject) {
10658
10741
  }
10659
10742
  return toObject;
10660
10743
  }
10661
- function recontextImageSourceToVertex(fromObject, parentObject) {
10744
+ function recontextImageSourceToVertex(fromObject, parentObject, rootObject) {
10662
10745
  const toObject = {};
10663
10746
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
10664
10747
  if (parentObject !== undefined && fromPrompt != null) {
@@ -10682,7 +10765,7 @@ function recontextImageSourceToVertex(fromObject, parentObject) {
10682
10765
  }
10683
10766
  return toObject;
10684
10767
  }
10685
- function referenceImageAPIInternalToVertex(fromObject) {
10768
+ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
10686
10769
  const toObject = {};
10687
10770
  const fromReferenceImage = getValueByPath(fromObject, [
10688
10771
  'referenceImage',
@@ -10726,7 +10809,7 @@ function referenceImageAPIInternalToVertex(fromObject) {
10726
10809
  }
10727
10810
  return toObject;
10728
10811
  }
10729
- function safetyAttributesFromMldev(fromObject) {
10812
+ function safetyAttributesFromMldev(fromObject, _rootObject) {
10730
10813
  const toObject = {};
10731
10814
  const fromCategories = getValueByPath(fromObject, [
10732
10815
  'safetyAttributes',
@@ -10748,7 +10831,7 @@ function safetyAttributesFromMldev(fromObject) {
10748
10831
  }
10749
10832
  return toObject;
10750
10833
  }
10751
- function safetyAttributesFromVertex(fromObject) {
10834
+ function safetyAttributesFromVertex(fromObject, _rootObject) {
10752
10835
  const toObject = {};
10753
10836
  const fromCategories = getValueByPath(fromObject, [
10754
10837
  'safetyAttributes',
@@ -10770,7 +10853,7 @@ function safetyAttributesFromVertex(fromObject) {
10770
10853
  }
10771
10854
  return toObject;
10772
10855
  }
10773
- function safetySettingToMldev(fromObject) {
10856
+ function safetySettingToMldev(fromObject, _rootObject) {
10774
10857
  const toObject = {};
10775
10858
  const fromCategory = getValueByPath(fromObject, ['category']);
10776
10859
  if (fromCategory != null) {
@@ -10785,7 +10868,7 @@ function safetySettingToMldev(fromObject) {
10785
10868
  }
10786
10869
  return toObject;
10787
10870
  }
10788
- function scribbleImageToVertex(fromObject) {
10871
+ function scribbleImageToVertex(fromObject, rootObject) {
10789
10872
  const toObject = {};
10790
10873
  const fromImage = getValueByPath(fromObject, ['image']);
10791
10874
  if (fromImage != null) {
@@ -10793,7 +10876,7 @@ function scribbleImageToVertex(fromObject) {
10793
10876
  }
10794
10877
  return toObject;
10795
10878
  }
10796
- function segmentImageConfigToVertex(fromObject, parentObject) {
10879
+ function segmentImageConfigToVertex(fromObject, parentObject, _rootObject) {
10797
10880
  const toObject = {};
10798
10881
  const fromMode = getValueByPath(fromObject, ['mode']);
10799
10882
  if (parentObject !== undefined && fromMode != null) {
@@ -10827,7 +10910,7 @@ function segmentImageConfigToVertex(fromObject, parentObject) {
10827
10910
  }
10828
10911
  return toObject;
10829
10912
  }
10830
- function segmentImageParametersToVertex(apiClient, fromObject) {
10913
+ function segmentImageParametersToVertex(apiClient, fromObject, rootObject) {
10831
10914
  const toObject = {};
10832
10915
  const fromModel = getValueByPath(fromObject, ['model']);
10833
10916
  if (fromModel != null) {
@@ -10843,7 +10926,7 @@ function segmentImageParametersToVertex(apiClient, fromObject) {
10843
10926
  }
10844
10927
  return toObject;
10845
10928
  }
10846
- function segmentImageResponseFromVertex(fromObject) {
10929
+ function segmentImageResponseFromVertex(fromObject, rootObject) {
10847
10930
  const toObject = {};
10848
10931
  const fromGeneratedMasks = getValueByPath(fromObject, ['predictions']);
10849
10932
  if (fromGeneratedMasks != null) {
@@ -10857,7 +10940,7 @@ function segmentImageResponseFromVertex(fromObject) {
10857
10940
  }
10858
10941
  return toObject;
10859
10942
  }
10860
- function segmentImageSourceToVertex(fromObject, parentObject) {
10943
+ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
10861
10944
  const toObject = {};
10862
10945
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
10863
10946
  if (parentObject !== undefined && fromPrompt != null) {
@@ -10875,7 +10958,7 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
10875
10958
  }
10876
10959
  return toObject;
10877
10960
  }
10878
- function toolConfigToMldev(fromObject) {
10961
+ function toolConfigToMldev(fromObject, rootObject) {
10879
10962
  const toObject = {};
10880
10963
  const fromRetrievalConfig = getValueByPath(fromObject, [
10881
10964
  'retrievalConfig',
@@ -10891,7 +10974,7 @@ function toolConfigToMldev(fromObject) {
10891
10974
  }
10892
10975
  return toObject;
10893
10976
  }
10894
- function toolToMldev$1(fromObject) {
10977
+ function toolToMldev$1(fromObject, rootObject) {
10895
10978
  const toObject = {};
10896
10979
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
10897
10980
  throw new Error('retrieval parameter is not supported in Gemini API.');
@@ -10945,7 +11028,7 @@ function toolToMldev$1(fromObject) {
10945
11028
  }
10946
11029
  return toObject;
10947
11030
  }
10948
- function toolToVertex(fromObject) {
11031
+ function toolToVertex(fromObject, rootObject) {
10949
11032
  const toObject = {};
10950
11033
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
10951
11034
  if (fromRetrieval != null) {
@@ -11002,7 +11085,7 @@ function toolToVertex(fromObject) {
11002
11085
  }
11003
11086
  return toObject;
11004
11087
  }
11005
- function tunedModelInfoFromMldev(fromObject) {
11088
+ function tunedModelInfoFromMldev(fromObject, _rootObject) {
11006
11089
  const toObject = {};
11007
11090
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
11008
11091
  if (fromBaseModel != null) {
@@ -11018,7 +11101,7 @@ function tunedModelInfoFromMldev(fromObject) {
11018
11101
  }
11019
11102
  return toObject;
11020
11103
  }
11021
- function tunedModelInfoFromVertex(fromObject) {
11104
+ function tunedModelInfoFromVertex(fromObject, _rootObject) {
11022
11105
  const toObject = {};
11023
11106
  const fromBaseModel = getValueByPath(fromObject, [
11024
11107
  'labels',
@@ -11037,7 +11120,7 @@ function tunedModelInfoFromVertex(fromObject) {
11037
11120
  }
11038
11121
  return toObject;
11039
11122
  }
11040
- function updateModelConfigToMldev(fromObject, parentObject) {
11123
+ function updateModelConfigToMldev(fromObject, parentObject, _rootObject) {
11041
11124
  const toObject = {};
11042
11125
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
11043
11126
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -11055,7 +11138,7 @@ function updateModelConfigToMldev(fromObject, parentObject) {
11055
11138
  }
11056
11139
  return toObject;
11057
11140
  }
11058
- function updateModelConfigToVertex(fromObject, parentObject) {
11141
+ function updateModelConfigToVertex(fromObject, parentObject, _rootObject) {
11059
11142
  const toObject = {};
11060
11143
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
11061
11144
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -11073,7 +11156,7 @@ function updateModelConfigToVertex(fromObject, parentObject) {
11073
11156
  }
11074
11157
  return toObject;
11075
11158
  }
11076
- function updateModelParametersToMldev(apiClient, fromObject) {
11159
+ function updateModelParametersToMldev(apiClient, fromObject, rootObject) {
11077
11160
  const toObject = {};
11078
11161
  const fromModel = getValueByPath(fromObject, ['model']);
11079
11162
  if (fromModel != null) {
@@ -11085,7 +11168,7 @@ function updateModelParametersToMldev(apiClient, fromObject) {
11085
11168
  }
11086
11169
  return toObject;
11087
11170
  }
11088
- function updateModelParametersToVertex(apiClient, fromObject) {
11171
+ function updateModelParametersToVertex(apiClient, fromObject, rootObject) {
11089
11172
  const toObject = {};
11090
11173
  const fromModel = getValueByPath(fromObject, ['model']);
11091
11174
  if (fromModel != null) {
@@ -11097,7 +11180,7 @@ function updateModelParametersToVertex(apiClient, fromObject) {
11097
11180
  }
11098
11181
  return toObject;
11099
11182
  }
11100
- function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
11183
+ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject, _rootObject) {
11101
11184
  const toObject = {};
11102
11185
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
11103
11186
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -11161,7 +11244,7 @@ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
11161
11244
  }
11162
11245
  return toObject;
11163
11246
  }
11164
- function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11247
+ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject, rootObject) {
11165
11248
  const toObject = {};
11166
11249
  const fromModel = getValueByPath(fromObject, ['model']);
11167
11250
  if (fromModel != null) {
@@ -11183,7 +11266,7 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11183
11266
  }
11184
11267
  return toObject;
11185
11268
  }
11186
- function upscaleImageResponseFromVertex(fromObject) {
11269
+ function upscaleImageResponseFromVertex(fromObject, rootObject) {
11187
11270
  const toObject = {};
11188
11271
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11189
11272
  'sdkHttpResponse',
@@ -11205,7 +11288,7 @@ function upscaleImageResponseFromVertex(fromObject) {
11205
11288
  }
11206
11289
  return toObject;
11207
11290
  }
11208
- function videoFromMldev(fromObject) {
11291
+ function videoFromMldev(fromObject, _rootObject) {
11209
11292
  const toObject = {};
11210
11293
  const fromUri = getValueByPath(fromObject, ['uri']);
11211
11294
  if (fromUri != null) {
@@ -11221,7 +11304,7 @@ function videoFromMldev(fromObject) {
11221
11304
  }
11222
11305
  return toObject;
11223
11306
  }
11224
- function videoFromVertex(fromObject) {
11307
+ function videoFromVertex(fromObject, _rootObject) {
11225
11308
  const toObject = {};
11226
11309
  const fromUri = getValueByPath(fromObject, ['gcsUri']);
11227
11310
  if (fromUri != null) {
@@ -11239,7 +11322,7 @@ function videoFromVertex(fromObject) {
11239
11322
  }
11240
11323
  return toObject;
11241
11324
  }
11242
- function videoGenerationMaskToVertex(fromObject) {
11325
+ function videoGenerationMaskToVertex(fromObject, rootObject) {
11243
11326
  const toObject = {};
11244
11327
  const fromImage = getValueByPath(fromObject, ['image']);
11245
11328
  if (fromImage != null) {
@@ -11251,7 +11334,7 @@ function videoGenerationMaskToVertex(fromObject) {
11251
11334
  }
11252
11335
  return toObject;
11253
11336
  }
11254
- function videoGenerationReferenceImageToMldev(fromObject) {
11337
+ function videoGenerationReferenceImageToMldev(fromObject, rootObject) {
11255
11338
  const toObject = {};
11256
11339
  const fromImage = getValueByPath(fromObject, ['image']);
11257
11340
  if (fromImage != null) {
@@ -11265,7 +11348,7 @@ function videoGenerationReferenceImageToMldev(fromObject) {
11265
11348
  }
11266
11349
  return toObject;
11267
11350
  }
11268
- function videoGenerationReferenceImageToVertex(fromObject) {
11351
+ function videoGenerationReferenceImageToVertex(fromObject, rootObject) {
11269
11352
  const toObject = {};
11270
11353
  const fromImage = getValueByPath(fromObject, ['image']);
11271
11354
  if (fromImage != null) {
@@ -11279,7 +11362,7 @@ function videoGenerationReferenceImageToVertex(fromObject) {
11279
11362
  }
11280
11363
  return toObject;
11281
11364
  }
11282
- function videoToMldev(fromObject) {
11365
+ function videoToMldev(fromObject, _rootObject) {
11283
11366
  const toObject = {};
11284
11367
  const fromUri = getValueByPath(fromObject, ['uri']);
11285
11368
  if (fromUri != null) {
@@ -11295,7 +11378,7 @@ function videoToMldev(fromObject) {
11295
11378
  }
11296
11379
  return toObject;
11297
11380
  }
11298
- function videoToVertex(fromObject) {
11381
+ function videoToVertex(fromObject, _rootObject) {
11299
11382
  const toObject = {};
11300
11383
  const fromUri = getValueByPath(fromObject, ['uri']);
11301
11384
  if (fromUri != null) {
@@ -11556,7 +11639,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
11556
11639
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
11557
11640
  const USER_AGENT_HEADER = 'User-Agent';
11558
11641
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
11559
- const SDK_VERSION = '1.38.0'; // x-release-please-version
11642
+ const SDK_VERSION = '1.40.0'; // x-release-please-version
11560
11643
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
11561
11644
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
11562
11645
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13732,7 +13815,7 @@ class Models extends BaseModule {
13732
13815
  _c = apiResponse_1_1.value;
13733
13816
  _d = false;
13734
13817
  const chunk = _c;
13735
- const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
13818
+ const resp = generateContentResponseFromVertex((yield __await(chunk.json())), params);
13736
13819
  resp['sdkHttpResponse'] = {
13737
13820
  headers: chunk.headers,
13738
13821
  };
@@ -13774,7 +13857,7 @@ class Models extends BaseModule {
13774
13857
  _c = apiResponse_2_1.value;
13775
13858
  _d = false;
13776
13859
  const chunk = _c;
13777
- const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
13860
+ const resp = generateContentResponseFromMldev((yield __await(chunk.json())), params);
13778
13861
  resp['sdkHttpResponse'] = {
13779
13862
  headers: chunk.headers,
13780
13863
  };
@@ -16707,7 +16790,9 @@ class BaseInteractions extends APIResource {
16707
16790
  *
16708
16791
  * @example
16709
16792
  * ```ts
16710
- * const interaction = await client.interactions.delete('id');
16793
+ * const interaction = await client.interactions.delete('id', {
16794
+ * api_version: 'api_version',
16795
+ * });
16711
16796
  * ```
16712
16797
  */
16713
16798
  delete(id, params = {}, options) {
@@ -16719,7 +16804,9 @@ class BaseInteractions extends APIResource {
16719
16804
  *
16720
16805
  * @example
16721
16806
  * ```ts
16722
- * const interaction = await client.interactions.cancel('id');
16807
+ * const interaction = await client.interactions.cancel('id', {
16808
+ * api_version: 'api_version',
16809
+ * });
16723
16810
  * ```
16724
16811
  */
16725
16812
  cancel(id, params = {}, options) {
@@ -17325,6 +17412,11 @@ async function defaultParseResponse(client, props) {
17325
17412
  const mediaType = (_a = contentType === null || contentType === void 0 ? void 0 : contentType.split(';')[0]) === null || _a === void 0 ? void 0 : _a.trim();
17326
17413
  const isJSON = (mediaType === null || mediaType === void 0 ? void 0 : mediaType.includes('application/json')) || (mediaType === null || mediaType === void 0 ? void 0 : mediaType.endsWith('+json'));
17327
17414
  if (isJSON) {
17415
+ const contentLength = response.headers.get('content-length');
17416
+ if (contentLength === '0') {
17417
+ // if there is no content we can't do anything
17418
+ return undefined;
17419
+ }
17328
17420
  const json = await response.json();
17329
17421
  return json;
17330
17422
  }
@@ -17784,9 +17876,10 @@ class BaseGeminiNextGenAPIClient {
17784
17876
  }
17785
17877
  async fetchWithTimeout(url, init, ms, controller) {
17786
17878
  const _b = init || {}, { signal, method } = _b, options = __rest(_b, ["signal", "method"]);
17879
+ const abort = controller.abort.bind(controller);
17787
17880
  if (signal)
17788
- signal.addEventListener('abort', () => controller.abort());
17789
- const timeout = setTimeout(() => controller.abort(), ms);
17881
+ signal.addEventListener('abort', abort, { once: true });
17882
+ const timeout = setTimeout(abort, ms);
17790
17883
  const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||
17791
17884
  (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
17792
17885
  const fetchOptions = Object.assign(Object.assign(Object.assign({ signal: controller.signal }, (isReadableBody ? { duplex: 'half' } : {})), { method: 'GET' }), options);
@@ -18216,6 +18309,12 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18216
18309
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
18217
18310
  throw new Error('adapterSize parameter is not supported in Gemini API.');
18218
18311
  }
18312
+ if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
18313
+ throw new Error('tuningMode parameter is not supported in Gemini API.');
18314
+ }
18315
+ if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
18316
+ throw new Error('customBaseModel parameter is not supported in Gemini API.');
18317
+ }
18219
18318
  const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18220
18319
  if (parentObject !== undefined && fromBatchSize != null) {
18221
18320
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'batchSize'], fromBatchSize);
@@ -18230,6 +18329,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18230
18329
  if (getValueByPath(fromObject, ['beta']) !== undefined) {
18231
18330
  throw new Error('beta parameter is not supported in Gemini API.');
18232
18331
  }
18332
+ if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
18333
+ throw new Error('baseTeacherModel parameter is not supported in Gemini API.');
18334
+ }
18335
+ if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
18336
+ throw new Error('tunedTeacherModelSource parameter is not supported in Gemini API.');
18337
+ }
18338
+ if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
18339
+ throw new Error('sftLossWeightMultiplier parameter is not supported in Gemini API.');
18340
+ }
18341
+ if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
18342
+ throw new Error('outputUri parameter is not supported in Gemini API.');
18343
+ }
18233
18344
  return toObject;
18234
18345
  }
18235
18346
  function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
@@ -18257,6 +18368,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18257
18368
  setValueByPath(parentObject, ['preferenceOptimizationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18258
18369
  }
18259
18370
  }
18371
+ else if (discriminatorValidationDataset === 'DISTILLATION') {
18372
+ const fromValidationDataset = getValueByPath(fromObject, [
18373
+ 'validationDataset',
18374
+ ]);
18375
+ if (parentObject !== undefined && fromValidationDataset != null) {
18376
+ setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18377
+ }
18378
+ }
18260
18379
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
18261
18380
  'tunedModelDisplayName',
18262
18381
  ]);
@@ -18286,6 +18405,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18286
18405
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18287
18406
  }
18288
18407
  }
18408
+ else if (discriminatorEpochCount === 'DISTILLATION') {
18409
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
18410
+ if (parentObject !== undefined && fromEpochCount != null) {
18411
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18412
+ }
18413
+ }
18289
18414
  let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
18290
18415
  'config',
18291
18416
  'method',
@@ -18313,6 +18438,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18313
18438
  ], fromLearningRateMultiplier);
18314
18439
  }
18315
18440
  }
18441
+ else if (discriminatorLearningRateMultiplier === 'DISTILLATION') {
18442
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
18443
+ 'learningRateMultiplier',
18444
+ ]);
18445
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
18446
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
18447
+ }
18448
+ }
18316
18449
  let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
18317
18450
  if (discriminatorExportLastCheckpointOnly === undefined) {
18318
18451
  discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
@@ -18333,6 +18466,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18333
18466
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18334
18467
  }
18335
18468
  }
18469
+ else if (discriminatorExportLastCheckpointOnly === 'DISTILLATION') {
18470
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
18471
+ 'exportLastCheckpointOnly',
18472
+ ]);
18473
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
18474
+ setValueByPath(parentObject, ['distillationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18475
+ }
18476
+ }
18336
18477
  let discriminatorAdapterSize = getValueByPath(rootObject, [
18337
18478
  'config',
18338
18479
  'method',
@@ -18352,11 +18493,58 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18352
18493
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18353
18494
  }
18354
18495
  }
18355
- if (getValueByPath(fromObject, ['batchSize']) !== undefined) {
18356
- throw new Error('batchSize parameter is not supported in Vertex AI.');
18496
+ else if (discriminatorAdapterSize === 'DISTILLATION') {
18497
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
18498
+ if (parentObject !== undefined && fromAdapterSize != null) {
18499
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18500
+ }
18357
18501
  }
18358
- if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18359
- throw new Error('learningRate parameter is not supported in Vertex AI.');
18502
+ let discriminatorTuningMode = getValueByPath(rootObject, [
18503
+ 'config',
18504
+ 'method',
18505
+ ]);
18506
+ if (discriminatorTuningMode === undefined) {
18507
+ discriminatorTuningMode = 'SUPERVISED_FINE_TUNING';
18508
+ }
18509
+ if (discriminatorTuningMode === 'SUPERVISED_FINE_TUNING') {
18510
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
18511
+ if (parentObject !== undefined && fromTuningMode != null) {
18512
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
18513
+ }
18514
+ }
18515
+ const fromCustomBaseModel = getValueByPath(fromObject, [
18516
+ 'customBaseModel',
18517
+ ]);
18518
+ if (parentObject !== undefined && fromCustomBaseModel != null) {
18519
+ setValueByPath(parentObject, ['customBaseModel'], fromCustomBaseModel);
18520
+ }
18521
+ let discriminatorBatchSize = getValueByPath(rootObject, [
18522
+ 'config',
18523
+ 'method',
18524
+ ]);
18525
+ if (discriminatorBatchSize === undefined) {
18526
+ discriminatorBatchSize = 'SUPERVISED_FINE_TUNING';
18527
+ }
18528
+ if (discriminatorBatchSize === 'SUPERVISED_FINE_TUNING') {
18529
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18530
+ if (parentObject !== undefined && fromBatchSize != null) {
18531
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
18532
+ }
18533
+ }
18534
+ let discriminatorLearningRate = getValueByPath(rootObject, [
18535
+ 'config',
18536
+ 'method',
18537
+ ]);
18538
+ if (discriminatorLearningRate === undefined) {
18539
+ discriminatorLearningRate = 'SUPERVISED_FINE_TUNING';
18540
+ }
18541
+ if (discriminatorLearningRate === 'SUPERVISED_FINE_TUNING') {
18542
+ const fromLearningRate = getValueByPath(fromObject, [
18543
+ 'learningRate',
18544
+ ]);
18545
+ if (parentObject !== undefined && fromLearningRate != null) {
18546
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
18547
+ }
18360
18548
  }
18361
18549
  const fromLabels = getValueByPath(fromObject, ['labels']);
18362
18550
  if (parentObject !== undefined && fromLabels != null) {
@@ -18366,6 +18554,28 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18366
18554
  if (parentObject !== undefined && fromBeta != null) {
18367
18555
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'beta'], fromBeta);
18368
18556
  }
18557
+ const fromBaseTeacherModel = getValueByPath(fromObject, [
18558
+ 'baseTeacherModel',
18559
+ ]);
18560
+ if (parentObject !== undefined && fromBaseTeacherModel != null) {
18561
+ setValueByPath(parentObject, ['distillationSpec', 'baseTeacherModel'], fromBaseTeacherModel);
18562
+ }
18563
+ const fromTunedTeacherModelSource = getValueByPath(fromObject, [
18564
+ 'tunedTeacherModelSource',
18565
+ ]);
18566
+ if (parentObject !== undefined && fromTunedTeacherModelSource != null) {
18567
+ setValueByPath(parentObject, ['distillationSpec', 'tunedTeacherModelSource'], fromTunedTeacherModelSource);
18568
+ }
18569
+ const fromSftLossWeightMultiplier = getValueByPath(fromObject, [
18570
+ 'sftLossWeightMultiplier',
18571
+ ]);
18572
+ if (parentObject !== undefined && fromSftLossWeightMultiplier != null) {
18573
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'sftLossWeightMultiplier'], fromSftLossWeightMultiplier);
18574
+ }
18575
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
18576
+ if (parentObject !== undefined && fromOutputUri != null) {
18577
+ setValueByPath(parentObject, ['outputUri'], fromOutputUri);
18578
+ }
18369
18579
  return toObject;
18370
18580
  }
18371
18581
  function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
@@ -18585,6 +18795,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18585
18795
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromGcsUri);
18586
18796
  }
18587
18797
  }
18798
+ else if (discriminatorGcsUri === 'DISTILLATION') {
18799
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
18800
+ if (parentObject !== undefined && fromGcsUri != null) {
18801
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
18802
+ }
18803
+ }
18588
18804
  let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
18589
18805
  'config',
18590
18806
  'method',
@@ -18608,6 +18824,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18608
18824
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
18609
18825
  }
18610
18826
  }
18827
+ else if (discriminatorVertexDatasetResource === 'DISTILLATION') {
18828
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
18829
+ 'vertexDatasetResource',
18830
+ ]);
18831
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
18832
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
18833
+ }
18834
+ }
18611
18835
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
18612
18836
  throw new Error('examples parameter is not supported in Vertex AI.');
18613
18837
  }
@@ -18731,6 +18955,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
18731
18955
  if (fromPreferenceOptimizationSpec != null) {
18732
18956
  setValueByPath(toObject, ['preferenceOptimizationSpec'], fromPreferenceOptimizationSpec);
18733
18957
  }
18958
+ const fromDistillationSpec = getValueByPath(fromObject, [
18959
+ 'distillationSpec',
18960
+ ]);
18961
+ if (fromDistillationSpec != null) {
18962
+ setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
18963
+ }
18734
18964
  const fromTuningDataStats = getValueByPath(fromObject, [
18735
18965
  'tuningDataStats',
18736
18966
  ]);
@@ -19508,6 +19738,48 @@ class NodeUploader {
19508
19738
  }
19509
19739
  }
19510
19740
 
19741
+ /**
19742
+ * @license
19743
+ * Copyright 2025 Google LLC
19744
+ * SPDX-License-Identifier: Apache-2.0
19745
+ */
19746
+ class NodeFiles extends Files {
19747
+ /**
19748
+ * Registers Google Cloud Storage files for use with the API.
19749
+ * This method is only available in Node.js environments.
19750
+ */
19751
+ async registerFiles(params) {
19752
+ if (typeof process === 'undefined' ||
19753
+ !process.versions ||
19754
+ !process.versions.node) {
19755
+ throw new Error('registerFiles is only supported in Node.js environments.');
19756
+ }
19757
+ const googleAuth = params.auth;
19758
+ const authHeaders = await googleAuth.getRequestHeaders();
19759
+ const config = params.config || {};
19760
+ const httpOptions = config.httpOptions || {};
19761
+ const headers = Object.assign({}, (httpOptions.headers || {}));
19762
+ if (authHeaders) {
19763
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19764
+ if (typeof authHeaders[Symbol.iterator] === 'function') {
19765
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19766
+ for (const [key, value] of authHeaders) {
19767
+ headers[key] = value;
19768
+ }
19769
+ }
19770
+ else {
19771
+ for (const [key, value] of Object.entries(authHeaders)) {
19772
+ headers[key] = value;
19773
+ }
19774
+ }
19775
+ }
19776
+ return this._registerFiles({
19777
+ uris: params.uris,
19778
+ config: Object.assign(Object.assign({}, config), { httpOptions: Object.assign(Object.assign({}, httpOptions), { headers }) }),
19779
+ });
19780
+ }
19781
+ }
19782
+
19511
19783
  /**
19512
19784
  * @license
19513
19785
  * Copyright 2025 Google LLC
@@ -19657,7 +19929,7 @@ class GoogleGenAI {
19657
19929
  this.batches = new Batches(this.apiClient);
19658
19930
  this.chats = new Chats(this.models, this.apiClient);
19659
19931
  this.caches = new Caches(this.apiClient);
19660
- this.files = new Files(this.apiClient);
19932
+ this.files = new NodeFiles(this.apiClient);
19661
19933
  this.operations = new Operations(this.apiClient);
19662
19934
  this.authTokens = new Tokens(this.apiClient);
19663
19935
  this.tunings = new Tunings(this.apiClient);
@@ -19737,6 +20009,7 @@ exports.Operations = Operations;
19737
20009
  exports.Pager = Pager;
19738
20010
  exports.RawReferenceImage = RawReferenceImage;
19739
20011
  exports.RecontextImageResponse = RecontextImageResponse;
20012
+ exports.RegisterFilesResponse = RegisterFilesResponse;
19740
20013
  exports.ReplayResponse = ReplayResponse;
19741
20014
  exports.SegmentImageResponse = SegmentImageResponse;
19742
20015
  exports.Session = Session;