@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/dist/index.cjs CHANGED
@@ -259,6 +259,22 @@ exports.HarmCategory = void 0;
259
259
  * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
260
260
  */
261
261
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
262
+ /**
263
+ * The harm category is image hate.
264
+ */
265
+ HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
266
+ /**
267
+ * The harm category is image dangerous content.
268
+ */
269
+ HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
270
+ /**
271
+ * The harm category is image harassment.
272
+ */
273
+ HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
274
+ /**
275
+ * The harm category is image sexually explicit content.
276
+ */
277
+ HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
262
278
  })(exports.HarmCategory || (exports.HarmCategory = {}));
263
279
  /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
264
280
  exports.HarmBlockMethod = void 0;
@@ -345,6 +361,50 @@ exports.AuthType = void 0;
345
361
  */
346
362
  AuthType["OIDC_AUTH"] = "OIDC_AUTH";
347
363
  })(exports.AuthType || (exports.AuthType = {}));
364
+ /** The API spec that the external API implements. */
365
+ exports.ApiSpec = void 0;
366
+ (function (ApiSpec) {
367
+ /**
368
+ * Unspecified API spec. This value should not be used.
369
+ */
370
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
371
+ /**
372
+ * Simple search API spec.
373
+ */
374
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
375
+ /**
376
+ * Elastic search API spec.
377
+ */
378
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
379
+ })(exports.ApiSpec || (exports.ApiSpec = {}));
380
+ /** Required. The environment being operated. */
381
+ exports.Environment = void 0;
382
+ (function (Environment) {
383
+ /**
384
+ * Defaults to browser.
385
+ */
386
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
387
+ /**
388
+ * Operates in a web browser.
389
+ */
390
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
391
+ })(exports.Environment || (exports.Environment = {}));
392
+ /** Status of the url retrieval. */
393
+ exports.UrlRetrievalStatus = void 0;
394
+ (function (UrlRetrievalStatus) {
395
+ /**
396
+ * Default value. This value is unused
397
+ */
398
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
399
+ /**
400
+ * Url retrieval is successful.
401
+ */
402
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
403
+ /**
404
+ * Url retrieval is failed due to error.
405
+ */
406
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
407
+ })(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
348
408
  /** Output only. The reason why the model stopped generating tokens.
349
409
 
350
410
  If empty, the model has not stopped generating the tokens.
@@ -475,6 +535,10 @@ exports.BlockedReason = void 0;
475
535
  * Candidates blocked due to prohibited content.
476
536
  */
477
537
  BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
538
+ /**
539
+ * Candidates blocked due to unsafe image generation content.
540
+ */
541
+ BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
478
542
  })(exports.BlockedReason || (exports.BlockedReason = {}));
479
543
  /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
480
544
  exports.TrafficType = void 0;
@@ -672,22 +736,6 @@ exports.FunctionCallingConfigMode = void 0;
672
736
  */
673
737
  FunctionCallingConfigMode["NONE"] = "NONE";
