@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.
@@ -1529,6 +1529,10 @@ var TuningMethod;
1529
1529
  * Preference optimization tuning.
1530
1530
  */
1531
1531
  TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
1532
+ /**
1533
+ * Distillation tuning.
1534
+ */
1535
+ TuningMethod["DISTILLATION"] = "DISTILLATION";
1532
1536
  })(TuningMethod || (TuningMethod = {}));
1533
1537
  /** State for the lifecycle of a Document. */
1534
1538
  var DocumentState;
@@ -2320,6 +2324,9 @@ class CreateFileResponse {
2320
2324
  /** Response for the delete file method. */
2321
2325
  class DeleteFileResponse {
2322
2326
  }
2327
+ /** Response for the _register file method. */
2328
+ class RegisterFilesResponse {
2329
+ }
2323
2330
  /** Config for `inlined_responses` parameter. */
2324
2331
  class InlinedResponse {
2325
2332
  }
@@ -4314,6 +4321,10 @@ function inlinedResponseFromMldev(fromObject) {
4314
4321
  if (fromResponse != null) {
4315
4322
  setValueByPath(toObject, ['response'], generateContentResponseFromMldev$1(fromResponse));
4316
4323
  }
4324
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
4325
+ if (fromMetadata != null) {
4326
+ setValueByPath(toObject, ['metadata'], fromMetadata);
4327
+ }
4317
4328
  const fromError = getValueByPath(fromObject, ['error']);
4318
4329
  if (fromError != null) {
4319
4330
  setValueByPath(toObject, ['error'], fromError);
@@ -6754,6 +6765,14 @@ function getFileParametersToMldev(fromObject) {
6754
6765
  }
6755
6766
  return toObject;
6756
6767
  }
6768
+ function internalRegisterFilesParametersToMldev(fromObject) {
6769
+ const toObject = {};
6770
+ const fromUris = getValueByPath(fromObject, ['uris']);
6771
+ if (fromUris != null) {
6772
+ setValueByPath(toObject, ['uris'], fromUris);
6773
+ }
6774
+ return toObject;
6775
+ }
6757
6776
  function listFilesConfigToMldev(fromObject, parentObject) {
6758
6777
  const toObject = {};
6759
6778
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
@@ -6800,6 +6819,26 @@ function listFilesResponseFromMldev(fromObject) {
6800
6819
  }
6801
6820
  return toObject;
6802
6821
  }
6822
+ function registerFilesResponseFromMldev(fromObject) {
6823
+ const toObject = {};
6824
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6825
+ 'sdkHttpResponse',
6826
+ ]);
6827
+ if (fromSdkHttpResponse != null) {
6828
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6829
+ }
6830
+ const fromFiles = getValueByPath(fromObject, ['files']);
6831
+ if (fromFiles != null) {
6832
+ let transformedList = fromFiles;
6833
+ if (Array.isArray(transformedList)) {
6834
+ transformedList = transformedList.map((item) => {
6835
+ return item;
6836
+ });
6837
+ }
6838
+ setValueByPath(toObject, ['files'], transformedList);
6839
+ }
6840
+ return toObject;
6841
+ }
6803
6842
 
6804
6843
  /**
6805
6844
  * @license
@@ -6900,6 +6939,16 @@ class Files extends BaseModule {
6900
6939
  async download(params) {
6901
6940
  await this.apiClient.downloadFile(params);
6902
6941
  }
6942
+ /**
6943
+ * Registers Google Cloud Storage files for use with the API.
6944
+ * This method is only available in Node.js environments.
6945
+ */
6946
+ async registerFiles(params) {
6947
+ throw new Error('registerFiles is only supported in Node.js environments.');
6948
+ }
6949
+ async _registerFiles(params) {
6950
+ return this.registerFilesInternal(params);
6951
+ }
6903
6952
  async listInternal(params) {
6904
6953
  var _a, _b;
6905
6954
  let response;
@@ -7073,6 +7122,40 @@ class Files extends BaseModule {
7073
7122
  });
7074
7123
  }
7075
7124
  }
7125
+ async registerFilesInternal(params) {
7126
+ var _a, _b;
7127
+ let response;
7128
+ let path = '';
7129
+ let queryParams = {};
7130
+ if (this.apiClient.isVertexAI()) {
7131
+ throw new Error('This method is only supported by the Gemini Developer API.');
7132
+ }
7133
+ else {
7134
+ const body = internalRegisterFilesParametersToMldev(params);
7135
+ path = formatMap('files:register', body['_url']);
7136
+ queryParams = body['_query'];
7137
+ delete body['_url'];
7138
+ delete body['_query'];
7139
+ response = this.apiClient
7140
+ .request({
7141
+ path: path,
7142
+ queryParams: queryParams,
7143
+ body: JSON.stringify(body),
7144
+ httpMethod: 'POST',
7145
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
7146
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
7147
+ })
7148
+ .then((httpResponse) => {
7149
+ return httpResponse.json();
7150
+ });
7151
+ return response.then((apiResponse) => {
7152
+ const resp = registerFilesResponseFromMldev(apiResponse);
7153
+ const typedResp = new RegisterFilesResponse();
7154
+ Object.assign(typedResp, resp);
7155
+ return typedResp;
7156
+ });
7157
+ }
7158
+ }
7076
7159
  }
7077
7160
 
7078
7161
  /**
@@ -8045,7 +8128,7 @@ function voiceActivityFromVertex(fromObject) {
8045
8128
  * Copyright 2025 Google LLC
8046
8129
  * SPDX-License-Identifier: Apache-2.0
8047
8130
  */
