@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.
@@ -219,6 +219,216 @@ function tBytes$1(fromBytes) {
219
219
  * SPDX-License-Identifier: Apache-2.0
220
220
  */
221
221
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
222
+ function getOperationParametersToMldev(fromObject) {
223
+ const toObject = {};
224
+ const fromOperationName = getValueByPath(fromObject, [
225
+ 'operationName',
226
+ ]);
227
+ if (fromOperationName != null) {
228
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
229
+ }
230
+ const fromConfig = getValueByPath(fromObject, ['config']);
231
+ if (fromConfig != null) {
232
+ setValueByPath(toObject, ['config'], fromConfig);
233
+ }
234
+ return toObject;
235
+ }
236
+ function fetchPredictOperationParametersToVertex(fromObject) {
237
+ const toObject = {};
238
+ const fromOperationName = getValueByPath(fromObject, [
239
+ 'operationName',
240
+ ]);
241
+ if (fromOperationName != null) {
242
+ setValueByPath(toObject, ['operationName'], fromOperationName);
243
+ }
244
+ const fromResourceName = getValueByPath(fromObject, ['resourceName']);
245
+ if (fromResourceName != null) {
246
+ setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
247
+ }
248
+ const fromConfig = getValueByPath(fromObject, ['config']);
249
+ if (fromConfig != null) {
250
+ setValueByPath(toObject, ['config'], fromConfig);
251
+ }
252
+ return toObject;
253
+ }
254
+ function getOperationParametersToVertex(fromObject) {
255
+ const toObject = {};
256
+ const fromOperationName = getValueByPath(fromObject, [
257
+ 'operationName',
258
+ ]);
259
+ if (fromOperationName != null) {
260
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
261
+ }
262
+ const fromConfig = getValueByPath(fromObject, ['config']);
263
+ if (fromConfig != null) {
264
+ setValueByPath(toObject, ['config'], fromConfig);
265
+ }
266
+ return toObject;
267
+ }
268
+ function videoFromMldev$1(fromObject) {
269
+ const toObject = {};
270
+ const fromUri = getValueByPath(fromObject, ['video', 'uri']);
271
+ if (fromUri != null) {
272
+ setValueByPath(toObject, ['uri'], fromUri);
273
+ }
274
+ const fromVideoBytes = getValueByPath(fromObject, [
275
+ 'video',
276
+ 'encodedVideo',
277
+ ]);
278
+ if (fromVideoBytes != null) {
279
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
280
+ }
281
+ const fromMimeType = getValueByPath(fromObject, ['encoding']);
282
+ if (fromMimeType != null) {
283
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
284
+ }
285
+ return toObject;
286
+ }
287
+ function generatedVideoFromMldev$1(fromObject) {
288
+ const toObject = {};
289
+ const fromVideo = getValueByPath(fromObject, ['_self']);
290
+ if (fromVideo != null) {
291
+ setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
292
+ }
293
+ return toObject;
294
+ }
295
+ function generateVideosResponseFromMldev$1(fromObject) {
296
+ const toObject = {};
297
+ const fromGeneratedVideos = getValueByPath(fromObject, [
298
+ 'generatedSamples',
299
+ ]);
300
+ if (fromGeneratedVideos != null) {
301
+ let transformedList = fromGeneratedVideos;
302
+ if (Array.isArray(transformedList)) {
303
+ transformedList = transformedList.map((item) => {
304
+ return generatedVideoFromMldev$1(item);
305
+ });
306
+ }
307
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
308
+ }
309
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
310
+ 'raiMediaFilteredCount',
311
+ ]);
312
+ if (fromRaiMediaFilteredCount != null) {
313
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
314
+ }
315
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
316
+ 'raiMediaFilteredReasons',
317
+ ]);
318
+ if (fromRaiMediaFilteredReasons != null) {
319
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
320
+ }
321
+ return toObject;
322
+ }
323
+ function generateVideosOperationFromMldev$1(fromObject) {
324
+ const toObject = {};
325
+ const fromName = getValueByPath(fromObject, ['name']);
326
+ if (fromName != null) {
327
+ setValueByPath(toObject, ['name'], fromName);
328
+ }
329
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
330
+ if (fromMetadata != null) {
331
+ setValueByPath(toObject, ['metadata'], fromMetadata);
332
+ }
333
+ const fromDone = getValueByPath(fromObject, ['done']);
334
+ if (fromDone != null) {
335
+ setValueByPath(toObject, ['done'], fromDone);
336
+ }
337
+ const fromError = getValueByPath(fromObject, ['error']);
338
+ if (fromError != null) {
339
+ setValueByPath(toObject, ['error'], fromError);
340
+ }
341
+ const fromResponse = getValueByPath(fromObject, [
342
+ 'response',
343
+ 'generateVideoResponse',
344
+ ]);
345
+ if (fromResponse != null) {
346
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
347
+ }
348
+ return toObject;
349
+ }
350
+ function videoFromVertex$1(fromObject) {
351
+ const toObject = {};
352
+ const fromUri = getValueByPath(fromObject, ['gcsUri']);
353
+ if (fromUri != null) {
354
+ setValueByPath(toObject, ['uri'], fromUri);
355
+ }
356
+ const fromVideoBytes = getValueByPath(fromObject, [
357
+ 'bytesBase64Encoded',
358
+ ]);
359
+ if (fromVideoBytes != null) {
360
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
361
+ }
362
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
363
+ if (fromMimeType != null) {
364
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
365
+ }
366
+ return toObject;
367
+ }
368
+ function generatedVideoFromVertex$1(fromObject) {
369
+ const toObject = {};
370
+ const fromVideo = getValueByPath(fromObject, ['_self']);
371
+ if (fromVideo != null) {
372
+ setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
373
+ }
374
+ return toObject;
375
+ }
376
+ function generateVideosResponseFromVertex$1(fromObject) {
377
+ const toObject = {};
378
+ const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
379
+ if (fromGeneratedVideos != null) {
380
+ let transformedList = fromGeneratedVideos;
381
+ if (Array.isArray(transformedList)) {
382
+ transformedList = transformedList.map((item) => {
383
+ return generatedVideoFromVertex$1(item);
384
+ });
385
+ }
386
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
387
+ }
388
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
389
+ 'raiMediaFilteredCount',
390
+ ]);
391
+ if (fromRaiMediaFilteredCount != null) {
392
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
393
+ }
394
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
395
+ 'raiMediaFilteredReasons',
396
+ ]);
397
+ if (fromRaiMediaFilteredReasons != null) {
398
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
399
+ }
400
+ return toObject;
401
+ }
402
+ function generateVideosOperationFromVertex$1(fromObject) {
403
+ const toObject = {};
404
+ const fromName = getValueByPath(fromObject, ['name']);
405
+ if (fromName != null) {
406
+ setValueByPath(toObject, ['name'], fromName);
407
+ }
408
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
409
+ if (fromMetadata != null) {
410
+ setValueByPath(toObject, ['metadata'], fromMetadata);
411
+ }
412
+ const fromDone = getValueByPath(fromObject, ['done']);
413
+ if (fromDone != null) {
414
+ setValueByPath(toObject, ['done'], fromDone);
415
+ }
416
+ const fromError = getValueByPath(fromObject, ['error']);
417
+ if (fromError != null) {
418
+ setValueByPath(toObject, ['error'], fromError);
419
+ }
420
+ const fromResponse = getValueByPath(fromObject, ['response']);
421
+ if (fromResponse != null) {
422
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
423
+ }
424
+ return toObject;
425
+ }
426
+
427
+ /**
428
+ * @license
429
+ * Copyright 2025 Google LLC
430
+ * SPDX-License-Identifier: Apache-2.0
431
+ */
222
432
  /** Required. Outcome of the code execution. */
