@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.mjs CHANGED
@@ -257,6 +257,22 @@ var HarmCategory;
257
257
  * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
258
258
  */
259
259
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
260
+ /**
261
+ * The harm category is image hate.
262
+ */
263
+ HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
264
+ /**
265
+ * The harm category is image dangerous content.
266
+ */
267
+ HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
268
+ /**
269
+ * The harm category is image harassment.
270
+ */
271
+ HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
272
+ /**
273
+ * The harm category is image sexually explicit content.
274
+ */
275
+ HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
260
276
  })(HarmCategory || (HarmCategory = {}));
261
277
  /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
262
278
  var HarmBlockMethod;
@@ -343,6 +359,50 @@ var AuthType;
343
359
  */
344
360
  AuthType["OIDC_AUTH"] = "OIDC_AUTH";
345
361
  })(AuthType || (AuthType = {}));
362
+ /** The API spec that the external API implements. */
363
+ var ApiSpec;
364
+ (function (ApiSpec) {
365
+ /**
366
+ * Unspecified API spec. This value should not be used.
367
+ */
368
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
369
+ /**
370
+ * Simple search API spec.
371
+ */
372
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
373
+ /**
374
+ * Elastic search API spec.
375
+ */
376
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
377
+ })(ApiSpec || (ApiSpec = {}));
378
+ /** Required. The environment being operated. */
379
+ var Environment;
380
+ (function (Environment) {
381
+ /**
382
+ * Defaults to browser.
383
+ */
384
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
385
+ /**
386
+ * Operates in a web browser.
387
+ */
388
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
389
+ })(Environment || (Environment = {}));
390
+ /** Status of the url retrieval. */
391
+ var UrlRetrievalStatus;
392
+ (function (UrlRetrievalStatus) {
393
+ /**
394
+ * Default value. This value is unused
395
+ */
396
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
397
+ /**
398
+ * Url retrieval is successful.
399
+ */
400
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
401
+ /**
402
+ * Url retrieval is failed due to error.
403
+ */
404
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
405
+ })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
346
406
  /** Output only. The reason why the model stopped generating tokens.
347
407
 
348
408
  If empty, the model has not stopped generating the tokens.
@@ -473,6 +533,10 @@ var BlockedReason;
473
533
  * Candidates blocked due to prohibited content.
474
534
  */
475
535
  BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
536
+ /**
537
+ * Candidates blocked due to unsafe image generation content.
538
+ */
539
+ BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
476
540
  })(BlockedReason || (BlockedReason = {}));
477
541
  /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
478
542
  var TrafficType;
@@ -670,22 +734,6 @@ var FunctionCallingConfigMode;
670
734
  */
671
735
  FunctionCallingConfigMode["NONE"] = "NONE";
672
736
  })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
673
- /** Status of the url retrieval. */
674
- var UrlRetrievalStatus;
675
- (function (UrlRetrievalStatus) {
676
- /**
677
- * Default value. This value is unused
678
- */
679
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
680
- /**
681
- * Url retrieval is successful.
682
- */
683
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
684
- /**
685
- * Url retrieval is failed due to error.
686
- */
687
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
688
- })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
689
737
  /** Enum that controls the safety filter level for objectionable content. */
690
738
  var SafetyFilterLevel;
