@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.
package/dist/index.mjs CHANGED
@@ -183,6 +183,216 @@ function tBytes$1(fromBytes) {
183
183
  * SPDX-License-Identifier: Apache-2.0
184
184
  */
185
185
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
186
+ function getOperationParametersToMldev(fromObject) {
187
+ const toObject = {};
188
+ const fromOperationName = getValueByPath(fromObject, [
189
+ 'operationName',
190
+ ]);
191
+ if (fromOperationName != null) {
192
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
193
+ }
194
+ const fromConfig = getValueByPath(fromObject, ['config']);
195
+ if (fromConfig != null) {
196
+ setValueByPath(toObject, ['config'], fromConfig);
197
+ }
198
+ return toObject;
199
+ }
200
+ function fetchPredictOperationParametersToVertex(fromObject) {
201
+ const toObject = {};
202
+ const fromOperationName = getValueByPath(fromObject, [
203
+ 'operationName',
204
+ ]);
205
+ if (fromOperationName != null) {
206
+ setValueByPath(toObject, ['operationName'], fromOperationName);
207
+ }
208
+ const fromResourceName = getValueByPath(fromObject, ['resourceName']);
209
+ if (fromResourceName != null) {
210
+ setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
211
+ }
212
+ const fromConfig = getValueByPath(fromObject, ['config']);
213
+ if (fromConfig != null) {
214
+ setValueByPath(toObject, ['config'], fromConfig);
215
+ }
216
+ return toObject;
217
+ }
218
+ function getOperationParametersToVertex(fromObject) {
219
+ const toObject = {};
220
+ const fromOperationName = getValueByPath(fromObject, [
221
+ 'operationName',
222
+ ]);
223
+ if (fromOperationName != null) {
224
+ setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
225
+ }
226
+ const fromConfig = getValueByPath(fromObject, ['config']);
227
+ if (fromConfig != null) {
228
+ setValueByPath(toObject, ['config'], fromConfig);
229
+ }
230
+ return toObject;
231
+ }
232
+ function videoFromMldev$1(fromObject) {
233
+ const toObject = {};
234
+ const fromUri = getValueByPath(fromObject, ['video', 'uri']);
235
+ if (fromUri != null) {
236
+ setValueByPath(toObject, ['uri'], fromUri);
237
+ }
238
+ const fromVideoBytes = getValueByPath(fromObject, [
239
+ 'video',
240
+ 'encodedVideo',
241
+ ]);
242
+ if (fromVideoBytes != null) {
243
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
244
+ }
245
+ const fromMimeType = getValueByPath(fromObject, ['encoding']);
246
+ if (fromMimeType != null) {
247
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
248
+ }
249
+ return toObject;
250
+ }
251
+ function generatedVideoFromMldev$1(fromObject) {
252
+ const toObject = {};
253
+ const fromVideo = getValueByPath(fromObject, ['_self']);
254
+ if (fromVideo != null) {
255
+ setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
256
+ }
257
+ return toObject;
258
+ }
259
+ function generateVideosResponseFromMldev$1(fromObject) {
260
+ const toObject = {};
261
+ const fromGeneratedVideos = getValueByPath(fromObject, [
262
+ 'generatedSamples',
263
+ ]);
264
+ if (fromGeneratedVideos != null) {
265
+ let transformedList = fromGeneratedVideos;
266
+ if (Array.isArray(transformedList)) {
267
+ transformedList = transformedList.map((item) => {
268
+ return generatedVideoFromMldev$1(item);
269
+ });
270
+ }
271
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
272
+ }
273
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
274
+ 'raiMediaFilteredCount',
275
+ ]);
276
+ if (fromRaiMediaFilteredCount != null) {
277
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
278
+ }
279
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
280
+ 'raiMediaFilteredReasons',
281
+ ]);
282
+ if (fromRaiMediaFilteredReasons != null) {
283
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
284
+ }
285
+ return toObject;
286
+ }
287
+ function generateVideosOperationFromMldev$1(fromObject) {
288
+ const toObject = {};
289
+ const fromName = getValueByPath(fromObject, ['name']);
290
+ if (fromName != null) {
291
+ setValueByPath(toObject, ['name'], fromName);
292
+ }
293
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
294
+ if (fromMetadata != null) {
295
+ setValueByPath(toObject, ['metadata'], fromMetadata);
296
+ }
297
+ const fromDone = getValueByPath(fromObject, ['done']);
298
+ if (fromDone != null) {
299
+ setValueByPath(toObject, ['done'], fromDone);
300
+ }
301
+ const fromError = getValueByPath(fromObject, ['error']);
302
+ if (fromError != null) {
303
+ setValueByPath(toObject, ['error'], fromError);
304
+ }
305
+ const fromResponse = getValueByPath(fromObject, [
306
+ 'response',
307
+ 'generateVideoResponse',
308
+ ]);
309
+ if (fromResponse != null) {
310
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
311
+ }
312
+ return toObject;
313
+ }
314
+ function videoFromVertex$1(fromObject) {
315
+ const toObject = {};
316
+ const fromUri = getValueByPath(fromObject, ['gcsUri']);
317
+ if (fromUri != null) {
318
+ setValueByPath(toObject, ['uri'], fromUri);
319
+ }
320
+ const fromVideoBytes = getValueByPath(fromObject, [
321
+ 'bytesBase64Encoded',
322
+ ]);
323
+ if (fromVideoBytes != null) {
324
+ setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
325
+ }
326
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
327
+ if (fromMimeType != null) {
328
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
329
+ }
330
+ return toObject;
331
+ }
332
+ function generatedVideoFromVertex$1(fromObject) {
333
+ const toObject = {};
334
+ const fromVideo = getValueByPath(fromObject, ['_self']);
335
+ if (fromVideo != null) {
336
+ setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
337
+ }
338
+ return toObject;
339
+ }
340
+ function generateVideosResponseFromVertex$1(fromObject) {
341
+ const toObject = {};
342
+ const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
343
+ if (fromGeneratedVideos != null) {
344
+ let transformedList = fromGeneratedVideos;
345
+ if (Array.isArray(transformedList)) {
346
+ transformedList = transformedList.map((item) => {
347
+ return generatedVideoFromVertex$1(item);
348
+ });
349
+ }
350
+ setValueByPath(toObject, ['generatedVideos'], transformedList);
351
+ }
352
+ const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
353
+ 'raiMediaFilteredCount',
354
+ ]);
355
+ if (fromRaiMediaFilteredCount != null) {
356
+ setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
357
+ }
358
+ const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
359
+ 'raiMediaFilteredReasons',
360
+ ]);
361
+ if (fromRaiMediaFilteredReasons != null) {
362
+ setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
363
+ }
364
+ return toObject;
365
+ }
366
+ function generateVideosOperationFromVertex$1(fromObject) {
367
+ const toObject = {};
368
+ const fromName = getValueByPath(fromObject, ['name']);
369
+ if (fromName != null) {
370
+ setValueByPath(toObject, ['name'], fromName);
371
+ }
372
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
373
+ if (fromMetadata != null) {
374
+ setValueByPath(toObject, ['metadata'], fromMetadata);
375
+ }
376
+ const fromDone = getValueByPath(fromObject, ['done']);
377
+ if (fromDone != null) {
378
+ setValueByPath(toObject, ['done'], fromDone);
379
+ }
380
+ const fromError = getValueByPath(fromObject, ['error']);
381
+ if (fromError != null) {
382
+ setValueByPath(toObject, ['error'], fromError);
383
+ }
384
+ const fromResponse = getValueByPath(fromObject, ['response']);
385
+ if (fromResponse != null) {
386
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
387
+ }
388
+ return toObject;
389
+ }
390
+
391
+ /**
392
+ * @license
393
+ * Copyright 2025 Google LLC
394
+ * SPDX-License-Identifier: Apache-2.0
395
+ */
186
396
  /** Required. Outcome of the code execution. */
