@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/genai.d.ts +72 -2
- package/dist/index.cjs +330 -104
- package/dist/index.mjs +331 -105
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +330 -104
- package/dist/node/index.mjs +331 -105
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +72 -2
- package/dist/web/index.mjs +331 -105
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +72 -2
- package/package.json +4 -1
package/dist/web/index.mjs
CHANGED
|
@@ -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) {
|
|
@@ -934,6 +1144,33 @@ var VideoGenerationReferenceType;
|
|
|
934
1144
|
*/
|
|
935
1145
|
VideoGenerationReferenceType["STYLE"] = "STYLE";
|
|
936
1146
|
})(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
|
|
1147
|
+
/** Enum for the mask mode of a video generation mask. */
|
|
1148
|
+
var VideoGenerationMaskMode;
|
|
1149
|
+
(function (VideoGenerationMaskMode) {
|
|
1150
|
+
/**
|
|
1151
|
+
* The image mask contains a masked rectangular region which is
|
|
1152
|
+
applied on the first frame of the input video. The object described in
|
|
1153
|
+
the prompt is inserted into this region and will appear in subsequent
|
|
1154
|
+
frames.
|
|
1155
|
+
*/
|
|
1156
|
+
VideoGenerationMaskMode["INSERT"] = "INSERT";
|
|
1157
|
+
/**
|
|
1158
|
+
* The image mask is used to determine an object in the
|
|
1159
|
+
first video frame to track. This object is removed from the video.
|
|
1160
|
+
*/
|
|
1161
|
+
VideoGenerationMaskMode["REMOVE"] = "REMOVE";
|
|
1162
|
+
/**
|
|
1163
|
+
* The image mask is used to determine a region in the
|
|
1164
|
+
video. Objects in this region will be removed.
|
|
1165
|
+
*/
|
|
1166
|
+
VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
|
|
1167
|
+
/**
|
|
1168
|
+
* The image mask contains a masked rectangular region where
|
|
1169
|
+
the input video will go. The remaining area will be generated. Video
|
|
1170
|
+
masks are not supported.
|
|
1171
|
+
*/
|
|
1172
|
+
VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
|
|
1173
|
+
})(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
|
|
937
1174
|
/** Enum that controls the compression quality of the generated videos. */
|
|
938
1175
|
var VideoCompressionQuality;
|
|
939
1176
|
(function (VideoCompressionQuality) {
|
|
@@ -963,6 +1200,26 @@ var FileSource;
|
|
|
963
1200
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
964
1201
|
FileSource["GENERATED"] = "GENERATED";
|
|
965
1202
|
})(FileSource || (FileSource = {}));
|
|
1203
|
+
/** The reason why the turn is complete. */
|
|
1204
|
+
var TurnCompleteReason;
|
|
1205
|
+
(function (TurnCompleteReason) {
|
|
1206
|
+
/**
|
|
1207
|
+
* Default value. Reason is unspecified.
|
|
1208
|
+
*/
|
|
1209
|
+
TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
|
|
1210
|
+
/**
|
|
1211
|
+
* The function call generated by the model is invalid.
|
|
1212
|
+
*/
|
|
1213
|
+
TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
|
|
1214
|
+
/**
|
|
1215
|
+
* The response is rejected by the model.
|
|
1216
|
+
*/
|
|
1217
|
+
TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
|
|
1218
|
+
/**
|
|
1219
|
+
* Needs more input from the user.
|
|
1220
|
+
*/
|
|
1221
|
+
TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
|
|
1222
|
+
})(TurnCompleteReason || (TurnCompleteReason = {}));
|
|
966
1223
|
/** Server content modalities. */
|
|
967
1224
|
var MediaModality;
|
|
968
1225
|
(function (MediaModality) {
|
|
@@ -1604,54 +1861,15 @@ class GenerateVideosOperation {
|
|
|
1604
1861
|
*/
|
|
1605
1862
|
_fromAPIResponse({ apiResponse, isVertexAI, }) {
|
|
1606
1863
|
const operation = new GenerateVideosOperation();
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
operation.done = apiResponse['done'];
|
|
1610
|
-
operation.error = apiResponse['error'];
|
|
1864
|
+
let response;
|
|
1865
|
+
const op = apiResponse;
|
|
1611
1866
|
if (isVertexAI) {
|
|
1612
|
-
|
|
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
|
-
}
|
|
1867
|
+
response = generateVideosOperationFromVertex$1(op);
|
|
1631
1868
|
}
|
|
1632
1869
|
else {
|
|
1633
|
-
|
|
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
|
-
}
|
|
1870
|
+
response = generateVideosOperationFromMldev$1(op);
|
|
1654
1871
|
}
|
|
1872
|
+
Object.assign(operation, response);
|
|
1655
1873
|
return operation;
|
|
1656
1874
|
}
|
|
1657
1875
|
}
|
|
@@ -5628,8 +5846,9 @@ function fileDataToVertex$2(fromObject) {
|
|
|
5628
5846
|
}
|
|
5629
5847
|
function functionCallToVertex$2(fromObject) {
|
|
5630
5848
|
const toObject = {};
|
|
5631
|
-
|
|
5632
|
-
|
|
5849
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
5850
|
+
if (fromId != null) {
|
|
5851
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
5633
5852
|
}
|
|
5634
5853
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
5635
5854
|
if (fromArgs != null) {
|
|
@@ -8434,8 +8653,9 @@ function fileDataToVertex$1(fromObject) {
|
|
|
8434
8653
|
}
|
|
8435
8654
|
function functionCallToVertex$1(fromObject) {
|
|
8436
8655
|
const toObject = {};
|
|
8437
|
-
|
|
8438
|
-
|
|
8656
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
8657
|
+
if (fromId != null) {
|
|
8658
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
8439
8659
|
}
|
|
8440
8660
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
8441
8661
|
if (fromArgs != null) {
|
|
@@ -9208,6 +9428,18 @@ function liveServerContentFromMldev(fromObject) {
|
|
|
9208
9428
|
if (fromUrlContextMetadata != null) {
|
|
9209
9429
|
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
9210
9430
|
}
|
|
9431
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
9432
|
+
'turnCompleteReason',
|
|
9433
|
+
]);
|
|
9434
|
+
if (fromTurnCompleteReason != null) {
|
|
9435
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
9436
|
+
}
|
|
9437
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
9438
|
+
'waitingForInput',
|
|
9439
|
+
]);
|
|
9440
|
+
if (fromWaitingForInput != null) {
|
|
9441
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
9442
|
+
}
|
|
9211
9443
|
return toObject;
|
|
9212
9444
|
}
|
|
9213
9445
|
function liveServerToolCallFromMldev(fromObject) {
|
|
@@ -9632,6 +9864,10 @@ function fileDataFromVertex$1(fromObject) {
|
|
|
9632
9864
|
}
|
|
9633
9865
|
function functionCallFromVertex$1(fromObject) {
|
|
9634
9866
|
const toObject = {};
|
|
9867
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
9868
|
+
if (fromId != null) {
|
|
9869
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
9870
|
+
}
|
|
9635
9871
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
9636
9872
|
if (fromArgs != null) {
|
|
9637
9873
|
setValueByPath(toObject, ['args'], fromArgs);
|
|
@@ -9764,6 +10000,18 @@ function liveServerContentFromVertex(fromObject) {
|
|
|
9764
10000
|
if (fromOutputTranscription != null) {
|
|
9765
10001
|
setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
|
|
9766
10002
|
}
|
|
10003
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
10004
|
+
'turnCompleteReason',
|
|
10005
|
+
]);
|
|
10006
|
+
if (fromTurnCompleteReason != null) {
|
|
10007
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
10008
|
+
}
|
|
10009
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
10010
|
+
'waitingForInput',
|
|
10011
|
+
]);
|
|
10012
|
+
if (fromWaitingForInput != null) {
|
|
10013
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
10014
|
+
}
|
|
9767
10015
|
return toObject;
|
|
9768
10016
|
}
|
|
9769
10017
|
function liveServerToolCallFromVertex(fromObject) {
|
|
@@ -11014,6 +11262,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
|
|
|
11014
11262
|
if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
|
|
11015
11263
|
throw new Error('referenceImages parameter is not supported in Gemini API.');
|
|
11016
11264
|
}
|
|
11265
|
+
if (getValueByPath(fromObject, ['mask']) !== undefined) {
|
|
11266
|
+
throw new Error('mask parameter is not supported in Gemini API.');
|
|
11267
|
+
}
|
|
11017
11268
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
11018
11269
|
throw new Error('compressionQuality parameter is not supported in Gemini API.');
|
|
11019
11270
|
}
|
|
@@ -11096,8 +11347,9 @@ function fileDataToVertex(fromObject) {
|
|
|
11096
11347
|
}
|
|
11097
11348
|
function functionCallToVertex(fromObject) {
|
|
11098
11349
|
const toObject = {};
|
|
11099
|
-
|
|
11100
|
-
|
|
11350
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
11351
|
+
if (fromId != null) {
|
|
11352
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
11101
11353
|
}
|
|
11102
11354
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
11103
11355
|
if (fromArgs != null) {
|
|
@@ -12621,6 +12873,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
|
|
|
12621
12873
|
}
|
|
12622
12874
|
return toObject;
|
|
12623
12875
|
}
|
|
12876
|
+
function videoGenerationMaskToVertex(fromObject) {
|
|
12877
|
+
const toObject = {};
|
|
12878
|
+
const fromImage = getValueByPath(fromObject, ['image']);
|
|
12879
|
+
if (fromImage != null) {
|
|
12880
|
+
setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
|
|
12881
|
+
}
|
|
12882
|
+
const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
|
|
12883
|
+
if (fromMaskMode != null) {
|
|
12884
|
+
setValueByPath(toObject, ['maskMode'], fromMaskMode);
|
|
12885
|
+
}
|
|
12886
|
+
return toObject;
|
|
12887
|
+
}
|
|
12624
12888
|
function generateVideosConfigToVertex(fromObject, parentObject) {
|
|
12625
12889
|
const toObject = {};
|
|
12626
12890
|
const fromNumberOfVideos = getValueByPath(fromObject, [
|
|
@@ -12699,6 +12963,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
|
|
|
12699
12963
|
}
|
|
12700
12964
|
setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
|
|
12701
12965
|
}
|
|
12966
|
+
const fromMask = getValueByPath(fromObject, ['mask']);
|
|
12967
|
+
if (parentObject !== undefined && fromMask != null) {
|
|
12968
|
+
setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
|
|
12969
|
+
}
|
|
12702
12970
|
const fromCompressionQuality = getValueByPath(fromObject, [
|
|
12703
12971
|
'compressionQuality',
|
|
12704
12972
|
]);
|
|
@@ -13357,6 +13625,10 @@ function fileDataFromVertex(fromObject) {
|
|
|
13357
13625
|
}
|
|
13358
13626
|
function functionCallFromVertex(fromObject) {
|
|
13359
13627
|
const toObject = {};
|
|
13628
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
13629
|
+
if (fromId != null) {
|
|
13630
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
13631
|
+
}
|
|
13360
13632
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
13361
13633
|
if (fromArgs != null) {
|
|
13362
13634
|
setValueByPath(toObject, ['args'], fromArgs);
|
|
@@ -14083,7 +14355,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
14083
14355
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
14084
14356
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
14085
14357
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
14086
|
-
const SDK_VERSION = '1.
|
|
14358
|
+
const SDK_VERSION = '1.20.0'; // x-release-please-version
|
|
14087
14359
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
14088
14360
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
14089
14361
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -17068,59 +17340,6 @@ class Models extends BaseModule {
|
|
|
17068
17340
|
}
|
|
17069
17341
|
}
|
|
17070
17342
|
|
|
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
17343
|
/**
|
|
17125
17344
|
* @license
|
|
17126
17345
|
* Copyright 2025 Google LLC
|
|
@@ -18302,6 +18521,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
|
|
|
18302
18521
|
if (parentObject !== undefined && fromLearningRate != null) {
|
|
18303
18522
|
setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
|
|
18304
18523
|
}
|
|
18524
|
+
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
18525
|
+
throw new Error('labels parameter is not supported in Gemini API.');
|
|
18526
|
+
}
|
|
18305
18527
|
return toObject;
|
|
18306
18528
|
}
|
|
18307
18529
|
function createTuningJobParametersPrivateToMldev(fromObject) {
|
|
@@ -18457,6 +18679,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
|
|
|
18457
18679
|
if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
|
|
18458
18680
|
throw new Error('learningRate parameter is not supported in Vertex AI.');
|
|
18459
18681
|
}
|
|
18682
|
+
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
18683
|
+
if (parentObject !== undefined && fromLabels != null) {
|
|
18684
|
+
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
18685
|
+
}
|
|
18460
18686
|
return toObject;
|
|
18461
18687
|
}
|
|
18462
18688
|
function createTuningJobParametersPrivateToVertex(fromObject) {
|
|
@@ -19405,5 +19631,5 @@ class GoogleGenAI {
|
|
|
19405
19631
|
}
|
|
19406
19632
|
}
|
|
19407
19633
|
|
|
19408
|
-
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 };
|
|
19634
|
+
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 };
|
|
19409
19635
|
//# sourceMappingURL=index.mjs.map
|