691
739
  (function (SafetyFilterLevel) {
@@ -2888,6 +2936,10 @@ function toolToMldev$4(fromObject) {
2888
2936
  if (fromCodeExecution != null) {
2889
2937
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2890
2938
  }
2939
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2940
+ if (fromComputerUse != null) {
2941
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
2942
+ }
2891
2943
  return toObject;
2892
2944
  }
2893
2945
  function functionCallingConfigToMldev$2(fromObject) {
@@ -3299,6 +3351,18 @@ function listBatchJobsParametersToMldev(fromObject) {
3299
3351
  }
3300
3352
  return toObject;
3301
3353
  }
3354
+ function deleteBatchJobParametersToMldev(apiClient, fromObject) {
3355
+ const toObject = {};
3356
+ const fromName = getValueByPath(fromObject, ['name']);
3357
+ if (fromName != null) {
3358
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3359
+ }
3360
+ const fromConfig = getValueByPath(fromObject, ['config']);
3361
+ if (fromConfig != null) {
3362
+ setValueByPath(toObject, ['config'], fromConfig);
3363
+ }
3364
+ return toObject;
3365
+ }
3302
3366
  function batchJobSourceToVertex(fromObject) {
3303
3367
  const toObject = {};
3304
3368
  const fromFormat = getValueByPath(fromObject, ['format']);
@@ -3419,6 +3483,18 @@ function listBatchJobsParametersToVertex(fromObject) {
3419
3483
  }
3420
3484
  return toObject;
3421
3485
  }
3486
+ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3487
+ const toObject = {};
3488
+ const fromName = getValueByPath(fromObject, ['name']);
3489
+ if (fromName != null) {
3490
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3491
+ }
3492
+ const fromConfig = getValueByPath(fromObject, ['config']);
3493
+ if (fromConfig != null) {
3494
+ setValueByPath(toObject, ['config'], fromConfig);
3495
+ }
3496
+ return toObject;
3497
+ }
3422
3498
  function jobErrorFromMldev() {
3423
3499
  const toObject = {};
3424
3500
  return toObject;
@@ -3756,6 +3832,22 @@ function listBatchJobsResponseFromMldev(fromObject) {
3756
3832
  }
3757
3833
  return toObject;
3758
3834
  }
3835
+ function deleteResourceJobFromMldev(fromObject) {
3836
+ const toObject = {};
3837
+ const fromName = getValueByPath(fromObject, ['name']);
3838
+ if (fromName != null) {
3839
+ setValueByPath(toObject, ['name'], fromName);
3840
+ }
3841
+ const fromDone = getValueByPath(fromObject, ['done']);
3842
+ if (fromDone != null) {
3843
+ setValueByPath(toObject, ['done'], fromDone);
3844
+ }
3845
+ const fromError = getValueByPath(fromObject, ['error']);
3846
+ if (fromError != null) {
3847
+ setValueByPath(toObject, ['error'], jobErrorFromMldev());
3848
+ }
3849
+ return toObject;
3850
+ }
3759
3851
  function jobErrorFromVertex(fromObject) {
3760
3852
  const toObject = {};
3761
3853
  const fromDetails = getValueByPath(fromObject, ['details']);
@@ -3883,6 +3975,22 @@ function listBatchJobsResponseFromVertex(fromObject) {
3883
3975
  }
3884
3976
  return toObject;
3885
3977
  }
3978
+ function deleteResourceJobFromVertex(fromObject) {
3979
+ const toObject = {};
3980
+ const fromName = getValueByPath(fromObject, ['name']);
3981
+ if (fromName != null) {
3982
+ setValueByPath(toObject, ['name'], fromName);
3983
+ }
3984
+ const fromDone = getValueByPath(fromObject, ['done']);
3985
+ if (fromDone != null) {
3986
+ setValueByPath(toObject, ['done'], fromDone);
3987
+ }
3988
+ const fromError = getValueByPath(fromObject, ['error']);
3989
+ if (fromError != null) {
3990
+ setValueByPath(toObject, ['error'], jobErrorFromVertex(fromError));
3991
+ }
3992
+ return toObject;
3993
+ }
3886
3994
 
3887
3995
  /**
3888
3996
  * @license
@@ -4090,20 +4198,23 @@ class Batches extends BaseModule {
4090
4198
  */
4091
4199
  this.create = async (params) => {
4092
4200
  if (this.apiClient.isVertexAI()) {
4201
+ const timestamp = Date.now();
4202
+ const timestampStr = timestamp.toString();
4093
4203
  if (Array.isArray(params.src)) {
4094
4204
  throw new Error('InlinedRequest[] is not supported in Vertex AI. Please use ' +
4095
4205
  'Google Cloud Storage URI or BigQuery URI instead.');
4096
4206
  }
4097
4207
  params.config = params.config || {};
4098
4208
  if (params.config.displayName === undefined) {
4099
- params.config.displayName = 'genaiBatchJob_';
4209
+ params.config.displayName = 'genaiBatchJob_${timestampStr}';
4100
4210
  }
4101
4211
  if (params.config.dest === undefined && typeof params.src === 'string') {
4102
4212
  if (params.src.startsWith('gs://') && params.src.endsWith('.jsonl')) {
4103
4213
  params.config.dest = `${params.src.slice(0, -6)}/dest`;
4104
4214
  }
4105
4215
  else if (params.src.startsWith('bq://')) {
4106
- params.config.dest = `${params.src}_dest_`;
4216
+ params.config.dest =
4217
+ `${params.src}_dest_${timestampStr}`;
4107
4218
  }
4108
4219
  else {
4109
4220
  throw new Error('Unsupported source:' + params.src);
@@ -4362,6 +4473,71 @@ class Batches extends BaseModule {
4362
4473
  });
4363
4474
  }
4364
4475
  }
4476
+ /**
4477
+ * Deletes a batch job.
4478
+ *
4479
+ * @param params - The parameters for the delete request.
4480
+ * @return The empty response returned by the API.
4481
+ *
4482
+ * @example
4483
+ * ```ts
4484
+ * await ai.batches.delete({name: '...'}); // The server-generated resource name.
4485
+ * ```
4486
+ */
4487
+ async delete(params) {
4488
+ var _a, _b, _c, _d;
4489
+ let response;
4490
+ let path = '';
4491
+ let queryParams = {};
4492
+ if (this.apiClient.isVertexAI()) {
4493
+ const body = deleteBatchJobParametersToVertex(this.apiClient, params);
4494
+ path = formatMap('batchPredictionJobs/{name}', body['_url']);
4495
+ queryParams = body['_query'];
4496
+ delete body['config'];
4497
+ delete body['_url'];
4498
+ delete body['_query'];
4499
+ response = this.apiClient
4500
+ .request({
4501
+ path: path,
4502
+ queryParams: queryParams,
4503
+ body: JSON.stringify(body),
4504
+ httpMethod: 'DELETE',
4505
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
4506
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4507
+ })
4508
+ .then((httpResponse) => {
4509
+ return httpResponse.json();
4510
+ });
4511
+ return response.then((apiResponse) => {
4512
+ const resp = deleteResourceJobFromVertex(apiResponse);
4513
+ return resp;
4514
+ });
4515
+ }
4516
+ else {
4517
+ const body = deleteBatchJobParametersToMldev(this.apiClient, params);
4518
+ path = formatMap('batches/{name}', body['_url']);
4519
+ queryParams = body['_query'];
4520
+ delete body['config'];
4521
+ delete body['_url'];
4522
+ delete body['_query'];
4523
+ response = this.apiClient
4524
+ .request({
4525
+ path: path,
4526
+ queryParams: queryParams,
4527
+ body: JSON.stringify(body),
4528
+ httpMethod: 'DELETE',
4529
+ httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
4530
+ abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4531
+ })
4532
+ .then((httpResponse) => {
4533
+ return httpResponse.json();
4534
+ });
4535
+ return response.then((apiResponse) => {
4536
+ const resp = deleteResourceJobFromMldev(apiResponse);
4537
+ return resp;
4538
+ });
4539
+ }
4540
+ }
4365
4541
  }
4366
4542
 
4367
4543
  /**
@@ -4616,6 +4792,10 @@ function toolToMldev$3(fromObject) {
4616
4792
  if (fromCodeExecution != null) {
4617
4793
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4618
4794
  }
4795
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4796
+ if (fromComputerUse != null) {
4797
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
4798
+ }
4619
4799
  return toObject;
4620
4800
  }
4621
4801
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5106,6 +5286,10 @@ function toolToVertex$2(fromObject) {
5106
5286
  if (fromCodeExecution != null) {
5107
5287
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5108
5288
  }
5289
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5290
+ if (fromComputerUse != null) {
5291
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
5292
+ }
5109
5293
  return toObject;
5110
5294
  }
5111
5295
  function functionCallingConfigToVertex$1(fromObject) {
@@ -6193,7 +6377,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6193
6377
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6194
6378
  const USER_AGENT_HEADER = 'User-Agent';
6195
6379
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6196
- const SDK_VERSION = '1.7.0'; // x-release-please-version
6380
+ const SDK_VERSION = '1.8.0'; // x-release-please-version
6197
6381
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6198
6382
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6199
6383
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -8002,6 +8186,10 @@ function toolToMldev$2(fromObject) {
8002
8186
  if (fromCodeExecution != null) {
8003
8187
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8004
8188
  }
8189
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8190
+ if (fromComputerUse != null) {
8191
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8192
+ }
8005
8193
  return toObject;
8006
8194
  }
8007
8195
  function toolToVertex$1(fromObject) {
@@ -8052,6 +8240,10 @@ function toolToVertex$1(fromObject) {
8052
8240
  if (fromCodeExecution != null) {
8053
8241
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8054
8242
  }
8243
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8244
+ if (fromComputerUse != null) {
8245
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8246
+ }
8055
8247
  return toObject;
8056
8248
  }
8057
8249
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -8547,8 +8739,9 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
8547
8739
  if (fromMedia != null) {
8548
8740
  setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8549
8741
  }
8550
- if (getValueByPath(fromObject, ['audio']) !== undefined) {
8551
- throw new Error('audio parameter is not supported in Vertex AI.');
8742
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8743
+ if (fromAudio != null) {
8744
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8552
8745
  }
8553
8746
  const fromAudioStreamEnd = getValueByPath(fromObject, [
8554
8747
  'audioStreamEnd',
@@ -8556,11 +8749,13 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
8556
8749
  if (fromAudioStreamEnd != null) {
8557
8750
  setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8558
8751
  }
8559
- if (getValueByPath(fromObject, ['video']) !== undefined) {
8560
- throw new Error('video parameter is not supported in Vertex AI.');
8752
+ const fromVideo = getValueByPath(fromObject, ['video']);
8753
+ if (fromVideo != null) {
8754
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8561
8755
  }
8562
- if (getValueByPath(fromObject, ['text']) !== undefined) {
8563
- throw new Error('text parameter is not supported in Vertex AI.');
8756
+ const fromText = getValueByPath(fromObject, ['text']);
8757
+ if (fromText != null) {
8758
+ setValueByPath(toObject, ['text'], fromText);
8564
8759
  }
8565
8760
  const fromActivityStart = getValueByPath(fromObject, [
8566
8761
  'activityStart',
@@ -8716,8 +8911,12 @@ function liveServerSetupCompleteFromMldev() {
8716
8911
  const toObject = {};
8717
8912
  return toObject;
8718
8913
  }
8719
- function liveServerSetupCompleteFromVertex() {
8914
+ function liveServerSetupCompleteFromVertex(fromObject) {
8720
8915
  const toObject = {};
8916
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8917
+ if (fromSessionId != null) {
8918
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
8919
+ }
8721
8920
  return toObject;
8722
8921
  }
8723
8922
  function videoMetadataFromMldev$1(fromObject) {
@@ -9470,7 +9669,7 @@ function liveServerMessageFromVertex(fromObject) {
9470
9669
  'setupComplete',
9471
9670
  ]);
9472
9671
  if (fromSetupComplete != null) {
9473
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex());
9672
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex(fromSetupComplete));
9474
9673
  }
9475
9674
  const fromServerContent = getValueByPath(fromObject, [
9476
9675
  'serverContent',
@@ -10038,6 +10237,10 @@ function toolToMldev$1(fromObject) {
10038
10237
  if (fromCodeExecution != null) {
10039
10238
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10040
10239
  }
10240
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10241
+ if (fromComputerUse != null) {
10242
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
10243
+ }
10041
10244
  return toObject;
10042
10245
  }
10043
10246
  function functionCallingConfigToMldev(fromObject) {
@@ -11127,6 +11330,10 @@ function toolToVertex(fromObject) {
11127
11330
  if (fromCodeExecution != null) {
11128
11331
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
11129
11332
  }
11333
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
11334
+ if (fromComputerUse != null) {
11335
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
11336
+ }
11130
11337
  return toObject;
11131
11338
  }
11132
11339
  function functionCallingConfigToVertex(fromObject) {
@@ -12510,7 +12717,7 @@ function modelFromMldev(fromObject) {
12510
12717
  }
12511
12718
  return toObject;
12512
12719
  }
12513
- function listModelsResponseFromMldev(apiClient, fromObject) {
12720
+ function listModelsResponseFromMldev(fromObject) {
12514
12721
  const toObject = {};
12515
12722
  const fromNextPageToken = getValueByPath(fromObject, [
12516
12723
  'nextPageToken',
@@ -13154,7 +13361,7 @@ function modelFromVertex(fromObject) {
13154
13361
  }
13155
13362
  return toObject;
13156
13363
  }
13157
- function listModelsResponseFromVertex(apiClient, fromObject) {
13364
+ function listModelsResponseFromVertex(fromObject) {
13158
13365
  const toObject = {};
13159
13366
  const fromNextPageToken = getValueByPath(fromObject, [
13160
13367
  'nextPageToken',
@@ -15047,7 +15254,7 @@ class Models extends BaseModule {
15047
15254
  return httpResponse.json();
15048
15255
  });
15049
15256
  return response.then((apiResponse) => {
15050
- const resp = listModelsResponseFromVertex(this.apiClient, apiResponse);
15257
+ const resp = listModelsResponseFromVertex(apiResponse);
15051
15258
  const typedResp = new ListModelsResponse();
15052
15259
  Object.assign(typedResp, resp);
15053
15260
  return typedResp;
@@ -15073,7 +15280,7 @@ class Models extends BaseModule {
15073
15280
  return httpResponse.json();
15074
15281
  });
15075
15282
  return response.then((apiResponse) => {
15076
- const resp = listModelsResponseFromMldev(this.apiClient, apiResponse);
15283
+ const resp = listModelsResponseFromMldev(apiResponse);
15077
15284
  const typedResp = new ListModelsResponse();
15078
15285
  Object.assign(typedResp, resp);
15079
15286
  return typedResp;
@@ -16083,6 +16290,10 @@ function toolToMldev(fromObject) {
16083
16290
  if (fromCodeExecution != null) {
16084
16291
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16085
16292
  }
16293
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16294
+ if (fromComputerUse != null) {
16295
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
16296
+ }
16086
16297
  return toObject;
16087
16298
  }
16088
16299
  function sessionResumptionConfigToMldev(fromObject) {
@@ -16673,6 +16884,9 @@ function tuningDatasetToMldev(fromObject) {
16673
16884
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
16674
16885
  throw new Error('gcsUri parameter is not supported in Gemini API.');
16675
16886
  }
16887
+ if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
16888
+ throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
16889
+ }
16676
16890
  const fromExamples = getValueByPath(fromObject, ['examples']);
16677
16891
  if (fromExamples != null) {
16678
16892
  let transformedList = fromExamples;
@@ -16786,17 +17000,29 @@ function tuningDatasetToVertex(fromObject, parentObject) {
16786
17000
  if (parentObject !== undefined && fromGcsUri != null) {
16787
17001
  setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
16788
17002
  }
17003
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
17004
+ 'vertexDatasetResource',
17005
+ ]);
17006
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
17007
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
17008
+ }
16789
17009
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
16790
17010
  throw new Error('examples parameter is not supported in Vertex AI.');
16791
17011
  }
16792
17012
  return toObject;
16793
17013
  }
16794
- function tuningValidationDatasetToVertex(fromObject) {
17014
+ function tuningValidationDatasetToVertex(fromObject, parentObject) {
16795
17015
  const toObject = {};
16796
17016
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
16797
17017
  if (fromGcsUri != null) {
16798
17018
  setValueByPath(toObject, ['validationDatasetUri'], fromGcsUri);
16799
17019
  }
17020
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
17021
+ 'vertexDatasetResource',
17022
+ ]);
17023
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
17024
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
17025
+ }
16800
17026
  return toObject;
16801
17027
  }
16802
17028
  function createTuningJobConfigToVertex(fromObject, parentObject) {
@@ -16805,7 +17031,7 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
16805
17031
  'validationDataset',
16806
17032
  ]);
16807
17033
  if (parentObject !== undefined && fromValidationDataset != null) {
16808
- setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
17034
+ setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
16809
17035
  }
16810
17036
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
16811
17037
  'tunedModelDisplayName',
@@ -16937,6 +17163,14 @@ function tuningJobFromMldev(fromObject) {
16937
17163
  if (fromPipelineJob != null) {
16938
17164
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
16939
17165
  }
17166
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17167
+ if (fromSatisfiesPzi != null) {
17168
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17169
+ }
17170
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17171
+ if (fromSatisfiesPzs != null) {
17172
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17173
+ }
16940
17174
  const fromServiceAccount = getValueByPath(fromObject, [
16941
17175
  'serviceAccount',
16942
17176
  ]);
@@ -17117,6 +17351,14 @@ function tuningJobFromVertex(fromObject) {
17117
17351
  if (fromPipelineJob != null) {
17118
17352
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17119
17353
  }
17354
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17355
+ if (fromSatisfiesPzi != null) {
17356
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17357
+ }
17358
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17359
+ if (fromSatisfiesPzs != null) {
17360
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17361
+ }
17120
17362
  const fromServiceAccount = getValueByPath(fromObject, [
17121
17363
  'serviceAccount',
17122
17364
  ]);
@@ -17492,5 +17734,5 @@ class GoogleGenAI {
17492
17734
  }
17493
17735
  }
17494
17736
 
17495
- export { ActivityHandling, AdapterSize, ApiError, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
17737
+ 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, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
17496
17738
  //# sourceMappingURL=index.mjs.map