@google/genai 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +17 -2
- package/dist/index.cjs +259 -104
- package/dist/index.mjs +259 -104
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +259 -104
- package/dist/node/index.mjs +259 -104
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +17 -2
- package/dist/web/index.mjs +259 -104
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +17 -2
- package/package.json +1 -1
package/dist/genai.d.ts
CHANGED
|
@@ -1517,6 +1517,8 @@ export declare interface CreateTuningJobConfig {
|
|
|
1517
1517
|
batchSize?: number;
|
|
1518
1518
|
/** The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. */
|
|
1519
1519
|
learningRate?: number;
|
|
1520
|
+
/** Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */
|
|
1521
|
+
labels?: Record<string, string>;
|
|
1520
1522
|
}
|
|
1521
1523
|
|
|
1522
1524
|
/** Supervised fine-tuning job creation parameters - optional fields. */
|
|
@@ -2949,6 +2951,8 @@ export declare interface GenerateVideosConfig {
|
|
|
2949
2951
|
be associated with a type. Veo 2 supports up to 3 asset images *or* 1
|
|
2950
2952
|
style image. */
|
|
2951
2953
|
referenceImages?: VideoGenerationReferenceImage[];
|
|
2954
|
+
/** The mask to use for generating videos. */
|
|
2955
|
+
mask?: VideoGenerationMask;
|
|
2952
2956
|
/** Compression quality of the generated videos. */
|
|
2953
2957
|
compressionQuality?: VideoCompressionQuality;
|
|
2954
2958
|
}
|
|
@@ -2965,13 +2969,13 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
|
|
|
2965
2969
|
error?: Record<string, unknown>;
|
|
2966
2970
|
/** The generated videos. */
|
|
2967
2971
|
response?: GenerateVideosResponse;
|
|
2968
|
-
/** The full HTTP response. */
|
|
2969
|
-
sdkHttpResponse?: HttpResponse;
|
|
2970
2972
|
/**
|
|
2971
2973
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2972
2974
|
* @internal
|
|
2973
2975
|
*/
|
|
2974
2976
|
_fromAPIResponse({ apiResponse, isVertexAI, }: OperationFromAPIResponseParameters): Operation<GenerateVideosResponse>;
|
|
2977
|
+
/** The full HTTP response. */
|
|
2978
|
+
sdkHttpResponse?: HttpResponse;
|
|
2975
2979
|
}
|
|
2976
2980
|
|
|
2977
2981
|
/** Class that represents the parameters for generating videos. */
|
|
@@ -7266,6 +7270,7 @@ declare namespace types {
|
|
|
7266
7270
|
Video,
|
|
7267
7271
|
GenerateVideosSource,
|
|
7268
7272
|
VideoGenerationReferenceImage,
|
|
7273
|
+
VideoGenerationMask,
|
|
7269
7274
|
GenerateVideosConfig,
|
|
7270
7275
|
GenerateVideosParameters,
|
|
7271
7276
|
GeneratedVideo,
|
|
@@ -7740,6 +7745,16 @@ export declare enum VideoCompressionQuality {
|
|
|
7740
7745
|
LOSSLESS = "LOSSLESS"
|
|
7741
7746
|
}
|
|
7742
7747
|
|
|
7748
|
+
/** A mask for video generation. */
|
|
7749
|
+
export declare interface VideoGenerationMask {
|
|
7750
|
+
/** The image mask to use for generating videos. */
|
|
7751
|
+
image?: Image_2;
|
|
7752
|
+
/** Describes how the mask will be used. Inpainting masks must
|
|
7753
|
+
match the aspect ratio of the input video. Outpainting masks can be
|
|
7754
|
+
either 9:16 or 16:9. */
|
|
7755
|
+
maskMode?: string;
|
|
7756
|
+
}
|
|
7757
|
+
|
|
7743
7758
|
/** A reference image for video generation. */
|
|
7744
7759
|
export declare interface VideoGenerationReferenceImage {
|
|
7745
7760
|
/** The reference image. */
|
package/dist/index.cjs
CHANGED
|
@@ -185,6 +185,216 @@ function tBytes$1(fromBytes) {
|
|
|
185
185
|
* SPDX-License-Identifier: Apache-2.0
|
|
186
186
|
*/
|
|
187
187
|
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
|
|
188
|
+
function getOperationParametersToMldev(fromObject) {
|
|
189
|
+
const toObject = {};
|
|
190
|
+
const fromOperationName = getValueByPath(fromObject, [
|
|
191
|
+
'operationName',
|
|
192
|
+
]);
|
|
193
|
+
if (fromOperationName != null) {
|
|
194
|
+
setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
|
|
195
|
+
}
|
|
196
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
197
|
+
if (fromConfig != null) {
|
|
198
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
199
|
+
}
|
|
200
|
+
return toObject;
|
|
201
|
+
}
|
|
202
|
+
function fetchPredictOperationParametersToVertex(fromObject) {
|
|
203
|
+
const toObject = {};
|
|
204
|
+
const fromOperationName = getValueByPath(fromObject, [
|
|
205
|
+
'operationName',
|
|
206
|
+
]);
|
|
207
|
+
if (fromOperationName != null) {
|
|
208
|
+
setValueByPath(toObject, ['operationName'], fromOperationName);
|
|
209
|
+
}
|
|
210
|
+
const fromResourceName = getValueByPath(fromObject, ['resourceName']);
|
|
211
|
+
if (fromResourceName != null) {
|
|
212
|
+
setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
|
|
213
|
+
}
|
|
214
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
215
|
+
if (fromConfig != null) {
|
|
216
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
217
|
+
}
|
|
218
|
+
return toObject;
|
|
219
|
+
}
|
|
220
|
+
function getOperationParametersToVertex(fromObject) {
|
|
221
|
+
const toObject = {};
|
|
222
|
+
const fromOperationName = getValueByPath(fromObject, [
|
|
223
|
+
'operationName',
|
|
224
|
+
]);
|
|
225
|
+
if (fromOperationName != null) {
|
|
226
|
+
setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
|
|
227
|
+
}
|
|
228
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
229
|
+
if (fromConfig != null) {
|
|
230
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
231
|
+
}
|
|
232
|
+
return toObject;
|
|
233
|
+
}
|
|
234
|
+
function videoFromMldev$1(fromObject) {
|
|
235
|
+
const toObject = {};
|
|
236
|
+
const fromUri = getValueByPath(fromObject, ['video', 'uri']);
|
|
237
|
+
if (fromUri != null) {
|
|
238
|
+
setValueByPath(toObject, ['uri'], fromUri);
|
|
239
|
+
}
|
|
240
|
+
const fromVideoBytes = getValueByPath(fromObject, [
|
|
241
|
+
'video',
|
|
242
|
+
'encodedVideo',
|
|
243
|
+
]);
|
|
244
|
+
if (fromVideoBytes != null) {
|
|
245
|
+
setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
|
|
246
|
+
}
|
|
247
|
+
const fromMimeType = getValueByPath(fromObject, ['encoding']);
|
|
248
|
+
if (fromMimeType != null) {
|
|
249
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
250
|
+
}
|
|
251
|
+
return toObject;
|
|
252
|
+
}
|
|
253
|
+
function generatedVideoFromMldev$1(fromObject) {
|
|
254
|
+
const toObject = {};
|
|
255
|
+
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
256
|
+
if (fromVideo != null) {
|
|
257
|
+
setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
|
|
258
|
+
}
|
|
259
|
+
return toObject;
|
|
260
|
+
}
|
|
261
|
+
function generateVideosResponseFromMldev$1(fromObject) {
|
|
262
|
+
const toObject = {};
|
|
263
|
+
const fromGeneratedVideos = getValueByPath(fromObject, [
|
|
264
|
+
'generatedSamples',
|
|
265
|
+
]);
|
|
266
|
+
if (fromGeneratedVideos != null) {
|
|
267
|
+
let transformedList = fromGeneratedVideos;
|
|
268
|
+
if (Array.isArray(transformedList)) {
|
|
269
|
+
transformedList = transformedList.map((item) => {
|
|
270
|
+
return generatedVideoFromMldev$1(item);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
274
|
+
}
|
|
275
|
+
const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
|
|
276
|
+
'raiMediaFilteredCount',
|
|
277
|
+
]);
|
|
278
|
+
if (fromRaiMediaFilteredCount != null) {
|
|
279
|
+
setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
|
|
280
|
+
}
|
|
281
|
+
const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
|
|
282
|
+
'raiMediaFilteredReasons',
|
|
283
|
+
]);
|
|
284
|
+
if (fromRaiMediaFilteredReasons != null) {
|
|
285
|
+
setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
|
|
286
|
+
}
|
|
287
|
+
return toObject;
|
|
288
|
+
}
|
|
289
|
+
function generateVideosOperationFromMldev$1(fromObject) {
|
|
290
|
+
const toObject = {};
|
|
291
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
292
|
+
if (fromName != null) {
|
|
293
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
294
|
+
}
|
|
295
|
+
const fromMetadata = getValueByPath(fromObject, ['metadata']);
|
|
296
|
+
if (fromMetadata != null) {
|
|
297
|
+
setValueByPath(toObject, ['metadata'], fromMetadata);
|
|
298
|
+
}
|
|
299
|
+
const fromDone = getValueByPath(fromObject, ['done']);
|
|
300
|
+
if (fromDone != null) {
|
|
301
|
+
setValueByPath(toObject, ['done'], fromDone);
|
|
302
|
+
}
|
|
303
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
304
|
+
if (fromError != null) {
|
|
305
|
+
setValueByPath(toObject, ['error'], fromError);
|
|
306
|
+
}
|
|
307
|
+
const fromResponse = getValueByPath(fromObject, [
|
|
308
|
+
'response',
|
|
309
|
+
'generateVideoResponse',
|
|
310
|
+
]);
|
|
311
|
+
if (fromResponse != null) {
|
|
312
|
+
setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
|
|
313
|
+
}
|
|
314
|
+
return toObject;
|
|
315
|
+
}
|
|
316
|
+
function videoFromVertex$1(fromObject) {
|
|
317
|
+
const toObject = {};
|
|
318
|
+
const fromUri = getValueByPath(fromObject, ['gcsUri']);
|
|
319
|
+
if (fromUri != null) {
|
|
320
|
+
setValueByPath(toObject, ['uri'], fromUri);
|
|
321
|
+
}
|
|
322
|
+
const fromVideoBytes = getValueByPath(fromObject, [
|
|
323
|
+
'bytesBase64Encoded',
|
|
324
|
+
]);
|
|
325
|
+
if (fromVideoBytes != null) {
|
|
326
|
+
setValueByPath(toObject, ['videoBytes'], tBytes$1(fromVideoBytes));
|
|
327
|
+
}
|
|
328
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
329
|
+
if (fromMimeType != null) {
|
|
330
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
331
|
+
}
|
|
332
|
+
return toObject;
|
|
333
|
+
}
|
|
334
|
+
function generatedVideoFromVertex$1(fromObject) {
|
|
335
|
+
const toObject = {};
|
|
336
|
+
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
337
|
+
if (fromVideo != null) {
|
|
338
|
+
setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
|
|
339
|
+
}
|
|
340
|
+
return toObject;
|
|
341
|
+
}
|
|
342
|
+
function generateVideosResponseFromVertex$1(fromObject) {
|
|
343
|
+
const toObject = {};
|
|
344
|
+
const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
|
|
345
|
+
if (fromGeneratedVideos != null) {
|
|
346
|
+
let transformedList = fromGeneratedVideos;
|
|
347
|
+
if (Array.isArray(transformedList)) {
|
|
348
|
+
transformedList = transformedList.map((item) => {
|
|
349
|
+
return generatedVideoFromVertex$1(item);
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
353
|
+
}
|
|
354
|
+
const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
|
|
355
|
+
'raiMediaFilteredCount',
|
|
356
|
+
]);
|
|
357
|
+
if (fromRaiMediaFilteredCount != null) {
|
|
358
|
+
setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
|
|
359
|
+
}
|
|
360
|
+
const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
|
|
361
|
+
'raiMediaFilteredReasons',
|
|
362
|
+
]);
|
|
363
|
+
if (fromRaiMediaFilteredReasons != null) {
|
|
364
|
+
setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
|
|
365
|
+
}
|
|
366
|
+
return toObject;
|
|
367
|
+
}
|
|
368
|
+
function generateVideosOperationFromVertex$1(fromObject) {
|
|
369
|
+
const toObject = {};
|
|
370
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
371
|
+
if (fromName != null) {
|
|
372
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
373
|
+
}
|
|
374
|
+
const fromMetadata = getValueByPath(fromObject, ['metadata']);
|
|
375
|
+
if (fromMetadata != null) {
|
|
376
|
+
setValueByPath(toObject, ['metadata'], fromMetadata);
|
|
377
|
+
}
|
|
378
|
+
const fromDone = getValueByPath(fromObject, ['done']);
|
|
379
|
+
if (fromDone != null) {
|
|
380
|
+
setValueByPath(toObject, ['done'], fromDone);
|
|
381
|
+
}
|
|
382
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
383
|
+
if (fromError != null) {
|
|
384
|
+
setValueByPath(toObject, ['error'], fromError);
|
|
385
|
+
}
|
|
386
|
+
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
387
|
+
if (fromResponse != null) {
|
|
388
|
+
setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
|
|
389
|
+
}
|
|
390
|
+
return toObject;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @license
|
|
395
|
+
* Copyright 2025 Google LLC
|
|
396
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
397
|
+
*/
|
|
188
398
|
/** Required. Outcome of the code execution. */
|
|
189
399
|
exports.Outcome = void 0;
|
|
190
400
|
(function (Outcome) {
|
|
@@ -1576,54 +1786,15 @@ class GenerateVideosOperation {
|
|
|
1576
1786
|
*/
|
|
1577
1787
|
_fromAPIResponse({ apiResponse, isVertexAI, }) {
|
|
1578
1788
|
const operation = new GenerateVideosOperation();
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
operation.done = apiResponse['done'];
|
|
1582
|
-
operation.error = apiResponse['error'];
|
|
1789
|
+
let response;
|
|
1790
|
+
const op = apiResponse;
|
|
1583
1791
|
if (isVertexAI) {
|
|
1584
|
-
|
|
1585
|
-
if (response) {
|
|
1586
|
-
const operationResponse = new GenerateVideosResponse();
|
|
1587
|
-
const responseVideos = response['videos'];
|
|
1588
|
-
operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
|
|
1589
|
-
return {
|
|
1590
|
-
video: {
|
|
1591
|
-
uri: generatedVideo['gcsUri'],
|
|
1592
|
-
videoBytes: generatedVideo['bytesBase64Encoded']
|
|
1593
|
-
? tBytes$1(generatedVideo['bytesBase64Encoded'])
|
|
1594
|
-
: undefined,
|
|
1595
|
-
mimeType: generatedVideo['mimeType'],
|
|
1596
|
-
},
|
|
1597
|
-
};
|
|
1598
|
-
});
|
|
1599
|
-
operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
|
|
1600
|
-
operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
|
|
1601
|
-
operation.response = operationResponse;
|
|
1602
|
-
}
|
|
1792
|
+
response = generateVideosOperationFromVertex$1(op);
|
|
1603
1793
|
}
|
|
1604
1794
|
else {
|
|
1605
|
-
|
|
1606
|
-
if (response) {
|
|
1607
|
-
const operationResponse = new GenerateVideosResponse();
|
|
1608
|
-
const generatedVideoResponse = response['generateVideoResponse'];
|
|
1609
|
-
const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
|
|
1610
|
-
operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
|
|
1611
|
-
const video = generatedVideo['video'];
|
|
1612
|
-
return {
|
|
1613
|
-
video: {
|
|
1614
|
-
uri: video === null || video === void 0 ? void 0 : video['uri'],
|
|
1615
|
-
videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
|
|
1616
|
-
? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
|
|
1617
|
-
: undefined,
|
|
1618
|
-
mimeType: generatedVideo['encoding'],
|
|
1619
|
-
},
|
|
1620
|
-
};
|
|
1621
|
-
});
|
|
1622
|
-
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1623
|
-
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1624
|
-
operation.response = operationResponse;
|
|
1625
|
-
}
|
|
1795
|
+
response = generateVideosOperationFromMldev$1(op);
|
|
1626
1796
|
}
|
|
1797
|
+
Object.assign(operation, response);
|
|
1627
1798
|
return operation;
|
|
1628
1799
|
}
|
|
1629
1800
|
}
|
|
@@ -5600,8 +5771,9 @@ function fileDataToVertex$2(fromObject) {
|
|
|
5600
5771
|
}
|
|
5601
5772
|
function functionCallToVertex$2(fromObject) {
|
|
5602
5773
|
const toObject = {};
|
|
5603
|
-
|
|
5604
|
-
|
|
5774
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
5775
|
+
if (fromId != null) {
|
|
5776
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
5605
5777
|
}
|
|
5606
5778
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
5607
5779
|
if (fromArgs != null) {
|
|
@@ -7026,7 +7198,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7026
7198
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7027
7199
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7028
7200
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7029
|
-
const SDK_VERSION = '1.
|
|
7201
|
+
const SDK_VERSION = '1.19.0'; // x-release-please-version
|
|
7030
7202
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7031
7203
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7032
7204
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -9103,8 +9275,9 @@ function fileDataToVertex$1(fromObject) {
|
|
|
9103
9275
|
}
|
|
9104
9276
|
function functionCallToVertex$1(fromObject) {
|
|
9105
9277
|
const toObject = {};
|
|
9106
|
-
|
|
9107
|
-
|
|
9278
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
9279
|
+
if (fromId != null) {
|
|
9280
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
9108
9281
|
}
|
|
9109
9282
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
9110
9283
|
if (fromArgs != null) {
|
|
@@ -10301,6 +10474,10 @@ function fileDataFromVertex$1(fromObject) {
|
|
|
10301
10474
|
}
|
|
10302
10475
|
function functionCallFromVertex$1(fromObject) {
|
|
10303
10476
|
const toObject = {};
|
|
10477
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
10478
|
+
if (fromId != null) {
|
|
10479
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
10480
|
+
}
|
|
10304
10481
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
10305
10482
|
if (fromArgs != null) {
|
|
10306
10483
|
setValueByPath(toObject, ['args'], fromArgs);
|
|
@@ -11683,6 +11860,9 @@ function generateVideosConfigToMldev(fromObject, parentObject) {
|
|
|
11683
11860
|
if (getValueByPath(fromObject, ['referenceImages']) !== undefined) {
|
|
11684
11861
|
throw new Error('referenceImages parameter is not supported in Gemini API.');
|
|
11685
11862
|
}
|
|
11863
|
+
if (getValueByPath(fromObject, ['mask']) !== undefined) {
|
|
11864
|
+
throw new Error('mask parameter is not supported in Gemini API.');
|
|
11865
|
+
}
|
|
11686
11866
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
11687
11867
|
throw new Error('compressionQuality parameter is not supported in Gemini API.');
|
|
11688
11868
|
}
|
|
@@ -11765,8 +11945,9 @@ function fileDataToVertex(fromObject) {
|
|
|
11765
11945
|
}
|
|
11766
11946
|
function functionCallToVertex(fromObject) {
|
|
11767
11947
|
const toObject = {};
|
|
11768
|
-
|
|
11769
|
-
|
|
11948
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
11949
|
+
if (fromId != null) {
|
|
11950
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
11770
11951
|
}
|
|
11771
11952
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
11772
11953
|
if (fromArgs != null) {
|
|
@@ -13290,6 +13471,18 @@ function videoGenerationReferenceImageToVertex(fromObject) {
|
|
|
13290
13471
|
}
|
|
13291
13472
|
return toObject;
|
|
13292
13473
|
}
|
|
13474
|
+
function videoGenerationMaskToVertex(fromObject) {
|
|
13475
|
+
const toObject = {};
|
|
13476
|
+
const fromImage = getValueByPath(fromObject, ['image']);
|
|
13477
|
+
if (fromImage != null) {
|
|
13478
|
+
setValueByPath(toObject, ['_self'], imageToVertex(fromImage));
|
|
13479
|
+
}
|
|
13480
|
+
const fromMaskMode = getValueByPath(fromObject, ['maskMode']);
|
|
13481
|
+
if (fromMaskMode != null) {
|
|
13482
|
+
setValueByPath(toObject, ['maskMode'], fromMaskMode);
|
|
13483
|
+
}
|
|
13484
|
+
return toObject;
|
|
13485
|
+
}
|
|
13293
13486
|
function generateVideosConfigToVertex(fromObject, parentObject) {
|
|
13294
13487
|
const toObject = {};
|
|
13295
13488
|
const fromNumberOfVideos = getValueByPath(fromObject, [
|
|
@@ -13368,6 +13561,10 @@ function generateVideosConfigToVertex(fromObject, parentObject) {
|
|
|
13368
13561
|
}
|
|
13369
13562
|
setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
|
|
13370
13563
|
}
|
|
13564
|
+
const fromMask = getValueByPath(fromObject, ['mask']);
|
|
13565
|
+
if (parentObject !== undefined && fromMask != null) {
|
|
13566
|
+
setValueByPath(parentObject, ['instances[0]', 'mask'], videoGenerationMaskToVertex(fromMask));
|
|
13567
|
+
}
|
|
13371
13568
|
const fromCompressionQuality = getValueByPath(fromObject, [
|
|
13372
13569
|
'compressionQuality',
|
|
13373
13570
|
]);
|
|
@@ -14026,6 +14223,10 @@ function fileDataFromVertex(fromObject) {
|
|
|
14026
14223
|
}
|
|
14027
14224
|
function functionCallFromVertex(fromObject) {
|
|
14028
14225
|
const toObject = {};
|
|
14226
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
14227
|
+
if (fromId != null) {
|
|
14228
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
14229
|
+
}
|
|
14029
14230
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
14030
14231
|
if (fromArgs != null) {
|
|
14031
14232
|
setValueByPath(toObject, ['args'], fromArgs);
|
|
@@ -17163,59 +17364,6 @@ class Models extends BaseModule {
|
|
|
17163
17364
|
}
|
|
17164
17365
|
}
|
|
17165
17366
|
|
|
17166
|
-
/**
|
|
17167
|
-
* @license
|
|
17168
|
-
* Copyright 2025 Google LLC
|
|
17169
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
17170
|
-
*/
|
|
17171
|
-
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
|
|
17172
|
-
function getOperationParametersToMldev(fromObject) {
|
|
17173
|
-
const toObject = {};
|
|
17174
|
-
const fromOperationName = getValueByPath(fromObject, [
|
|
17175
|
-
'operationName',
|
|
17176
|
-
]);
|
|
17177
|
-
if (fromOperationName != null) {
|
|
17178
|
-
setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
|
|
17179
|
-
}
|
|
17180
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
17181
|
-
if (fromConfig != null) {
|
|
17182
|
-
setValueByPath(toObject, ['config'], fromConfig);
|
|
17183
|
-
}
|
|
17184
|
-
return toObject;
|
|
17185
|
-
}
|
|
17186
|
-
function fetchPredictOperationParametersToVertex(fromObject) {
|
|
17187
|
-
const toObject = {};
|
|
17188
|
-
const fromOperationName = getValueByPath(fromObject, [
|
|
17189
|
-
'operationName',
|
|
17190
|
-
]);
|
|
17191
|
-
if (fromOperationName != null) {
|
|
17192
|
-
setValueByPath(toObject, ['operationName'], fromOperationName);
|
|
17193
|
-
}
|
|
17194
|
-
const fromResourceName = getValueByPath(fromObject, ['resourceName']);
|
|
17195
|
-
if (fromResourceName != null) {
|
|
17196
|
-
setValueByPath(toObject, ['_url', 'resourceName'], fromResourceName);
|
|
17197
|
-
}
|
|
17198
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
17199
|
-
if (fromConfig != null) {
|
|
17200
|
-
setValueByPath(toObject, ['config'], fromConfig);
|
|
17201
|
-
}
|
|
17202
|
-
return toObject;
|
|
17203
|
-
}
|
|
17204
|
-
function getOperationParametersToVertex(fromObject) {
|
|
17205
|
-
const toObject = {};
|
|
17206
|
-
const fromOperationName = getValueByPath(fromObject, [
|
|
17207
|
-
'operationName',
|
|
17208
|
-
]);
|
|
17209
|
-
if (fromOperationName != null) {
|
|
17210
|
-
setValueByPath(toObject, ['_url', 'operationName'], fromOperationName);
|
|
17211
|
-
}
|
|
17212
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
17213
|
-
if (fromConfig != null) {
|
|
17214
|
-
setValueByPath(toObject, ['config'], fromConfig);
|
|
17215
|
-
}
|
|
17216
|
-
return toObject;
|
|
17217
|
-
}
|
|
17218
|
-
|
|
17219
17367
|
/**
|
|
17220
17368
|
* @license
|
|
17221
17369
|
* Copyright 2025 Google LLC
|
|
@@ -18397,6 +18545,9 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
|
|
|
18397
18545
|
if (parentObject !== undefined && fromLearningRate != null) {
|
|
18398
18546
|
setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
|
|
18399
18547
|
}
|
|
18548
|
+
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
18549
|
+
throw new Error('labels parameter is not supported in Gemini API.');
|
|
18550
|
+
}
|
|
18400
18551
|
return toObject;
|
|
18401
18552
|
}
|
|
18402
18553
|
function createTuningJobParametersPrivateToMldev(fromObject) {
|
|
@@ -18552,6 +18703,10 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
|
|
|
18552
18703
|
if (getValueByPath(fromObject, ['learningRate']) !== undefined) {
|
|
18553
18704
|
throw new Error('learningRate parameter is not supported in Vertex AI.');
|
|
18554
18705
|
}
|
|
18706
|
+
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
18707
|
+
if (parentObject !== undefined && fromLabels != null) {
|
|
18708
|
+
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
18709
|
+
}
|
|
18555
18710
|
return toObject;
|
|
18556
18711
|
}
|
|
18557
18712
|
function createTuningJobParametersPrivateToVertex(fromObject) {
|