187
397
  var Outcome;
188
398
  (function (Outcome) {
@@ -904,6 +1114,33 @@ var VideoGenerationReferenceType;
904
1114
  */
905
1115
  VideoGenerationReferenceType["STYLE"] = "STYLE";
906
1116
  })(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
1117
+ /** Enum for the mask mode of a video generation mask. */
1118
+ var VideoGenerationMaskMode;
1119
+ (function (VideoGenerationMaskMode) {
1120
+ /**
1121
+ * The image mask contains a masked rectangular region which is
1122
+ applied on the first frame of the input video. The object described in
1123
+ the prompt is inserted into this region and will appear in subsequent
1124
+ frames.
1125
+ */
1126
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1127
+ /**
1128
+ * The image mask is used to determine an object in the
1129
+ first video frame to track. This object is removed from the video.
1130
+ */
1131
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1132
+ /**
1133
+ * The image mask is used to determine a region in the
1134
+ video. Objects in this region will be removed.
1135
+ */
1136
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1137
+ /**
1138
+ * The image mask contains a masked rectangular region where
1139
+ the input video will go. The remaining area will be generated. Video
1140
+ masks are not supported.
1141
+ */
1142
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1143
+ })(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
907
1144
  /** Enum that controls the compression quality of the generated videos. */
908
1145
  var VideoCompressionQuality;
909
1146
  (function (VideoCompressionQuality) {
@@ -933,6 +1170,26 @@ var FileSource;
933
1170
  FileSource["UPLOADED"] = "UPLOADED";
934
1171
  FileSource["GENERATED"] = "GENERATED";
935
1172
  })(FileSource || (FileSource = {}));
1173
+ /** The reason why the turn is complete. */
1174
+ var TurnCompleteReason;
1175
+ (function (TurnCompleteReason) {
1176
+ /**
1177
+ * Default value. Reason is unspecified.
1178
+ */
1179
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1180
+ /**
1181
+ * The function call generated by the model is invalid.
1182
+ */
1183
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1184
+ /**
1185
+ * The response is rejected by the model.
1186
+ */
1187
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1188
+ /**
1189
+ * Needs more input from the user.
1190
+ */
1191
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1192
+ })(TurnCompleteReason || (TurnCompleteReason = {}));
936
1193
  /** Server content modalities. */
937
1194
  var MediaModality;
938
1195
  (function (MediaModality) {
@@ -1574,54 +1831,15 @@ class GenerateVideosOperation {
1574
1831
  */
1575
1832
  _fromAPIResponse({ apiResponse, isVertexAI, }) {
1576
1833
  const operation = new GenerateVideosOperation();
1577
- operation.name = apiResponse['name'];
1578
- operation.metadata = apiResponse['metadata'];
1579
- operation.done = apiResponse['done'];
1580
- operation.error = apiResponse['error'];
1834
+ let response;
1835
+ const op = apiResponse;
1581
1836
  if (isVertexAI) {
1582
- const response = apiResponse['response'];
1583
- if (response) {
1584
- const operationResponse = new GenerateVideosResponse();
1585
- const responseVideos = response['videos'];
1586
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1587
- return {
1588
- video: {
1589
- uri: generatedVideo['gcsUri'],
1590
- videoBytes: generatedVideo['bytesBase64Encoded']
1591
- ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1592
- : undefined,
1593
- mimeType: generatedVideo['mimeType'],
1594
- },
1595
- };
1596
- });
1597
- operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1598
- operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1599
- operation.response = operationResponse;
1600
- }
1837
+ response = generateVideosOperationFromVertex$1(op);
1601
1838
  }
1602
1839
  else {
1603
- const response = apiResponse['response'];
1604
- if (response) {
1605
- const operationResponse = new GenerateVideosResponse();
1606
- const generatedVideoResponse = response['generateVideoResponse'];
1607
- const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1608
- operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1609
- const video = generatedVideo['video'];
1610
- return {
1611
- video: {
1612
- uri: video === null || video === void 0 ? void 0 : video['uri'],
1613
- videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1614
- ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1615
- : undefined,
1616
- mimeType: generatedVideo['encoding'],
1617
- },
1618
- };
1619
- });
1620
- operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
1621
- operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
1622
- operation.response = operationResponse;
1623
- }
1840
+ response = generateVideosOperationFromMldev$1(op);
1624
1841
  }
1842
+ Object.assign(operation, response);
1625
1843
  return operation;
1626
1844
  }
1627
1845
  }
