@google/genai 1.18.0 → 1.19.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.
@@ -1517,6 +1517,8 @@ export declare interface CreateTuningJobConfig {
1517
1517
  batchSize?: number;
1518
1518
  /** The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. */
1519
1519
  learningRate?: number;
1520
+ /** Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */
1521
+ labels?: Record<string, string>;
1520
1522
  }
1521
1523
 
1522
1524
  /** Supervised fine-tuning job creation parameters - optional fields. */
@@ -2949,6 +2951,8 @@ export declare interface GenerateVideosConfig {
2949
2951
  be associated with a type. Veo 2 supports up to 3 asset images *or* 1
2950
2952
  style image. */
2951
2953
  referenceImages?: VideoGenerationReferenceImage[];
2954
+ /** The mask to use for generating videos. */
2955
+ mask?: VideoGenerationMask;
2952
2956
  /** Compression quality of the generated videos. */
2953
2957
  compressionQuality?: VideoCompressionQuality;
2954
2958
  }
@@ -2965,13 +2969,13 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
2965
2969
  error?: Record<string, unknown>;
2966
2970
  /** The generated videos. */
2967
2971
  response?: GenerateVideosResponse;
2968
- /** The full HTTP response. */
2969
- sdkHttpResponse?: HttpResponse;
2970
2972
  /**
2971
2973
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2972
2974
  * @internal
2973
2975
  */
2974
2976
  _fromAPIResponse({ apiResponse, isVertexAI, }: OperationFromAPIResponseParameters): Operation<GenerateVideosResponse>;
2977
+ /** The full HTTP response. */
2978
+ sdkHttpResponse?: HttpResponse;
2975
2979
  }
2976
2980
 
2977
2981
  /** Class that represents the parameters for generating videos. */
