@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.
package/dist/index.mjs CHANGED
@@ -1499,6 +1499,10 @@ var TuningMethod;
1499
1499
  * Preference optimization tuning.
1500
1500
  */
1501
1501
  TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
1502
+ /**
1503
+ * Distillation tuning.
1504
+ */
1505
+ TuningMethod["DISTILLATION"] = "DISTILLATION";
1502
1506
  })(TuningMethod || (TuningMethod = {}));
1503
1507
  /** State for the lifecycle of a Document. */
1504
1508
  var DocumentState;
@@ -2290,6 +2294,9 @@ class CreateFileResponse {
2290
2294
  /** Response for the delete file method. */
2291
2295
  class DeleteFileResponse {
2292
2296
  }
2297
+ /** Response for the _register file method. */
2298
+ class RegisterFilesResponse {
2299
+ }
2293
2300
  /** Config for `inlined_responses` parameter. */
2294
2301
  class InlinedResponse {
2295
2302
  }
@@ -4284,6 +4291,10 @@ function inlinedResponseFromMldev(fromObject) {
4284
4291
  if (fromResponse != null) {
4285
4292
  setValueByPath(toObject, ['response'], generateContentResponseFromMldev$1(fromResponse));
4286
4293
  }
4294
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
4295
+ if (fromMetadata != null) {
4296
+ setValueByPath(toObject, ['metadata'], fromMetadata);
4297
+ }
4287
4298
  const fromError = getValueByPath(fromObject, ['error']);
4288
4299
  if (fromError != null) {
4289
4300
  setValueByPath(toObject, ['error'], fromError);
@@ -6918,7 +6929,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6918
6929
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6919
6930
  const USER_AGENT_HEADER = 'User-Agent';
6920
6931
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6921
- const SDK_VERSION = '1.38.0'; // x-release-please-version
6932
+ const SDK_VERSION = '1.40.0'; // x-release-please-version
6922
6933
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6923
6934
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6924
6935
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7753,6 +7764,14 @@ function getFileParametersToMldev(fromObject) {
7753
7764
  }
7754
7765
  return toObject;
7755
7766
  }
7767
+ function internalRegisterFilesParametersToMldev(fromObject) {
7768
+ const toObject = {};
7769
+ const fromUris = getValueByPath(fromObject, ['uris']);
7770
+ if (fromUris != null) {
7771
+ setValueByPath(toObject, ['uris'], fromUris);
7772
+ }
7773
+ return toObject;
7774
+ }
7756
7775
  function listFilesConfigToMldev(fromObject, parentObject) {
7757
7776
  const toObject = {};
7758
7777
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
@@ -7799,6 +7818,26 @@ function listFilesResponseFromMldev(fromObject) {
7799
7818
  }
7800
7819
  return toObject;
7801
7820
  }
7821
+ function registerFilesResponseFromMldev(fromObject) {
7822
+ const toObject = {};
7823
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
7824
+ 'sdkHttpResponse',
7825
+ ]);
7826
+ if (fromSdkHttpResponse != null) {
7827
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
7828
+ }
7829
+ const fromFiles = getValueByPath(fromObject, ['files']);
7830
+ if (fromFiles != null) {
7831
+ let transformedList = fromFiles;
7832
+ if (Array.isArray(transformedList)) {
7833
+ transformedList = transformedList.map((item) => {
7834
+ return item;
7835
+ });
7836
+ }
7837
+ setValueByPath(toObject, ['files'], transformedList);
7838
+ }
7839
+ return toObject;
7840
+ }
7802
7841
 
7803
7842
  /**
7804
7843
  * @license
@@ -7899,6 +7938,16 @@ class Files extends BaseModule {
7899
7938
  async download(params) {
7900
7939
  await this.apiClient.downloadFile(params);
7901
7940
  }
7941
+ /**
7942
+ * Registers Google Cloud Storage files for use with the API.
7943
+ * This method is only available in Node.js environments.
7944
+ */
7945
+ async registerFiles(params) {
7946
+ throw new Error('registerFiles is only supported in Node.js environments.');
7947
+ }
7948
+ async _registerFiles(params) {
7949
+ return this.registerFilesInternal(params);
7950
+ }
7902
7951
  async listInternal(params) {
7903
7952
  var _a, _b;
7904
7953
  let response;
@@ -8072,6 +8121,40 @@ class Files extends BaseModule {
8072
8121
  });
8073
8122
  }
8074
8123
  }
8124
+ async registerFilesInternal(params) {
8125
+ var _a, _b;
8126
+ let response;
8127
+ let path = '';
8128
+ let queryParams = {};
8129
+ if (this.apiClient.isVertexAI()) {
8130
+ throw new Error('This method is only supported by the Gemini Developer API.');
8131
+ }
8132
+ else {
8133
+ const body = internalRegisterFilesParametersToMldev(params);
8134
+ path = formatMap('files:register', body['_url']);
8135
+ queryParams = body['_query'];
8136
+ delete body['_url'];
8137
+ delete body['_query'];
8138
+ response = this.apiClient
8139
+ .request({
8140
+ path: path,
8141
+ queryParams: queryParams,
8142
+ body: JSON.stringify(body),
8143
+ httpMethod: 'POST',
8144
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
8145
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
8146
+ })
8147
+ .then((httpResponse) => {
8148
+ return httpResponse.json();
8149
+ });
8150
+ return response.then((apiResponse) => {
8151
+ const resp = registerFilesResponseFromMldev(apiResponse);
8152
+ const typedResp = new RegisterFilesResponse();
8153
+ Object.assign(typedResp, resp);
8154
+ return typedResp;
8155
+ });
8156
+ }
8157
+ }
8075
8158
  }
8076
8159
 
8077
8160
  /**
@@ -9310,7 +9393,9 @@ class BaseInteractions extends APIResource {
9310
9393
  *
9311
9394
  * @example
9312
9395
  * ```ts
9313
- * const interaction = await client.interactions.delete('id');
9396
+ * const interaction = await client.interactions.delete('id', {
9397
+ * api_version: 'api_version',
9398
+ * });
9314
9399
  * ```
9315
9400
  */