223
433
  var Outcome;
224
434
  (function (Outcome) {
@@ -940,6 +1150,33 @@ var VideoGenerationReferenceType;
940
1150
  */
941
1151
  VideoGenerationReferenceType["STYLE"] = "STYLE";
942
1152
  })(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
1153
+ /** Enum for the mask mode of a video generation mask. */
1154
+ var VideoGenerationMaskMode;
1155
+ (function (VideoGenerationMaskMode) {
1156
+ /**
1157
+ * The image mask contains a masked rectangular region which is
1158
+ applied on the first frame of the input video. The object described in
1159
+ the prompt is inserted into this region and will appear in subsequent
1160
+ frames.
1161
+ */
1162
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1163
+ /**
1164
+ * The image mask is used to determine an object in the
1165
+ first video frame to track. This object is removed from the video.
1166
+ */
1167
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1168
+ /**
1169
+ * The image mask is used to determine a region in the
1170
+ video. Objects in this region will be removed.
1171
+ */
1172
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1173
+ /**
1174
+ * The image mask contains a masked rectangular region where
1175
+ the input video will go. The remaining area will be generated. Video
1176
+ masks are not supported.
1177
+ */
1178
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1179
+ })(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
943
1180
  /** Enum that controls the compression quality of the generated videos. */
944
1181
  var VideoCompressionQuality;
945
1182
  (function (VideoCompressionQuality) {
@@ -969,6 +1206,26 @@ var FileSource;
969
1206
  FileSource["UPLOADED"] = "UPLOADED";
970
1207
  FileSource["GENERATED"] = "GENERATED";
971
1208
  })(FileSource || (FileSource = {}));
1209
+ /** The reason why the turn is complete. */
1210
+ var TurnCompleteReason;
1211
+ (function (TurnCompleteReason) {
1212
+ /**
1213
+ * Default value. Reason is unspecified.
1214
+ */
1215
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1216
+ /**
1217
+ * The function call generated by the model is invalid.
1218
+ */
1219
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1220
+ /**
1221
+ * The response is rejected by the model.
1222
+ */
1223
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1224
+ /**
1225
+ * Needs more input from the user.
1226
+ */
1227
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1228
+ })(TurnCompleteReason || (TurnCompleteReason = {}));
972
1229
  /** Server content modalities. */
973
1230
  var MediaModality;
974
1231
  (function (MediaModality) {
@@ -1610,54 +1867,15 @@ class GenerateVideosOperation {
1610
1867
  */
1611
1868
  _fromAPIResponse({ apiResponse, isVertexAI, }) {
1612
1869
  const operation = new GenerateVideosOperation();
1613
- operation.name = apiResponse['name'];
1614
- operation.metadata = apiResponse['metadata'];
1615
- operation.done = apiResponse['done'];
1616
- operation.error = apiResponse['error'];
1870
+ let response;
1871
+ const op = apiResponse;
1617
1872
  if (isVertexAI) {
1618
- const response = apiResponse['response'];
1619
- if (response) {
1620
- const operationResponse = new GenerateVideosResponse();
1621
- const responseVideos = response['videos'];
1622
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1623
- return {
1624
- video: {
1625
- uri: generatedVideo['gcsUri'],
1626
- videoBytes: generatedVideo['bytesBase64Encoded']
1627
- ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1628
- : undefined,
1629
- mimeType: generatedVideo['mimeType'],
1630
- },
1631
- };
1632
- });
1633
- operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1634
- operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1635
- operation.response = operationResponse;
1636
- }
1873
+ response = generateVideosOperationFromVertex$1(op);
1637
1874
  }
1638
1875
  else {
1639
- const response = apiResponse['response'];
1640
- if (response) {
1641
- const operationResponse = new GenerateVideosResponse();
1642
- const generatedVideoResponse = response['generateVideoResponse'];
1643
- const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1644
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1645
- const video = generatedVideo['video'];
1646
- return {
1647
- video: {
1648
- uri: video === null || video === void 0 ? void 0 : video['uri'],
1649
- videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1650
- ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1651
- : undefined,
1652
- mimeType: generatedVideo['encoding'],
1653
- },
1654
- };
1655
- });
1656
- operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
1657
- operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
1658
- operation.response = operationResponse;
1659
- }
1876
+ response = generateVideosOperationFromMldev$1(op);
1660
1877
  }
1878
+ Object.assign(operation, response);
1661
1879
  return operation;
1662
1880
  }
1663
1881
  }