@@ -7278,6 +7282,7 @@ declare namespace types {
7278
7282
  Video,
7279
7283
  GenerateVideosSource,
7280
7284
  VideoGenerationReferenceImage,
7285
+ VideoGenerationMask,
7281
7286
  GenerateVideosConfig,
7282
7287
  GenerateVideosParameters,
7283
7288
  GeneratedVideo,
@@ -7752,6 +7757,16 @@ export declare enum VideoCompressionQuality {
7752
7757
  LOSSLESS = "LOSSLESS"
7753
7758
  }
7754
7759
 
7760
+ /** A mask for video generation. */
7761
+ export declare interface VideoGenerationMask {
7762
+ /** The image mask to use for generating videos. */
7763
+ image?: Image_2;
7764
+ /** Describes how the mask will be used. Inpainting masks must
7765
+ match the aspect ratio of the input video. Outpainting masks can be
7766
+ either 9:16 or 16:9. */
7767
+ maskMode?: string;
7768
+ }
7769
+
7755
7770
  /** A reference image for video generation. */
7756
7771
  export declare interface VideoGenerationReferenceImage {
7757
7772
  /** The reference image. */
@@ -213,6 +213,216 @@ function tBytes$1(fromBytes) {
213
213
  * SPDX-License-Identifier: Apache-2.0
214
214
  */
215
215
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
216
+ function getOperationParametersToMldev(fromObject) {
217
+ const toObject = {};
218
+ const fromOperationName = getValueByPath(fromObject, [
219
+ 'operationName',
220
+ ]);
221
+ if (fromOperationName != null) {
222
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
223
+ }
224
+ const fromConfig = getValueByPath(fromObject, ['config']);
225
+ if (fromConfig != null) {
226
+ setValueByPath(toObject, ['config'], fromConfig);
227
+ }
228
+ return toObject;
229
+ }
230
+ function fetchPredictOperationParametersToVertex(fromObject) {
231
+ const toObject = {};
232
+ const fromOperationName = getValueByPath(fromObject, [
233
+ 'operationName',
234
+ ]);
235
+ if (fromOperationName != null) {
236
+ setValueByPath(toObject, ['operationName'], fromOperationName);
237
+ }
238
+ const fromResourceName = getValueByPath(fromObject, ['resourceName']);
239
+ if (fromResourceName != null) {
240
+ setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
241
+ }
242
+ const fromConfig = getValueByPath(fromObject, ['config']);
243
+ if (fromConfig != null) {
244
+ setValueByPath(toObject, ['config'], fromConfig);
245
+ }
246
+ return toObject;
247
+ }
248
+ function getOperationParametersToVertex(fromObject) {
249
+ const toObject = {};
250
+ const fromOperationName = getValueByPath(fromObject, [
251
+ 'operationName',
252
+ ]);
253
+ if (fromOperationName != null) {
254
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
255
+ }
256
+ const fromConfig = getValueByPath(fromObject, ['config']);
257
+ if (fromConfig != null) {
258
+ setValueByPath(toObject, ['config'], fromConfig);
259
+ }
260
+ return toObject;
261
+ }
262
+ function videoFromMldev$1(fromObject) {
263
+ const toObject = {};
264
+ const fromUri = getValueByPath(fromObject, ['video', 'uri']);
265
+ if (fromUri != null) {
266
+ setValueByPath(toObject, ['uri'], fromUri);
267
+ }
268
+ const fromVideoBytes = getValueByPath(fromObject, [
269
+ 'video',
270
+ 'encodedVideo',
271
+ ]);
272
+ if (fromVideoBytes != null) {
273
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
274
+ }
275
+ const fromMimeType = getValueByPath(fromObject, ['encoding']);
276
+ if (fromMimeType != null) {
277
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
278
+ }
279
+ return toObject;
280
+ }
281
+ function generatedVideoFromMldev$1(fromObject) {
282
+ const toObject = {};
283
+ const fromVideo = getValueByPath(fromObject, ['_self']);
284
+ if (fromVideo != null) {
285
+ setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
286
+ }
287
+ return toObject;
288
+ }
289
+ function generateVideosResponseFromMldev$1(fromObject) {
290
+ const toObject = {};
291
+ const fromGeneratedVideos = getValueByPath(fromObject, [
292
+ 'generatedSamples',
293
+ ]);
294
+ if (fromGeneratedVideos != null) {
295
+ let transformedList = fromGeneratedVideos;
296
+ if (Array.isArray(transformedList)) {
297
+ transformedList = transformedList.map((item) => {
298
+ return generatedVideoFromMldev$1(item);
299
+ });
300
+ }
301
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
302
+ }
303
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
304
+ 'raiMediaFilteredCount',
305
+ ]);
306
+ if (fromRaiMediaFilteredCount != null) {
307
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
308
+ }
309
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
310
+ 'raiMediaFilteredReasons',
311
+ ]);
312
+ if (fromRaiMediaFilteredReasons != null) {
313
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
314
+ }
315
+ return toObject;
316
+ }
317
+ function generateVideosOperationFromMldev$1(fromObject) {
318
+ const toObject = {};
319
+ const fromName = getValueByPath(fromObject, ['name']);
320
+ if (fromName != null) {
321
+ setValueByPath(toObject, ['name'], fromName);
322
+ }
323
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
324
+ if (fromMetadata != null) {
325
+ setValueByPath(toObject, ['metadata'], fromMetadata);
326
+ }
327
+ const fromDone = getValueByPath(fromObject, ['done']);
328
+ if (fromDone != null) {
329
+ setValueByPath(toObject, ['done'], fromDone);
330
+ }
331
+ const fromError = getValueByPath(fromObject, ['error']);
332
+ if (fromError != null) {
333
+ setValueByPath(toObject, ['error'], fromError);
334
+ }
335
+ const fromResponse = getValueByPath(fromObject, [
336
+ 'response',
337
+ 'generateVideoResponse',
338
+ ]);
339
+ if (fromResponse != null) {
340
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
341
+ }
342
+ return toObject;
343
+ }
344
+ function videoFromVertex$1(fromObject) {
345
+ const toObject = {};
346
+ const fromUri = getValueByPath(fromObject, ['gcsUri']);
347
+ if (fromUri != null) {
348
+ setValueByPath(toObject, ['uri'], fromUri);
349
+ }
350
+ const fromVideoBytes = getValueByPath(fromObject, [
351
+ 'bytesBase64Encoded',
352
+ ]);
353
+ if (fromVideoBytes != null) {
354
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
355
+ }
356
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
357
+ if (fromMimeType != null) {
358
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
359
+ }
360
+ return toObject;
361
+ }
362
+ function generatedVideoFromVertex$1(fromObject) {
363
+ const toObject = {};
364
+ const fromVideo = getValueByPath(fromObject, ['_self']);
365
+ if (fromVideo != null) {
366
+ setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
367
+ }
368
+ return toObject;
369
+ }
370
+ function generateVideosResponseFromVertex$1(fromObject) {
371
+ const toObject = {};
372
+ const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
373
+ if (fromGeneratedVideos != null) {
374
+ let transformedList = fromGeneratedVideos;
375
+ if (Array.isArray(transformedList)) {
376
+ transformedList = transformedList.map((item) => {
377
+ return generatedVideoFromVertex$1(item);
378
+ });
379
+ }
380
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
381
+ }
382
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
383
+ 'raiMediaFilteredCount',
384
+ ]);
385
+ if (fromRaiMediaFilteredCount != null) {
386
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
387
+ }
388
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
389
+ 'raiMediaFilteredReasons',
390
+ ]);
391
+ if (fromRaiMediaFilteredReasons != null) {
392
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
393
+ }
394
+ return toObject;
395
+ }
396
+ function generateVideosOperationFromVertex$1(fromObject) {
397
+ const toObject = {};
398
+ const fromName = getValueByPath(fromObject, ['name']);
399
+ if (fromName != null) {
400
+ setValueByPath(toObject, ['name'], fromName);
401
+ }
402
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
403
+ if (fromMetadata != null) {
404
+ setValueByPath(toObject, ['metadata'], fromMetadata);
405
+ }
406
+ const fromDone = getValueByPath(fromObject, ['done']);
407
+ if (fromDone != null) {
408
+ setValueByPath(toObject, ['done'], fromDone);
409
+ }
410
+ const fromError = getValueByPath(fromObject, ['error']);
411
+ if (fromError != null) {
412
+ setValueByPath(toObject, ['error'], fromError);
413
+ }
414
+ const fromResponse = getValueByPath(fromObject, ['response']);
415
+ if (fromResponse != null) {
416
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
417
+ }
418
+ return toObject;
419
+ }
420
+
421
+ /**
422
+ * @license
423
+ * Copyright 2025 Google LLC
424
+ * SPDX-License-Identifier: Apache-2.0
425
+ */
216
426
  /** Required. Outcome of the code execution. */