9316
9401
  delete(id, params = {}, options) {
@@ -9322,7 +9407,9 @@ class BaseInteractions extends APIResource {
9322
9407
  *
9323
9408
  * @example
9324
9409
  * ```ts
9325
- * const interaction = await client.interactions.cancel('id');
9410
+ * const interaction = await client.interactions.cancel('id', {
9411
+ * api_version: 'api_version',
9412
+ * });
9326
9413
  * ```
9327
9414
  */
9328
9415
  cancel(id, params = {}, options) {
@@ -9928,6 +10015,11 @@ async function defaultParseResponse(client, props) {
9928
10015
  const mediaType = (_a = contentType === null || contentType === void 0 ? void 0 : contentType.split(';')[0]) === null || _a === void 0 ? void 0 : _a.trim();
9929
10016
  const isJSON = (mediaType === null || mediaType === void 0 ? void 0 : mediaType.includes('application/json')) || (mediaType === null || mediaType === void 0 ? void 0 : mediaType.endsWith('+json'));
9930
10017
  if (isJSON) {
10018
+ const contentLength = response.headers.get('content-length');
10019
+ if (contentLength === '0') {
10020
+ // if there is no content we can't do anything
10021
+ return undefined;
10022
+ }
9931
10023
  const json = await response.json();
9932
10024
  return json;
9933
10025
  }
@@ -10387,9 +10479,10 @@ class BaseGeminiNextGenAPIClient {
10387
10479
  }
10388
10480
  async fetchWithTimeout(url, init, ms, controller) {
10389
10481
  const _b = init || {}, { signal, method } = _b, options = __rest(_b, ["signal", "method"]);
10482
+ const abort = controller.abort.bind(controller);
10390
10483
  if (signal)
10391
- signal.addEventListener('abort', () => controller.abort());
10392
- const timeout = setTimeout(() => controller.abort(), ms);
10484
+ signal.addEventListener('abort', abort, { once: true });
10485
+ const timeout = setTimeout(abort, ms);
10393
10486
  const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||
10394
10487
  (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
10395
10488
  const fetchOptions = Object.assign(Object.assign(Object.assign({ signal: controller.signal }, (isReadableBody ? { duplex: 'half' } : {})), { method: 'GET' }), options);
@@ -11533,7 +11626,7 @@ function voiceActivityFromVertex(fromObject) {
11533
11626
  * Copyright 2025 Google LLC
11534
11627
  * SPDX-License-Identifier: Apache-2.0
11535
11628
  */
11536
- function blobToMldev$1(fromObject) {
11629
+ function blobToMldev$1(fromObject, _rootObject) {
11537
11630
  const toObject = {};
11538
11631
  const fromData = getValueByPath(fromObject, ['data']);
11539
11632
  if (fromData != null) {
@@ -11548,7 +11641,7 @@ function blobToMldev$1(fromObject) {
11548
11641
  }
11549
11642
  return toObject;
11550
11643
  }
11551
- function candidateFromMldev(fromObject) {
11644
+ function candidateFromMldev(fromObject, rootObject) {
11552
11645
  const toObject = {};
11553
11646
  const fromContent = getValueByPath(fromObject, ['content']);
11554
11647
  if (fromContent != null) {
@@ -11608,7 +11701,7 @@ function candidateFromMldev(fromObject) {
11608
11701
  }
11609
11702
  return toObject;
11610
11703
  }
11611
- function citationMetadataFromMldev(fromObject) {
11704
+ function citationMetadataFromMldev(fromObject, _rootObject) {
11612
11705
  const toObject = {};
11613
11706
  const fromCitations = getValueByPath(fromObject, ['citationSources']);
11614
11707
  if (fromCitations != null) {
@@ -11622,7 +11715,7 @@ function citationMetadataFromMldev(fromObject) {
11622
11715
  }
11623
11716
  return toObject;
11624
11717
  }
11625
- function computeTokensParametersToVertex(apiClient, fromObject) {
11718
+ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
11626
11719
  const toObject = {};
11627
11720
  const fromModel = getValueByPath(fromObject, ['model']);
11628
11721
  if (fromModel != null) {
@@ -11640,7 +11733,7 @@ function computeTokensParametersToVertex(apiClient, fromObject) {
11640
11733
  }
11641
11734
  return toObject;
11642
11735
  }
11643
- function computeTokensResponseFromVertex(fromObject) {
11736
+ function computeTokensResponseFromVertex(fromObject, _rootObject) {
11644
11737
  const toObject = {};
11645
11738
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11646
11739
  'sdkHttpResponse',
@@ -11660,7 +11753,7 @@ function computeTokensResponseFromVertex(fromObject) {
11660
11753
  }
11661
11754
  return toObject;
11662
11755
  }
11663
- function contentEmbeddingFromVertex(fromObject) {
11756
+ function contentEmbeddingFromVertex(fromObject, rootObject) {
11664
11757
  const toObject = {};
11665
11758
  const fromValues = getValueByPath(fromObject, ['values']);
11666
11759
  if (fromValues != null) {
@@ -11672,7 +11765,7 @@ function contentEmbeddingFromVertex(fromObject) {
11672
11765
  }
11673
11766
  return toObject;
11674
11767
  }
11675
- function contentEmbeddingStatisticsFromVertex(fromObject) {
11768
+ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
11676
11769
  const toObject = {};
11677
11770
  const fromTruncated = getValueByPath(fromObject, ['truncated']);
11678
11771
  if (fromTruncated != null) {
@@ -11684,7 +11777,7 @@ function contentEmbeddingStatisticsFromVertex(fromObject) {
11684
11777
  }
11685
11778
  return toObject;
11686
11779
  }
11687
- function contentToMldev$1(fromObject) {
11780
+ function contentToMldev$1(fromObject, rootObject) {
11688
11781
  const toObject = {};
11689
11782
  const fromParts = getValueByPath(fromObject, ['parts']);
11690
11783
  if (fromParts != null) {
@@ -11702,7 +11795,7 @@ function contentToMldev$1(fromObject) {
11702
11795
  }
11703
11796
  return toObject;
11704
11797
  }
11705
- function controlReferenceConfigToVertex(fromObject) {
11798
+ function controlReferenceConfigToVertex(fromObject, _rootObject) {
11706
11799
  const toObject = {};
11707
11800
  const fromControlType = getValueByPath(fromObject, ['controlType']);
11708
11801
  if (fromControlType != null) {
@@ -11716,7 +11809,7 @@ function controlReferenceConfigToVertex(fromObject) {
11716
11809
  }
11717
11810
  return toObject;
11718
11811
  }
11719
- function countTokensConfigToMldev(fromObject) {
11812
+ function countTokensConfigToMldev(fromObject, _rootObject) {
11720
11813
  const toObject = {};
11721
11814
  if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
11722
11815
  throw new Error('systemInstruction parameter is not supported in Gemini API.');
@@ -11729,7 +11822,7 @@ function countTokensConfigToMldev(fromObject) {
11729
11822
  }
11730
11823
  return toObject;
11731
11824
  }
11732
- function countTokensConfigToVertex(fromObject, parentObject) {
11825
+ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
11733
11826
  const toObject = {};
11734
11827
  const fromSystemInstruction = getValueByPath(fromObject, [
11735
11828
  'systemInstruction',
@@ -11755,7 +11848,7 @@ function countTokensConfigToVertex(fromObject, parentObject) {
11755
11848
  }
11756
11849
  return toObject;
11757
11850
  }
11758
- function countTokensParametersToMldev(apiClient, fromObject) {
11851
+ function countTokensParametersToMldev(apiClient, fromObject, rootObject) {
11759
11852
  const toObject = {};
11760
11853
  const fromModel = getValueByPath(fromObject, ['model']);
11761
11854
  if (fromModel != null) {
@@ -11777,7 +11870,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
11777
11870
  }
11778
11871
  return toObject;
11779
11872
  }
11780
- function countTokensParametersToVertex(apiClient, fromObject) {
11873
+ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
11781
11874
  const toObject = {};
11782
11875
  const fromModel = getValueByPath(fromObject, ['model']);
11783
11876
  if (fromModel != null) {
@@ -11799,7 +11892,7 @@ function countTokensParametersToVertex(apiClient, fromObject) {
11799
11892
  }
11800
11893
  return toObject;
11801
11894
  }
11802
- function countTokensResponseFromMldev(fromObject) {
11895
+ function countTokensResponseFromMldev(fromObject, _rootObject) {
11803
11896
  const toObject = {};
11804
11897
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11805
11898
  'sdkHttpResponse',
@@ -11819,7 +11912,7 @@ function countTokensResponseFromMldev(fromObject) {
11819
11912
  }
11820
11913
  return toObject;
11821
11914
  }
11822
- function countTokensResponseFromVertex(fromObject) {
11915
+ function countTokensResponseFromVertex(fromObject, _rootObject) {
11823
11916
  const toObject = {};
11824
11917
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11825
11918
  'sdkHttpResponse',
@@ -11833,7 +11926,7 @@ function countTokensResponseFromVertex(fromObject) {
11833
11926
  }
11834
11927
  return toObject;
11835
11928
  }
11836
- function deleteModelParametersToMldev(apiClient, fromObject) {
11929
+ function deleteModelParametersToMldev(apiClient, fromObject, _rootObject) {
11837
11930
  const toObject = {};
11838
11931
  const fromModel = getValueByPath(fromObject, ['model']);
11839
11932
  if (fromModel != null) {
@@ -11841,7 +11934,7 @@ function deleteModelParametersToMldev(apiClient, fromObject) {
11841
11934
  }
11842
11935
  return toObject;
11843
11936
  }
11844
- function deleteModelParametersToVertex(apiClient, fromObject) {
11937
+ function deleteModelParametersToVertex(apiClient, fromObject, _rootObject) {
11845
11938
  const toObject = {};
11846
11939
  const fromModel = getValueByPath(fromObject, ['model']);
11847
11940
  if (fromModel != null) {
@@ -11849,7 +11942,7 @@ function deleteModelParametersToVertex(apiClient, fromObject) {
11849
11942
  }
11850
11943
  return toObject;
11851
11944
  }
11852
- function deleteModelResponseFromMldev(fromObject) {
11945
+ function deleteModelResponseFromMldev(fromObject, _rootObject) {
11853
11946
  const toObject = {};
11854
11947
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11855
11948
  'sdkHttpResponse',
@@ -11859,7 +11952,7 @@ function deleteModelResponseFromMldev(fromObject) {
11859
11952
  }
11860
11953
  return toObject;
11861
11954
  }
11862
- function deleteModelResponseFromVertex(fromObject) {
11955
+ function deleteModelResponseFromVertex(fromObject, _rootObject) {
11863
11956
  const toObject = {};
11864
11957
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11865
11958
  'sdkHttpResponse',
@@ -11869,7 +11962,7 @@ function deleteModelResponseFromVertex(fromObject) {
11869
11962
  }
11870
11963
  return toObject;
11871
11964
  }
11872
- function editImageConfigToVertex(fromObject, parentObject) {
11965
+ function editImageConfigToVertex(fromObject, parentObject, _rootObject) {
11873
11966
  const toObject = {};
11874
11967
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
11875
11968
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -11959,7 +12052,7 @@ function editImageConfigToVertex(fromObject, parentObject) {
11959
12052
  }
11960
12053
  return toObject;
11961
12054
  }
11962
- function editImageParametersInternalToVertex(apiClient, fromObject) {
12055
+ function editImageParametersInternalToVertex(apiClient, fromObject, rootObject) {
11963
12056
  const toObject = {};
11964
12057
  const fromModel = getValueByPath(fromObject, ['model']);
11965
12058
  if (fromModel != null) {
@@ -11987,7 +12080,7 @@ function editImageParametersInternalToVertex(apiClient, fromObject) {
11987
12080
  }
11988
12081
  return toObject;
11989
12082
  }
11990
- function editImageResponseFromVertex(fromObject) {
12083
+ function editImageResponseFromVertex(fromObject, rootObject) {
11991
12084
  const toObject = {};
11992
12085
  const fromSdkHttpResponse = getValueByPath(fromObject, [
11993
12086
  'sdkHttpResponse',
@@ -12009,7 +12102,7 @@ function editImageResponseFromVertex(fromObject) {
12009
12102
  }
12010
12103
  return toObject;
12011
12104
  }
12012
- function embedContentConfigToMldev(fromObject, parentObject) {
12105
+ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
12013
12106
  const toObject = {};
12014
12107
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
12015
12108
  if (parentObject !== undefined && fromTaskType != null) {
@@ -12033,7 +12126,7 @@ function embedContentConfigToMldev(fromObject, parentObject) {
12033
12126
  }
12034
12127
  return toObject;
12035
12128
  }
12036
- function embedContentConfigToVertex(fromObject, parentObject) {
12129
+ function embedContentConfigToVertex(fromObject, parentObject, _rootObject) {
12037
12130
  const toObject = {};
12038
12131
  const fromTaskType = getValueByPath(fromObject, ['taskType']);
12039
12132
  if (parentObject !== undefined && fromTaskType != null) {
@@ -12059,7 +12152,7 @@ function embedContentConfigToVertex(fromObject, parentObject) {
12059
12152
  }
12060
12153
  return toObject;
12061
12154
  }
12062
- function embedContentParametersToMldev(apiClient, fromObject) {
12155
+ function embedContentParametersToMldev(apiClient, fromObject, rootObject) {
12063
12156
  const toObject = {};
12064
12157
  const fromModel = getValueByPath(fromObject, ['model']);
12065
12158
  if (fromModel != null) {
@@ -12085,7 +12178,7 @@ function embedContentParametersToMldev(apiClient, fromObject) {
12085
12178
  }
12086
12179
  return toObject;
12087
12180
  }
12088
- function embedContentParametersToVertex(apiClient, fromObject) {
12181
+ function embedContentParametersToVertex(apiClient, fromObject, rootObject) {
12089
12182
  const toObject = {};
12090
12183
  const fromModel = getValueByPath(fromObject, ['model']);
12091
12184
  if (fromModel != null) {
@@ -12107,7 +12200,7 @@ function embedContentParametersToVertex(apiClient, fromObject) {
12107
12200
  }
12108
12201
  return toObject;
12109
12202
  }
12110
- function embedContentResponseFromMldev(fromObject) {
12203
+ function embedContentResponseFromMldev(fromObject, _rootObject) {
12111
12204
  const toObject = {};
12112
12205
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12113
12206
  'sdkHttpResponse',
@@ -12131,7 +12224,7 @@ function embedContentResponseFromMldev(fromObject) {
12131
12224
  }
12132
12225
  return toObject;
12133
12226
  }
12134
- function embedContentResponseFromVertex(fromObject) {
12227
+ function embedContentResponseFromVertex(fromObject, rootObject) {
12135
12228
  const toObject = {};
12136
12229
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12137
12230
  'sdkHttpResponse',
@@ -12158,7 +12251,7 @@ function embedContentResponseFromVertex(fromObject) {
12158
12251
  }
12159
12252
  return toObject;
12160
12253
  }
12161
- function endpointFromVertex(fromObject) {
12254
+ function endpointFromVertex(fromObject, _rootObject) {
12162
12255
  const toObject = {};
12163
12256
  const fromName = getValueByPath(fromObject, ['endpoint']);
12164
12257
  if (fromName != null) {
@@ -12172,7 +12265,7 @@ function endpointFromVertex(fromObject) {
12172
12265
  }
12173
12266
  return toObject;
12174
12267
  }
12175
- function fileDataToMldev$1(fromObject) {
12268
+ function fileDataToMldev$1(fromObject, _rootObject) {
12176
12269
  const toObject = {};
12177
12270
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
12178
12271
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -12187,7 +12280,7 @@ function fileDataToMldev$1(fromObject) {
12187
12280
  }
12188
12281
  return toObject;
12189
12282
  }
12190
- function functionCallToMldev$1(fromObject) {
12283
+ function functionCallToMldev$1(fromObject, _rootObject) {
12191
12284
  const toObject = {};
12192
12285
  const fromId = getValueByPath(fromObject, ['id']);
12193
12286
  if (fromId != null) {
@@ -12209,7 +12302,7 @@ function functionCallToMldev$1(fromObject) {
12209
12302
  }
12210
12303
  return toObject;
12211
12304
  }
12212
- function functionCallingConfigToMldev(fromObject) {
12305
+ function functionCallingConfigToMldev(fromObject, _rootObject) {
12213
12306
  const toObject = {};
12214
12307
  const fromAllowedFunctionNames = getValueByPath(fromObject, [
12215
12308
  'allowedFunctionNames',
@@ -12227,7 +12320,7 @@ function functionCallingConfigToMldev(fromObject) {
12227
12320
  }
12228
12321
  return toObject;
12229
12322
  }
12230
- function functionDeclarationToVertex(fromObject) {
12323
+ function functionDeclarationToVertex(fromObject, _rootObject) {
12231
12324
  const toObject = {};
12232
12325
  const fromDescription = getValueByPath(fromObject, ['description']);
12233
12326
  if (fromDescription != null) {
@@ -12262,7 +12355,7 @@ function functionDeclarationToVertex(fromObject) {
12262
12355
  }
12263
12356
  return toObject;
12264
12357
  }
12265
- function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
12358
+ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootObject) {
12266
12359
  const toObject = {};
12267
12360
  const fromSystemInstruction = getValueByPath(fromObject, [
12268
12361
  'systemInstruction',
@@ -12425,7 +12518,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
12425
12518
  }
12426
12519
  return toObject;
12427
12520
  }
12428
- function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
12521
+ function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
12429
12522
  const toObject = {};
12430
12523
  const fromSystemInstruction = getValueByPath(fromObject, [
12431
12524
  'systemInstruction',
@@ -12599,7 +12692,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
12599
12692
  }
12600
12693
  return toObject;
12601
12694
  }
12602
- function generateContentParametersToMldev(apiClient, fromObject) {
12695
+ function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
12603
12696
  const toObject = {};
12604
12697
  const fromModel = getValueByPath(fromObject, ['model']);
12605
12698
  if (fromModel != null) {
@@ -12621,7 +12714,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
12621
12714
  }
12622
12715
  return toObject;
12623
12716
  }
12624
- function generateContentParametersToVertex(apiClient, fromObject) {
12717
+ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
12625
12718
  const toObject = {};
12626
12719
  const fromModel = getValueByPath(fromObject, ['model']);
12627
12720
  if (fromModel != null) {
@@ -12643,7 +12736,7 @@ function generateContentParametersToVertex(apiClient, fromObject) {
12643
12736
  }
12644
12737
  return toObject;
12645
12738
  }
12646
- function generateContentResponseFromMldev(fromObject) {
12739
+ function generateContentResponseFromMldev(fromObject, rootObject) {
12647
12740
  const toObject = {};
12648
12741
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12649
12742
  'sdkHttpResponse',
@@ -12683,7 +12776,7 @@ function generateContentResponseFromMldev(fromObject) {
12683
12776
  }
12684
12777
  return toObject;
12685
12778
  }
12686
- function generateContentResponseFromVertex(fromObject) {
12779
+ function generateContentResponseFromVertex(fromObject, _rootObject) {
12687
12780
  const toObject = {};
12688
12781
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12689
12782
  'sdkHttpResponse',
@@ -12727,7 +12820,7 @@ function generateContentResponseFromVertex(fromObject) {
12727
12820
  }
12728
12821
  return toObject;
12729
12822
  }
12730
- function generateImagesConfigToMldev(fromObject, parentObject) {
12823
+ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
12731
12824
  const toObject = {};
12732
12825
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
12733
12826
  throw new Error('outputGcsUri parameter is not supported in Gemini API.');
@@ -12809,7 +12902,7 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
12809
12902
  }
12810
12903
  return toObject;
12811
12904
  }
12812
- function generateImagesConfigToVertex(fromObject, parentObject) {
12905
+ function generateImagesConfigToVertex(fromObject, parentObject, _rootObject) {
12813
12906
  const toObject = {};
12814
12907
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
12815
12908
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -12901,7 +12994,7 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
12901
12994
  }
12902
12995
  return toObject;
12903
12996
  }
12904
- function generateImagesParametersToMldev(apiClient, fromObject) {
12997
+ function generateImagesParametersToMldev(apiClient, fromObject, rootObject) {
12905
12998
  const toObject = {};
12906
12999
  const fromModel = getValueByPath(fromObject, ['model']);
12907
13000
  if (fromModel != null) {
@@ -12917,7 +13010,7 @@ function generateImagesParametersToMldev(apiClient, fromObject) {
12917
13010
  }
12918
13011
  return toObject;
12919
13012
  }
12920
- function generateImagesParametersToVertex(apiClient, fromObject) {
13013
+ function generateImagesParametersToVertex(apiClient, fromObject, rootObject) {
12921
13014
  const toObject = {};
12922
13015
  const fromModel = getValueByPath(fromObject, ['model']);
12923
13016
  if (fromModel != null) {
@@ -12933,7 +13026,7 @@ function generateImagesParametersToVertex(apiClient, fromObject) {
12933
13026
  }
12934
13027
  return toObject;
12935
13028
  }
12936
- function generateImagesResponseFromMldev(fromObject) {
13029
+ function generateImagesResponseFromMldev(fromObject, rootObject) {
12937
13030
  const toObject = {};
12938
13031
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12939
13032
  'sdkHttpResponse',
@@ -12961,7 +13054,7 @@ function generateImagesResponseFromMldev(fromObject) {
12961
13054
  }
12962
13055
  return toObject;
12963
13056
  }
12964
- function generateImagesResponseFromVertex(fromObject) {
13057
+ function generateImagesResponseFromVertex(fromObject, rootObject) {
12965
13058
  const toObject = {};
12966
13059
  const fromSdkHttpResponse = getValueByPath(fromObject, [
12967
13060
  'sdkHttpResponse',
@@ -12989,7 +13082,7 @@ function generateImagesResponseFromVertex(fromObject) {
12989
13082
  }
12990
13083
  return toObject;
12991
13084
  }
12992
- function generateVideosConfigToMldev(fromObject, parentObject) {
13085
+ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
12993
13086
  const toObject = {};
12994
13087
  const fromNumberOfVideos = getValueByPath(fromObject, [
12995
13088
  'numberOfVideos',
@@ -13068,7 +13161,7 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
13068
13161
  }
13069
13162
  return toObject;
13070
13163
  }
13071
- function generateVideosConfigToVertex(fromObject, parentObject) {
13164
+ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
13072
13165
  const toObject = {};
13073
13166
  const fromNumberOfVideos = getValueByPath(fromObject, [
13074
13167
  'numberOfVideos',
@@ -13158,7 +13251,7 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
13158
13251
  }
13159
13252
  return toObject;
13160
13253
  }
13161
- function generateVideosOperationFromMldev(fromObject) {
13254
+ function generateVideosOperationFromMldev(fromObject, rootObject) {
13162
13255
  const toObject = {};
13163
13256
  const fromName = getValueByPath(fromObject, ['name']);
13164
13257
  if (fromName != null) {
@@ -13185,7 +13278,7 @@ function generateVideosOperationFromMldev(fromObject) {
13185
13278
  }
13186
13279
  return toObject;
13187
13280
  }
13188
- function generateVideosOperationFromVertex(fromObject) {
13281
+ function generateVideosOperationFromVertex(fromObject, rootObject) {
13189
13282
  const toObject = {};
13190
13283
  const fromName = getValueByPath(fromObject, ['name']);
13191
13284
  if (fromName != null) {
@@ -13209,7 +13302,7 @@ function generateVideosOperationFromVertex(fromObject) {
13209
13302
  }
13210
13303
  return toObject;
13211
13304
  }
13212
- function generateVideosParametersToMldev(apiClient, fromObject) {
13305
+ function generateVideosParametersToMldev(apiClient, fromObject, rootObject) {
13213
13306
  const toObject = {};
13214
13307
  const fromModel = getValueByPath(fromObject, ['model']);
13215
13308
  if (fromModel != null) {
@@ -13237,7 +13330,7 @@ function generateVideosParametersToMldev(apiClient, fromObject) {
13237
13330
  }
13238
13331
  return toObject;
13239
13332
  }
13240
- function generateVideosParametersToVertex(apiClient, fromObject) {
13333
+ function generateVideosParametersToVertex(apiClient, fromObject, rootObject) {
13241
13334
  const toObject = {};
13242
13335
  const fromModel = getValueByPath(fromObject, ['model']);
13243
13336
  if (fromModel != null) {
@@ -13265,7 +13358,7 @@ function generateVideosParametersToVertex(apiClient, fromObject) {
13265
13358
  }
13266
13359
  return toObject;
13267
13360
  }
13268
- function generateVideosResponseFromMldev(fromObject) {
13361
+ function generateVideosResponseFromMldev(fromObject, rootObject) {
13269
13362
  const toObject = {};
13270
13363
  const fromGeneratedVideos = getValueByPath(fromObject, [
13271
13364
  'generatedSamples',
@@ -13293,7 +13386,7 @@ function generateVideosResponseFromMldev(fromObject) {
13293
13386
  }
13294
13387
  return toObject;
13295
13388
  }
13296
- function generateVideosResponseFromVertex(fromObject) {
13389
+ function generateVideosResponseFromVertex(fromObject, rootObject) {
13297
13390
  const toObject = {};
13298
13391
  const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
13299
13392
  if (fromGeneratedVideos != null) {
@@ -13319,7 +13412,7 @@ function generateVideosResponseFromVertex(fromObject) {
13319
13412
  }
13320
13413
  return toObject;
13321
13414
  }
13322
- function generateVideosSourceToMldev(fromObject, parentObject) {
13415
+ function generateVideosSourceToMldev(fromObject, parentObject, rootObject) {
13323
13416
  const toObject = {};
13324
13417
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
13325
13418
  if (parentObject !== undefined && fromPrompt != null) {
@@ -13335,7 +13428,7 @@ function generateVideosSourceToMldev(fromObject, parentObject) {
13335
13428
  }
13336
13429
  return toObject;
13337
13430
  }
13338
- function generateVideosSourceToVertex(fromObject, parentObject) {
13431
+ function generateVideosSourceToVertex(fromObject, parentObject, rootObject) {
13339
13432
  const toObject = {};
13340
13433
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
13341
13434
  if (parentObject !== undefined && fromPrompt != null) {
@@ -13351,7 +13444,7 @@ function generateVideosSourceToVertex(fromObject, parentObject) {
13351
13444
  }
13352
13445
  return toObject;
13353
13446
  }
13354
- function generatedImageFromMldev(fromObject) {
13447
+ function generatedImageFromMldev(fromObject, rootObject) {
13355
13448
  const toObject = {};
13356
13449
  const fromImage = getValueByPath(fromObject, ['_self']);
13357
13450
  if (fromImage != null) {
@@ -13369,7 +13462,7 @@ function generatedImageFromMldev(fromObject) {
13369
13462
  }
13370
13463
  return toObject;
13371
13464
  }
13372
- function generatedImageFromVertex(fromObject) {
13465
+ function generatedImageFromVertex(fromObject, rootObject) {
13373
13466
  const toObject = {};
13374
13467
  const fromImage = getValueByPath(fromObject, ['_self']);
13375
13468
  if (fromImage != null) {
@@ -13391,7 +13484,7 @@ function generatedImageFromVertex(fromObject) {
13391
13484
  }
13392
13485
  return toObject;
13393
13486
  }
13394
- function generatedImageMaskFromVertex(fromObject) {
13487
+ function generatedImageMaskFromVertex(fromObject, rootObject) {
13395
13488
  const toObject = {};
13396
13489
  const fromMask = getValueByPath(fromObject, ['_self']);
13397
13490
  if (fromMask != null) {
@@ -13409,7 +13502,7 @@ function generatedImageMaskFromVertex(fromObject) {
13409
13502
  }
13410
13503
  return toObject;
13411
13504
  }
13412
- function generatedVideoFromMldev(fromObject) {
13505
+ function generatedVideoFromMldev(fromObject, rootObject) {
13413
13506
  const toObject = {};
13414
13507
  const fromVideo = getValueByPath(fromObject, ['video']);
13415
13508
  if (fromVideo != null) {
@@ -13417,7 +13510,7 @@ function generatedVideoFromMldev(fromObject) {
13417
13510
  }
13418
13511
  return toObject;
13419
13512
  }
13420
- function generatedVideoFromVertex(fromObject) {
13513
+ function generatedVideoFromVertex(fromObject, rootObject) {
13421
13514
  const toObject = {};
13422
13515
  const fromVideo = getValueByPath(fromObject, ['_self']);
13423
13516
  if (fromVideo != null) {
@@ -13425,7 +13518,7 @@ function generatedVideoFromVertex(fromObject) {
13425
13518
  }
13426
13519
  return toObject;
13427
13520
  }
13428
- function generationConfigToVertex(fromObject) {
13521
+ function generationConfigToVertex(fromObject, _rootObject) {
13429
13522
  const toObject = {};
13430
13523
  const fromModelSelectionConfig = getValueByPath(fromObject, [
13431
13524
  'modelSelectionConfig',
@@ -13553,7 +13646,7 @@ function generationConfigToVertex(fromObject) {
13553
13646
  }
13554
13647
  return toObject;
13555
13648
  }
13556
- function getModelParametersToMldev(apiClient, fromObject) {
13649
+ function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
13557
13650
  const toObject = {};
13558
13651
  const fromModel = getValueByPath(fromObject, ['model']);
13559
13652
  if (fromModel != null) {
@@ -13561,7 +13654,7 @@ function getModelParametersToMldev(apiClient, fromObject) {
13561
13654
  }
13562
13655
  return toObject;
13563
13656
  }
13564
- function getModelParametersToVertex(apiClient, fromObject) {
13657
+ function getModelParametersToVertex(apiClient, fromObject, _rootObject) {
13565
13658
  const toObject = {};
13566
13659
  const fromModel = getValueByPath(fromObject, ['model']);
13567
13660
  if (fromModel != null) {
@@ -13569,7 +13662,7 @@ function getModelParametersToVertex(apiClient, fromObject) {
13569
13662
  }
13570
13663
  return toObject;
13571
13664
  }
13572
- function googleMapsToMldev$1(fromObject) {
13665
+ function googleMapsToMldev$1(fromObject, _rootObject) {
13573
13666
  const toObject = {};
13574
13667
  if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
13575
13668
  throw new Error('authConfig parameter is not supported in Gemini API.');
@@ -13580,7 +13673,7 @@ function googleMapsToMldev$1(fromObject) {
13580
13673
  }
13581
13674
  return toObject;
13582
13675
  }
13583
- function googleSearchToMldev$1(fromObject) {
13676
+ function googleSearchToMldev$1(fromObject, _rootObject) {
13584
13677
  const toObject = {};
13585
13678
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13586
13679
  throw new Error('excludeDomains parameter is not supported in Gemini API.');
@@ -13596,7 +13689,7 @@ function googleSearchToMldev$1(fromObject) {
13596
13689
  }
13597
13690
  return toObject;
13598
13691
  }
13599
- function imageConfigToMldev(fromObject) {
13692
+ function imageConfigToMldev(fromObject, _rootObject) {
13600
13693
  const toObject = {};
13601
13694
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
13602
13695
  if (fromAspectRatio != null) {
@@ -13618,7 +13711,7 @@ function imageConfigToMldev(fromObject) {
13618
13711
  }
13619
13712
  return toObject;
13620
13713
  }
13621
- function imageConfigToVertex(fromObject) {
13714
+ function imageConfigToVertex(fromObject, _rootObject) {
13622
13715
  const toObject = {};
13623
13716
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
13624
13717
  if (fromAspectRatio != null) {
@@ -13648,7 +13741,7 @@ function imageConfigToVertex(fromObject) {
13648
13741
  }
13649
13742
  return toObject;
13650
13743
  }
13651
- function imageFromMldev(fromObject) {
13744
+ function imageFromMldev(fromObject, _rootObject) {
13652
13745
  const toObject = {};
13653
13746
  const fromImageBytes = getValueByPath(fromObject, [
13654
13747
  'bytesBase64Encoded',
@@ -13662,7 +13755,7 @@ function imageFromMldev(fromObject) {
13662
13755
  }
13663
13756
  return toObject;
13664
13757
  }
13665
- function imageFromVertex(fromObject) {
13758
+ function imageFromVertex(fromObject, _rootObject) {
13666
13759
  const toObject = {};
13667
13760
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
13668
13761
  if (fromGcsUri != null) {
@@ -13680,7 +13773,7 @@ function imageFromVertex(fromObject) {
13680
13773
  }
13681
13774
  return toObject;
13682
13775
  }
13683
- function imageToMldev(fromObject) {
13776
+ function imageToMldev(fromObject, _rootObject) {
13684
13777
  const toObject = {};
13685
13778
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
13686
13779
  throw new Error('gcsUri parameter is not supported in Gemini API.');
@@ -13695,7 +13788,7 @@ function imageToMldev(fromObject) {
13695
13788
  }
13696
13789
  return toObject;
13697
13790
  }
13698
- function imageToVertex(fromObject) {
13791
+ function imageToVertex(fromObject, _rootObject) {
13699
13792
  const toObject = {};
13700
13793
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
13701
13794
  if (fromGcsUri != null) {
@@ -13711,7 +13804,7 @@ function imageToVertex(fromObject) {
13711
13804
  }
13712
13805
  return toObject;
13713
13806
  }
13714
- function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
13807
+ function listModelsConfigToMldev(apiClient, fromObject, parentObject, _rootObject) {
13715
13808
  const toObject = {};
13716
13809
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
13717
13810
  if (parentObject !== undefined && fromPageSize != null) {
@@ -13731,7 +13824,7 @@ function listModelsConfigToMldev(apiClient, fromObject, parentObject) {
13731
13824
  }
13732
13825
  return toObject;
13733
13826
  }
13734
- function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
13827
+ function listModelsConfigToVertex(apiClient, fromObject, parentObject, _rootObject) {
13735
13828
  const toObject = {};
13736
13829
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
13737
13830
  if (parentObject !== undefined && fromPageSize != null) {
@@ -13751,7 +13844,7 @@ function listModelsConfigToVertex(apiClient, fromObject, parentObject) {
13751
13844
  }
13752
13845
  return toObject;
13753
13846
  }
13754
- function listModelsParametersToMldev(apiClient, fromObject) {
13847
+ function listModelsParametersToMldev(apiClient, fromObject, rootObject) {
13755
13848
  const toObject = {};
13756
13849
  const fromConfig = getValueByPath(fromObject, ['config']);
13757
13850
  if (fromConfig != null) {
@@ -13759,7 +13852,7 @@ function listModelsParametersToMldev(apiClient, fromObject) {
13759
13852
  }
13760
13853
  return toObject;
13761
13854
  }
13762
- function listModelsParametersToVertex(apiClient, fromObject) {
13855
+ function listModelsParametersToVertex(apiClient, fromObject, rootObject) {
13763
13856
  const toObject = {};
13764
13857
  const fromConfig = getValueByPath(fromObject, ['config']);
13765
13858
  if (fromConfig != null) {
@@ -13767,7 +13860,7 @@ function listModelsParametersToVertex(apiClient, fromObject) {
13767
13860
  }
13768
13861
  return toObject;
13769
13862
  }
13770
- function listModelsResponseFromMldev(fromObject) {
13863
+ function listModelsResponseFromMldev(fromObject, rootObject) {
13771
13864
  const toObject = {};
13772
13865
  const fromSdkHttpResponse = getValueByPath(fromObject, [
13773
13866
  'sdkHttpResponse',
@@ -13793,7 +13886,7 @@ function listModelsResponseFromMldev(fromObject) {
13793
13886
  }
13794
13887
  return toObject;
13795
13888
  }
13796
- function listModelsResponseFromVertex(fromObject) {
13889
+ function listModelsResponseFromVertex(fromObject, rootObject) {
13797
13890
  const toObject = {};
13798
13891
  const fromSdkHttpResponse = getValueByPath(fromObject, [
13799
13892
  'sdkHttpResponse',
@@ -13819,7 +13912,7 @@ function listModelsResponseFromVertex(fromObject) {
13819
13912
  }
13820
13913
  return toObject;
13821
13914
  }
13822
- function maskReferenceConfigToVertex(fromObject) {
13915
+ function maskReferenceConfigToVertex(fromObject, _rootObject) {
13823
13916
  const toObject = {};
13824
13917
  const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
13825
13918
  if (fromMaskMode != null) {
@@ -13837,7 +13930,7 @@ function maskReferenceConfigToVertex(fromObject) {
13837
13930
  }
13838
13931
  return toObject;
13839
13932
  }
13840
- function modelFromMldev(fromObject) {
13933
+ function modelFromMldev(fromObject, rootObject) {
13841
13934
  const toObject = {};
13842
13935
  const fromName = getValueByPath(fromObject, ['name']);
13843
13936
  if (fromName != null) {
@@ -13901,7 +13994,7 @@ function modelFromMldev(fromObject) {
13901
13994
  }
13902
13995
  return toObject;
13903
13996
  }
13904
- function modelFromVertex(fromObject) {
13997
+ function modelFromVertex(fromObject, rootObject) {
13905
13998
  const toObject = {};
13906
13999
  const fromName = getValueByPath(fromObject, ['name']);
13907
14000
  if (fromName != null) {
@@ -13955,7 +14048,7 @@ function modelFromVertex(fromObject) {
13955
14048
  }
13956
14049
  return toObject;
13957
14050
  }
13958
- function partToMldev$1(fromObject) {
14051
+ function partToMldev$1(fromObject, rootObject) {
13959
14052
  const toObject = {};
13960
14053
  const fromMediaResolution = getValueByPath(fromObject, [
13961
14054
  'mediaResolution',
@@ -14015,7 +14108,7 @@ function partToMldev$1(fromObject) {
14015
14108
  }
14016
14109
  return toObject;
14017
14110
  }
14018
- function productImageToVertex(fromObject) {
14111
+ function productImageToVertex(fromObject, rootObject) {
14019
14112
  const toObject = {};
14020
14113
  const fromProductImage = getValueByPath(fromObject, ['productImage']);
14021
14114
  if (fromProductImage != null) {
@@ -14023,7 +14116,7 @@ function productImageToVertex(fromObject) {
14023
14116
  }
14024
14117
  return toObject;
14025
14118
  }
14026
- function recontextImageConfigToVertex(fromObject, parentObject) {
14119
+ function recontextImageConfigToVertex(fromObject, parentObject, _rootObject) {
14027
14120
  const toObject = {};
14028
14121
  const fromNumberOfImages = getValueByPath(fromObject, [
14029
14122
  'numberOfImages',
@@ -14083,7 +14176,7 @@ function recontextImageConfigToVertex(fromObject, parentObject) {
14083
14176
  }
14084
14177
  return toObject;
14085
14178
  }
14086
- function recontextImageParametersToVertex(apiClient, fromObject) {
14179
+ function recontextImageParametersToVertex(apiClient, fromObject, rootObject) {
14087
14180
  const toObject = {};
14088
14181
  const fromModel = getValueByPath(fromObject, ['model']);
14089
14182
  if (fromModel != null) {
@@ -14099,7 +14192,7 @@ function recontextImageParametersToVertex(apiClient, fromObject) {
14099
14192
  }
14100
14193
  return toObject;
14101
14194
  }
14102
- function recontextImageResponseFromVertex(fromObject) {
14195
+ function recontextImageResponseFromVertex(fromObject, rootObject) {
14103
14196
  const toObject = {};
14104
14197
  const fromGeneratedImages = getValueByPath(fromObject, [
14105
14198
  'predictions',
@@ -14115,7 +14208,7 @@ function recontextImageResponseFromVertex(fromObject) {
14115
14208
  }
14116
14209
  return toObject;
14117
14210
  }
14118
- function recontextImageSourceToVertex(fromObject, parentObject) {
14211
+ function recontextImageSourceToVertex(fromObject, parentObject, rootObject) {
14119
14212
  const toObject = {};
14120
14213
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
14121
14214
  if (parentObject !== undefined && fromPrompt != null) {
@@ -14139,7 +14232,7 @@ function recontextImageSourceToVertex(fromObject, parentObject) {
14139
14232
  }
14140
14233
  return toObject;
14141
14234
  }
14142
- function referenceImageAPIInternalToVertex(fromObject) {
14235
+ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
14143
14236
  const toObject = {};
14144
14237
  const fromReferenceImage = getValueByPath(fromObject, [
14145
14238
  'referenceImage',
@@ -14183,7 +14276,7 @@ function referenceImageAPIInternalToVertex(fromObject) {
14183
14276
  }
14184
14277
  return toObject;
14185
14278
  }
14186
- function safetyAttributesFromMldev(fromObject) {
14279
+ function safetyAttributesFromMldev(fromObject, _rootObject) {
14187
14280
  const toObject = {};
14188
14281
  const fromCategories = getValueByPath(fromObject, [
14189
14282
  'safetyAttributes',
@@ -14205,7 +14298,7 @@ function safetyAttributesFromMldev(fromObject) {
14205
14298
  }
14206
14299
  return toObject;
14207
14300
  }
14208
- function safetyAttributesFromVertex(fromObject) {
14301
+ function safetyAttributesFromVertex(fromObject, _rootObject) {
14209
14302
  const toObject = {};
14210
14303
  const fromCategories = getValueByPath(fromObject, [
14211
14304
  'safetyAttributes',
@@ -14227,7 +14320,7 @@ function safetyAttributesFromVertex(fromObject) {
14227
14320
  }
14228
14321
  return toObject;
14229
14322
  }
14230
- function safetySettingToMldev(fromObject) {
14323
+ function safetySettingToMldev(fromObject, _rootObject) {
14231
14324
  const toObject = {};
14232
14325
  const fromCategory = getValueByPath(fromObject, ['category']);
14233
14326
  if (fromCategory != null) {
@@ -14242,7 +14335,7 @@ function safetySettingToMldev(fromObject) {
14242
14335
  }
14243
14336
  return toObject;
14244
14337
  }
14245
- function scribbleImageToVertex(fromObject) {
14338
+ function scribbleImageToVertex(fromObject, rootObject) {
14246
14339
  const toObject = {};
14247
14340
  const fromImage = getValueByPath(fromObject, ['image']);
14248
14341
  if (fromImage != null) {
@@ -14250,7 +14343,7 @@ function scribbleImageToVertex(fromObject) {
14250
14343
  }
14251
14344
  return toObject;
14252
14345
  }
14253
- function segmentImageConfigToVertex(fromObject, parentObject) {
14346
+ function segmentImageConfigToVertex(fromObject, parentObject, _rootObject) {
14254
14347
  const toObject = {};
14255
14348
  const fromMode = getValueByPath(fromObject, ['mode']);
14256
14349
  if (parentObject !== undefined && fromMode != null) {
@@ -14284,7 +14377,7 @@ function segmentImageConfigToVertex(fromObject, parentObject) {
14284
14377
  }
14285
14378
  return toObject;
14286
14379
  }
14287
- function segmentImageParametersToVertex(apiClient, fromObject) {
14380
+ function segmentImageParametersToVertex(apiClient, fromObject, rootObject) {
14288
14381
  const toObject = {};
14289
14382
  const fromModel = getValueByPath(fromObject, ['model']);
14290
14383
  if (fromModel != null) {
@@ -14300,7 +14393,7 @@ function segmentImageParametersToVertex(apiClient, fromObject) {
14300
14393
  }
14301
14394
  return toObject;
14302
14395
  }
14303
- function segmentImageResponseFromVertex(fromObject) {
14396
+ function segmentImageResponseFromVertex(fromObject, rootObject) {
14304
14397
  const toObject = {};
14305
14398
  const fromGeneratedMasks = getValueByPath(fromObject, ['predictions']);
14306
14399
  if (fromGeneratedMasks != null) {
@@ -14314,7 +14407,7 @@ function segmentImageResponseFromVertex(fromObject) {
14314
14407
  }
14315
14408
  return toObject;
14316
14409
  }
14317
- function segmentImageSourceToVertex(fromObject, parentObject) {
14410
+ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
14318
14411
  const toObject = {};
14319
14412
  const fromPrompt = getValueByPath(fromObject, ['prompt']);
14320
14413
  if (parentObject !== undefined && fromPrompt != null) {
@@ -14332,7 +14425,7 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
14332
14425
  }
14333
14426
  return toObject;
14334
14427
  }
14335
- function toolConfigToMldev(fromObject) {
14428
+ function toolConfigToMldev(fromObject, rootObject) {
14336
14429
  const toObject = {};
14337
14430
  const fromRetrievalConfig = getValueByPath(fromObject, [
14338
14431
  'retrievalConfig',
@@ -14348,7 +14441,7 @@ function toolConfigToMldev(fromObject) {
14348
14441
  }
14349
14442
  return toObject;
14350
14443
  }
14351
- function toolToMldev$1(fromObject) {
14444
+ function toolToMldev$1(fromObject, rootObject) {
14352
14445
  const toObject = {};
14353
14446
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
14354
14447
  throw new Error('retrieval parameter is not supported in Gemini API.');
@@ -14402,7 +14495,7 @@ function toolToMldev$1(fromObject) {
14402
14495
  }
14403
14496
  return toObject;
14404
14497
  }
14405
- function toolToVertex(fromObject) {
14498
+ function toolToVertex(fromObject, rootObject) {
14406
14499
  const toObject = {};
14407
14500
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
14408
14501
  if (fromRetrieval != null) {
@@ -14459,7 +14552,7 @@ function toolToVertex(fromObject) {
14459
14552
  }
14460
14553
  return toObject;
14461
14554
  }
14462
- function tunedModelInfoFromMldev(fromObject) {
14555
+ function tunedModelInfoFromMldev(fromObject, _rootObject) {
14463
14556
  const toObject = {};
14464
14557
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
14465
14558
  if (fromBaseModel != null) {
@@ -14475,7 +14568,7 @@ function tunedModelInfoFromMldev(fromObject) {
14475
14568
  }
14476
14569
  return toObject;
14477
14570
  }
14478
- function tunedModelInfoFromVertex(fromObject) {
14571
+ function tunedModelInfoFromVertex(fromObject, _rootObject) {
14479
14572
  const toObject = {};
14480
14573
  const fromBaseModel = getValueByPath(fromObject, [
14481
14574
  'labels',
@@ -14494,7 +14587,7 @@ function tunedModelInfoFromVertex(fromObject) {
14494
14587
  }
14495
14588
  return toObject;
14496
14589
  }
14497
- function updateModelConfigToMldev(fromObject, parentObject) {
14590
+ function updateModelConfigToMldev(fromObject, parentObject, _rootObject) {
14498
14591
  const toObject = {};
14499
14592
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
14500
14593
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -14512,7 +14605,7 @@ function updateModelConfigToMldev(fromObject, parentObject) {
14512
14605
  }
14513
14606
  return toObject;
14514
14607
  }
14515
- function updateModelConfigToVertex(fromObject, parentObject) {
14608
+ function updateModelConfigToVertex(fromObject, parentObject, _rootObject) {
14516
14609
  const toObject = {};
14517
14610
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
14518
14611
  if (parentObject !== undefined && fromDisplayName != null) {
@@ -14530,7 +14623,7 @@ function updateModelConfigToVertex(fromObject, parentObject) {
14530
14623
  }
14531
14624
  return toObject;
14532
14625
  }
14533
- function updateModelParametersToMldev(apiClient, fromObject) {
14626
+ function updateModelParametersToMldev(apiClient, fromObject, rootObject) {
14534
14627
  const toObject = {};
14535
14628
  const fromModel = getValueByPath(fromObject, ['model']);
14536
14629
  if (fromModel != null) {
@@ -14542,7 +14635,7 @@ function updateModelParametersToMldev(apiClient, fromObject) {
14542
14635
  }
14543
14636
  return toObject;
14544
14637
  }
14545
- function updateModelParametersToVertex(apiClient, fromObject) {
14638
+ function updateModelParametersToVertex(apiClient, fromObject, rootObject) {
14546
14639
  const toObject = {};
14547
14640
  const fromModel = getValueByPath(fromObject, ['model']);
14548
14641
  if (fromModel != null) {
@@ -14554,7 +14647,7 @@ function updateModelParametersToVertex(apiClient, fromObject) {
14554
14647
  }
14555
14648
  return toObject;
14556
14649
  }
14557
- function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
14650
+ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject, _rootObject) {
14558
14651
  const toObject = {};
14559
14652
  const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
14560
14653
  if (parentObject !== undefined && fromOutputGcsUri != null) {
@@ -14618,7 +14711,7 @@ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
14618
14711
  }
14619
14712
  return toObject;
14620
14713
  }
14621
- function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
14714
+ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject, rootObject) {
14622
14715
  const toObject = {};
14623
14716
  const fromModel = getValueByPath(fromObject, ['model']);
14624
14717
  if (fromModel != null) {
@@ -14640,7 +14733,7 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
14640
14733
  }
14641
14734
  return toObject;
14642
14735
  }
14643
- function upscaleImageResponseFromVertex(fromObject) {
14736
+ function upscaleImageResponseFromVertex(fromObject, rootObject) {
14644
14737
  const toObject = {};
14645
14738
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14646
14739
  'sdkHttpResponse',
@@ -14662,7 +14755,7 @@ function upscaleImageResponseFromVertex(fromObject) {
14662
14755
  }
14663
14756
  return toObject;
14664
14757
  }
14665
- function videoFromMldev(fromObject) {
14758
+ function videoFromMldev(fromObject, _rootObject) {
14666
14759
  const toObject = {};
14667
14760
  const fromUri = getValueByPath(fromObject, ['uri']);
14668
14761
  if (fromUri != null) {
@@ -14678,7 +14771,7 @@ function videoFromMldev(fromObject) {
14678
14771
  }
14679
14772
  return toObject;
14680
14773
  }
14681
- function videoFromVertex(fromObject) {
14774
+ function videoFromVertex(fromObject, _rootObject) {
14682
14775
  const toObject = {};
14683
14776
  const fromUri = getValueByPath(fromObject, ['gcsUri']);
14684
14777
  if (fromUri != null) {
@@ -14696,7 +14789,7 @@ function videoFromVertex(fromObject) {
14696
14789
  }
14697
14790
  return toObject;
14698
14791
  }
14699
- function videoGenerationMaskToVertex(fromObject) {
14792
+ function videoGenerationMaskToVertex(fromObject, rootObject) {
14700
14793
  const toObject = {};
14701
14794
  const fromImage = getValueByPath(fromObject, ['image']);
14702
14795
  if (fromImage != null) {
@@ -14708,7 +14801,7 @@ function videoGenerationMaskToVertex(fromObject) {
14708
14801
  }
14709
14802
  return toObject;
14710
14803
  }
14711
- function videoGenerationReferenceImageToMldev(fromObject) {
14804
+ function videoGenerationReferenceImageToMldev(fromObject, rootObject) {
14712
14805
  const toObject = {};
14713
14806
  const fromImage = getValueByPath(fromObject, ['image']);
14714
14807
  if (fromImage != null) {
@@ -14722,7 +14815,7 @@ function videoGenerationReferenceImageToMldev(fromObject) {
14722
14815
  }
14723
14816
  return toObject;
14724
14817
  }
14725
- function videoGenerationReferenceImageToVertex(fromObject) {
14818
+ function videoGenerationReferenceImageToVertex(fromObject, rootObject) {
14726
14819
  const toObject = {};
14727
14820
  const fromImage = getValueByPath(fromObject, ['image']);
14728
14821
  if (fromImage != null) {
@@ -14736,7 +14829,7 @@ function videoGenerationReferenceImageToVertex(fromObject) {
14736
14829
  }
14737
14830
  return toObject;
14738
14831
  }
14739
- function videoToMldev(fromObject) {
14832
+ function videoToMldev(fromObject, _rootObject) {
14740
14833
  const toObject = {};
14741
14834
  const fromUri = getValueByPath(fromObject, ['uri']);
14742
14835
  if (fromUri != null) {
@@ -14752,7 +14845,7 @@ function videoToMldev(fromObject) {
14752
14845
  }
14753
14846
  return toObject;
14754
14847
  }
14755
- function videoToVertex(fromObject) {
14848
+ function videoToVertex(fromObject, _rootObject) {
14756
14849
  const toObject = {};
14757
14850
  const fromUri = getValueByPath(fromObject, ['uri']);
14758
14851
  if (fromUri != null) {
@@ -16308,7 +16401,7 @@ class Models extends BaseModule {
16308
16401
  _c = apiResponse_1_1.value;
16309
16402
  _d = false;
16310
16403
  const chunk = _c;
16311
- const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
16404
+ const resp = generateContentResponseFromVertex((yield __await(chunk.json())), params);
16312
16405
  resp['sdkHttpResponse'] = {
16313
16406
  headers: chunk.headers,
16314
16407
  };
@@ -16350,7 +16443,7 @@ class Models extends BaseModule {
16350
16443
  _c = apiResponse_2_1.value;
16351
16444
  _d = false;
16352
16445
  const chunk = _c;
16353
- const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
16446
+ const resp = generateContentResponseFromMldev((yield __await(chunk.json())), params);
16354
16447
  resp['sdkHttpResponse'] = {
16355
16448
  headers: chunk.headers,
16356
16449
  };
@@ -18124,6 +18217,12 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18124
18217
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
18125
18218
  throw new Error('adapterSize parameter is not supported in Gemini API.');
18126
18219
  }
18220
+ if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
18221
+ throw new Error('tuningMode parameter is not supported in Gemini API.');
18222
+ }
18223
+ if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
18224
+ throw new Error('customBaseModel parameter is not supported in Gemini API.');
18225
+ }
18127
18226
  const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18128
18227
  if (parentObject !== undefined && fromBatchSize != null) {
18129
18228
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'batchSize'], fromBatchSize);
@@ -18138,6 +18237,18 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
18138
18237
  if (getValueByPath(fromObject, ['beta']) !== undefined) {
18139
18238
  throw new Error('beta parameter is not supported in Gemini API.');
18140
18239
  }
18240
+ if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
18241
+ throw new Error('baseTeacherModel parameter is not supported in Gemini API.');
18242
+ }
18243
+ if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
18244
+ throw new Error('tunedTeacherModelSource parameter is not supported in Gemini API.');
18245
+ }
18246
+ if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
18247
+ throw new Error('sftLossWeightMultiplier parameter is not supported in Gemini API.');
18248
+ }
18249
+ if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
18250
+ throw new Error('outputUri parameter is not supported in Gemini API.');
18251
+ }
18141
18252
  return toObject;
18142
18253
  }
18143
18254
  function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
@@ -18165,6 +18276,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18165
18276
  setValueByPath(parentObject, ['preferenceOptimizationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18166
18277
  }
18167
18278
  }
18279
+ else if (discriminatorValidationDataset === 'DISTILLATION') {
18280
+ const fromValidationDataset = getValueByPath(fromObject, [
18281
+ 'validationDataset',
18282
+ ]);
18283
+ if (parentObject !== undefined && fromValidationDataset != null) {
18284
+ setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
18285
+ }
18286
+ }
18168
18287
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
18169
18288
  'tunedModelDisplayName',
18170
18289
  ]);
@@ -18194,6 +18313,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18194
18313
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18195
18314
  }
18196
18315
  }
18316
+ else if (discriminatorEpochCount === 'DISTILLATION') {
18317
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
18318
+ if (parentObject !== undefined && fromEpochCount != null) {
18319
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
18320
+ }
18321
+ }
18197
18322
  let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
18198
18323
  'config',
18199
18324
  'method',
@@ -18221,6 +18346,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18221
18346
  ], fromLearningRateMultiplier);
18222
18347
  }
18223
18348
  }
18349
+ else if (discriminatorLearningRateMultiplier === 'DISTILLATION') {
18350
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
18351
+ 'learningRateMultiplier',
18352
+ ]);
18353
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
18354
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
18355
+ }
18356
+ }
18224
18357
  let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
18225
18358
  if (discriminatorExportLastCheckpointOnly === undefined) {
18226
18359
  discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
@@ -18241,6 +18374,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18241
18374
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18242
18375
  }
18243
18376
  }
18377
+ else if (discriminatorExportLastCheckpointOnly === 'DISTILLATION') {
18378
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
18379
+ 'exportLastCheckpointOnly',
18380
+ ]);
18381
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
18382
+ setValueByPath(parentObject, ['distillationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
18383
+ }
18384
+ }
18244
18385
  let discriminatorAdapterSize = getValueByPath(rootObject, [
18245
18386
  'config',
18246
18387
  'method',
@@ -18260,11 +18401,58 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18260
18401
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18261
18402
  }
18262
18403
  }
18263
- if (getValueByPath(fromObject, ['batchSize']) !== undefined) {
18264
- throw new Error('batchSize parameter is not supported in Vertex AI.');
18404
+ else if (discriminatorAdapterSize === 'DISTILLATION') {
18405
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
18406
+ if (parentObject !== undefined && fromAdapterSize != null) {
18407
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
18408
+ }
18265
18409
  }
18266
- if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18267
- throw new Error('learningRate parameter is not supported in Vertex AI.');
18410
+ let discriminatorTuningMode = getValueByPath(rootObject, [
18411
+ 'config',
18412
+ 'method',
18413
+ ]);
18414
+ if (discriminatorTuningMode === undefined) {
18415
+ discriminatorTuningMode = 'SUPERVISED_FINE_TUNING';
18416
+ }
18417
+ if (discriminatorTuningMode === 'SUPERVISED_FINE_TUNING') {
18418
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
18419
+ if (parentObject !== undefined && fromTuningMode != null) {
18420
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
18421
+ }
18422
+ }
18423
+ const fromCustomBaseModel = getValueByPath(fromObject, [
18424
+ 'customBaseModel',
18425
+ ]);
18426
+ if (parentObject !== undefined && fromCustomBaseModel != null) {
18427
+ setValueByPath(parentObject, ['customBaseModel'], fromCustomBaseModel);
18428
+ }
18429
+ let discriminatorBatchSize = getValueByPath(rootObject, [
18430
+ 'config',
18431
+ 'method',
18432
+ ]);
18433
+ if (discriminatorBatchSize === undefined) {
18434
+ discriminatorBatchSize = 'SUPERVISED_FINE_TUNING';
18435
+ }
18436
+ if (discriminatorBatchSize === 'SUPERVISED_FINE_TUNING') {
18437
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
18438
+ if (parentObject !== undefined && fromBatchSize != null) {
18439
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
18440
+ }
18441
+ }
18442
+ let discriminatorLearningRate = getValueByPath(rootObject, [
18443
+ 'config',
18444
+ 'method',
18445
+ ]);
18446
+ if (discriminatorLearningRate === undefined) {
18447
+ discriminatorLearningRate = 'SUPERVISED_FINE_TUNING';
18448
+ }
18449
+ if (discriminatorLearningRate === 'SUPERVISED_FINE_TUNING') {
18450
+ const fromLearningRate = getValueByPath(fromObject, [
18451
+ 'learningRate',
18452
+ ]);
18453
+ if (parentObject !== undefined && fromLearningRate != null) {
18454
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
18455
+ }
18268
18456
  }
18269
18457
  const fromLabels = getValueByPath(fromObject, ['labels']);
18270
18458
  if (parentObject !== undefined && fromLabels != null) {
@@ -18274,6 +18462,28 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18274
18462
  if (parentObject !== undefined && fromBeta != null) {
18275
18463
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'beta'], fromBeta);
18276
18464
  }
18465
+ const fromBaseTeacherModel = getValueByPath(fromObject, [
18466
+ 'baseTeacherModel',
18467
+ ]);
18468
+ if (parentObject !== undefined && fromBaseTeacherModel != null) {
18469
+ setValueByPath(parentObject, ['distillationSpec', 'baseTeacherModel'], fromBaseTeacherModel);
18470
+ }
18471
+ const fromTunedTeacherModelSource = getValueByPath(fromObject, [
18472
+ 'tunedTeacherModelSource',
18473
+ ]);
18474
+ if (parentObject !== undefined && fromTunedTeacherModelSource != null) {
18475
+ setValueByPath(parentObject, ['distillationSpec', 'tunedTeacherModelSource'], fromTunedTeacherModelSource);
18476
+ }
18477
+ const fromSftLossWeightMultiplier = getValueByPath(fromObject, [
18478
+ 'sftLossWeightMultiplier',
18479
+ ]);
18480
+ if (parentObject !== undefined && fromSftLossWeightMultiplier != null) {
18481
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'sftLossWeightMultiplier'], fromSftLossWeightMultiplier);
18482
+ }
18483
+ const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
18484
+ if (parentObject !== undefined && fromOutputUri != null) {
18485
+ setValueByPath(parentObject, ['outputUri'], fromOutputUri);
18486
+ }
18277
18487
  return toObject;
18278
18488
  }
18279
18489
  function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
@@ -18493,6 +18703,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18493
18703
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromGcsUri);
18494
18704
  }
18495
18705
  }
18706
+ else if (discriminatorGcsUri === 'DISTILLATION') {
18707
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
18708
+ if (parentObject !== undefined && fromGcsUri != null) {
18709
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
18710
+ }
18711
+ }
18496
18712
  let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
18497
18713
  'config',
18498
18714
  'method',
@@ -18516,6 +18732,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
18516
18732
  setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
18517
18733
  }
18518
18734
  }
18735
+ else if (discriminatorVertexDatasetResource === 'DISTILLATION') {
18736
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
18737
+ 'vertexDatasetResource',
18738
+ ]);
18739
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
18740
+ setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
18741
+ }
18742
+ }
18519
18743
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
18520
18744
  throw new Error('examples parameter is not supported in Vertex AI.');
18521
18745
  }
@@ -18639,6 +18863,12 @@ function tuningJobFromVertex(fromObject, _rootObject) {
18639
18863
  if (fromPreferenceOptimizationSpec != null) {
18640
18864
  setValueByPath(toObject, ['preferenceOptimizationSpec'], fromPreferenceOptimizationSpec);
18641
18865
  }
18866
+ const fromDistillationSpec = getValueByPath(fromObject, [
18867
+ 'distillationSpec',
18868
+ ]);
18869
+ if (fromDistillationSpec != null) {
18870
+ setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
18871
+ }
18642
18872
  const fromTuningDataStats = getValueByPath(fromObject, [
18643
18873
  'tuningDataStats',
18644
18874
  ]);
@@ -19237,5 +19467,5 @@ class GoogleGenAI {
19237
19467
  }
19238
19468
  }
19239
19469
 
19240
- 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 };
19470
+ 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 };
19241
19471
  //# sourceMappingURL=index.mjs.map