@@ -5598,8 +5816,9 @@ function fileDataToVertex$2(fromObject) {
5598
5816
  }
5599
5817
  function functionCallToVertex$2(fromObject) {
5600
5818
  const toObject = {};
5601
- if (getValueByPath(fromObject, ['id']) !== undefined) {
5602
- throw new Error('id parameter is not supported in Vertex AI.');
5819
+ const fromId = getValueByPath(fromObject, ['id']);
5820
+ if (fromId != null) {
5821
+ setValueByPath(toObject, ['id'], fromId);
5603
5822
  }
5604
5823
  const fromArgs = getValueByPath(fromObject, ['args']);
5605
5824
  if (fromArgs != null) {
@@ -7024,7 +7243,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7024
7243
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7025
7244
  const USER_AGENT_HEADER = 'User-Agent';
7026
7245
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7027
- const SDK_VERSION = '1.18.0'; // x-release-please-version
7246
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
7028
7247
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7029
7248
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7030
7249
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -9101,8 +9320,9 @@ function fileDataToVertex$1(fromObject) {
9101
9320
  }
9102
9321
  function functionCallToVertex$1(fromObject) {
9103
9322
  const toObject = {};
9104
- if (getValueByPath(fromObject, ['id']) !== undefined) {
9105
- throw new Error('id parameter is not supported in Vertex AI.');
9323
+ const fromId = getValueByPath(fromObject, ['id']);
9324
+ if (fromId != null) {
9325
+ setValueByPath(toObject, ['id'], fromId);
9106
9326
  }
9107
9327
  const fromArgs = getValueByPath(fromObject, ['args']);
9108
9328
  if (fromArgs != null) {
@@ -9875,6 +10095,18 @@ function liveServerContentFromMldev(fromObject) {
9875
10095
  if (fromUrlContextMetadata != null) {
9876
10096
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9877
10097
  }
10098
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10099
+ 'turnCompleteReason',
10100
+ ]);
10101
+ if (fromTurnCompleteReason != null) {
10102
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10103
+ }
10104
+ const fromWaitingForInput = getValueByPath(fromObject, [
10105
+ 'waitingForInput',
10106
+ ]);
10107
+ if (fromWaitingForInput != null) {
10108
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10109
+ }
9878
10110
  return toObject;
9879
10111
  }
9880
10112
  function liveServerToolCallFromMldev(fromObject) {
@@ -10299,6 +10531,10 @@ function fileDataFromVertex$1(fromObject) {
10299
10531
  }
10300
10532
  function functionCallFromVertex$1(fromObject) {
10301
10533
  const toObject = {};
10534
+ const fromId = getValueByPath(fromObject, ['id']);
10535
+ if (fromId != null) {
10536
+ setValueByPath(toObject, ['id'], fromId);
10537
+ }
10302
10538
  const fromArgs = getValueByPath(fromObject, ['args']);
10303
10539
  if (fromArgs != null) {
10304
10540
  setValueByPath(toObject, ['args'], fromArgs);
@@ -10431,6 +10667,18 @@ function liveServerContentFromVertex(fromObject) {
10431
10667
  if (fromOutputTranscription != null) {
10432
10668
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
10433
10669
  }
10670
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10671
+ 'turnCompleteReason',
10672
+ ]);
10673
+ if (fromTurnCompleteReason != null) {
10674
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10675
+ }
10676
+ const fromWaitingForInput = getValueByPath(fromObject, [
10677
+ 'waitingForInput',
10678
+ ]);
10679
+ if (fromWaitingForInput != null) {
10680
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10681
+ }
10434
10682
  return toObject;
10435
10683
  }
10436
10684
  function liveServerToolCallFromVertex(fromObject) {
@@ -11681,6 +11929,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
11681
11929
  if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
11682
11930
  throw new Error('referenceImages parameter is not supported in Gemini API.');
11683
11931
  }
11932
+ if (getValueByPath(fromObject, ['mask']) !== undefined) {
11933
+ throw new Error('mask parameter is not supported in Gemini API.');
11934
+ }
11684
11935
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
11685
11936
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
11686
11937
  }
@@ -11763,8 +12014,9 @@ function fileDataToVertex(fromObject) {
11763
12014
  }
11764
12015
  function functionCallToVertex(fromObject) {
11765
12016
  const toObject = {};
11766
- if (getValueByPath(fromObject, ['id']) !== undefined) {
11767
- throw new Error('id parameter is not supported in Vertex AI.');
12017
+ const fromId = getValueByPath(fromObject, ['id']);
12018
+ if (fromId != null) {
12019
+ setValueByPath(toObject, ['id'], fromId);
11768
12020
  }
11769
12021
  const fromArgs = getValueByPath(fromObject, ['args']);
11770
12022
  if (fromArgs != null) {
@@ -13288,6 +13540,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
13288
13540
  }
13289
13541
  return toObject;
13290
13542
  }
13543
+ function videoGenerationMaskToVertex(fromObject) {
13544
+ const toObject = {};
13545
+ const fromImage = getValueByPath(fromObject, ['image']);
13546
+ if (fromImage != null) {
13547
+ setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
13548
+ }
13549
+ const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
13550
+ if (fromMaskMode != null) {
13551
+ setValueByPath(toObject, ['maskMode'], fromMaskMode);
13552
+ }
13553
+ return toObject;
13554
+ }
13291
13555
  function generateVideosConfigToVertex(fromObject, parentObject) {
13292
13556
  const toObject = {};
13293
13557
  const fromNumberOfVideos = getValueByPath(fromObject, [
@@ -13366,6 +13630,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
13366
13630
  }
13367
13631
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
13368
13632
  }
13633
+ const fromMask = getValueByPath(fromObject, ['mask']);
13634
+ if (parentObject !== undefined && fromMask != null) {
13635
+ setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
13636
+ }
13369
13637
  const fromCompressionQuality = getValueByPath(fromObject, [
13370
13638
  'compressionQuality',
13371
13639
  ]);
@@ -14024,6 +14292,10 @@ function fileDataFromVertex(fromObject) {
14024
14292
  }
14025
14293
  function functionCallFromVertex(fromObject) {
14026
14294
  const toObject = {};
14295
+ const fromId = getValueByPath(fromObject, ['id']);
14296
+ if (fromId != null) {
14297
+ setValueByPath(toObject, ['id'], fromId);
14298
+ }
14027
14299
  const fromArgs = getValueByPath(fromObject, ['args']);
14028
14300
  if (fromArgs != null) {
14029
14301
  setValueByPath(toObject, ['args'], fromArgs);
@@ -17161,59 +17433,6 @@ class Models extends BaseModule {
17161
17433
  }
17162
17434
  }
17163
17435
 
17164
- /**
17165
- * @license
17166
- * Copyright 2025 Google LLC
17167
- * SPDX-License-Identifier: Apache-2.0
17168
- */
17169
- // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17170
- function getOperationParametersToMldev(fromObject) {
17171
- const toObject = {};
17172
- const fromOperationName = getValueByPath(fromObject, [
17173
- 'operationName',
17174
- ]);
17175
- if (fromOperationName != null) {
17176
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17177
- }
17178
- const fromConfig = getValueByPath(fromObject, ['config']);
17179
- if (fromConfig != null) {
17180
- setValueByPath(toObject, ['config'], fromConfig);
17181
- }
17182
- return toObject;
17183
- }
17184
- function fetchPredictOperationParametersToVertex(fromObject) {
17185
- const toObject = {};
17186
- const fromOperationName = getValueByPath(fromObject, [
17187
- 'operationName',
17188
- ]);
17189
- if (fromOperationName != null) {
17190
- setValueByPath(toObject, ['operationName'], fromOperationName);
17191
- }
17192
- const fromResourceName = getValueByPath(fromObject, ['resourceName']);
17193
- if (fromResourceName != null) {
17194
- setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
17195
- }
17196
- const fromConfig = getValueByPath(fromObject, ['config']);
17197
- if (fromConfig != null) {
17198
- setValueByPath(toObject, ['config'], fromConfig);
17199
- }
17200
- return toObject;
17201
- }
17202
- function getOperationParametersToVertex(fromObject) {
17203
- const toObject = {};
17204
- const fromOperationName = getValueByPath(fromObject, [
17205
- 'operationName',
17206
- ]);
17207
- if (fromOperationName != null) {
17208
- setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
17209
- }
17210
- const fromConfig = getValueByPath(fromObject, ['config']);
17211
- if (fromConfig != null) {
17212
- setValueByPath(toObject, ['config'], fromConfig);
17213
- }
17214
- return toObject;
17215
- }
17216
-
17217
17436
  /**
17218
17437
  * @license
17219
17438
  * Copyright 2025 Google LLC
@@ -18395,6 +18614,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
18395
18614
  if (parentObject !== undefined && fromLearningRate != null) {
18396
18615
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
18397
18616
  }
18617
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
18618
+ throw new Error('labels parameter is not supported in Gemini API.');
18619
+ }
18398
18620
  return toObject;
18399
18621
  }
18400
18622
  function createTuningJobParametersPrivateToMldev(fromObject) {
@@ -18550,6 +18772,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
18550
18772
  if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
18551
18773
  throw new Error('learningRate parameter is not supported in Vertex AI.');
18552
18774
  }
18775
+ const fromLabels = getValueByPath(fromObject, ['labels']);
18776
+ if (parentObject !== undefined && fromLabels != null) {
18777
+ setValueByPath(parentObject, ['labels'], fromLabels);
18778
+ }
18553
18779
  return toObject;
18554
18780
  }
18555
18781
  function createTuningJobParametersPrivateToVertex(fromObject) {
@@ -19345,5 +19571,5 @@ class GoogleGenAI {
19345
19571
  }
19346
19572
  }
19347
19573
 
19348
- 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 };
19574
+ 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 };
19349
19575
  //# sourceMappingURL=index.mjs.map