217
427
  var Outcome;
218
428
  (function (Outcome) {
@@ -1604,54 +1814,15 @@ class GenerateVideosOperation {
1604
1814
  */
1605
1815
  _fromAPIResponse({ apiResponse, isVertexAI, }) {
1606
1816
  const operation = new GenerateVideosOperation();
1607
- operation.name = apiResponse['name'];
1608
- operation.metadata = apiResponse['metadata'];
1609
- operation.done = apiResponse['done'];
1610
- operation.error = apiResponse['error'];
1817
+ let response;
1818
+ const op = apiResponse;
1611
1819
  if (isVertexAI) {
1612
- const response = apiResponse['response'];
1613
- if (response) {
1614
- const operationResponse = new GenerateVideosResponse();
1615
- const responseVideos = response['videos'];
1616
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1617
- return {
1618
- video: {
1619
- uri: generatedVideo['gcsUri'],
1620
- videoBytes: generatedVideo['bytesBase64Encoded']
1621
- ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1622
- : undefined,
1623
- mimeType: generatedVideo['mimeType'],
1624
- },
1625
- };
1626
- });
1627
- operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1628
- operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1629
- operation.response = operationResponse;
1630
- }
1820
+ response = generateVideosOperationFromVertex$1(op);
1631
1821
  }
1632
1822
  else {
1633
- const response = apiResponse['response'];
1634
- if (response) {
1635
- const operationResponse = new GenerateVideosResponse();
1636
- const generatedVideoResponse = response['generateVideoResponse'];
1637
- const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1638
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1639
- const video = generatedVideo['video'];
1640
- return {
1641
- video: {
1642
- uri: video === null || video === void 0 ? void 0 : video['uri'],
1643
- videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1644
- ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1645
- : undefined,
1646
- mimeType: generatedVideo['encoding'],
1647
- },
1648
- };
1649
- });
1650
- operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
1651
- operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
1652
- operation.response = operationResponse;
1653
- }
1823
+ response = generateVideosOperationFromMldev$1(op);
1654
1824
  }
