@google/genai 1.18.0 → 1.20.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.
@@ -241,6 +241,216 @@ function tBytes$1(fromBytes) {
241
241
  * SPDX-License-Identifier: Apache-2.0
242
242
  */
243
243
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
244
+ function getOperationParametersToMldev(fromObject) {
245
+ const toObject = {};
246
+ const fromOperationName = getValueByPath(fromObject, [
247
+ 'operationName',
248
+ ]);
249
+ if (fromOperationName != null) {
250
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
251
+ }
252
+ const fromConfig = getValueByPath(fromObject, ['config']);
253
+ if (fromConfig != null) {
254
+ setValueByPath(toObject, ['config'], fromConfig);
255
+ }
256
+ return toObject;
257
+ }
258
+ function fetchPredictOperationParametersToVertex(fromObject) {
259
+ const toObject = {};
260
+ const fromOperationName = getValueByPath(fromObject, [
261
+ 'operationName',
262
+ ]);
263
+ if (fromOperationName != null) {
264
+ setValueByPath(toObject, ['operationName'], fromOperationName);
265
+ }
266
+ const fromResourceName = getValueByPath(fromObject, ['resourceName']);
267
+ if (fromResourceName != null) {
268
+ setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
269
+ }
270
+ const fromConfig = getValueByPath(fromObject, ['config']);
271
+ if (fromConfig != null) {
272
+ setValueByPath(toObject, ['config'], fromConfig);
273
+ }
274
+ return toObject;
275
+ }
276
+ function getOperationParametersToVertex(fromObject) {
277
+ const toObject = {};
278
+ const fromOperationName = getValueByPath(fromObject, [
279
+ 'operationName',
280
+ ]);
281
+ if (fromOperationName != null) {
282
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
283
+ }
284
+ const fromConfig = getValueByPath(fromObject, ['config']);
285
+ if (fromConfig != null) {
286
+ setValueByPath(toObject, ['config'], fromConfig);
287
+ }
288
+ return toObject;
289
+ }
290
+ function videoFromMldev$1(fromObject) {
291
+ const toObject = {};
292
+ const fromUri = getValueByPath(fromObject, ['video', 'uri']);
293
+ if (fromUri != null) {
294
+ setValueByPath(toObject, ['uri'], fromUri);
295
+ }
296
+ const fromVideoBytes = getValueByPath(fromObject, [
297
+ 'video',
298
+ 'encodedVideo',
299
+ ]);
300
+ if (fromVideoBytes != null) {
301
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
302
+ }
303
+ const fromMimeType = getValueByPath(fromObject, ['encoding']);
304
+ if (fromMimeType != null) {
305
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
306
+ }
307
+ return toObject;
308
+ }
309
+ function generatedVideoFromMldev$1(fromObject) {
310
+ const toObject = {};
311
+ const fromVideo = getValueByPath(fromObject, ['_self']);
312
+ if (fromVideo != null) {
313
+ setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
314
+ }
315
+ return toObject;
316
+ }
317
+ function generateVideosResponseFromMldev$1(fromObject) {
318
+ const toObject = {};
319
+ const fromGeneratedVideos = getValueByPath(fromObject, [
320
+ 'generatedSamples',
321
+ ]);
322
+ if (fromGeneratedVideos != null) {
323
+ let transformedList = fromGeneratedVideos;
324
+ if (Array.isArray(transformedList)) {
325
+ transformedList = transformedList.map((item) => {
326
+ return generatedVideoFromMldev$1(item);
327
+ });
328
+ }
329
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
330
+ }
331
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
332
+ 'raiMediaFilteredCount',
333
+ ]);
334
+ if (fromRaiMediaFilteredCount != null) {
335
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
336
+ }
337
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
338
+ 'raiMediaFilteredReasons',
339
+ ]);
340
+ if (fromRaiMediaFilteredReasons != null) {
341
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
342
+ }
343
+ return toObject;
344
+ }
345
+ function generateVideosOperationFromMldev$1(fromObject) {
346
+ const toObject = {};
347
+ const fromName = getValueByPath(fromObject, ['name']);
348
+ if (fromName != null) {
349
+ setValueByPath(toObject, ['name'], fromName);
350
+ }
351
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
352
+ if (fromMetadata != null) {
353
+ setValueByPath(toObject, ['metadata'], fromMetadata);
354
+ }
355
+ const fromDone = getValueByPath(fromObject, ['done']);
356
+ if (fromDone != null) {
357
+ setValueByPath(toObject, ['done'], fromDone);
358
+ }
359
+ const fromError = getValueByPath(fromObject, ['error']);
360
+ if (fromError != null) {
361
+ setValueByPath(toObject, ['error'], fromError);
362
+ }
363
+ const fromResponse = getValueByPath(fromObject, [
364
+ 'response',
365
+ 'generateVideoResponse',
366
+ ]);
367
+ if (fromResponse != null) {
368
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
369
+ }
370
+ return toObject;
371
+ }
372
+ function videoFromVertex$1(fromObject) {
373
+ const toObject = {};
374
+ const fromUri = getValueByPath(fromObject, ['gcsUri']);
375
+ if (fromUri != null) {
376
+ setValueByPath(toObject, ['uri'], fromUri);
377
+ }
378
+ const fromVideoBytes = getValueByPath(fromObject, [
379
+ 'bytesBase64Encoded',
380
+ ]);
381
+ if (fromVideoBytes != null) {
382
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
383
+ }
384
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
385
+ if (fromMimeType != null) {
386
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
387
+ }
388
+ return toObject;
389
+ }
390
+ function generatedVideoFromVertex$1(fromObject) {
391
+ const toObject = {};
392
+ const fromVideo = getValueByPath(fromObject, ['_self']);
393
+ if (fromVideo != null) {
394
+ setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
395
+ }
396
+ return toObject;
397
+ }
398
+ function generateVideosResponseFromVertex$1(fromObject) {
399
+ const toObject = {};
400
+ const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
401
+ if (fromGeneratedVideos != null) {
402
+ let transformedList = fromGeneratedVideos;
403
+ if (Array.isArray(transformedList)) {
404
+ transformedList = transformedList.map((item) => {
405
+ return generatedVideoFromVertex$1(item);
406
+ });
407
+ }
408
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
409
+ }
410
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
411
+ 'raiMediaFilteredCount',
412
+ ]);
413
+ if (fromRaiMediaFilteredCount != null) {
414
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
415
+ }
416
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
417
+ 'raiMediaFilteredReasons',
418
+ ]);
419
+ if (fromRaiMediaFilteredReasons != null) {
420
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
421
+ }
422
+ return toObject;
423
+ }
424
+ function generateVideosOperationFromVertex$1(fromObject) {
425
+ const toObject = {};
426
+ const fromName = getValueByPath(fromObject, ['name']);
427
+ if (fromName != null) {
428
+ setValueByPath(toObject, ['name'], fromName);
429
+ }
430
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
431
+ if (fromMetadata != null) {
432
+ setValueByPath(toObject, ['metadata'], fromMetadata);
433
+ }
434
+ const fromDone = getValueByPath(fromObject, ['done']);
435
+ if (fromDone != null) {
436
+ setValueByPath(toObject, ['done'], fromDone);
437
+ }
438
+ const fromError = getValueByPath(fromObject, ['error']);
439
+ if (fromError != null) {
440
+ setValueByPath(toObject, ['error'], fromError);
441
+ }
442
+ const fromResponse = getValueByPath(fromObject, ['response']);
443
+ if (fromResponse != null) {
444
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
445
+ }
446
+ return toObject;
447
+ }
448
+
449
+ /**
450
+ * @license
451
+ * Copyright 2025 Google LLC
452
+ * SPDX-License-Identifier: Apache-2.0
453
+ */
244
454
  /** Required. Outcome of the code execution. */
