@google/genai 1.7.0 → 1.8.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/README.md +43 -0
- package/dist/genai.d.ts +195 -18
- package/dist/index.cjs +275 -33
- package/dist/index.mjs +276 -34
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +275 -33
- package/dist/node/index.mjs +276 -34
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +195 -18
- package/dist/web/index.mjs +276 -34
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +195 -18
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -314,6 +314,22 @@ exports.HarmCategory = void 0;
|
|
|
314
314
|
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
315
315
|
*/
|
|
316
316
|
HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
317
|
+
/**
|
|
318
|
+
* The harm category is image hate.
|
|
319
|
+
*/
|
|
320
|
+
HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
|
|
321
|
+
/**
|
|
322
|
+
* The harm category is image dangerous content.
|
|
323
|
+
*/
|
|
324
|
+
HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
|
|
325
|
+
/**
|
|
326
|
+
* The harm category is image harassment.
|
|
327
|
+
*/
|
|
328
|
+
HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
|
|
329
|
+
/**
|
|
330
|
+
* The harm category is image sexually explicit content.
|
|
331
|
+
*/
|
|
332
|
+
HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
|
|
317
333
|
})(exports.HarmCategory || (exports.HarmCategory = {}));
|
|
318
334
|
/** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
|
|
319
335
|
exports.HarmBlockMethod = void 0;
|
|
@@ -400,6 +416,50 @@ exports.AuthType = void 0;
|
|
|
400
416
|
*/
|
|
401
417
|
AuthType["OIDC_AUTH"] = "OIDC_AUTH";
|
|
402
418
|
})(exports.AuthType || (exports.AuthType = {}));
|
|
419
|
+
/** The API spec that the external API implements. */
|
|
420
|
+
exports.ApiSpec = void 0;
|
|
421
|
+
(function (ApiSpec) {
|
|
422
|
+
/**
|
|
423
|
+
* Unspecified API spec. This value should not be used.
|
|
424
|
+
*/
|
|
425
|
+
ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
|
|
426
|
+
/**
|
|
427
|
+
* Simple search API spec.
|
|
428
|
+
*/
|
|
429
|
+
ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
|
|
430
|
+
/**
|
|
431
|
+
* Elastic search API spec.
|
|
432
|
+
*/
|
|
433
|
+
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
434
|
+
})(exports.ApiSpec || (exports.ApiSpec = {}));
|
|
435
|
+
/** Required. The environment being operated. */
|
|
436
|
+
exports.Environment = void 0;
|
|
437
|
+
(function (Environment) {
|
|
438
|
+
/**
|
|
439
|
+
* Defaults to browser.
|
|
440
|
+
*/
|
|
441
|
+
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
442
|
+
/**
|
|
443
|
+
* Operates in a web browser.
|
|
444
|
+
*/
|
|
445
|
+
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
446
|
+
})(exports.Environment || (exports.Environment = {}));
|
|
447
|
+
/** Status of the url retrieval. */
|
|
448
|
+
exports.UrlRetrievalStatus = void 0;
|
|
449
|
+
(function (UrlRetrievalStatus) {
|
|
450
|
+
/**
|
|
451
|
+
* Default value. This value is unused
|
|
452
|
+
*/
|
|
453
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
|
|
454
|
+
/**
|
|
455
|
+
* Url retrieval is successful.
|
|
456
|
+
*/
|
|
457
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
|
|
458
|
+
/**
|
|
459
|
+
* Url retrieval is failed due to error.
|
|
460
|
+
*/
|
|
461
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
462
|
+
})(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
|
|
403
463
|
/** Output only. The reason why the model stopped generating tokens.
|
|
404
464
|
|
|
405
465
|
If empty, the model has not stopped generating the tokens.
|
|
@@ -530,6 +590,10 @@ exports.BlockedReason = void 0;
|
|
|
530
590
|
* Candidates blocked due to prohibited content.
|
|
531
591
|
*/
|
|
532
592
|
BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
|
|
593
|
+
/**
|
|
594
|
+
* Candidates blocked due to unsafe image generation content.
|
|
595
|
+
*/
|
|
596
|
+
BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
|
|
533
597
|
})(exports.BlockedReason || (exports.BlockedReason = {}));
|
|
534
598
|
/** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
|
|
535
599
|
exports.TrafficType = void 0;
|
|
@@ -727,22 +791,6 @@ exports.FunctionCallingConfigMode = void 0;
|
|
|
727
791
|
*/
|
|
728
792
|
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
729
793
|
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
730
|
-
/** Status of the url retrieval. */
|
|
731
|
-
exports.UrlRetrievalStatus = void 0;
|
|
732
|
-
(function (UrlRetrievalStatus) {
|
|
733
|
-
/**
|
|
734
|
-
* Default value. This value is unused
|
|
735
|
-
*/
|
|
736
|
-
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
|
|
737
|
-
/**
|
|
738
|
-
* Url retrieval is successful.
|
|
739
|
-
*/
|
|
740
|
-
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
|
|
741
|
-
/**
|
|
742
|
-
* Url retrieval is failed due to error.
|
|
743
|
-
*/
|
|
744
|
-
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
745
|
-
})(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
|
|
746
794
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
747
795
|
exports.SafetyFilterLevel = void 0;
|
|
748
796
|
(function (SafetyFilterLevel) {
|
|
@@ -2945,6 +2993,10 @@ function toolToMldev$4(fromObject) {
|
|
|
2945
2993
|
if (fromCodeExecution != null) {
|
|
2946
2994
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
2947
2995
|
}
|
|
2996
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
2997
|
+
if (fromComputerUse != null) {
|
|
2998
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
2999
|
+
}
|
|
2948
3000
|
return toObject;
|
|
2949
3001
|
}
|
|
2950
3002
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
@@ -3356,6 +3408,18 @@ function listBatchJobsParametersToMldev(fromObject) {
|
|
|
3356
3408
|
}
|
|
3357
3409
|
return toObject;
|
|
3358
3410
|
}
|
|
3411
|
+
function deleteBatchJobParametersToMldev(apiClient, fromObject) {
|
|
3412
|
+
const toObject = {};
|
|
3413
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
3414
|
+
if (fromName != null) {
|
|
3415
|
+
setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
|
|
3416
|
+
}
|
|
3417
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
3418
|
+
if (fromConfig != null) {
|
|
3419
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
3420
|
+
}
|
|
3421
|
+
return toObject;
|
|
3422
|
+
}
|
|
3359
3423
|
function batchJobSourceToVertex(fromObject) {
|
|
3360
3424
|
const toObject = {};
|
|
3361
3425
|
const fromFormat = getValueByPath(fromObject, ['format']);
|
|
@@ -3476,6 +3540,18 @@ function listBatchJobsParametersToVertex(fromObject) {
|
|
|
3476
3540
|
}
|
|
3477
3541
|
return toObject;
|
|
3478
3542
|
}
|
|
3543
|
+
function deleteBatchJobParametersToVertex(apiClient, fromObject) {
|
|
3544
|
+
const toObject = {};
|
|
3545
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
3546
|
+
if (fromName != null) {
|
|
3547
|
+
setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
|
|
3548
|
+
}
|
|
3549
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
3550
|
+
if (fromConfig != null) {
|
|
3551
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
3552
|
+
}
|
|
3553
|
+
return toObject;
|
|
3554
|
+
}
|
|
3479
3555
|
function jobErrorFromMldev() {
|
|
3480
3556
|
const toObject = {};
|
|
3481
3557
|
return toObject;
|
|
@@ -3813,6 +3889,22 @@ function listBatchJobsResponseFromMldev(fromObject) {
|
|
|
3813
3889
|
}
|
|
3814
3890
|
return toObject;
|
|
3815
3891
|
}
|
|
3892
|
+
function deleteResourceJobFromMldev(fromObject) {
|
|
3893
|
+
const toObject = {};
|
|
3894
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
3895
|
+
if (fromName != null) {
|
|
3896
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
3897
|
+
}
|
|
3898
|
+
const fromDone = getValueByPath(fromObject, ['done']);
|
|
3899
|
+
if (fromDone != null) {
|
|
3900
|
+
setValueByPath(toObject, ['done'], fromDone);
|
|
3901
|
+
}
|
|
3902
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
3903
|
+
if (fromError != null) {
|
|
3904
|
+
setValueByPath(toObject, ['error'], jobErrorFromMldev());
|
|
3905
|
+
}
|
|
3906
|
+
return toObject;
|
|
3907
|
+
}
|
|
3816
3908
|
function jobErrorFromVertex(fromObject) {
|
|
3817
3909
|
const toObject = {};
|
|
3818
3910
|
const fromDetails = getValueByPath(fromObject, ['details']);
|
|
@@ -3940,6 +4032,22 @@ function listBatchJobsResponseFromVertex(fromObject) {
|
|
|
3940
4032
|
}
|
|
3941
4033
|
return toObject;
|
|
3942
4034
|
}
|
|
4035
|
+
function deleteResourceJobFromVertex(fromObject) {
|
|
4036
|
+
const toObject = {};
|
|
4037
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
4038
|
+
if (fromName != null) {
|
|
4039
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
4040
|
+
}
|
|
4041
|
+
const fromDone = getValueByPath(fromObject, ['done']);
|
|
4042
|
+
if (fromDone != null) {
|
|
4043
|
+
setValueByPath(toObject, ['done'], fromDone);
|
|
4044
|
+
}
|
|
4045
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
4046
|
+
if (fromError != null) {
|
|
4047
|
+
setValueByPath(toObject, ['error'], jobErrorFromVertex(fromError));
|
|
4048
|
+
}
|
|
4049
|
+
return toObject;
|
|
4050
|
+
}
|
|
3943
4051
|
|
|
3944
4052
|
/**
|
|
3945
4053
|
* @license
|
|
@@ -4147,20 +4255,23 @@ class Batches extends BaseModule {
|
|
|
4147
4255
|
*/
|
|
4148
4256
|
this.create = async (params) => {
|
|
4149
4257
|
if (this.apiClient.isVertexAI()) {
|
|
4258
|
+
const timestamp = Date.now();
|
|
4259
|
+
const timestampStr = timestamp.toString();
|
|
4150
4260
|
if (Array.isArray(params.src)) {
|
|
4151
4261
|
throw new Error('InlinedRequest[] is not supported in Vertex AI. Please use ' +
|
|
4152
4262
|
'Google Cloud Storage URI or BigQuery URI instead.');
|
|
4153
4263
|
}
|
|
4154
4264
|
params.config = params.config || {};
|
|
4155
4265
|
if (params.config.displayName === undefined) {
|
|
4156
|
-
params.config.displayName = 'genaiBatchJob_';
|
|
4266
|
+
params.config.displayName = 'genaiBatchJob_${timestampStr}';
|
|
4157
4267
|
}
|
|
4158
4268
|
if (params.config.dest === undefined && typeof params.src === 'string') {
|
|
4159
4269
|
if (params.src.startsWith('gs://') && params.src.endsWith('.jsonl')) {
|
|
4160
4270
|
params.config.dest = `${params.src.slice(0, -6)}/dest`;
|
|
4161
4271
|
}
|
|
4162
4272
|
else if (params.src.startsWith('bq://')) {
|
|
4163
|
-
params.config.dest =
|
|
4273
|
+
params.config.dest =
|
|
4274
|
+
`${params.src}_dest_${timestampStr}`;
|
|
4164
4275
|
}
|
|
4165
4276
|
else {
|
|
4166
4277
|
throw new Error('Unsupported source:' + params.src);
|
|
@@ -4419,6 +4530,71 @@ class Batches extends BaseModule {
|
|
|
4419
4530
|
});
|
|
4420
4531
|
}
|
|
4421
4532
|
}
|
|
4533
|
+
/**
|
|
4534
|
+
* Deletes a batch job.
|
|
4535
|
+
*
|
|
4536
|
+
* @param params - The parameters for the delete request.
|
|
4537
|
+
* @return The empty response returned by the API.
|
|
4538
|
+
*
|
|
4539
|
+
* @example
|
|
4540
|
+
* ```ts
|
|
4541
|
+
* await ai.batches.delete({name: '...'}); // The server-generated resource name.
|
|
4542
|
+
* ```
|
|
4543
|
+
*/
|
|
4544
|
+
async delete(params) {
|
|
4545
|
+
var _a, _b, _c, _d;
|
|
4546
|
+
let response;
|
|
4547
|
+
let path = '';
|
|
4548
|
+
let queryParams = {};
|
|
4549
|
+
if (this.apiClient.isVertexAI()) {
|
|
4550
|
+
const body = deleteBatchJobParametersToVertex(this.apiClient, params);
|
|
4551
|
+
path = formatMap('batchPredictionJobs/{name}', body['_url']);
|
|
4552
|
+
queryParams = body['_query'];
|
|
4553
|
+
delete body['config'];
|
|
4554
|
+
delete body['_url'];
|
|
4555
|
+
delete body['_query'];
|
|
4556
|
+
response = this.apiClient
|
|
4557
|
+
.request({
|
|
4558
|
+
path: path,
|
|
4559
|
+
queryParams: queryParams,
|
|
4560
|
+
body: JSON.stringify(body),
|
|
4561
|
+
httpMethod: 'DELETE',
|
|
4562
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
4563
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
4564
|
+
})
|
|
4565
|
+
.then((httpResponse) => {
|
|
4566
|
+
return httpResponse.json();
|
|
4567
|
+
});
|
|
4568
|
+
return response.then((apiResponse) => {
|
|
4569
|
+
const resp = deleteResourceJobFromVertex(apiResponse);
|
|
4570
|
+
return resp;
|
|
4571
|
+
});
|
|
4572
|
+
}
|
|
4573
|
+
else {
|
|
4574
|
+
const body = deleteBatchJobParametersToMldev(this.apiClient, params);
|
|
4575
|
+
path = formatMap('batches/{name}', body['_url']);
|
|
4576
|
+
queryParams = body['_query'];
|
|
4577
|
+
delete body['config'];
|
|
4578
|
+
delete body['_url'];
|
|
4579
|
+
delete body['_query'];
|
|
4580
|
+
response = this.apiClient
|
|
4581
|
+
.request({
|
|
4582
|
+
path: path,
|
|
4583
|
+
queryParams: queryParams,
|
|
4584
|
+
body: JSON.stringify(body),
|
|
4585
|
+
httpMethod: 'DELETE',
|
|
4586
|
+
httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
|
|
4587
|
+
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
4588
|
+
})
|
|
4589
|
+
.then((httpResponse) => {
|
|
4590
|
+
return httpResponse.json();
|
|
4591
|
+
});
|
|
4592
|
+
return response.then((apiResponse) => {
|
|
4593
|
+
const resp = deleteResourceJobFromMldev(apiResponse);
|
|
4594
|
+
return resp;
|
|
4595
|
+
});
|
|
4596
|
+
}
|
|
4597
|
+
}
|
|
4422
4598
|
}
|
|
4423
4599
|
|
|
4424
4600
|
/**
|
|
@@ -4673,6 +4849,10 @@ function toolToMldev$3(fromObject) {
|
|
|
4673
4849
|
if (fromCodeExecution != null) {
|
|
4674
4850
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
4675
4851
|
}
|
|
4852
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4853
|
+
if (fromComputerUse != null) {
|
|
4854
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
4855
|
+
}
|
|
4676
4856
|
return toObject;
|
|
4677
4857
|
}
|
|
4678
4858
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
@@ -5163,6 +5343,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5163
5343
|
if (fromCodeExecution != null) {
|
|
5164
5344
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
5165
5345
|
}
|
|
5346
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5347
|
+
if (fromComputerUse != null) {
|
|
5348
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
5349
|
+
}
|
|
5166
5350
|
return toObject;
|
|
5167
5351
|
}
|
|
5168
5352
|
function functionCallingConfigToVertex$1(fromObject) {
|
|
@@ -7369,6 +7553,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7369
7553
|
if (fromCodeExecution != null) {
|
|
7370
7554
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
7371
7555
|
}
|
|
7556
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7557
|
+
if (fromComputerUse != null) {
|
|
7558
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
7559
|
+
}
|
|
7372
7560
|
return toObject;
|
|
7373
7561
|
}
|
|
7374
7562
|
function toolToVertex$1(fromObject) {
|
|
@@ -7419,6 +7607,10 @@ function toolToVertex$1(fromObject) {
|
|
|
7419
7607
|
if (fromCodeExecution != null) {
|
|
7420
7608
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
7421
7609
|
}
|
|
7610
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7611
|
+
if (fromComputerUse != null) {
|
|
7612
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
7613
|
+
}
|
|
7422
7614
|
return toObject;
|
|
7423
7615
|
}
|
|
7424
7616
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
@@ -7914,8 +8106,9 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
|
|
|
7914
8106
|
if (fromMedia != null) {
|
|
7915
8107
|
setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
|
|
7916
8108
|
}
|
|
7917
|
-
|
|
7918
|
-
|
|
8109
|
+
const fromAudio = getValueByPath(fromObject, ['audio']);
|
|
8110
|
+
if (fromAudio != null) {
|
|
8111
|
+
setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
|
|
7919
8112
|
}
|
|
7920
8113
|
const fromAudioStreamEnd = getValueByPath(fromObject, [
|
|
7921
8114
|
'audioStreamEnd',
|
|
@@ -7923,11 +8116,13 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
|
|
|
7923
8116
|
if (fromAudioStreamEnd != null) {
|
|
7924
8117
|
setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
|
|
7925
8118
|
}
|
|
7926
|
-
|
|
7927
|
-
|
|
8119
|
+
const fromVideo = getValueByPath(fromObject, ['video']);
|
|
8120
|
+
if (fromVideo != null) {
|
|
8121
|
+
setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
|
|
7928
8122
|
}
|
|
7929
|
-
|
|
7930
|
-
|
|
8123
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8124
|
+
if (fromText != null) {
|
|
8125
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
7931
8126
|
}
|
|
7932
8127
|
const fromActivityStart = getValueByPath(fromObject, [
|
|
7933
8128
|
'activityStart',
|
|
@@ -8083,8 +8278,12 @@ function liveServerSetupCompleteFromMldev() {
|
|
|
8083
8278
|
const toObject = {};
|
|
8084
8279
|
return toObject;
|
|
8085
8280
|
}
|
|
8086
|
-
function liveServerSetupCompleteFromVertex() {
|
|
8281
|
+
function liveServerSetupCompleteFromVertex(fromObject) {
|
|
8087
8282
|
const toObject = {};
|
|
8283
|
+
const fromSessionId = getValueByPath(fromObject, ['sessionId']);
|
|
8284
|
+
if (fromSessionId != null) {
|
|
8285
|
+
setValueByPath(toObject, ['sessionId'], fromSessionId);
|
|
8286
|
+
}
|
|
8088
8287
|
return toObject;
|
|
8089
8288
|
}
|
|
8090
8289
|
function videoMetadataFromMldev$1(fromObject) {
|
|
@@ -8837,7 +9036,7 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8837
9036
|
'setupComplete',
|
|
8838
9037
|
]);
|
|
8839
9038
|
if (fromSetupComplete != null) {
|
|
8840
|
-
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex());
|
|
9039
|
+
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex(fromSetupComplete));
|
|
8841
9040
|
}
|
|
8842
9041
|
const fromServerContent = getValueByPath(fromObject, [
|
|
8843
9042
|
'serverContent',
|
|
@@ -9405,6 +9604,10 @@ function toolToMldev$1(fromObject) {
|
|
|
9405
9604
|
if (fromCodeExecution != null) {
|
|
9406
9605
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
9407
9606
|
}
|
|
9607
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
9608
|
+
if (fromComputerUse != null) {
|
|
9609
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
9610
|
+
}
|
|
9408
9611
|
return toObject;
|
|
9409
9612
|
}
|
|
9410
9613
|
function functionCallingConfigToMldev(fromObject) {
|
|
@@ -10494,6 +10697,10 @@ function toolToVertex(fromObject) {
|
|
|
10494
10697
|
if (fromCodeExecution != null) {
|
|
10495
10698
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
10496
10699
|
}
|
|
10700
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10701
|
+
if (fromComputerUse != null) {
|
|
10702
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
10703
|
+
}
|
|
10497
10704
|
return toObject;
|
|
10498
10705
|
}
|
|
10499
10706
|
function functionCallingConfigToVertex(fromObject) {
|
|
@@ -11877,7 +12084,7 @@ function modelFromMldev(fromObject) {
|
|
|
11877
12084
|
}
|
|
11878
12085
|
return toObject;
|
|
11879
12086
|
}
|
|
11880
|
-
function listModelsResponseFromMldev(
|
|
12087
|
+
function listModelsResponseFromMldev(fromObject) {
|
|
11881
12088
|
const toObject = {};
|
|
11882
12089
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
11883
12090
|
'nextPageToken',
|
|
@@ -12521,7 +12728,7 @@ function modelFromVertex(fromObject) {
|
|
|
12521
12728
|
}
|
|
12522
12729
|
return toObject;
|
|
12523
12730
|
}
|
|
12524
|
-
function listModelsResponseFromVertex(
|
|
12731
|
+
function listModelsResponseFromVertex(fromObject) {
|
|
12525
12732
|
const toObject = {};
|
|
12526
12733
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
12527
12734
|
'nextPageToken',
|
|
@@ -12647,7 +12854,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12647
12854
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12648
12855
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12649
12856
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12650
|
-
const SDK_VERSION = '1.
|
|
12857
|
+
const SDK_VERSION = '1.8.0'; // x-release-please-version
|
|
12651
12858
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12652
12859
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12653
12860
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -14981,7 +15188,7 @@ class Models extends BaseModule {
|
|
|
14981
15188
|
return httpResponse.json();
|
|
14982
15189
|
});
|
|
14983
15190
|
return response.then((apiResponse) => {
|
|
14984
|
-
const resp = listModelsResponseFromVertex(
|
|
15191
|
+
const resp = listModelsResponseFromVertex(apiResponse);
|
|
14985
15192
|
const typedResp = new ListModelsResponse();
|
|
14986
15193
|
Object.assign(typedResp, resp);
|
|
14987
15194
|
return typedResp;
|
|
@@ -15007,7 +15214,7 @@ class Models extends BaseModule {
|
|
|
15007
15214
|
return httpResponse.json();
|
|
15008
15215
|
});
|
|
15009
15216
|
return response.then((apiResponse) => {
|
|
15010
|
-
const resp = listModelsResponseFromMldev(
|
|
15217
|
+
const resp = listModelsResponseFromMldev(apiResponse);
|
|
15011
15218
|
const typedResp = new ListModelsResponse();
|
|
15012
15219
|
Object.assign(typedResp, resp);
|
|
15013
15220
|
return typedResp;
|
|
@@ -16017,6 +16224,10 @@ function toolToMldev(fromObject) {
|
|
|
16017
16224
|
if (fromCodeExecution != null) {
|
|
16018
16225
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
16019
16226
|
}
|
|
16227
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
16228
|
+
if (fromComputerUse != null) {
|
|
16229
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
16230
|
+
}
|
|
16020
16231
|
return toObject;
|
|
16021
16232
|
}
|
|
16022
16233
|
function sessionResumptionConfigToMldev(fromObject) {
|
|
@@ -16781,6 +16992,9 @@ function tuningDatasetToMldev(fromObject) {
|
|
|
16781
16992
|
if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
|
|
16782
16993
|
throw new Error('gcsUri parameter is not supported in Gemini API.');
|
|
16783
16994
|
}
|
|
16995
|
+
if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
|
|
16996
|
+
throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
|
|
16997
|
+
}
|
|
16784
16998
|
const fromExamples = getValueByPath(fromObject, ['examples']);
|
|
16785
16999
|
if (fromExamples != null) {
|
|
16786
17000
|
let transformedList = fromExamples;
|
|
@@ -16894,17 +17108,29 @@ function tuningDatasetToVertex(fromObject, parentObject) {
|
|
|
16894
17108
|
if (parentObject !== undefined && fromGcsUri != null) {
|
|
16895
17109
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
16896
17110
|
}
|
|
17111
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
17112
|
+
'vertexDatasetResource',
|
|
17113
|
+
]);
|
|
17114
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
17115
|
+
setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
17116
|
+
}
|
|
16897
17117
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
16898
17118
|
throw new Error('examples parameter is not supported in Vertex AI.');
|
|
16899
17119
|
}
|
|
16900
17120
|
return toObject;
|
|
16901
17121
|
}
|
|
16902
|
-
function tuningValidationDatasetToVertex(fromObject) {
|
|
17122
|
+
function tuningValidationDatasetToVertex(fromObject, parentObject) {
|
|
16903
17123
|
const toObject = {};
|
|
16904
17124
|
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
16905
17125
|
if (fromGcsUri != null) {
|
|
16906
17126
|
setValueByPath(toObject, ['validationDatasetUri'], fromGcsUri);
|
|
16907
17127
|
}
|
|
17128
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
17129
|
+
'vertexDatasetResource',
|
|
17130
|
+
]);
|
|
17131
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
17132
|
+
setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
17133
|
+
}
|
|
16908
17134
|
return toObject;
|
|
16909
17135
|
}
|
|
16910
17136
|
function createTuningJobConfigToVertex(fromObject, parentObject) {
|
|
@@ -16913,7 +17139,7 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
|
|
|
16913
17139
|
'validationDataset',
|
|
16914
17140
|
]);
|
|
16915
17141
|
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
16916
|
-
setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
17142
|
+
setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
|
|
16917
17143
|
}
|
|
16918
17144
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
16919
17145
|
'tunedModelDisplayName',
|
|
@@ -17045,6 +17271,14 @@ function tuningJobFromMldev(fromObject) {
|
|
|
17045
17271
|
if (fromPipelineJob != null) {
|
|
17046
17272
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
17047
17273
|
}
|
|
17274
|
+
const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
|
|
17275
|
+
if (fromSatisfiesPzi != null) {
|
|
17276
|
+
setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
|
|
17277
|
+
}
|
|
17278
|
+
const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
|
|
17279
|
+
if (fromSatisfiesPzs != null) {
|
|
17280
|
+
setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
|
|
17281
|
+
}
|
|
17048
17282
|
const fromServiceAccount = getValueByPath(fromObject, [
|
|
17049
17283
|
'serviceAccount',
|
|
17050
17284
|
]);
|
|
@@ -17225,6 +17459,14 @@ function tuningJobFromVertex(fromObject) {
|
|
|
17225
17459
|
if (fromPipelineJob != null) {
|
|
17226
17460
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
17227
17461
|
}
|
|
17462
|
+
const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
|
|
17463
|
+
if (fromSatisfiesPzi != null) {
|
|
17464
|
+
setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
|
|
17465
|
+
}
|
|
17466
|
+
const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
|
|
17467
|
+
if (fromSatisfiesPzs != null) {
|
|
17468
|
+
setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
|
|
17469
|
+
}
|
|
17228
17470
|
const fromServiceAccount = getValueByPath(fromObject, [
|
|
17229
17471
|
'serviceAccount',
|
|
17230
17472
|
]);
|