1825
+ Object.assign(operation, response);
1655
1826
  return operation;
1656
1827
  }
1657
1828
  }
@@ -5628,8 +5799,9 @@ function fileDataToVertex$2(fromObject) {
5628
5799
  }
5629
5800
  function functionCallToVertex$2(fromObject) {
5630
5801
  const toObject = {};
5631
- if (getValueByPath(fromObject, ['id']) !== undefined) {
5632
- throw new Error('id parameter is not supported in Vertex AI.');
5802
+ const fromId = getValueByPath(fromObject, ['id']);
5803
+ if (fromId != null) {
5804
+ setValueByPath(toObject, ['id'], fromId);
5633
5805
  }
5634
5806
  const fromArgs = getValueByPath(fromObject, ['args']);
5635
5807
  if (fromArgs != null) {
@@ -8434,8 +8606,9 @@ function fileDataToVertex$1(fromObject) {
8434
8606
  }
8435
8607
  function functionCallToVertex$1(fromObject) {
8436
8608
  const toObject = {};
8437
- if (getValueByPath(fromObject, ['id']) !== undefined) {
8438
- throw new Error('id parameter is not supported in Vertex AI.');
8609
+ const fromId = getValueByPath(fromObject, ['id']);
8610
+ if (fromId != null) {
8611
+ setValueByPath(toObject, ['id'], fromId);
8439
8612
  }
8440
8613
  const fromArgs = getValueByPath(fromObject, ['args']);
8441
8614
  if (fromArgs != null) {
@@ -9632,6 +9805,10 @@ function fileDataFromVertex$1(fromObject) {
9632
9805
  }
9633
9806
  function functionCallFromVertex$1(fromObject) {
9634
9807
  const toObject = {};
9808
+ const fromId = getValueByPath(fromObject, ['id']);
9809
+ if (fromId != null) {
9810
+ setValueByPath(toObject, ['id'], fromId);
9811
+ }
9635
9812
  const fromArgs = getValueByPath(fromObject, ['args']);
9636
9813
  if (fromArgs != null) {
9637
9814
  setValueByPath(toObject, ['args'], fromArgs);
@@ -11014,6 +11191,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
11014
11191
  if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
11015
11192
  throw new Error('referenceImages parameter is not supported in Gemini API.');
11016
11193
  }
11194
+ if (getValueByPath(fromObject, ['mask']) !== undefined) {
11195
+ throw new Error('mask parameter is not supported in Gemini API.');
11196
+ }
11017
11197
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
11018
11198
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
11019
11199
  }
@@ -11096,8 +11276,9 @@ function fileDataToVertex(fromObject) {
11096
11276
  }
11097
11277
  function functionCallToVertex(fromObject) {
11098
11278
  const toObject = {};
11099
- if (getValueByPath(fromObject, ['id']) !== undefined) {
11100
- throw new Error('id parameter is not supported in Vertex AI.');
11279
+ const fromId = getValueByPath(fromObject, ['id']);
11280
+ if (fromId != null) {
11281
+ setValueByPath(toObject, ['id'], fromId);
11101
11282
  }
11102
11283
  const fromArgs = getValueByPath(fromObject, ['args']);
11103
11284
  if (fromArgs != null) {
@@ -12621,6 +12802,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
12621
12802
  }
12622
12803
  return toObject;
12623
12804
  }
12805
+ function videoGenerationMaskToVertex(fromObject) {
12806
+ const toObject = {};
12807
+ const fromImage = getValueByPath(fromObject, ['image']);
12808
+ if (fromImage != null) {
12809
+ setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
12810
+ }
12811
+ const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
12812
+ if (fromMaskMode != null) {
12813
+ setValueByPath(toObject, ['maskMode'], fromMaskMode);
12814
+ }
12815
+ return toObject;
12816
+ }
12624
12817
  function generateVideosConfigToVertex(fromObject, parentObject) {
12625
12818
  const toObject = {};
12626
12819
  const fromNumberOfVideos = getValueByPath(fromObject, [
@@ -12699,6 +12892,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
12699
12892
  }
12700
12893
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
12701
12894
  }
12895
+ const fromMask = getValueByPath(fromObject, ['mask']);
12896
+ if (parentObject !== undefined && fromMask != null) {
12897
+ setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
12898
+ }
12702
12899
  const fromCompressionQuality = getValueByPath(fromObject, [
12703
12900
  'compressionQuality',
12704
12901
  ]);
@@ -13357,6 +13554,10 @@ function fileDataFromVertex(fromObject) {
13357
13554
  }
13358
13555
  function functionCallFromVertex(fromObject) {
13359
13556
  const toObject = {};
13557
+ const fromId = getValueByPath(fromObject, ['id']);
13558
+ if (fromId != null) {
13559
+ setValueByPath(toObject, ['id'], fromId);
13560
+ }
13360
13561
  const fromArgs = getValueByPath(fromObject, ['args']);
13361
13562
  if (fromArgs != null) {
13362
13563
  setValueByPath(toObject, ['args'], fromArgs);
@@ -14083,7 +14284,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
14083
14284
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
14084
14285
  const USER_AGENT_HEADER = 'User-Agent';
14085
14286
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
14086
- const SDK_VERSION = '1.18.0'; // x-release-please-version
14287
+ const SDK_VERSION = '1.19.0'; // x-release-please-version
14087
14288
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
14088
14289
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
14089
14290
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -17068,59 +17269,6 @@ class Models extends BaseModule {
17068
17269
  }
17069
17270
  }
17070
17271
 
17071
- /**
17072
- * @license
17073
- * Copyright 2025 Google LLC
17074
- * SPDX-License-Identifier: Apache-2.0
17075
- */
17076
- // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17077
- function getOperationParametersToMldev(fromObject) {
17078
- const toObject = {};
17079
- const fromOperationName = getValueByPath(fromObject, [
17080
- 'operationName',
17081
- ]);
17082
- if (fromOperationName != null) {
17083
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17084
- }
17085
- const fromConfig = getValueByPath(fromObject, ['config']);
17086
- if (fromConfig != null) {
17087
- setValueByPath(toObject, ['config'], fromConfig);
17088
- }
17089
- return toObject;
17090
- }
17091
- function fetchPredictOperationParametersToVertex(fromObject) {
17092
- const toObject = {};
17093
- const fromOperationName = getValueByPath(fromObject, [
17094
- 'operationName',
17095
- ]);
17096
- if (fromOperationName != null) {
17097
- setValueByPath(toObject, ['operationName'], fromOperationName);
17098
- }
17099
- const fromResourceName = getValueByPath(fromObject, ['resourceName']);
17100
- if (fromResourceName != null) {
17101
- setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
17102
- }
17103
- const fromConfig = getValueByPath(fromObject, ['config']);
17104
- if (fromConfig != null) {
17105
- setValueByPath(toObject, ['config'], fromConfig);
17106
- }
17107
- return toObject;
17108
- }
17109
- function getOperationParametersToVertex(fromObject) {
17110
- const toObject = {};
17111
- const fromOperationName = getValueByPath(fromObject, [
17112
- 'operationName',
17113
- ]);
17114
- if (fromOperationName != null) {
17115
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17116
- }
17117
- const fromConfig = getValueByPath(fromObject, ['config']);
17118
- if (fromConfig != null) {
17119
- setValueByPath(toObject, ['config'], fromConfig);
17120
- }
17121
- return toObject;
17122
- }
17123
-
17124
17272
  /**
17125
17273
  * @license
17126
17274
  * Copyright 2025 Google LLC
@@ -18302,6 +18450,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
18302
18450
  if (parentObject !== undefined && fromLearningRate != null) {
18303
18451
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
18304
18452
  }
18453
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
18454
+ throw new Error('labels parameter is not supported in Gemini API.');
18455
+ }
18305
18456
  return toObject;
18306
18457
  }
18307
18458
  function createTuningJobParametersPrivateToMldev(fromObject) {
@@ -18457,6 +18608,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
18457
18608
  if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18458
18609
  throw new Error('learningRate parameter is not supported in Vertex AI.');
18459
18610
  }
18611
+ const fromLabels = getValueByPath(fromObject, ['labels']);
18612
+ if (parentObject !== undefined && fromLabels != null) {
18613
+ setValueByPath(parentObject, ['labels'], fromLabels);
18614
+ }
18460
18615
  return toObject;
18461
18616
  }
18462
18617
  function createTuningJobParametersPrivateToVertex(fromObject) {