245
455
  exports.Outcome = void 0;
246
456
  (function (Outcome) {
@@ -962,6 +1172,33 @@ exports.VideoGenerationReferenceType = void 0;
962
1172
  */
963
1173
  VideoGenerationReferenceType["STYLE"] = "STYLE";
964
1174
  })(exports.VideoGenerationReferenceType || (exports.VideoGenerationReferenceType = {}));
1175
+ /** Enum for the mask mode of a video generation mask. */
1176
+ exports.VideoGenerationMaskMode = void 0;
1177
+ (function (VideoGenerationMaskMode) {
1178
+ /**
1179
+ * The image mask contains a masked rectangular region which is
1180
+ applied on the first frame of the input video. The object described in
1181
+ the prompt is inserted into this region and will appear in subsequent
1182
+ frames.
1183
+ */
1184
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1185
+ /**
1186
+ * The image mask is used to determine an object in the
1187
+ first video frame to track. This object is removed from the video.
1188
+ */
1189
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1190
+ /**
1191
+ * The image mask is used to determine a region in the
1192
+ video. Objects in this region will be removed.
1193
+ */
1194
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1195
+ /**
1196
+ * The image mask contains a masked rectangular region where
1197
+ the input video will go. The remaining area will be generated. Video
1198
+ masks are not supported.
1199
+ */
1200
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1201
+ })(exports.VideoGenerationMaskMode || (exports.VideoGenerationMaskMode = {}));
965
1202
  /** Enum that controls the compression quality of the generated videos. */