674
738
  })(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
675
- /** Status of the url retrieval. */
676
- exports.UrlRetrievalStatus = void 0;
677
- (function (UrlRetrievalStatus) {
678
- /**
679
- * Default value. This value is unused
680
- */
681
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
682
- /**
683
- * Url retrieval is successful.
684
- */
685
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
686
- /**
687
- * Url retrieval is failed due to error.
688
- */
689
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
690
- })(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
691
739
  /** Enum that controls the safety filter level for objectionable content. */
692
740
  exports.SafetyFilterLevel = void 0;
693
741
  (function (SafetyFilterLevel) {
@@ -2890,6 +2938,10 @@ function toolToMldev$4(fromObject) {
2890
2938
  if (fromCodeExecution != null) {
2891
2939
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2892
2940
  }
2941
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2942
+ if (fromComputerUse != null) {
2943
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
2944
+ }
2893
2945
  return toObject;
2894
2946
  }
2895
2947
  function functionCallingConfigToMldev$2(fromObject) {
@@ -3301,6 +3353,18 @@ function listBatchJobsParametersToMldev(fromObject) {
3301
3353
  }
3302
3354
  return toObject;
3303
3355
  }
3356
+ function deleteBatchJobParametersToMldev(apiClient, fromObject) {
3357
+ const toObject = {};
3358
+ const fromName = getValueByPath(fromObject, ['name']);
3359
+ if (fromName != null) {
3360
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3361
+ }
3362
+ const fromConfig = getValueByPath(fromObject, ['config']);
3363
+ if (fromConfig != null) {
3364
+ setValueByPath(toObject, ['config'], fromConfig);
3365
+ }
3366
+ return toObject;
3367
+ }
3304
3368
  function batchJobSourceToVertex(fromObject) {
3305
3369
  const toObject = {};
3306
3370
  const fromFormat = getValueByPath(fromObject, ['format']);
@@ -3421,6 +3485,18 @@ function listBatchJobsParametersToVertex(fromObject) {
3421
3485
  }
3422
3486
  return toObject;
3423
3487
  }
3488
+ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3489
+ const toObject = {};
3490
+ const fromName = getValueByPath(fromObject, ['name']);
3491
+ if (fromName != null) {
3492
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3493
+ }
3494
+ const fromConfig = getValueByPath(fromObject, ['config']);
3495
+ if (fromConfig != null) {
3496
+ setValueByPath(toObject, ['config'], fromConfig);
3497
+ }
3498
+ return toObject;
3499
+ }
3424
3500
  function jobErrorFromMldev() {
3425
3501
  const toObject = {};
3426
3502
  return toObject;
@@ -3758,6 +3834,22 @@ function listBatchJobsResponseFromMldev(fromObject) {
3758
3834
  }
3759
3835
  return toObject;
3760
3836
  }
3837
+ function deleteResourceJobFromMldev(fromObject) {
3838
+ const toObject = {};
3839
+ const fromName = getValueByPath(fromObject, ['name']);
3840
+ if (fromName != null) {
3841
+ setValueByPath(toObject, ['name'], fromName);
3842
+ }
3843
+ const fromDone = getValueByPath(fromObject, ['done']);
3844
+ if (fromDone != null) {
3845
+ setValueByPath(toObject, ['done'], fromDone);
3846
+ }
3847
+ const fromError = getValueByPath(fromObject, ['error']);
3848
+ if (fromError != null) {
3849
+ setValueByPath(toObject, ['error'], jobErrorFromMldev());
3850
+ }
3851
+ return toObject;
3852
+ }
3761
3853
  function jobErrorFromVertex(fromObject) {
3762
3854
  const toObject = {};
3763
3855
  const fromDetails = getValueByPath(fromObject, ['details']);
@@ -3885,6 +3977,22 @@ function listBatchJobsResponseFromVertex(fromObject) {
3885
3977
  }
3886
3978
  return toObject;
3887
3979
  }
3980
+ function deleteResourceJobFromVertex(fromObject) {
3981
+ const toObject = {};
3982
+ const fromName = getValueByPath(fromObject, ['name']);
3983
+ if (fromName != null) {
3984
+ setValueByPath(toObject, ['name'], fromName);
3985
+ }
3986
+ const fromDone = getValueByPath(fromObject, ['done']);
3987
+ if (fromDone != null) {
3988
+ setValueByPath(toObject, ['done'], fromDone);
3989
+ }
3990
+ const fromError = getValueByPath(fromObject, ['error']);
3991
+ if (fromError != null) {
3992
+ setValueByPath(toObject, ['error'], jobErrorFromVertex(fromError));
3993
+ }
3994
+ return toObject;
3995
+ }
3888
3996
 
3889
3997
  /**
3890
3998
  * @license
@@ -4092,20 +4200,23 @@ class Batches extends BaseModule {
4092
4200
  */
4093
4201
  this.create = async (params) => {
4094
4202
  if (this.apiClient.isVertexAI()) {
4203
+ const timestamp = Date.now();
4204
+ const timestampStr = timestamp.toString();
4095
4205
  if (Array.isArray(params.src)) {
4096
4206
  throw new Error('InlinedRequest[] is not supported in Vertex AI. Please use ' +
4097
4207
  'Google Cloud Storage URI or BigQuery URI instead.');
4098
4208
  }
4099
4209
  params.config = params.config || {};
4100
4210
  if (params.config.displayName === undefined) {
4101
- params.config.displayName = 'genaiBatchJob_';
4211
+ params.config.displayName = 'genaiBatchJob_${timestampStr}';
4102
4212
  }
4103
4213
  if (params.config.dest === undefined && typeof params.src === 'string') {
4104
4214
  if (params.src.startsWith('gs://') && params.src.endsWith('.jsonl')) {
4105
4215
  params.config.dest = `${params.src.slice(0, -6)}/dest`;
4106
4216
  }
4107
4217
  else if (params.src.startsWith('bq://')) {
4108
- params.config.dest = `${params.src}_dest_`;
4218
+ params.config.dest =
4219
+ `${params.src}_dest_${timestampStr}`;
4109
4220
  }
4110
4221
  else {
4111
4222
  throw new Error('Unsupported source:' + params.src);
@@ -4364,6 +4475,71 @@ class Batches extends BaseModule {
4364
4475
  });
4365
4476
  }
4366
4477
  }
4478
+ /**
4479
+ * Deletes a batch job.
4480
+ *
4481
+ * @param params - The parameters for the delete request.
4482
+ * @return The empty response returned by the API.
4483
+ *
4484
+ * @example
4485
+ * ```ts
4486
+ * await ai.batches.delete({name: '...'}); // The server-generated resource name.
4487
+ * ```
4488
+ */
4489
+ async delete(params) {
4490
+ var _a, _b, _c, _d;
4491
+ let response;
4492
+ let path = '';
4493
+ let queryParams = {};
4494
+ if (this.apiClient.isVertexAI()) {
4495
+ const body = deleteBatchJobParametersToVertex(this.apiClient, params);
4496
+ path = formatMap('batchPredictionJobs/{name}', body['_url']);
4497
+ queryParams = body['_query'];
4498
+ delete body['config'];
4499
+ delete body['_url'];
4500
+ delete body['_query'];
4501
+ response = this.apiClient
4502
+ .request({
4503
+ path: path,
4504
+ queryParams: queryParams,
4505
+ body: JSON.stringify(body),
4506
+ httpMethod: 'DELETE',
4507
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
4508
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4509
+ })
4510
+ .then((httpResponse) => {
4511
+ return httpResponse.json();
4512
+ });
4513
+ return response.then((apiResponse) => {
4514
+ const resp = deleteResourceJobFromVertex(apiResponse);
4515
+ return resp;
4516
+ });
4517
+ }
4518
+ else {
4519
+ const body = deleteBatchJobParametersToMldev(this.apiClient, params);
4520
+ path = formatMap('batches/{name}', body['_url']);
4521
+ queryParams = body['_query'];
4522
+ delete body['config'];
4523
+ delete body['_url'];
4524
+ delete body['_query'];
4525
+ response = this.apiClient
4526
+ .request({
4527
+ path: path,
4528
+ queryParams: queryParams,
4529
+ body: JSON.stringify(body),
4530
+ httpMethod: 'DELETE',
4531
+ httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
4532
+ abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4533
+ })
4534
+ .then((httpResponse) => {
4535
+ return httpResponse.json();
4536
+ });
4537
+ return response.then((apiResponse) => {
4538
+ const resp = deleteResourceJobFromMldev(apiResponse);
4539
+ return resp;
4540
+ });
4541
+ }
4542
+ }
4367
4543
  }
4368
4544
 
4369
4545
  /**
@@ -4618,6 +4794,10 @@ function toolToMldev$3(fromObject) {
4618
4794
  if (fromCodeExecution != null) {
4619
4795
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4620
4796
  }
4797
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4798
+ if (fromComputerUse != null) {
4799
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
4800
+ }
4621
4801
  return toObject;
4622
4802
  }
4623
4803
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5108,6 +5288,10 @@ function toolToVertex$2(fromObject) {
5108
5288
  if (fromCodeExecution != null) {
5109
5289
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5110
5290
  }
5291
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5292
+ if (fromComputerUse != null) {
5293
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
5294
+ }
5111
5295
  return toObject;
5112
5296
  }
5113
5297
  function functionCallingConfigToVertex$1(fromObject) {
@@ -6195,7 +6379,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6195
6379
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6196
6380
  const USER_AGENT_HEADER = 'User-Agent';
6197
6381
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6198
- const SDK_VERSION = '1.7.0'; // x-release-please-version
6382
+ const SDK_VERSION = '1.8.0'; // x-release-please-version
6199
6383
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6200
6384
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6201
6385
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -8004,6 +8188,10 @@ function toolToMldev$2(fromObject) {
8004
8188
  if (fromCodeExecution != null) {
8005
8189
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8006
8190
  }
8191
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8192
+ if (fromComputerUse != null) {
8193
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8194
+ }
8007
8195
  return toObject;
8008
8196
  }
8009
8197
  function toolToVertex$1(fromObject) {
@@ -8054,6 +8242,10 @@ function toolToVertex$1(fromObject) {
8054
8242
  if (fromCodeExecution != null) {
8055
8243
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8056
8244
  }
8245
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8246
+ if (fromComputerUse != null) {
8247
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8248
+ }
8057
8249
  return toObject;
8058
8250
  }
8059
8251
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -8549,8 +8741,9 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
8549
8741
  if (fromMedia != null) {
8550
8742
  setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8551
8743
  }
8552
- if (getValueByPath(fromObject, ['audio']) !== undefined) {
8553
- throw new Error('audio parameter is not supported in Vertex AI.');
8744
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8745
+ if (fromAudio != null) {
8746
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8554
8747
  }
8555
8748
  const fromAudioStreamEnd = getValueByPath(fromObject, [
8556
8749
  'audioStreamEnd',
@@ -8558,11 +8751,13 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
8558
8751
  if (fromAudioStreamEnd != null) {
8559
8752
  setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8560
8753
  }
8561
- if (getValueByPath(fromObject, ['video']) !== undefined) {
8562
- throw new Error('video parameter is not supported in Vertex AI.');
8754
+ const fromVideo = getValueByPath(fromObject, ['video']);
8755
+ if (fromVideo != null) {
8756
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8563
8757
  }
8564
- if (getValueByPath(fromObject, ['text']) !== undefined) {
8565
- throw new Error('text parameter is not supported in Vertex AI.');
8758
+ const fromText = getValueByPath(fromObject, ['text']);
8759
+ if (fromText != null) {
8760
+ setValueByPath(toObject, ['text'], fromText);
8566
8761
  }
8567
8762
  const fromActivityStart = getValueByPath(fromObject, [
8568
8763
  'activityStart',
@@ -8718,8 +8913,12 @@ function liveServerSetupCompleteFromMldev() {
8718
8913
  const toObject = {};
8719
8914
  return toObject;
8720
8915
  }
8721
- function liveServerSetupCompleteFromVertex() {
8916
+ function liveServerSetupCompleteFromVertex(fromObject) {
8722
8917
  const toObject = {};
8918
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8919
+ if (fromSessionId != null) {
8920
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
8921
+ }
8723
8922
  return toObject;
8724
8923
  }
8725
8924
  function videoMetadataFromMldev$1(fromObject) {
@@ -9472,7 +9671,7 @@ function liveServerMessageFromVertex(fromObject) {
9472
9671
  'setupComplete',
9473
9672
  ]);
9474
9673
  if (fromSetupComplete != null) {
9475
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex());
9674
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex(fromSetupComplete));
9476
9675
  }
9477
9676
  const fromServerContent = getValueByPath(fromObject, [
9478
9677
  'serverContent',
@@ -10040,6 +10239,10 @@ function toolToMldev$1(fromObject) {
10040
10239
  if (fromCodeExecution != null) {
10041
10240
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10042
10241
  }
10242
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10243
+ if (fromComputerUse != null) {
10244
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
10245
+ }
10043
10246
  return toObject;
10044
10247
  }
10045
10248
  function functionCallingConfigToMldev(fromObject) {
@@ -11129,6 +11332,10 @@ function toolToVertex(fromObject) {
11129
11332
  if (fromCodeExecution != null) {
11130
11333
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
11131
11334
  }
11335
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11336
+ if (fromComputerUse != null) {
11337
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
11338
+ }
11132
11339
  return toObject;
11133
11340
  }
11134
11341
  function functionCallingConfigToVertex(fromObject) {
@@ -12512,7 +12719,7 @@ function modelFromMldev(fromObject) {
12512
12719
  }
12513
12720
  return toObject;
12514
12721
  }
12515
- function listModelsResponseFromMldev(apiClient, fromObject) {
12722
+ function listModelsResponseFromMldev(fromObject) {
12516
12723
  const toObject = {};
12517
12724
  const fromNextPageToken = getValueByPath(fromObject, [
12518
12725
  'nextPageToken',
@@ -13156,7 +13363,7 @@ function modelFromVertex(fromObject) {
13156
13363
  }
13157
13364
  return toObject;
13158
13365
  }
13159
- function listModelsResponseFromVertex(apiClient, fromObject) {
13366
+ function listModelsResponseFromVertex(fromObject) {
13160
13367
  const toObject = {};
13161
13368
  const fromNextPageToken = getValueByPath(fromObject, [
13162
13369
  'nextPageToken',
@@ -15049,7 +15256,7 @@ class Models extends BaseModule {
15049
15256
  return httpResponse.json();
15050
15257
  });
15051
15258
  return response.then((apiResponse) => {
15052
- const resp = listModelsResponseFromVertex(this.apiClient, apiResponse);
15259
+ const resp = listModelsResponseFromVertex(apiResponse);
15053
15260
  const typedResp = new ListModelsResponse();
15054
15261
  Object.assign(typedResp, resp);
15055
15262
  return typedResp;
@@ -15075,7 +15282,7 @@ class Models extends BaseModule {
15075
15282
  return httpResponse.json();
15076
15283
  });
15077
15284
  return response.then((apiResponse) => {
15078
- const resp = listModelsResponseFromMldev(this.apiClient, apiResponse);
15285
+ const resp = listModelsResponseFromMldev(apiResponse);
15079
15286
  const typedResp = new ListModelsResponse();
15080
15287
  Object.assign(typedResp, resp);
15081
15288
  return typedResp;
@@ -16085,6 +16292,10 @@ function toolToMldev(fromObject) {
16085
16292
  if (fromCodeExecution != null) {
16086
16293
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16087
16294
  }
16295
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16296
+ if (fromComputerUse != null) {
16297
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
16298
+ }
16088
16299
  return toObject;
16089
16300
  }
16090
16301
  function sessionResumptionConfigToMldev(fromObject) {
@@ -16675,6 +16886,9 @@ function tuningDatasetToMldev(fromObject) {
16675
16886
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
16676
16887
  throw new Error('gcsUri parameter is not supported in Gemini API.');
16677
16888
  }
16889
+ if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
16890
+ throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
16891
+ }
16678
16892
  const fromExamples = getValueByPath(fromObject, ['examples']);
16679
16893
  if (fromExamples != null) {
16680
16894
  let transformedList = fromExamples;
@@ -16788,17 +17002,29 @@ function tuningDatasetToVertex(fromObject, parentObject) {
16788
17002
  if (parentObject !== undefined && fromGcsUri != null) {
16789
17003
  setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
16790
17004
  }
17005
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
17006
+ 'vertexDatasetResource',
17007
+ ]);
17008
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
17009
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
17010
+ }
16791
17011
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
16792
17012
  throw new Error('examples parameter is not supported in Vertex AI.');
16793
17013
  }
16794
17014
  return toObject;
16795
17015
  }
16796
- function tuningValidationDatasetToVertex(fromObject) {
17016
+ function tuningValidationDatasetToVertex(fromObject, parentObject) {
16797
17017
  const toObject = {};
16798
17018
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
16799
17019
  if (fromGcsUri != null) {
16800
17020
  setValueByPath(toObject, ['validationDatasetUri'], fromGcsUri);
16801
17021
  }
17022
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
17023
+ 'vertexDatasetResource',
17024
+ ]);
17025
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
17026
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
17027
+ }
16802
17028
  return toObject;
16803
17029
  }
16804
17030
  function createTuningJobConfigToVertex(fromObject, parentObject) {
@@ -16807,7 +17033,7 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
16807
17033
  'validationDataset',
16808
17034
  ]);
16809
17035
  if (parentObject !== undefined && fromValidationDataset != null) {
16810
- setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
17036
+ setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
16811
17037
  }
16812
17038
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
16813
17039
  'tunedModelDisplayName',
@@ -16939,6 +17165,14 @@ function tuningJobFromMldev(fromObject) {
16939
17165
  if (fromPipelineJob != null) {
16940
17166
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
16941
17167
  }
17168
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17169
+ if (fromSatisfiesPzi != null) {
17170
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17171
+ }
17172
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17173
+ if (fromSatisfiesPzs != null) {
17174
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17175
+ }
16942
17176
  const fromServiceAccount = getValueByPath(fromObject, [
16943
17177
  'serviceAccount',
16944
17178
  ]);
@@ -17119,6 +17353,14 @@ function tuningJobFromVertex(fromObject) {
17119
17353
  if (fromPipelineJob != null) {
17120
17354
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17121
17355
  }
17356
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17357
+ if (fromSatisfiesPzi != null) {
17358
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17359
+ }
17360
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17361
+ if (fromSatisfiesPzs != null) {
17362
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17363
+ }
17122
17364
  const fromServiceAccount = getValueByPath(fromObject, [
17123
17365
  'serviceAccount',
17124
17366
  ]);