@@ -5634,8 +5852,9 @@ function fileDataToVertex$2(fromObject) {
5634
5852
  }
5635
5853
  function functionCallToVertex$2(fromObject) {
5636
5854
  const toObject = {};
5637
- if (getValueByPath(fromObject, ['id']) !== undefined) {
5638
- throw new Error('id parameter is not supported in Vertex AI.');
5855
+ const fromId = getValueByPath(fromObject, ['id']);
5856
+ if (fromId != null) {
5857
+ setValueByPath(toObject, ['id'], fromId);
5639
5858
  }
5640
5859
  const fromArgs = getValueByPath(fromObject, ['args']);
5641
5860
  if (fromArgs != null) {
@@ -8440,8 +8659,9 @@ function fileDataToVertex$1(fromObject) {
8440
8659
  }
8441
8660
  function functionCallToVertex$1(fromObject) {
8442
8661
  const toObject = {};
8443
- if (getValueByPath(fromObject, ['id']) !== undefined) {
8444
- throw new Error('id parameter is not supported in Vertex AI.');
8662
+ const fromId = getValueByPath(fromObject, ['id']);
8663
+ if (fromId != null) {
8664
+ setValueByPath(toObject, ['id'], fromId);
8445
8665
  }
8446
8666
  const fromArgs = getValueByPath(fromObject, ['args']);
8447
8667
  if (fromArgs != null) {
@@ -9214,6 +9434,18 @@ function liveServerContentFromMldev(fromObject) {
9214
9434
  if (fromUrlContextMetadata != null) {
9215
9435
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9216
9436
  }
9437
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
9438
+ 'turnCompleteReason',
9439
+ ]);
9440
+ if (fromTurnCompleteReason != null) {
9441
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
9442
+ }
9443
+ const fromWaitingForInput = getValueByPath(fromObject, [
9444
+ 'waitingForInput',
9445
+ ]);
9446
+ if (fromWaitingForInput != null) {
9447
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
9448
+ }
9217
9449
  return toObject;
9218
9450
  }
9219
9451
  function liveServerToolCallFromMldev(fromObject) {
@@ -9638,6 +9870,10 @@ function fileDataFromVertex$1(fromObject) {
9638
9870
  }
9639
9871
  function functionCallFromVertex$1(fromObject) {
9640
9872
  const toObject = {};
9873
+ const fromId = getValueByPath(fromObject, ['id']);
9874
+ if (fromId != null) {
9875
+ setValueByPath(toObject, ['id'], fromId);
9876
+ }
9641
9877
  const fromArgs = getValueByPath(fromObject, ['args']);
9642
9878
  if (fromArgs != null) {
9643
9879
  setValueByPath(toObject, ['args'], fromArgs);
@@ -9770,6 +10006,18 @@ function liveServerContentFromVertex(fromObject) {
9770
10006
  if (fromOutputTranscription != null) {
9771
10007
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
9772
10008
  }
10009
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10010
+ 'turnCompleteReason',
10011
+ ]);
10012
+ if (fromTurnCompleteReason != null) {
10013
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10014
+ }
10015
+ const fromWaitingForInput = getValueByPath(fromObject, [
10016
+ 'waitingForInput',
10017
+ ]);
10018
+ if (fromWaitingForInput != null) {
10019
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10020
+ }
9773
10021
  return toObject;
9774
10022
  }
9775
10023
  function liveServerToolCallFromVertex(fromObject) {
@@ -11020,6 +11268,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
11020
11268
  if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
11021
11269
  throw new Error('referenceImages parameter is not supported in Gemini API.');
11022
11270
  }
11271
+ if (getValueByPath(fromObject, ['mask']) !== undefined) {
11272
+ throw new Error('mask parameter is not supported in Gemini API.');
11273
+ }
11023
11274
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
11024
11275
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
11025
11276
  }
@@ -11102,8 +11353,9 @@ function fileDataToVertex(fromObject) {
11102
11353
  }
11103
11354
  function functionCallToVertex(fromObject) {
11104
11355
  const toObject = {};
11105
- if (getValueByPath(fromObject, ['id']) !== undefined) {
11106
- throw new Error('id parameter is not supported in Vertex AI.');
11356
+ const fromId = getValueByPath(fromObject, ['id']);
11357
+ if (fromId != null) {
11358
+ setValueByPath(toObject, ['id'], fromId);
11107
11359
  }
11108
11360
  const fromArgs = getValueByPath(fromObject, ['args']);
11109
11361
  if (fromArgs != null) {
@@ -12627,6 +12879,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
12627
12879
  }
12628
12880
  return toObject;
12629
12881
  }
12882
+ function videoGenerationMaskToVertex(fromObject) {
12883
+ const toObject = {};
12884
+ const fromImage = getValueByPath(fromObject, ['image']);
12885
+ if (fromImage != null) {
12886
+ setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
12887
+ }
12888
+ const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
12889
+ if (fromMaskMode != null) {
12890
+ setValueByPath(toObject, ['maskMode'], fromMaskMode);
12891
+ }
12892
+ return toObject;
12893
+ }
12630
12894
  function generateVideosConfigToVertex(fromObject, parentObject) {
12631
12895
  const toObject = {};
12632
12896
  const fromNumberOfVideos = getValueByPath(fromObject, [
@@ -12705,6 +12969,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
12705
12969
  }
12706
12970
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
12707
12971
  }
12972
+ const fromMask = getValueByPath(fromObject, ['mask']);
12973
+ if (parentObject !== undefined && fromMask != null) {
12974
+ setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
12975
+ }
12708
12976
  const fromCompressionQuality = getValueByPath(fromObject, [
12709
12977
  'compressionQuality',
12710
12978
  ]);
@@ -13363,6 +13631,10 @@ function fileDataFromVertex(fromObject) {
13363
13631
  }
13364
13632
  function functionCallFromVertex(fromObject) {
13365
13633
  const toObject = {};
13634
+ const fromId = getValueByPath(fromObject, ['id']);
13635
+ if (fromId != null) {
13636
+ setValueByPath(toObject, ['id'], fromId);
13637
+ }
13366
13638
  const fromArgs = getValueByPath(fromObject, ['args']);
13367
13639
  if (fromArgs != null) {
13368
13640
  setValueByPath(toObject, ['args'], fromArgs);
@@ -14089,7 +14361,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
14089
14361
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
14090
14362
  const USER_AGENT_HEADER = 'User-Agent';
14091
14363
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
14092
- const SDK_VERSION = '1.18.0'; // x-release-please-version
14364
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
14093
14365
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
14094
14366
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
14095
14367
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -17074,59 +17346,6 @@ class Models extends BaseModule {
17074
17346
  }
17075
17347
  }
17076
17348
 
17077
- /**
17078
- * @license
17079
- * Copyright 2025 Google LLC
17080
- * SPDX-License-Identifier: Apache-2.0
17081
- */
17082
- // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17083
- function getOperationParametersToMldev(fromObject) {
17084
- const toObject = {};
17085
- const fromOperationName = getValueByPath(fromObject, [
17086
- 'operationName',
17087
- ]);
17088
- if (fromOperationName != null) {
17089
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17090
- }
17091
- const fromConfig = getValueByPath(fromObject, ['config']);
17092
- if (fromConfig != null) {
17093
- setValueByPath(toObject, ['config'], fromConfig);
17094
- }
17095
- return toObject;
17096
- }
17097
- function fetchPredictOperationParametersToVertex(fromObject) {
17098
- const toObject = {};
17099
- const fromOperationName = getValueByPath(fromObject, [
17100
- 'operationName',
17101
- ]);
17102
- if (fromOperationName != null) {
17103
- setValueByPath(toObject, ['operationName'], fromOperationName);
17104
- }
17105
- const fromResourceName = getValueByPath(fromObject, ['resourceName']);
17106
- if (fromResourceName != null) {
17107
- setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
17108
- }
17109
- const fromConfig = getValueByPath(fromObject, ['config']);
17110
- if (fromConfig != null) {
17111
- setValueByPath(toObject, ['config'], fromConfig);
17112
- }
17113
- return toObject;
17114
- }
17115
- function getOperationParametersToVertex(fromObject) {
17116
- const toObject = {};
17117
- const fromOperationName = getValueByPath(fromObject, [
17118
- 'operationName',
17119
- ]);
17120
- if (fromOperationName != null) {
17121
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17122
- }
17123
- const fromConfig = getValueByPath(fromObject, ['config']);
17124
- if (fromConfig != null) {
17125
- setValueByPath(toObject, ['config'], fromConfig);
17126
- }
17127
- return toObject;
17128
- }
17129
-
17130
17349
  /**
17131
17350
  * @license
17132
17351
  * Copyright 2025 Google LLC
@@ -18482,6 +18701,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
18482
18701
  if (parentObject !== undefined && fromLearningRate != null) {
18483
18702
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
18484
18703
  }
18704
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
18705
+ throw new Error('labels parameter is not supported in Gemini API.');
18706
+ }
18485
18707
  return toObject;
18486
18708
  }
18487
18709
  function createTuningJobParametersPrivateToMldev(fromObject) {
@@ -18637,6 +18859,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
18637
18859
  if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18638
18860
  throw new Error('learningRate parameter is not supported in Vertex AI.');
18639
18861
  }
18862
+ const fromLabels = getValueByPath(fromObject, ['labels']);
18863
+ if (parentObject !== undefined && fromLabels != null) {
18864
+ setValueByPath(parentObject, ['labels'], fromLabels);
18865
+ }
18640
18866
  return toObject;
18641
18867
  }
18642
18868
  function createTuningJobParametersPrivateToVertex(fromObject) {
@@ -19743,5 +19969,5 @@ function getApiKeyFromEnv() {
19743
19969
  return envGoogleApiKey || envGeminiApiKey || undefined;
19744
19970
  }
19745
19971
 
19746
- export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationReferenceType, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
19972
+ export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TurnCompleteReason, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
19747
19973
  //# sourceMappingURL=index.mjs.map