966
1203
  exports.VideoCompressionQuality = void 0;
967
1204
  (function (VideoCompressionQuality) {
@@ -991,6 +1228,26 @@ exports.FileSource = void 0;
991
1228
  FileSource["UPLOADED"] = "UPLOADED";
992
1229
  FileSource["GENERATED"] = "GENERATED";
993
1230
  })(exports.FileSource || (exports.FileSource = {}));
1231
+ /** The reason why the turn is complete. */
1232
+ exports.TurnCompleteReason = void 0;
1233
+ (function (TurnCompleteReason) {
1234
+ /**
1235
+ * Default value. Reason is unspecified.
1236
+ */
1237
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1238
+ /**
1239
+ * The function call generated by the model is invalid.
1240
+ */
1241
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1242
+ /**
1243
+ * The response is rejected by the model.
1244
+ */
1245
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1246
+ /**
1247
+ * Needs more input from the user.
1248
+ */
1249
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1250
+ })(exports.TurnCompleteReason || (exports.TurnCompleteReason = {}));
994
1251
  /** Server content modalities. */
995
1252
  exports.MediaModality = void 0;
996
1253
  (function (MediaModality) {
@@ -1632,54 +1889,15 @@ class GenerateVideosOperation {
1632
1889
  */
1633
1890
  _fromAPIResponse({ apiResponse, isVertexAI, }) {
1634
1891
  const operation = new GenerateVideosOperation();
1635
- operation.name = apiResponse['name'];
1636
- operation.metadata = apiResponse['metadata'];
1637
- operation.done = apiResponse['done'];
1638
- operation.error = apiResponse['error'];
1892
+ let response;
1893
+ const op = apiResponse;
1639
1894
  if (isVertexAI) {
1640
- const response = apiResponse['response'];
1641
- if (response) {
1642
- const operationResponse = new GenerateVideosResponse();
1643
- const responseVideos = response['videos'];
1644
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1645
- return {
1646
- video: {
1647
- uri: generatedVideo['gcsUri'],
1648
- videoBytes: generatedVideo['bytesBase64Encoded']
1649
- ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1650
- : undefined,
1651
- mimeType: generatedVideo['mimeType'],
1652
- },
1653
- };
1654
- });
1655
- operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1656
- operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1657
- operation.response = operationResponse;
1658
- }
1895
+ response = generateVideosOperationFromVertex$1(op);
1659
1896
  }
1660
1897
  else {
1661
- const response = apiResponse['response'];
1662
- if (response) {
1663
- const operationResponse = new GenerateVideosResponse();
1664
- const generatedVideoResponse = response['generateVideoResponse'];
1665
- const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1666
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1667
- const video = generatedVideo['video'];
1668
- return {
1669
- video: {
1670
- uri: video === null || video === void 0 ? void 0 : video['uri'],
1671
- videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1672
- ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1673
- : undefined,
1674
- mimeType: generatedVideo['encoding'],
1675
- },
1676
- };
1677
- });
1678
- operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
1679
- operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
1680
- operation.response = operationResponse;
1681
- }
1898
+ response = generateVideosOperationFromMldev$1(op);
1682
1899
  }
1900
+ Object.assign(operation, response);
1683
1901
  return operation;
1684
1902
  }
1685
1903
  }
@@ -5656,8 +5874,9 @@ function fileDataToVertex$2(fromObject) {
5656
5874
  }