8048
- function blobToMldev$1(fromObject) {
8131
+ function blobToMldev$1(fromObject, _rootObject) {
8049
8132
  const toObject = {};
8050
8133
  const fromData = getValueByPath(fromObject, ['data']);
8051
8134
  if (fromData != null) {
@@ -8060,7 +8143,7 @@ function blobToMldev$1(fromObject) {
8060
8143
  }
8061
8144
  return toObject;
8062
8145
  }
8063
- function candidateFromMldev(fromObject) {
8146
+ function candidateFromMldev(fromObject, rootObject) {
8064
8147
  const toObject = {};
8065
8148
  const fromContent = getValueByPath(fromObject, ['content']);
8066
8149
  if (fromContent != null) {
@@ -8120,7 +8203,7 @@ function candidateFromMldev(fromObject) {
8120
8203
  }
8121
8204
  return toObject;
8122
8205
  }
8123
- function citationMetadataFromMldev(fromObject) {
8206
+ function citationMetadataFromMldev(fromObject, _rootObject) {
8124
8207
  const toObject = {};
8125
8208
  const fromCitations = getValueByPath(fromObject, ['citationSources']);
8126
8209
  if (fromCitations != null) {
@@ -8134,7 +8217,7 @@ function citationMetadataFromMldev(fromObject) {
8134
8217
  }
8135
8218
  return toObject;
8136
8219
  }
8137
- function computeTokensParametersToVertex(apiClient, fromObject) {
8220
+ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
8138
8221
  const toObject = {};
8139
8222
  const fromModel = getValueByPath(fromObject, ['model']);
8140
8223
  if (fromModel != null) {
@@ -8152,7 +8235,7 @@ function computeTokensParametersToVertex(apiClient, fromObject) {
8152
8235
  }
8153
8236
  return toObject;
8154
8237
  }
8155
- function computeTokensResponseFromVertex(fromObject) {
8238
+ function computeTokensResponseFromVertex(fromObject, _rootObject) {
8156
8239
  const toObject = {};
8157
8240
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8158
8241
  'sdkHttpResponse',
@@ -8172,7 +8255,7 @@ function computeTokensResponseFromVertex(fromObject) {
8172
8255
  }
8173
8256
  return toObject;
8174
8257
  }
8175
- function contentEmbeddingFromVertex(fromObject) {
8258
+ function contentEmbeddingFromVertex(fromObject, rootObject) {
8176
8259
  const toObject = {};
8177
8260
  const fromValues = getValueByPath(fromObject, ['values']);
8178
8261
  if (fromValues != null) {
@@ -8184,7 +8267,7 @@ function contentEmbeddingFromVertex(fromObject) {
8184
8267
  }
8185
8268
  return toObject;
8186
8269
  }
8187
- function contentEmbeddingStatisticsFromVertex(fromObject) {
8270
+ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
8188
8271
  const toObject = {};
8189
8272
  const fromTruncated = getValueByPath(fromObject, ['truncated']);
8190
8273
  if (fromTruncated != null) {
@@ -8196,7 +8279,7 @@ function contentEmbeddingStatisticsFromVertex(fromObject) {
8196
8279
  }
8197
8280
  return toObject;
8198
8281
  }
8199
- function contentToMldev$1(fromObject) {
8282
+ function contentToMldev$1(fromObject, rootObject) {
8200
8283
  const toObject = {};
8201
8284
  const fromParts = getValueByPath(fromObject, ['parts']);
8202
8285
  if (fromParts != null) {
@@ -8214,7 +8297,7 @@ function contentToMldev$1(fromObject) {
8214
8297
  }
8215
8298
  return toObject;
8216
8299
  }
8217
- function controlReferenceConfigToVertex(fromObject) {
8300
+ function controlReferenceConfigToVertex(fromObject, _rootObject) {
8218
8301
  const toObject = {};
8219
8302
  const fromControlType = getValueByPath(fromObject, ['controlType']);
8220
8303
  if (fromControlType != null) {
@@ -8228,7 +8311,7 @@ function controlReferenceConfigToVertex(fromObject) {
8228
8311
  }
8229
8312
  return toObject;
8230
8313
  }
8231
- function countTokensConfigToMldev(fromObject) {
8314
+ function countTokensConfigToMldev(fromObject, _rootObject) {
8232
8315
  const toObject = {};
8233
8316
  if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
8234
8317
  throw new Error('systemInstruction parameter is not supported in Gemini API.');
@@ -8241,7 +8324,7 @@ function countTokensConfigToMldev(fromObject) {
8241
8324
  }
8242
8325
  return toObject;
8243
8326
  }
8244
- function countTokensConfigToVertex(fromObject, parentObject) {
8327
+ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
8245
8328
  const toObject = {};
8246
8329
  const fromSystemInstruction = getValueByPath(fromObject, [
8247
8330
  'systemInstruction',
@@ -8267,7 +8350,7 @@ function countTokensConfigToVertex(fromObject, parentObject) {
8267
8350
  }
8268
8351
  return toObject;
8269
8352
  }
8270
- function countTokensParametersToMldev(apiClient, fromObject) {
8353
+ function countTokensParametersToMldev(apiClient, fromObject, rootObject) {
8271
8354
  const toObject = {};
8272
8355
  const fromModel = getValueByPath(fromObject, ['model']);
8273
8356
  if (fromModel != null) {
@@ -8289,7 +8372,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
8289
8372
  }
8290
8373
  return toObject;
8291
8374
  }
8292
- function countTokensParametersToVertex(apiClient, fromObject) {
8375
+ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
8293
8376
  const toObject = {};
8294
8377
  const fromModel = getValueByPath(fromObject, ['model']);
8295
8378
  if (fromModel != null) {
@@ -8311,7 +8394,7 @@ function countTokensParametersToVertex(apiClient, fromObject) {
8311
8394
  }
8312
8395
  return toObject;
8313
8396
  }
8314
- function countTokensResponseFromMldev(fromObject) {
8397
+ function countTokensResponseFromMldev(fromObject, _rootObject) {
8315
8398
  const toObject = {};
8316
8399
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8317
8400
  'sdkHttpResponse',
@@ -8331,7 +8414,7 @@ function countTokensResponseFromMldev(fromObject) {
8331
8414
  }
8332
8415
  return toObject;
8333
8416
  }
8334
- function countTokensResponseFromVertex(fromObject) {
8417
+ function countTokensResponseFromVertex(fromObject, _rootObject) {
8335
8418
  const toObject = {};
8336
8419
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8337
8420
  'sdkHttpResponse',
@@ -8345,7 +8428,7 @@ function countTokensResponseFromVertex(fromObject) {
8345
8428
  }
8346
8429
  return toObject;
8347
8430
  }
8348
- function deleteModelParametersToMldev(apiClient, fromObject) {
8431
+ function deleteModelParametersToMldev(apiClient, fromObject, _rootObject) {
8349
8432
  const toObject = {};
8350
8433
  const fromModel = getValueByPath(fromObject, ['model']);
8351
8434
  if (fromModel != null) {
@@ -8353,7 +8436,7 @@ function deleteModelParametersToMldev(apiClient, fromObject) {
8353
8436
  }
8354
8437
  return toObject;
8355
8438
  }
8356
- function deleteModelParametersToVertex(apiClient, fromObject) {
8439
+ function deleteModelParametersToVertex(apiClient, fromObject, _rootObject) {
8357
8440
  const toObject = {};
8358
8441
  const fromModel = getValueByPath(fromObject, ['model']);
8359
8442
  if (fromModel != null) {
@@ -8361,7 +8444,7 @@ function deleteModelParametersToVertex(apiClient, fromObject) {
8361
8444
  }
8362
8445
  return toObject;
8363
8446
  }
8364
- function deleteModelResponseFromMldev(fromObject) {
8447
+ function deleteModelResponseFromMldev(fromObject, _rootObject) {
8365
8448
  const toObject = {};
8366
8449
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8367
8450
  'sdkHttpResponse',
@@ -8371,7 +8454,7 @@ function deleteModelResponseFromMldev(fromObject) {
8371
8454
  }
8372
8455
  return toObject;
8373
8456
  }
8374
- function deleteModelResponseFromVertex(fromObject) {
8457
+ function deleteModelResponseFromVertex(fromObject, _rootObject) {
8375
8458
  const toObject = {};
8376
8459
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8377
8460
  'sdkHttpResponse',
@@ -8381,7 +8464,7 @@ function deleteModelResponseFromVertex(fromObject) {
8381
8464
  }
8382
8465
  return toObject;
8383
8466
  }
8384
- function editImageConfigToVertex(fromObject, parentObject) {
8467
+ function editImageConfigToVertex(fromObject, parentObject, _rootObject) {
8385
8468
  const toObject = {};
8386
8469
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
8387
8470
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -8471,7 +8554,7 @@ function editImageConfigToVertex(fromObject, parentObject) {
8471
8554
  }
8472
8555
  return toObject;
8473
8556
  }
8474
- function editImageParametersInternalToVertex(apiClient, fromObject) {
8557
+ function editImageParametersInternalToVertex(apiClient, fromObject, rootObject) {
8475
8558
  const toObject = {};
8476
8559
  const fromModel = getValueByPath(fromObject, ['model']);
8477
8560
  if (fromModel != null) {
@@ -8499,7 +8582,7 @@ function editImageParametersInternalToVertex(apiClient, fromObject) {
8499
8582
  }
8500
8583
  return toObject;
8501
8584
  }
8502
- function editImageResponseFromVertex(fromObject) {
8585
+ function editImageResponseFromVertex(fromObject, rootObject) {
8503
8586
  const toObject = {};
8504
8587
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8505
8588
  'sdkHttpResponse',
@@ -8521,7 +8604,7 @@ function editImageResponseFromVertex(fromObject) {
8521
8604
  }
8522
8605
  return toObject;
8523
8606
  }
8524
- function embedContentConfigToMldev(fromObject, parentObject) {
8607
+ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
8525
8608
  const toObject = {};
8526
8609
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
8527
8610
  if (parentObject !== undefined && fromTaskType != null) {
@@ -8545,7 +8628,7 @@ function embedContentConfigToMldev(fromObject, parentObject) {
8545
8628
  }
8546
8629
  return toObject;
8547
8630
  }
8548
- function embedContentConfigToVertex(fromObject, parentObject) {
8631
+ function embedContentConfigToVertex(fromObject, parentObject, _rootObject) {
8549
8632
  const toObject = {};
8550
8633
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
8551
8634
  if (parentObject !== undefined && fromTaskType != null) {
@@ -8571,7 +8654,7 @@ function embedContentConfigToVertex(fromObject, parentObject) {
8571
8654
  }
8572
8655
  return toObject;
8573
8656
  }
8574
- function embedContentParametersToMldev(apiClient, fromObject) {
8657
+ function embedContentParametersToMldev(apiClient, fromObject, rootObject) {
8575
8658
  const toObject = {};
8576
8659
  const fromModel = getValueByPath(fromObject, ['model']);
8577
8660
  if (fromModel != null) {
@@ -8597,7 +8680,7 @@ function embedContentParametersToMldev(apiClient, fromObject) {
8597
8680
  }
8598
8681
  return toObject;
8599
8682
  }
8600
- function embedContentParametersToVertex(apiClient, fromObject) {
8683
+ function embedContentParametersToVertex(apiClient, fromObject, rootObject) {
8601
8684
  const toObject = {};
8602
8685
  const fromModel = getValueByPath(fromObject, ['model']);
8603
8686
  if (fromModel != null) {
@@ -8619,7 +8702,7 @@ function embedContentParametersToVertex(apiClient, fromObject) {
8619
8702
  }
8620
8703
  return toObject;
8621
8704
  }
8622
- function embedContentResponseFromMldev(fromObject) {
8705
+ function embedContentResponseFromMldev(fromObject, _rootObject) {
8623
8706
  const toObject = {};
8624
8707
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8625
8708
  'sdkHttpResponse',
@@ -8643,7 +8726,7 @@ function embedContentResponseFromMldev(fromObject) {
8643
8726
  }
8644
8727
  return toObject;
8645
8728
  }
8646
- function embedContentResponseFromVertex(fromObject) {
8729
+ function embedContentResponseFromVertex(fromObject, rootObject) {
8647
8730
  const toObject = {};
8648
8731
  const fromSdkHttpResponse = getValueByPath(fromObject, [
8649
8732
  'sdkHttpResponse',
@@ -8670,7 +8753,7 @@ function embedContentResponseFromVertex(fromObject) {
8670
8753
  }
8671
8754
  return toObject;
8672
8755
  }
8673
- function endpointFromVertex(fromObject) {
8756
+ function endpointFromVertex(fromObject, _rootObject) {
8674
8757
  const toObject = {};
8675
8758
  const fromName = getValueByPath(fromObject, ['endpoint']);
8676
8759
  if (fromName != null) {
@@ -8684,7 +8767,7 @@ function endpointFromVertex(fromObject) {
8684
8767
  }
8685
8768
  return toObject;
8686
8769
  }
8687
- function fileDataToMldev$1(fromObject) {
8770
+ function fileDataToMldev$1(fromObject, _rootObject) {
8688
8771
  const toObject = {};
8689
8772
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
8690
8773
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -8699,7 +8782,7 @@ function fileDataToMldev$1(fromObject) {
8699
8782
  }
8700
8783
  return toObject;
8701
8784
  }
8702
- function functionCallToMldev$1(fromObject) {
8785
+ function functionCallToMldev$1(fromObject, _rootObject) {
8703
8786
  const toObject = {};
8704
8787
  const fromId = getValueByPath(fromObject, ['id']);
8705
8788
  if (fromId != null) {
@@ -8721,7 +8804,7 @@ function functionCallToMldev$1(fromObject) {
8721
8804
  }
8722
8805
  return toObject;
8723
8806
  }
8724
- function functionCallingConfigToMldev(fromObject) {
8807
+ function functionCallingConfigToMldev(fromObject, _rootObject) {
8725
8808
  const toObject = {};
8726
8809
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
8727
8810
  'allowedFunctionNames',
@@ -8739,7 +8822,7 @@ function functionCallingConfigToMldev(fromObject) {
8739
8822
  }
8740
8823
  return toObject;
8741
8824
  }
8742
- function functionDeclarationToVertex(fromObject) {
8825
+ function functionDeclarationToVertex(fromObject, _rootObject) {
8743
8826
  const toObject = {};
8744
8827
  const fromDescription = getValueByPath(fromObject, ['description']);
8745
8828
  if (fromDescription != null) {
@@ -8774,7 +8857,7 @@ function functionDeclarationToVertex(fromObject) {
8774
8857
  }
8775
8858
  return toObject;
8776
8859
  }
8777
- function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8860
+ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootObject) {
8778
8861
  const toObject = {};
8779
8862
  const fromSystemInstruction = getValueByPath(fromObject, [
8780
8863
  'systemInstruction',
@@ -8937,7 +9020,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8937
9020
  }
8938
9021
  return toObject;
8939
9022
  }
8940
- function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
9023
+ function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
8941
9024
  const toObject = {};
8942
9025
  const fromSystemInstruction = getValueByPath(fromObject, [
8943
9026
  'systemInstruction',
@@ -9111,7 +9194,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
9111
9194
  }
9112
9195
  return toObject;
9113
9196
  }
9114
- function generateContentParametersToMldev(apiClient, fromObject) {
9197
+ function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
9115
9198
  const toObject = {};
9116
9199
  const fromModel = getValueByPath(fromObject, ['model']);
9117
9200
  if (fromModel != null) {
@@ -9133,7 +9216,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
9133
9216
  }
9134
9217
  return toObject;
9135
9218
  }
9136
- function generateContentParametersToVertex(apiClient, fromObject) {
9219
+ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
9137
9220
  const toObject = {};
9138
9221
  const fromModel = getValueByPath(fromObject, ['model']);
9139
9222
  if (fromModel != null) {
@@ -9155,7 +9238,7 @@ function generateContentParametersToVertex(apiClient, fromObject) {
9155
9238
  }
9156
9239
  return toObject;
9157
9240
  }
9158
- function generateContentResponseFromMldev(fromObject) {
9241
+ function generateContentResponseFromMldev(fromObject, rootObject) {
9159
9242
  const toObject = {};
9160
9243
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9161
9244
  'sdkHttpResponse',
@@ -9195,7 +9278,7 @@ function generateContentResponseFromMldev(fromObject) {
9195
9278
  }
9196
9279
  return toObject;
9197
9280
  }
9198
- function generateContentResponseFromVertex(fromObject) {
9281
+ function generateContentResponseFromVertex(fromObject, _rootObject) {
9199
9282
  const toObject = {};
9200
9283
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9201
9284
  'sdkHttpResponse',
@@ -9239,7 +9322,7 @@ function generateContentResponseFromVertex(fromObject) {
9239
9322
  }
9240
9323
  return toObject;
9241
9324
  }
9242
- function generateImagesConfigToMldev(fromObject, parentObject) {
9325
+ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
9243
9326
  const toObject = {};
9244
9327
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
9245
9328
  throw new Error('outputGcsUri parameter is not supported in Gemini API.');
@@ -9321,7 +9404,7 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
9321
9404
  }
9322
9405
  return toObject;
9323
9406
  }
9324
- function generateImagesConfigToVertex(fromObject, parentObject) {
9407
+ function generateImagesConfigToVertex(fromObject, parentObject, _rootObject) {
9325
9408
  const toObject = {};
9326
9409
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
9327
9410
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -9413,7 +9496,7 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
9413
9496
  }
9414
9497
  return toObject;
9415
9498
  }
9416
- function generateImagesParametersToMldev(apiClient, fromObject) {
9499
+ function generateImagesParametersToMldev(apiClient, fromObject, rootObject) {
9417
9500
  const toObject = {};
9418
9501
  const fromModel = getValueByPath(fromObject, ['model']);
9419
9502
  if (fromModel != null) {
@@ -9429,7 +9512,7 @@ function generateImagesParametersToMldev(apiClient, fromObject) {
9429
9512
  }
9430
9513
  return toObject;
9431
9514
  }
9432
- function generateImagesParametersToVertex(apiClient, fromObject) {
9515
+ function generateImagesParametersToVertex(apiClient, fromObject, rootObject) {
9433
9516
  const toObject = {};
9434
9517
  const fromModel = getValueByPath(fromObject, ['model']);
9435
9518
  if (fromModel != null) {
@@ -9445,7 +9528,7 @@ function generateImagesParametersToVertex(apiClient, fromObject) {
9445
9528
  }
9446
9529
  return toObject;
9447
9530
  }
9448
- function generateImagesResponseFromMldev(fromObject) {
9531
+ function generateImagesResponseFromMldev(fromObject, rootObject) {
9449
9532
  const toObject = {};
9450
9533
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9451
9534
  'sdkHttpResponse',
@@ -9473,7 +9556,7 @@ function generateImagesResponseFromMldev(fromObject) {
9473
9556
  }
9474
9557
  return toObject;
9475
9558
  }
9476
- function generateImagesResponseFromVertex(fromObject) {
9559
+ function generateImagesResponseFromVertex(fromObject, rootObject) {
9477
9560
  const toObject = {};
9478
9561
  const fromSdkHttpResponse = getValueByPath(fromObject, [
9479
9562
  'sdkHttpResponse',
@@ -9501,7 +9584,7 @@ function generateImagesResponseFromVertex(fromObject) {
9501
9584
  }
9502
9585
  return toObject;
9503
9586
  }
9504
- function generateVideosConfigToMldev(fromObject, parentObject) {
9587
+ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
9505
9588
  const toObject = {};
9506
9589
  const fromNumberOfVideos = getValueByPath(fromObject, [
9507
9590
  'numberOfVideos',
@@ -9580,7 +9663,7 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
9580
9663
  }
9581
9664
  return toObject;
9582
9665
  }
9583
- function generateVideosConfigToVertex(fromObject, parentObject) {
9666
+ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
9584
9667
  const toObject = {};
9585
9668
  const fromNumberOfVideos = getValueByPath(fromObject, [
9586
9669
  'numberOfVideos',
@@ -9670,7 +9753,7 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
9670
9753
  }
9671
9754
  return toObject;
9672
9755
  }
9673
- function generateVideosOperationFromMldev(fromObject) {
9756
+ function generateVideosOperationFromMldev(fromObject, rootObject) {
9674
9757
  const toObject = {};
9675
9758
  const fromName = getValueByPath(fromObject, ['name']);
9676
9759
  if (fromName != null) {
@@ -9697,7 +9780,7 @@ function generateVideosOperationFromMldev(fromObject) {
9697
9780
  }
9698
9781
  return toObject;
9699
9782
  }
9700
- function generateVideosOperationFromVertex(fromObject) {
9783
+ function generateVideosOperationFromVertex(fromObject, rootObject) {
9701
9784
  const toObject = {};
9702
9785
  const fromName = getValueByPath(fromObject, ['name']);
9703
9786
  if (fromName != null) {
@@ -9721,7 +9804,7 @@ function generateVideosOperationFromVertex(fromObject) {
9721
9804
  }
9722
9805
  return toObject;
9723
9806
  }
9724
- function generateVideosParametersToMldev(apiClient, fromObject) {
9807
+ function generateVideosParametersToMldev(apiClient, fromObject, rootObject) {
9725
9808
  const toObject = {};
9726
9809
  const fromModel = getValueByPath(fromObject, ['model']);
9727
9810
  if (fromModel != null) {
@@ -9749,7 +9832,7 @@ function generateVideosParametersToMldev(apiClient, fromObject) {
9749
9832
  }
9750
9833
  return toObject;
9751
9834
  }
9752
- function generateVideosParametersToVertex(apiClient, fromObject) {
9835
+ function generateVideosParametersToVertex(apiClient, fromObject, rootObject) {
9753
9836
  const toObject = {};
9754
9837
  const fromModel = getValueByPath(fromObject, ['model']);
9755
9838
  if (fromModel != null) {
@@ -9777,7 +9860,7 @@ function generateVideosParametersToVertex(apiClient, fromObject) {
9777
9860
  }
9778
9861
  return toObject;
9779
9862
  }
9780
- function generateVideosResponseFromMldev(fromObject) {
9863
+ function generateVideosResponseFromMldev(fromObject, rootObject) {
9781
9864
  const toObject = {};
9782
9865
  const fromGeneratedVideos = getValueByPath(fromObject, [
9783
9866
  'generatedSamples',
@@ -9805,7 +9888,7 @@ function generateVideosResponseFromMldev(fromObject) {
9805
9888
  }
9806
9889
  return toObject;
9807
9890
  }
9808
- function generateVideosResponseFromVertex(fromObject) {
9891
+ function generateVideosResponseFromVertex(fromObject, rootObject) {
9809
9892
  const toObject = {};
9810
9893
  const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
9811
9894
  if (fromGeneratedVideos != null) {
@@ -9831,7 +9914,7 @@ function generateVideosResponseFromVertex(fromObject) {
9831
9914
  }
9832
9915
  return toObject;
9833
9916
  }
9834
- function generateVideosSourceToMldev(fromObject, parentObject) {
9917
+ function generateVideosSourceToMldev(fromObject, parentObject, rootObject) {
9835
9918
  const toObject = {};
9836
9919
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
9837
9920
  if (parentObject !== undefined && fromPrompt != null) {
@@ -9847,7 +9930,7 @@ function generateVideosSourceToMldev(fromObject, parentObject) {
9847
9930
  }
9848
9931
  return toObject;
9849
9932
  }
9850
- function generateVideosSourceToVertex(fromObject, parentObject) {
9933
+ function generateVideosSourceToVertex(fromObject, parentObject, rootObject) {
9851
9934
  const toObject = {};
9852
9935
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
9853
9936
  if (parentObject !== undefined && fromPrompt != null) {
@@ -9863,7 +9946,7 @@ function generateVideosSourceToVertex(fromObject, parentObject) {
9863
9946
  }
9864
9947
  return toObject;
9865
9948
  }
9866
- function generatedImageFromMldev(fromObject) {
9949
+ function generatedImageFromMldev(fromObject, rootObject) {
9867
9950
  const toObject = {};
9868
9951
  const fromImage = getValueByPath(fromObject, ['_self']);
9869
9952
  if (fromImage != null) {
@@ -9881,7 +9964,7 @@ function generatedImageFromMldev(fromObject) {
9881
9964
  }
9882
9965
  return toObject;
9883
9966
  }
9884
- function generatedImageFromVertex(fromObject) {
9967
+ function generatedImageFromVertex(fromObject, rootObject) {
9885
9968
  const toObject = {};
9886
9969
  const fromImage = getValueByPath(fromObject, ['_self']);
9887
9970
  if (fromImage != null) {
@@ -9903,7 +9986,7 @@ function generatedImageFromVertex(fromObject) {
9903
9986
  }
9904
9987
  return toObject;
9905
9988
  }
9906
- function generatedImageMaskFromVertex(fromObject) {
9989
+ function generatedImageMaskFromVertex(fromObject, rootObject) {
9907
9990
  const toObject = {};
9908
9991
  const fromMask = getValueByPath(fromObject, ['_self']);
9909
9992
  if (fromMask != null) {
@@ -9921,7 +10004,7 @@ function generatedImageMaskFromVertex(fromObject) {
9921
10004
  }
9922
10005
  return toObject;
9923
10006
  }
9924
- function generatedVideoFromMldev(fromObject) {
10007
+ function generatedVideoFromMldev(fromObject, rootObject) {
9925
10008
  const toObject = {};
9926
10009
  const fromVideo = getValueByPath(fromObject, ['video']);
9927
10010
  if (fromVideo != null) {
@@ -9929,7 +10012,7 @@ function generatedVideoFromMldev(fromObject) {
9929
10012
  }
9930
10013
  return toObject;
9931
10014
  }
9932
- function generatedVideoFromVertex(fromObject) {
10015
+ function generatedVideoFromVertex(fromObject, rootObject) {
9933
10016
  const toObject = {};
9934
10017
  const fromVideo = getValueByPath(fromObject, ['_self']);
9935
10018
  if (fromVideo != null) {
@@ -9937,7 +10020,7 @@ function generatedVideoFromVertex(fromObject) {
9937
10020
  }
9938
10021
  return toObject;
9939
10022
  }
9940
- function generationConfigToVertex(fromObject) {
10023
+ function generationConfigToVertex(fromObject, _rootObject) {
9941
10024
  const toObject = {};
9942
10025
  const fromModelSelectionConfig = getValueByPath(fromObject, [
9943
10026
  'modelSelectionConfig',
@@ -10065,7 +10148,7 @@ function generationConfigToVertex(fromObject) {
10065
10148
  }
10066
10149
  return toObject;
10067
10150
  }
10068
- function getModelParametersToMldev(apiClient, fromObject) {
10151
+ function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
10069
10152
  const toObject = {};
10070
10153
  const fromModel = getValueByPath(fromObject, ['model']);
10071
10154
  if (fromModel != null) {
@@ -10073,7 +10156,7 @@ function getModelParametersToMldev(apiClient, fromObject) {
10073
10156
  }
10074
10157
  return toObject;
10075
10158
  }
10076
- function getModelParametersToVertex(apiClient, fromObject) {
10159
+ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
10077
10160
  const toObject = {};
10078
10161
  const fromModel = getValueByPath(fromObject, ['model']);
10079
10162
  if (fromModel != null) {
@@ -10081,7 +10164,7 @@ function getModelParametersToVertex(apiClient, fromObject) {
10081
10164
  }
10082
10165
  return toObject;
10083
10166
  }
10084
- function googleMapsToMldev$1(fromObject) {
10167
+ function googleMapsToMldev$1(fromObject, _rootObject) {
10085
10168
  const toObject = {};
10086
10169
  if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
10087
10170
  throw new Error('authConfig parameter is not supported in Gemini API.');
@@ -10092,7 +10175,7 @@ function googleMapsToMldev$1(fromObject) {
10092
10175
  }
10093
10176
  return toObject;
10094
10177
  }
10095
- function googleSearchToMldev$1(fromObject) {
10178
+ function googleSearchToMldev$1(fromObject, _rootObject) {
10096
10179
  const toObject = {};
10097
10180
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
10098
10181
  throw new Error('excludeDomains parameter is not supported in Gemini API.');
@@ -10108,7 +10191,7 @@ function googleSearchToMldev$1(fromObject) {
10108
10191
  }
10109
10192
  return toObject;
10110
10193
  }
10111
- function imageConfigToMldev(fromObject) {
10194
+ function imageConfigToMldev(fromObject, _rootObject) {
10112
10195
  const toObject = {};
10113
10196
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10114
10197
  if (fromAspectRatio != null) {
@@ -10130,7 +10213,7 @@ function imageConfigToMldev(fromObject) {
10130
10213
  }
10131
10214
  return toObject;
10132
10215
  }
10133
- function imageConfigToVertex(fromObject) {
10216
+ function imageConfigToVertex(fromObject, _rootObject) {
10134
10217
  const toObject = {};
10135
10218
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10136
10219
  if (fromAspectRatio != null) {
@@ -10160,7 +10243,7 @@ function imageConfigToVertex(fromObject) {
10160
10243
  }
10161
10244
  return toObject;
10162
10245
  }
10163
- function imageFromMldev(fromObject) {
10246
+ function imageFromMldev(fromObject, _rootObject) {
10164
10247
  const toObject = {};
10165
10248
  const fromImageBytes = getValueByPath(fromObject, [
10166
10249
  'bytesBase64Encoded',
@@ -10174,7 +10257,7 @@ function imageFromMldev(fromObject) {
10174
10257
  }
10175
10258
  return toObject;
10176
10259
  }
10177
- function imageFromVertex(fromObject) {
10260
+ function imageFromVertex(fromObject, _rootObject) {
10178
10261
  const toObject = {};
10179
10262
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
10180
10263
  if (fromGcsUri != null) {
@@ -10192,7 +10275,7 @@ function imageFromVertex(fromObject) {
10192
10275
  }
10193
10276
  return toObject;
10194
10277
  }
10195
- function imageToMldev(fromObject) {
10278
+ function imageToMldev(fromObject, _rootObject) {
10196
10279
  const toObject = {};
10197
10280
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
10198
10281
  throw new Error('gcsUri parameter is not supported in Gemini API.');
@@ -10207,7 +10290,7 @@ function imageToMldev(fromObject) {
10207
10290
  }
10208
10291
  return toObject;
10209
10292
  }
10210
- function imageToVertex(fromObject) {
10293
+ function imageToVertex(fromObject, _rootObject) {
10211
10294
  const toObject = {};
10212
10295
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
10213
10296
  if (fromGcsUri != null) {
@@ -10223,7 +10306,7 @@ function imageToVertex(fromObject) {
10223
10306
  }
10224
10307
  return toObject;
10225
10308
  }
10226
- function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
10309
+ function listModelsConfigToMldev(apiClient, fromObject, parentObject, _rootObject) {
10227
10310
  const toObject = {};
10228
10311
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
10229
10312
  if (parentObject !== undefined && fromPageSize != null) {
@@ -10243,7 +10326,7 @@ function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
10243
10326
  }
10244
10327
  return toObject;
10245
10328
  }
10246
- function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
10329
+ function listModelsConfigToVertex(apiClient, fromObject, parentObject, _rootObject) {
10247
10330
  const toObject = {};
10248
10331
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
10249
10332
  if (parentObject !== undefined && fromPageSize != null) {
@@ -10263,7 +10346,7 @@ function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
10263
10346
  }
10264
10347
  return toObject;
10265
10348
  }
10266
- function listModelsParametersToMldev(apiClient, fromObject) {
10349
+ function listModelsParametersToMldev(apiClient, fromObject, rootObject) {
10267
10350
  const toObject = {};
10268
10351
  const fromConfig = getValueByPath(fromObject, ['config']);
10269
10352
  if (fromConfig != null) {
@@ -10271,7 +10354,7 @@ function listModelsParametersToMldev(apiClient, fromObject) {
10271
10354
  }
10272
10355
  return toObject;
10273
10356
  }
10274
- function listModelsParametersToVertex(apiClient, fromObject) {
10357
+ function listModelsParametersToVertex(apiClient, fromObject, rootObject) {
10275
10358
  const toObject = {};
10276
10359
  const fromConfig = getValueByPath(fromObject, ['config']);
10277
10360
  if (fromConfig != null) {
@@ -10279,7 +10362,7 @@ function listModelsParametersToVertex(apiClient, fromObject) {
10279
10362
  }
10280
10363
  return toObject;
10281
10364
  }
10282
- function listModelsResponseFromMldev(fromObject) {
10365
+ function listModelsResponseFromMldev(fromObject, rootObject) {
10283
10366
  const toObject = {};
10284
10367
  const fromSdkHttpResponse = getValueByPath(fromObject, [
10285
10368
  'sdkHttpResponse',
@@ -10305,7 +10388,7 @@ function listModelsResponseFromMldev(fromObject) {
10305
10388
  }
10306
10389
  return toObject;
10307
10390
  }
10308
- function listModelsResponseFromVertex(fromObject) {
10391
+ function listModelsResponseFromVertex(fromObject, rootObject) {
10309
10392
  const toObject = {};
10310
10393
  const fromSdkHttpResponse = getValueByPath(fromObject, [
10311
10394
  'sdkHttpResponse',
@@ -10331,7 +10414,7 @@ function listModelsResponseFromVertex(fromObject) {
10331
10414
  }
10332
10415
  return toObject;
10333
10416
  }
10334
- function maskReferenceConfigToVertex(fromObject) {
10417
+ function maskReferenceConfigToVertex(fromObject, _rootObject) {
10335
10418
  const toObject = {};
10336
10419
  const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
10337
10420
  if (fromMaskMode != null) {
@@ -10349,7 +10432,7 @@ function maskReferenceConfigToVertex(fromObject) {
10349
10432
  }
10350
10433
  return toObject;
10351
10434
  }
10352
- function modelFromMldev(fromObject) {
10435
+ function modelFromMldev(fromObject, rootObject) {
10353
10436
  const toObject = {};
10354
10437
  const fromName = getValueByPath(fromObject, ['name']);
10355
10438
  if (fromName != null) {
@@ -10413,7 +10496,7 @@ function modelFromMldev(fromObject) {
10413
10496
  }
10414
10497
  return toObject;
10415
10498
  }
10416
- function modelFromVertex(fromObject) {
10499
+ function modelFromVertex(fromObject, rootObject) {
10417
10500
  const toObject = {};
10418
10501
  const fromName = getValueByPath(fromObject, ['name']);
10419
10502
  if (fromName != null) {
@@ -10467,7 +10550,7 @@ function modelFromVertex(fromObject) {
10467
10550
  }
10468
10551
  return toObject;
10469
10552
  }
10470
- function partToMldev$1(fromObject) {
10553
+ function partToMldev$1(fromObject, rootObject) {
10471
10554
  const toObject = {};
10472
10555
  const fromMediaResolution = getValueByPath(fromObject, [
10473
10556
  'mediaResolution',
@@ -10527,7 +10610,7 @@ function partToMldev$1(fromObject) {
10527
10610
  }
10528
10611
  return toObject;
10529
10612
  }
10530
- function productImageToVertex(fromObject) {
10613
+ function productImageToVertex(fromObject, rootObject) {
10531
10614
  const toObject = {};
10532
10615
  const fromProductImage = getValueByPath(fromObject, ['productImage']);
10533
10616
  if (fromProductImage != null) {
@@ -10535,7 +10618,7 @@ function productImageToVertex(fromObject) {
10535
10618
  }
10536
10619
  return toObject;
10537
10620
  }
10538
- function recontextImageConfigToVertex(fromObject, parentObject) {
10621
+ function recontextImageConfigToVertex(fromObject, parentObject, _rootObject) {
10539
10622
  const toObject = {};
10540
10623
  const fromNumberOfImages = getValueByPath(fromObject, [
10541
10624
  'numberOfImages',
@@ -10595,7 +10678,7 @@ function recontextImageConfigToVertex(fromObject, parentObject) {
10595
10678
  }
10596
10679
  return toObject;
10597
10680
  }
10598
- function recontextImageParametersToVertex(apiClient, fromObject) {
10681
+ function recontextImageParametersToVertex(apiClient, fromObject, rootObject) {
10599
10682
  const toObject = {};
10600
10683
  const fromModel = getValueByPath(fromObject, ['model']);
10601
10684
  if (fromModel != null) {
@@ -10611,7 +10694,7 @@ function recontextImageParametersToVertex(apiClient, fromObject) {
10611
10694
  }
10612
10695
  return toObject;
10613
10696
  }
10614
- function recontextImageResponseFromVertex(fromObject) {
10697
+ function recontextImageResponseFromVertex(fromObject, rootObject) {
10615
10698
  const toObject = {};
10616
10699
  const fromGeneratedImages = getValueByPath(fromObject, [
10617
10700
  'predictions',
@@ -10627,7 +10710,7 @@ function recontextImageResponseFromVertex(fromObject) {
10627
10710
  }
10628
10711
  return toObject;
10629
10712
  }
10630
- function recontextImageSourceToVertex(fromObject, parentObject) {
10713
+ function recontextImageSourceToVertex(fromObject, parentObject, rootObject) {
10631
10714
  const toObject = {};
10632
10715
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
10633
10716
  if (parentObject !== undefined && fromPrompt != null) {
@@ -10651,7 +10734,7 @@ function recontextImageSourceToVertex(fromObject, parentObject) {
10651
10734
  }
10652
10735
  return toObject;
10653
10736
  }
10654
- function referenceImageAPIInternalToVertex(fromObject) {
10737
+ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
10655
10738
  const toObject = {};
10656
10739
  const fromReferenceImage = getValueByPath(fromObject, [
10657
10740
  'referenceImage',
@@ -10695,7 +10778,7 @@ function referenceImageAPIInternalToVertex(fromObject) {
10695
10778
  }
10696
10779
  return toObject;
10697
10780
  }
10698
- function safetyAttributesFromMldev(fromObject) {
10781
+ function safetyAttributesFromMldev(fromObject, _rootObject) {
10699
10782
  const toObject = {};
10700
10783
  const fromCategories = getValueByPath(fromObject, [
10701
10784
  'safetyAttributes',
@@ -10717,7 +10800,7 @@ function safetyAttributesFromMldev(fromObject) {
10717
10800
  }
10718
10801
  return toObject;
10719
10802
  }
10720
- function safetyAttributesFromVertex(fromObject) {
10803
+ function safetyAttributesFromVertex(fromObject, _rootObject) {
10721
10804
  const toObject = {};
10722
10805
  const fromCategories = getValueByPath(fromObject, [
10723
10806
  'safetyAttributes',
@@ -10739,7 +10822,7 @@ function safetyAttributesFromVertex(fromObject) {
10739
10822
  }
10740
10823
  return toObject;
10741
10824
  }
10742
- function safetySettingToMldev(fromObject) {
10825
+ function safetySettingToMldev(fromObject, _rootObject) {
10743
10826
  const toObject = {};
10744
10827
  const fromCategory = getValueByPath(fromObject, ['category']);
10745
10828
  if (fromCategory != null) {
@@ -10754,7 +10837,7 @@ function safetySettingToMldev(fromObject) {
10754
10837
  }
10755
10838
  return toObject;
10756
10839
  }
10757
- function scribbleImageToVertex(fromObject) {
10840
+ function scribbleImageToVertex(fromObject, rootObject) {
10758
10841
  const toObject = {};
10759
10842
  const fromImage = getValueByPath(fromObject, ['image']);
10760
10843
  if (fromImage != null) {
@@ -10762,7 +10845,7 @@ function scribbleImageToVertex(fromObject) {
10762
10845
  }
10763
10846
  return toObject;
10764
10847
  }
10765
- function segmentImageConfigToVertex(fromObject, parentObject) {
10848
+ function segmentImageConfigToVertex(fromObject, parentObject, _rootObject) {
10766
10849
  const toObject = {};
10767
10850
  const fromMode = getValueByPath(fromObject, ['mode']);
10768
10851
  if (parentObject !== undefined && fromMode != null) {
@@ -10796,7 +10879,7 @@ function segmentImageConfigToVertex(fromObject, parentObject) {
10796
10879
  }
10797
10880
  return toObject;
10798
10881
  }
10799
- function segmentImageParametersToVertex(apiClient, fromObject) {
10882
+ function segmentImageParametersToVertex(apiClient, fromObject, rootObject) {
10800
10883
  const toObject = {};
10801
10884
  const fromModel = getValueByPath(fromObject, ['model']);
10802
10885
  if (fromModel != null) {
@@ -10812,7 +10895,7 @@ function segmentImageParametersToVertex(apiClient, fromObject) {
10812
10895
  }
10813
10896
  return toObject;
10814
10897
  }
10815
- function segmentImageResponseFromVertex(fromObject) {
10898
+ function segmentImageResponseFromVertex(fromObject, rootObject) {
10816
10899
  const toObject = {};
10817
10900
  const fromGeneratedMasks = getValueByPath(fromObject, ['predictions']);
10818
10901
  if (fromGeneratedMasks != null) {
@@ -10826,7 +10909,7 @@ function segmentImageResponseFromVertex(fromObject) {
10826
10909
  }
10827
10910
  return toObject;
10828
10911
  }
10829
- function segmentImageSourceToVertex(fromObject, parentObject) {
10912
+ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
10830
10913
  const toObject = {};
10831
10914
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
10832
10915
  if (parentObject !== undefined && fromPrompt != null) {
@@ -10844,7 +10927,7 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
10844
10927
  }
10845
10928
  return toObject;
10846
10929
  }
10847
- function toolConfigToMldev(fromObject) {
10930
+ function toolConfigToMldev(fromObject, rootObject) {
10848
10931
  const toObject = {};
10849
10932
  const fromRetrievalConfig = getValueByPath(fromObject, [
10850
10933
  'retrievalConfig',
@@ -10860,7 +10943,7 @@ function toolConfigToMldev(fromObject) {
10860
10943
  }
10861
10944
  return toObject;
10862
10945
  }
10863
- function toolToMldev$1(fromObject) {
10946
+ function toolToMldev$1(fromObject, rootObject) {
10864
10947
  const toObject = {};
10865
10948
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
10866
10949
  throw new Error('retrieval parameter is not supported in Gemini API.');
@@ -10914,7 +10997,7 @@ function toolToMldev$1(fromObject) {
10914
10997
  }
10915
10998
  return toObject;
10916
10999
  }
10917
- function toolToVertex(fromObject) {
11000
+ function toolToVertex(fromObject, rootObject) {
10918
11001
  const toObject = {};
10919
11002
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
10920
11003
  if (fromRetrieval != null) {
@@ -10971,7 +11054,7 @@ function toolToVertex(fromObject) {
10971
11054
  }
10972
11055
  return toObject;
10973
11056
  }
10974
- function tunedModelInfoFromMldev(fromObject) {
11057
+ function tunedModelInfoFromMldev(fromObject, _rootObject) {
10975
11058
  const toObject = {};
10976
11059
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
10977
11060
  if (fromBaseModel != null) {
@@ -10987,7 +11070,7 @@ function tunedModelInfoFromMldev(fromObject) {
10987
11070
  }
10988
11071
  return toObject;
10989
11072
  }
10990
- function tunedModelInfoFromVertex(fromObject) {
11073
+ function tunedModelInfoFromVertex(fromObject, _rootObject) {
10991
11074
  const toObject = {};
10992
11075
  const fromBaseModel = getValueByPath(fromObject, [
10993
11076
  'labels',
@@ -11006,7 +11089,7 @@ function tunedModelInfoFromVertex(fromObject) {
11006
11089
  }
11007
11090
  return toObject;
11008
11091
  }
11009
- function updateModelConfigToMldev(fromObject, parentObject) {
11092
+ function updateModelConfigToMldev(fromObject, parentObject, _rootObject) {
11010
11093
  const toObject = {};
11011
11094
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
11012
11095
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -11024,7 +11107,7 @@ function updateModelConfigToMldev(fromObject, parentObject) {
11024
11107
  }
11025
11108
  return toObject;
11026
11109
  }
11027
- function updateModelConfigToVertex(fromObject, parentObject) {
11110
+ function updateModelConfigToVertex(fromObject, parentObject, _rootObject) {
11028
11111
  const toObject = {};
11029
11112
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
11030
11113
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -11042,7 +11125,7 @@ function updateModelConfigToVertex(fromObject, parentObject) {
11042
11125
  }
11043
11126
  return toObject;
11044
11127
  }
11045
- function updateModelParametersToMldev(apiClient, fromObject) {
11128
+ function updateModelParametersToMldev(apiClient, fromObject, rootObject) {
11046
11129
  const toObject = {};
11047
11130
  const fromModel = getValueByPath(fromObject, ['model']);
11048
11131
  if (fromModel != null) {
@@ -11054,7 +11137,7 @@ function updateModelParametersToMldev(apiClient, fromObject) {
11054
11137
  }
11055
11138
  return toObject;
11056
11139
  }
11057
- function updateModelParametersToVertex(apiClient, fromObject) {
11140
+ function updateModelParametersToVertex(apiClient, fromObject, rootObject) {
11058
11141
  const toObject = {};
11059
11142
  const fromModel = getValueByPath(fromObject, ['model']);
11060
11143
  if (fromModel != null) {
@@ -11066,7 +11149,7 @@ function updateModelParametersToVertex(apiClient, fromObject) {
11066
11149
  }
11067
11150
  return toObject;
11068
11151
  }
11069
- function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
11152
+ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject, _rootObject) {
11070
11153
  const toObject = {};
11071
11154
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
11072
11155
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -11130,7 +11213,7 @@ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
11130
11213
  }
11131
11214
  return toObject;
11132
11215
  }
11133
- function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11216
+ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject, rootObject) {
11134
11217
  const toObject = {};
11135
11218
  const fromModel = getValueByPath(fromObject, ['model']);
11136
11219
  if (fromModel != null) {
@@ -11152,7 +11235,7 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
11152
11235
  }
11153
11236
  return toObject;
11154
11237
  }
11155
- function upscaleImageResponseFromVertex(fromObject) {
11238
+ function upscaleImageResponseFromVertex(fromObject, rootObject) {
11156
11239
  const toObject = {};
11157
11240
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11158
11241
  'sdkHttpResponse',
@@ -11174,7 +11257,7 @@ function upscaleImageResponseFromVertex(fromObject) {
11174
11257
  }
11175
11258
  return toObject;
11176
11259
  }
11177
- function videoFromMldev(fromObject) {
11260
+ function videoFromMldev(fromObject, _rootObject) {
11178
11261
  const toObject = {};
11179
11262
  const fromUri = getValueByPath(fromObject, ['uri']);
11180
11263
  if (fromUri != null) {
@@ -11190,7 +11273,7 @@ function videoFromMldev(fromObject) {
11190
11273
  }
11191
11274
  return toObject;
11192
11275
  }
11193
- function videoFromVertex(fromObject) {
11276
+ function videoFromVertex(fromObject, _rootObject) {
11194
11277
  const toObject = {};
11195
11278
  const fromUri = getValueByPath(fromObject, ['gcsUri']);
11196
11279
  if (fromUri != null) {
@@ -11208,7 +11291,7 @@ function videoFromVertex(fromObject) {
11208
11291
  }
11209
11292
  return toObject;
11210
11293
  }
11211
- function videoGenerationMaskToVertex(fromObject) {
11294
+ function videoGenerationMaskToVertex(fromObject, rootObject) {
11212
11295
  const toObject = {};
11213
11296
  const fromImage = getValueByPath(fromObject, ['image']);
11214
11297
  if (fromImage != null) {
@@ -11220,7 +11303,7 @@ function videoGenerationMaskToVertex(fromObject) {
11220
11303
  }
11221
11304
  return toObject;
11222
11305
  }
11223
- function videoGenerationReferenceImageToMldev(fromObject) {
11306
+ function videoGenerationReferenceImageToMldev(fromObject, rootObject) {
11224
11307
  const toObject = {};
11225
11308
  const fromImage = getValueByPath(fromObject, ['image']);
11226
11309
  if (fromImage != null) {
@@ -11234,7 +11317,7 @@ function videoGenerationReferenceImageToMldev(fromObject) {
11234
11317
  }
11235
11318
  return toObject;
11236
11319
  }
11237
- function videoGenerationReferenceImageToVertex(fromObject) {
11320
+ function videoGenerationReferenceImageToVertex(fromObject, rootObject) {
11238
11321
  const toObject = {};
11239
11322
  const fromImage = getValueByPath(fromObject, ['image']);
11240
11323
  if (fromImage != null) {
@@ -11248,7 +11331,7 @@ function videoGenerationReferenceImageToVertex(fromObject) {
11248
11331
  }
11249
11332
  return toObject;
11250
11333
  }
11251
- function videoToMldev(fromObject) {
11334
+ function videoToMldev(fromObject, _rootObject) {
11252
11335
  const toObject = {};
11253
11336
  const fromUri = getValueByPath(fromObject, ['uri']);
11254
11337
  if (fromUri != null) {
@@ -11264,7 +11347,7 @@ function videoToMldev(fromObject) {
11264
11347
  }
11265
11348
  return toObject;
11266
11349
  }
11267
- function videoToVertex(fromObject) {
11350
+ function videoToVertex(fromObject, _rootObject) {
11268
11351
  const toObject = {};
11269
11352
  const fromUri = getValueByPath(fromObject, ['uri']);
11270
11353
  if (fromUri != null) {
@@ -11525,7 +11608,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
11525
11608
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
11526
11609
  const USER_AGENT_HEADER = 'User-Agent';
11527
11610
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
11528
- const SDK_VERSION = '1.38.0'; // x-release-please-version
11611
+ const SDK_VERSION = '1.40.0'; // x-release-please-version
11529
11612
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
11530
11613
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
11531
11614
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13701,7 +13784,7 @@ class Models extends BaseModule {
13701
13784
  _c = apiResponse_1_1.value;
13702
13785
  _d = false;
13703
13786
  const chunk = _c;
13704
- const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
13787
+ const resp = generateContentResponseFromVertex((yield __await(chunk.json())), params);
13705
13788
  resp['sdkHttpResponse'] = {
13706
13789
  headers: chunk.headers,
13707
13790
  };
@@ -13743,7 +13826,7 @@ class Models extends BaseModule {
13743
13826
  _c = apiResponse_2_1.value;
13744
13827
  _d = false;
13745
13828
  const chunk = _c;
13746
- const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
13829
+ const resp = generateContentResponseFromMldev((yield __await(chunk.json())), params);
13747
13830
  resp['sdkHttpResponse'] = {
13748
13831
  headers: chunk.headers,
13749
13832
  };
@@ -16676,7 +16759,9 @@ class BaseInteractions extends APIResource {
16676
16759
  *
16677
16760
  * @example
16678
16761
  * ```ts
16679
- * const interaction = await client.interactions.delete('id');
16762
+ * const interaction = await client.interactions.delete('id', {
16763
+ * api_version: 'api_version',
16764
+ * });
16680
16765
  * ```
16681
16766
  */
16682
16767
  delete(id, params = {}, options) {
@@ -16688,7 +16773,9 @@ class BaseInteractions extends APIResource {
16688
16773
  *
16689
16774
  * @example
16690
16775
  * ```ts
16691
- * const interaction = await client.interactions.cancel('id');
16776
+ * const interaction = await client.interactions.cancel('id', {
16777
+ * api_version: 'api_version',
16778
+ * });
16692
16779
  * ```
16693
16780
  */
16694
16781
  cancel(id, params = {}, options) {
@@ -17294,6 +17381,11 @@ async function defaultParseResponse(client, props) {
17294
17381
  const mediaType = (_a = contentType === null || contentType === void 0 ? void 0 : contentType.split(';')[0]) === null || _a === void 0 ? void 0 : _a.trim();
17295
17382
  const isJSON = (mediaType === null || mediaType === void 0 ? void 0 : mediaType.includes('application/json')) || (mediaType === null || mediaType === void 0 ? void 0 : mediaType.endsWith('+json'));
17296
17383
  if (isJSON) {
17384
+ const contentLength = response.headers.get('content-length');
17385
+ if (contentLength === '0') {
17386
+ // if there is no content we can't do anything
17387
+ return undefined;
17388
+ }
17297
17389
  const json = await response.json();
17298
17390
  return json;
17299
17391
  }
@@ -17753,9 +17845,10 @@ class BaseGeminiNextGenAPIClient {
17753
17845
  }
17754
17846
  async fetchWithTimeout(url, init, ms, controller) {
17755
17847
  const _b = init || {}, { signal, method } = _b, options = __rest(_b, ["signal", "method"]);
17848
+ const abort = controller.abort.bind(controller);
17756
17849
  if (signal)
17757
- signal.addEventListener('abort', () => controller.abort());
17758
- const timeout = setTimeout(() => controller.abort(), ms);
17850
+ signal.addEventListener('abort', abort, { once: true });
17851
+ const timeout = setTimeout(abort, ms);
17759
17852
  const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||
17760
17853
  (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
17761
17854
  const fetchOptions = Object.assign(Object.assign(Object.assign({ signal: controller.signal }, (isReadableBody ? { duplex: 'half' } : {})), { method: 'GET' }), options);
@@ -18006,6 +18099,12 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18006
18099
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
18007
18100
  throw new Error('adapterSize parameter is not supported in Gemini API.');
18008
18101
  }
18102
+ if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
18103
+ throw new Error('tuningMode parameter is not supported in Gemini API.');
18104
+ }
18105
+ if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
18106
+ throw new Error('customBaseModel parameter is not supported in Gemini API.');
18107
+ }
18009
18108
  const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18010
18109
  if (parentObject !== undefined && fromBatchSize != null) {
18011
18110
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'batchSize'], fromBatchSize);
@@ -18020,6 +18119,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18020
18119
  if (getValueByPath(fromObject, ['beta']) !== undefined) {
18021
18120
  throw new Error('beta parameter is not supported in Gemini API.');
18022
18121
  }
18122
+ if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
18123
+ throw new Error('baseTeacherModel parameter is not supported in Gemini API.');
18124
+ }
18125
+ if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
18126
+ throw new Error('tunedTeacherModelSource parameter is not supported in Gemini API.');
18127
+ }
18128
+ if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
18129
+ throw new Error('sftLossWeightMultiplier parameter is not supported in Gemini API.');
18130
+ }
18131
+ if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
18132
+ throw new Error('outputUri parameter is not supported in Gemini API.');
18133
+ }
18023
18134
  return toObject;
18024
18135
  }
18025
18136
  function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
@@ -18047,6 +18158,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18047
18158
  setValueByPath(parentObject, ['preferenceOptimizationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18048
18159
  }
18049
18160
  }
18161
+ else if (discriminatorValidationDataset === 'DISTILLATION') {
18162
+ const fromValidationDataset = getValueByPath(fromObject, [
18163
+ 'validationDataset',
18164
+ ]);
18165
+ if (parentObject !== undefined && fromValidationDataset != null) {
18166
+ setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18167
+ }
18168
+ }
18050
18169
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
18051
18170
  'tunedModelDisplayName',
18052
18171
  ]);
@@ -18076,6 +18195,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18076
18195
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18077
18196
  }
18078
18197
  }
18198
+ else if (discriminatorEpochCount === 'DISTILLATION') {
18199
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
18200
+ if (parentObject !== undefined && fromEpochCount != null) {
18201
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18202
+ }
18203
+ }
18079
18204
  let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
18080
18205
  'config',
18081
18206
  'method',
@@ -18103,6 +18228,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18103
18228
  ], fromLearningRateMultiplier);
18104
18229
  }
18105
18230
  }
18231
+ else if (discriminatorLearningRateMultiplier === 'DISTILLATION') {
18232
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
18233
+ 'learningRateMultiplier',
18234
+ ]);
18235
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
18236
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
18237
+ }
18238
+ }
18106
18239
  let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
18107
18240
  if (discriminatorExportLastCheckpointOnly === undefined) {
18108
18241
  discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
@@ -18123,6 +18256,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18123
18256
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18124
18257
  }
18125
18258
  }
18259
+ else if (discriminatorExportLastCheckpointOnly === 'DISTILLATION') {
18260
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
18261
+ 'exportLastCheckpointOnly',
18262
+ ]);
18263
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
18264
+ setValueByPath(parentObject, ['distillationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18265
+ }
18266
+ }
18126
18267
  let discriminatorAdapterSize = getValueByPath(rootObject, [
18127
18268
  'config',
18128
18269
  'method',
@@ -18142,11 +18283,58 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18142
18283
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18143
18284
  }
18144
18285
  }
18145
- if (getValueByPath(fromObject, ['batchSize']) !== undefined) {
18146
- throw new Error('batchSize parameter is not supported in Vertex AI.');
18286
+ else if (discriminatorAdapterSize === 'DISTILLATION') {
18287
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
18288
+ if (parentObject !== undefined && fromAdapterSize != null) {
18289
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18290
+ }
18147
18291
  }
18148
- if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18149
- throw new Error('learningRate parameter is not supported in Vertex AI.');
18292
+ let discriminatorTuningMode = getValueByPath(rootObject, [
18293
+ 'config',
18294
+ 'method',
18295
+ ]);
18296
+ if (discriminatorTuningMode === undefined) {
18297
+ discriminatorTuningMode = 'SUPERVISED_FINE_TUNING';
18298
+ }
18299
+ if (discriminatorTuningMode === 'SUPERVISED_FINE_TUNING') {
18300
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
18301
+ if (parentObject !== undefined && fromTuningMode != null) {
18302
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
18303
+ }
18304
+ }
18305
+ const fromCustomBaseModel = getValueByPath(fromObject, [
18306
+ 'customBaseModel',
18307
+ ]);
18308
+ if (parentObject !== undefined && fromCustomBaseModel != null) {
18309
+ setValueByPath(parentObject, ['customBaseModel'], fromCustomBaseModel);
18310
+ }
18311
+ let discriminatorBatchSize = getValueByPath(rootObject, [
18312
+ 'config',
18313
+ 'method',
18314
+ ]);
18315
+ if (discriminatorBatchSize === undefined) {
18316
+ discriminatorBatchSize = 'SUPERVISED_FINE_TUNING';
18317
+ }
18318
+ if (discriminatorBatchSize === 'SUPERVISED_FINE_TUNING') {
18319
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18320
+ if (parentObject !== undefined && fromBatchSize != null) {
18321
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
18322
+ }
18323
+ }
18324
+ let discriminatorLearningRate = getValueByPath(rootObject, [
18325
+ 'config',
18326
+ 'method',
18327
+ ]);
18328
+ if (discriminatorLearningRate === undefined) {
18329
+ discriminatorLearningRate = 'SUPERVISED_FINE_TUNING';
18330
+ }
18331
+ if (discriminatorLearningRate === 'SUPERVISED_FINE_TUNING') {
18332
+ const fromLearningRate = getValueByPath(fromObject, [
18333
+ 'learningRate',
18334
+ ]);
18335
+ if (parentObject !== undefined && fromLearningRate != null) {
18336
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
18337
+ }
18150
18338
  }
18151
18339
  const fromLabels = getValueByPath(fromObject, ['labels']);
18152
18340
  if (parentObject !== undefined && fromLabels != null) {
@@ -18156,6 +18344,28 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18156
18344
  if (parentObject !== undefined && fromBeta != null) {
18157
18345
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'beta'], fromBeta);
18158
18346
  }
18347
+ const fromBaseTeacherModel = getValueByPath(fromObject, [
18348
+ 'baseTeacherModel',
18349
+ ]);
18350
+ if (parentObject !== undefined && fromBaseTeacherModel != null) {
18351
+ setValueByPath(parentObject, ['distillationSpec', 'baseTeacherModel'], fromBaseTeacherModel);
18352
+ }
18353
+ const fromTunedTeacherModelSource = getValueByPath(fromObject, [
18354
+ 'tunedTeacherModelSource',
18355
+ ]);
18356
+ if (parentObject !== undefined && fromTunedTeacherModelSource != null) {
18357
+ setValueByPath(parentObject, ['distillationSpec', 'tunedTeacherModelSource'], fromTunedTeacherModelSource);
18358
+ }
18359
+ const fromSftLossWeightMultiplier = getValueByPath(fromObject, [
18360
+ 'sftLossWeightMultiplier',
18361
+ ]);
18362
+ if (parentObject !== undefined && fromSftLossWeightMultiplier != null) {
18363
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'sftLossWeightMultiplier'], fromSftLossWeightMultiplier);
18364
+ }
18365
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
18366
+ if (parentObject !== undefined && fromOutputUri != null) {
18367
+ setValueByPath(parentObject, ['outputUri'], fromOutputUri);
18368
+ }
18159
18369
  return toObject;
18160
18370
  }
18161
18371
  function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
@@ -18375,6 +18585,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18375
18585
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromGcsUri);
18376
18586
  }
18377
18587
  }
18588
+ else if (discriminatorGcsUri === 'DISTILLATION') {
18589
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
18590
+ if (parentObject !== undefined && fromGcsUri != null) {
18591
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
18592
+ }
18593
+ }
18378
18594
  let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
18379
18595
  'config',
18380
18596
  'method',
@@ -18398,6 +18614,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18398
18614
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
18399
18615
  }
18400
18616
  }
18617
+ else if (discriminatorVertexDatasetResource === 'DISTILLATION') {
18618
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
18619
+ 'vertexDatasetResource',
18620
+ ]);
18621
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
18622
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
18623
+ }
18624
+ }
18401
18625
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
18402
18626
  throw new Error('examples parameter is not supported in Vertex AI.');
18403
18627
  }
@@ -18521,6 +18745,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
18521
18745
  if (fromPreferenceOptimizationSpec != null) {
18522
18746
  setValueByPath(toObject, ['preferenceOptimizationSpec'], fromPreferenceOptimizationSpec);
18523
18747
  }
18748
+ const fromDistillationSpec = getValueByPath(fromObject, [
18749
+ 'distillationSpec',
18750
+ ]);
18751
+ if (fromDistillationSpec != null) {
18752
+ setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
18753
+ }
18524
18754
  const fromTuningDataStats = getValueByPath(fromObject, [
18525
18755
  'tuningDataStats',
18526
18756
  ]);
@@ -19292,5 +19522,5 @@ class GoogleGenAI {
19292
19522
  }
19293
19523
  }
19294
19524
 
19295
- export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, RawReferenceImage, RecontextImageResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
19525
+ export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
19296
19526
  //# sourceMappingURL=index.mjs.map