5657
5875
  function functionCallToVertex$2(fromObject) {
5658
5876
  const toObject = {};
5659
- if (getValueByPath(fromObject, ['id']) !== undefined) {
5660
- throw new Error('id parameter is not supported in Vertex AI.');
5877
+ const fromId = getValueByPath(fromObject, ['id']);
5878
+ if (fromId != null) {
5879
+ setValueByPath(toObject, ['id'], fromId);
5661
5880
  }
5662
5881
  const fromArgs = getValueByPath(fromObject, ['args']);
5663
5882
  if (fromArgs != null) {
@@ -8462,8 +8681,9 @@ function fileDataToVertex$1(fromObject) {
8462
8681
  }
8463
8682
  function functionCallToVertex$1(fromObject) {
8464
8683
  const toObject = {};
8465
- if (getValueByPath(fromObject, ['id']) !== undefined) {
8466
- throw new Error('id parameter is not supported in Vertex AI.');
8684
+ const fromId = getValueByPath(fromObject, ['id']);
8685
+ if (fromId != null) {
8686
+ setValueByPath(toObject, ['id'], fromId);
8467
8687
  }
8468
8688
  const fromArgs = getValueByPath(fromObject, ['args']);
8469
8689
  if (fromArgs != null) {
@@ -9236,6 +9456,18 @@ function liveServerContentFromMldev(fromObject) {
9236
9456
  if (fromUrlContextMetadata != null) {
9237
9457
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9238
9458
  }
9459
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
9460
+ 'turnCompleteReason',
9461
+ ]);
9462
+ if (fromTurnCompleteReason != null) {
9463
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
9464
+ }
9465
+ const fromWaitingForInput = getValueByPath(fromObject, [
9466
+ 'waitingForInput',
9467
+ ]);
9468
+ if (fromWaitingForInput != null) {
9469
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
9470
+ }
9239
9471
  return toObject;
9240
9472
  }
9241
9473
  function liveServerToolCallFromMldev(fromObject) {
@@ -9660,6 +9892,10 @@ function fileDataFromVertex$1(fromObject) {
9660
9892
  }
9661
9893
  function functionCallFromVertex$1(fromObject) {
9662
9894
  const toObject = {};
9895
+ const fromId = getValueByPath(fromObject, ['id']);
9896
+ if (fromId != null) {
9897
+ setValueByPath(toObject, ['id'], fromId);
9898
+ }
9663
9899
  const fromArgs = getValueByPath(fromObject, ['args']);
9664
9900
  if (fromArgs != null) {
9665
9901
  setValueByPath(toObject, ['args'], fromArgs);
@@ -9792,6 +10028,18 @@ function liveServerContentFromVertex(fromObject) {
9792
10028
  if (fromOutputTranscription != null) {
9793
10029
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
9794
10030
  }
10031
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10032
+ 'turnCompleteReason',
10033
+ ]);
10034
+ if (fromTurnCompleteReason != null) {
10035
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10036
+ }
10037
+ const fromWaitingForInput = getValueByPath(fromObject, [
10038
+ 'waitingForInput',
10039
+ ]);
10040
+ if (fromWaitingForInput != null) {
10041
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10042
+ }
9795
10043
  return toObject;
9796
10044
  }
9797
10045
  function liveServerToolCallFromVertex(fromObject) {
@@ -11042,6 +11290,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
11042
11290
  if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
11043
11291
  throw new Error('referenceImages parameter is not supported in Gemini API.');
11044
11292
  }
11293
+ if (getValueByPath(fromObject, ['mask']) !== undefined) {
11294
+ throw new Error('mask parameter is not supported in Gemini API.');
11295
+ }
11045
11296
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
11046
11297
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
11047
11298
  }
@@ -11124,8 +11375,9 @@ function fileDataToVertex(fromObject) {
11124
11375
  }
11125
11376
  function functionCallToVertex(fromObject) {
11126
11377
  const toObject = {};
11127
- if (getValueByPath(fromObject, ['id']) !== undefined) {
11128
- throw new Error('id parameter is not supported in Vertex AI.');
11378
+ const fromId = getValueByPath(fromObject, ['id']);
11379
+ if (fromId != null) {
11380
+ setValueByPath(toObject, ['id'], fromId);
11129
11381
  }
11130
11382
  const fromArgs = getValueByPath(fromObject, ['args']);
11131
11383
  if (fromArgs != null) {
@@ -12649,6 +12901,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
12649
12901
  }
12650
12902
  return toObject;
12651
12903
  }
12904
+ function videoGenerationMaskToVertex(fromObject) {
12905
+ const toObject = {};
12906
+ const fromImage = getValueByPath(fromObject, ['image']);
12907
+ if (fromImage != null) {
12908
+ setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
12909
+ }
12910
+ const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
12911
+ if (fromMaskMode != null) {
12912
+ setValueByPath(toObject, ['maskMode'], fromMaskMode);
12913
+ }
12914
+ return toObject;
12915
+ }
12652
12916
  function generateVideosConfigToVertex(fromObject, parentObject) {
12653
12917
  const toObject = {};
12654
12918
  const fromNumberOfVideos = getValueByPath(fromObject, [
@@ -12727,6 +12991,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
12727
12991
  }
12728
12992
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
12729
12993
  }
12994
+ const fromMask = getValueByPath(fromObject, ['mask']);
12995
+ if (parentObject !== undefined && fromMask != null) {
12996
+ setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
12997
+ }
12730
12998
  const fromCompressionQuality = getValueByPath(fromObject, [
12731
12999
  'compressionQuality',
12732
13000
  ]);
@@ -13385,6 +13653,10 @@ function fileDataFromVertex(fromObject) {
13385
13653
  }
13386
13654
  function functionCallFromVertex(fromObject) {
13387
13655
  const toObject = {};
13656
+ const fromId = getValueByPath(fromObject, ['id']);
13657
+ if (fromId != null) {
13658
+ setValueByPath(toObject, ['id'], fromId);
13659
+ }
13388
13660
  const fromArgs = getValueByPath(fromObject, ['args']);
13389
13661
  if (fromArgs != null) {
13390
13662
  setValueByPath(toObject, ['args'], fromArgs);
@@ -14111,7 +14383,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
14111
14383
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
14112
14384
  const USER_AGENT_HEADER = 'User-Agent';
14113
14385
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
14114
- const SDK_VERSION = '1.18.0'; // x-release-please-version
14386
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
14115
14387
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
14116
14388
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
14117
14389
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -17096,59 +17368,6 @@ class Models extends BaseModule {
17096
17368
  }
17097
17369
  }
17098
17370
 
17099
- /**
17100
- * @license
17101
- * Copyright 2025 Google LLC
17102
- * SPDX-License-Identifier: Apache-2.0
17103
- */
17104
- // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17105
- function getOperationParametersToMldev(fromObject) {
17106
- const toObject = {};
17107
- const fromOperationName = getValueByPath(fromObject, [
17108
- 'operationName',
17109
- ]);
17110
- if (fromOperationName != null) {
17111
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17112
- }
17113
- const fromConfig = getValueByPath(fromObject, ['config']);
17114
- if (fromConfig != null) {
17115
- setValueByPath(toObject, ['config'], fromConfig);
17116
- }
17117
- return toObject;
17118
- }
17119
- function fetchPredictOperationParametersToVertex(fromObject) {
17120
- const toObject = {};
17121
- const fromOperationName = getValueByPath(fromObject, [
17122
- 'operationName',
17123
- ]);
17124
- if (fromOperationName != null) {
17125
- setValueByPath(toObject, ['operationName'], fromOperationName);
17126
- }
17127
- const fromResourceName = getValueByPath(fromObject, ['resourceName']);
17128
- if (fromResourceName != null) {
17129
- setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
17130
- }
17131
- const fromConfig = getValueByPath(fromObject, ['config']);
17132
- if (fromConfig != null) {
17133
- setValueByPath(toObject, ['config'], fromConfig);
17134
- }
17135
- return toObject;
17136
- }
17137
- function getOperationParametersToVertex(fromObject) {
17138
- const toObject = {};
17139
- const fromOperationName = getValueByPath(fromObject, [
17140
- 'operationName',
17141
- ]);
17142
- if (fromOperationName != null) {
17143
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17144
- }
17145
- const fromConfig = getValueByPath(fromObject, ['config']);
17146
- if (fromConfig != null) {
17147
- setValueByPath(toObject, ['config'], fromConfig);
17148
- }
17149
- return toObject;
17150
- }
17151
-
17152
17371
  /**
17153
17372
  * @license
17154
17373
  * Copyright 2025 Google LLC
@@ -18504,6 +18723,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
18504
18723
  if (parentObject !== undefined && fromLearningRate != null) {
18505
18724
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
18506
18725
  }
18726
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
18727
+ throw new Error('labels parameter is not supported in Gemini API.');
18728
+ }
18507
18729
  return toObject;
18508
18730
  }
18509
18731
  function createTuningJobParametersPrivateToMldev(fromObject) {
@@ -18659,6 +18881,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
18659
18881
  if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18660
18882
  throw new Error('learningRate parameter is not supported in Vertex AI.');
18661
18883
  }
18884
+ const fromLabels = getValueByPath(fromObject, ['labels']);
18885
+ if (parentObject !== undefined && fromLabels != null) {
18886
+ setValueByPath(parentObject, ['labels'], fromLabels);
18887
+ }
18662
18888
  return toObject;
18663
18889
  }
18664
18890
  function createTuningJobParametersPrivateToVertex(fromObject) {