@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.
@@ -287,6 +287,22 @@ var HarmCategory;
287
287
  * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
288
288
  */
289
289
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
290
+ /**
291
+ * The harm category is image hate.
292
+ */
293
+ HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
294
+ /**
295
+ * The harm category is image dangerous content.
296
+ */
297
+ HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
298
+ /**
299
+ * The harm category is image harassment.
300
+ */
301
+ HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
302
+ /**
303
+ * The harm category is image sexually explicit content.
304
+ */
305
+ HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
290
306
  })(HarmCategory || (HarmCategory = {}));
291
307
  /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
292
308
  var HarmBlockMethod;
@@ -373,6 +389,50 @@ var AuthType;
373
389
  */
374
390
  AuthType["OIDC_AUTH"] = "OIDC_AUTH";
375
391
  })(AuthType || (AuthType = {}));
392
+ /** The API spec that the external API implements. */
393
+ var ApiSpec;
394
+ (function (ApiSpec) {
395
+ /**
396
+ * Unspecified API spec. This value should not be used.
397
+ */
398
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
399
+ /**
400
+ * Simple search API spec.
401
+ */
402
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
403
+ /**
404
+ * Elastic search API spec.
405
+ */
406
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
407
+ })(ApiSpec || (ApiSpec = {}));
408
+ /** Required. The environment being operated. */
409
+ var Environment;
410
+ (function (Environment) {
411
+ /**
412
+ * Defaults to browser.
413
+ */
414
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
415
+ /**
416
+ * Operates in a web browser.
417
+ */
418
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
419
+ })(Environment || (Environment = {}));
420
+ /** Status of the url retrieval. */
421
+ var UrlRetrievalStatus;
422
+ (function (UrlRetrievalStatus) {
423
+ /**
424
+ * Default value. This value is unused
425
+ */
426
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
427
+ /**
428
+ * Url retrieval is successful.
429
+ */
430
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
431
+ /**
432
+ * Url retrieval is failed due to error.
433
+ */
434
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
435
+ })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
376
436
  /** Output only. The reason why the model stopped generating tokens.
377
437
 
378
438
  If empty, the model has not stopped generating the tokens.
@@ -503,6 +563,10 @@ var BlockedReason;
503
563
  * Candidates blocked due to prohibited content.
504
564
  */
505
565
  BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
566
+ /**
567
+ * Candidates blocked due to unsafe image generation content.
568
+ */
569
+ BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
506
570
  })(BlockedReason || (BlockedReason = {}));
507
571
  /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
508
572
  var TrafficType;
@@ -700,22 +764,6 @@ var FunctionCallingConfigMode;
700
764
  */
701
765
  FunctionCallingConfigMode["NONE"] = "NONE";
702
766
  })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
703
- /** Status of the url retrieval. */
704
- var UrlRetrievalStatus;
705
- (function (UrlRetrievalStatus) {
706
- /**
707
- * Default value. This value is unused
708
- */
709
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
710
- /**
711
- * Url retrieval is successful.
712
- */
713
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
714
- /**
715
- * Url retrieval is failed due to error.
716
- */
717
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
718
- })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
719
767
  /** Enum that controls the safety filter level for objectionable content. */
720
768
  var SafetyFilterLevel;
721
769
  (function (SafetyFilterLevel) {
@@ -2918,6 +2966,10 @@ function toolToMldev$4(fromObject) {
2918
2966
  if (fromCodeExecution != null) {
2919
2967
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
2920
2968
  }
2969
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
2970
+ if (fromComputerUse != null) {
2971
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
2972
+ }
2921
2973
  return toObject;
2922
2974
  }
2923
2975
  function functionCallingConfigToMldev$2(fromObject) {
@@ -3329,6 +3381,18 @@ function listBatchJobsParametersToMldev(fromObject) {
3329
3381
  }
3330
3382
  return toObject;
3331
3383
  }
3384
+ function deleteBatchJobParametersToMldev(apiClient, fromObject) {
3385
+ const toObject = {};
3386
+ const fromName = getValueByPath(fromObject, ['name']);
3387
+ if (fromName != null) {
3388
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3389
+ }
3390
+ const fromConfig = getValueByPath(fromObject, ['config']);
3391
+ if (fromConfig != null) {
3392
+ setValueByPath(toObject, ['config'], fromConfig);
3393
+ }
3394
+ return toObject;
3395
+ }
3332
3396
  function batchJobSourceToVertex(fromObject) {
3333
3397
  const toObject = {};
3334
3398
  const fromFormat = getValueByPath(fromObject, ['format']);
@@ -3449,6 +3513,18 @@ function listBatchJobsParametersToVertex(fromObject) {
3449
3513
  }
3450
3514
  return toObject;
3451
3515
  }
3516
+ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3517
+ const toObject = {};
3518
+ const fromName = getValueByPath(fromObject, ['name']);
3519
+ if (fromName != null) {
3520
+ setValueByPath(toObject, ['_url', 'name'], tBatchJobName(apiClient, fromName));
3521
+ }
3522
+ const fromConfig = getValueByPath(fromObject, ['config']);
3523
+ if (fromConfig != null) {
3524
+ setValueByPath(toObject, ['config'], fromConfig);
3525
+ }
3526
+ return toObject;
3527
+ }
3452
3528
  function jobErrorFromMldev() {
3453
3529
  const toObject = {};
3454
3530
  return toObject;
@@ -3786,6 +3862,22 @@ function listBatchJobsResponseFromMldev(fromObject) {
3786
3862
  }
3787
3863
  return toObject;
3788
3864
  }
3865
+ function deleteResourceJobFromMldev(fromObject) {
3866
+ const toObject = {};
3867
+ const fromName = getValueByPath(fromObject, ['name']);
3868
+ if (fromName != null) {
3869
+ setValueByPath(toObject, ['name'], fromName);
3870
+ }
3871
+ const fromDone = getValueByPath(fromObject, ['done']);
3872
+ if (fromDone != null) {
3873
+ setValueByPath(toObject, ['done'], fromDone);
3874
+ }
3875
+ const fromError = getValueByPath(fromObject, ['error']);
3876
+ if (fromError != null) {
3877
+ setValueByPath(toObject, ['error'], jobErrorFromMldev());
3878
+ }
3879
+ return toObject;
3880
+ }
3789
3881
  function jobErrorFromVertex(fromObject) {
3790
3882
  const toObject = {};
3791
3883
  const fromDetails = getValueByPath(fromObject, ['details']);
@@ -3913,6 +4005,22 @@ function listBatchJobsResponseFromVertex(fromObject) {
3913
4005
  }
3914
4006
  return toObject;
3915
4007
  }
4008
+ function deleteResourceJobFromVertex(fromObject) {
4009
+ const toObject = {};
4010
+ const fromName = getValueByPath(fromObject, ['name']);
4011
+ if (fromName != null) {
4012
+ setValueByPath(toObject, ['name'], fromName);
4013
+ }
4014
+ const fromDone = getValueByPath(fromObject, ['done']);
4015
+ if (fromDone != null) {
4016
+ setValueByPath(toObject, ['done'], fromDone);
4017
+ }
4018
+ const fromError = getValueByPath(fromObject, ['error']);
4019
+ if (fromError != null) {
4020
+ setValueByPath(toObject, ['error'], jobErrorFromVertex(fromError));
4021
+ }
4022
+ return toObject;
4023
+ }
3916
4024
 
3917
4025
  /**
3918
4026
  * @license
@@ -4120,20 +4228,23 @@ class Batches extends BaseModule {
4120
4228
  */
4121
4229
  this.create = async (params) => {
4122
4230
  if (this.apiClient.isVertexAI()) {
4231
+ const timestamp = Date.now();
4232
+ const timestampStr = timestamp.toString();
4123
4233
  if (Array.isArray(params.src)) {
4124
4234
  throw new Error('InlinedRequest[] is not supported in Vertex AI. Please use ' +
4125
4235
  'Google Cloud Storage URI or BigQuery URI instead.');
4126
4236
  }
4127
4237
  params.config = params.config || {};
4128
4238
  if (params.config.displayName === undefined) {
4129
- params.config.displayName = 'genaiBatchJob_';
4239
+ params.config.displayName = 'genaiBatchJob_${timestampStr}';
4130
4240
  }
4131
4241
  if (params.config.dest === undefined && typeof params.src === 'string') {
4132
4242
  if (params.src.startsWith('gs://') && params.src.endsWith('.jsonl')) {
4133
4243
  params.config.dest = `${params.src.slice(0, -6)}/dest`;
4134
4244
  }
4135
4245
  else if (params.src.startsWith('bq://')) {
4136
- params.config.dest = `${params.src}_dest_`;
4246
+ params.config.dest =
4247
+ `${params.src}_dest_${timestampStr}`;
4137
4248
  }
4138
4249
  else {
4139
4250
  throw new Error('Unsupported source:' + params.src);
@@ -4392,6 +4503,71 @@ class Batches extends BaseModule {
4392
4503
  });
4393
4504
  }
4394
4505
  }
4506
+ /**
4507
+ * Deletes a batch job.
4508
+ *
4509
+ * @param params - The parameters for the delete request.
4510
+ * @return The empty response returned by the API.
4511
+ *
4512
+ * @example
4513
+ * ```ts
4514
+ * await ai.batches.delete({name: '...'}); // The server-generated resource name.
4515
+ * ```
4516
+ */
4517
+ async delete(params) {
4518
+ var _a, _b, _c, _d;
4519
+ let response;
4520
+ let path = '';
4521
+ let queryParams = {};
4522
+ if (this.apiClient.isVertexAI()) {
4523
+ const body = deleteBatchJobParametersToVertex(this.apiClient, params);
4524
+ path = formatMap('batchPredictionJobs/{name}', body['_url']);
4525
+ queryParams = body['_query'];
4526
+ delete body['config'];
4527
+ delete body['_url'];
4528
+ delete body['_query'];
4529
+ response = this.apiClient
4530
+ .request({
4531
+ path: path,
4532
+ queryParams: queryParams,
4533
+ body: JSON.stringify(body),
4534
+ httpMethod: 'DELETE',
4535
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
4536
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4537
+ })
4538
+ .then((httpResponse) => {
4539
+ return httpResponse.json();
4540
+ });
4541
+ return response.then((apiResponse) => {
4542
+ const resp = deleteResourceJobFromVertex(apiResponse);
4543
+ return resp;
4544
+ });
4545
+ }
4546
+ else {
4547
+ const body = deleteBatchJobParametersToMldev(this.apiClient, params);
4548
+ path = formatMap('batches/{name}', body['_url']);
4549
+ queryParams = body['_query'];
4550
+ delete body['config'];
4551
+ delete body['_url'];
4552
+ delete body['_query'];
4553
+ response = this.apiClient
4554
+ .request({
4555
+ path: path,
4556
+ queryParams: queryParams,
4557
+ body: JSON.stringify(body),
4558
+ httpMethod: 'DELETE',
4559
+ httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
4560
+ abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4561
+ })
4562
+ .then((httpResponse) => {
4563
+ return httpResponse.json();
4564
+ });
4565
+ return response.then((apiResponse) => {
4566
+ const resp = deleteResourceJobFromMldev(apiResponse);
4567
+ return resp;
4568
+ });
4569
+ }
4570
+ }
4395
4571
  }
4396
4572
 
4397
4573
  /**
@@ -4646,6 +4822,10 @@ function toolToMldev$3(fromObject) {
4646
4822
  if (fromCodeExecution != null) {
4647
4823
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4648
4824
  }
4825
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4826
+ if (fromComputerUse != null) {
4827
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
4828
+ }
4649
4829
  return toObject;
4650
4830
  }
4651
4831
  function functionCallingConfigToMldev$1(fromObject) {
@@ -5136,6 +5316,10 @@ function toolToVertex$2(fromObject) {
5136
5316
  if (fromCodeExecution != null) {
5137
5317
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5138
5318
  }
5319
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5320
+ if (fromComputerUse != null) {
5321
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
5322
+ }
5139
5323
  return toObject;
5140
5324
  }
5141
5325
  function functionCallingConfigToVertex$1(fromObject) {
@@ -7342,6 +7526,10 @@ function toolToMldev$2(fromObject) {
7342
7526
  if (fromCodeExecution != null) {
7343
7527
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7344
7528
  }
7529
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7530
+ if (fromComputerUse != null) {
7531
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
7532
+ }
7345
7533
  return toObject;
7346
7534
  }
7347
7535
  function toolToVertex$1(fromObject) {
@@ -7392,6 +7580,10 @@ function toolToVertex$1(fromObject) {
7392
7580
  if (fromCodeExecution != null) {
7393
7581
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7394
7582
  }
7583
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7584
+ if (fromComputerUse != null) {
7585
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
7586
+ }
7395
7587
  return toObject;
7396
7588
  }
7397
7589
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7887,8 +8079,9 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
7887
8079
  if (fromMedia != null) {
7888
8080
  setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
7889
8081
  }
7890
- if (getValueByPath(fromObject, ['audio']) !== undefined) {
7891
- throw new Error('audio parameter is not supported in Vertex AI.');
8082
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8083
+ if (fromAudio != null) {
8084
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
7892
8085
  }
7893
8086
  const fromAudioStreamEnd = getValueByPath(fromObject, [
7894
8087
  'audioStreamEnd',
@@ -7896,11 +8089,13 @@ function liveSendRealtimeInputParametersToVertex(fromObject) {
7896
8089
  if (fromAudioStreamEnd != null) {
7897
8090
  setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
7898
8091
  }
7899
- if (getValueByPath(fromObject, ['video']) !== undefined) {
7900
- throw new Error('video parameter is not supported in Vertex AI.');
8092
+ const fromVideo = getValueByPath(fromObject, ['video']);
8093
+ if (fromVideo != null) {
8094
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
7901
8095
  }
7902
- if (getValueByPath(fromObject, ['text']) !== undefined) {
7903
- throw new Error('text parameter is not supported in Vertex AI.');
8096
+ const fromText = getValueByPath(fromObject, ['text']);
8097
+ if (fromText != null) {
8098
+ setValueByPath(toObject, ['text'], fromText);
7904
8099
  }
7905
8100
  const fromActivityStart = getValueByPath(fromObject, [
7906
8101
  'activityStart',
@@ -8056,8 +8251,12 @@ function liveServerSetupCompleteFromMldev() {
8056
8251
  const toObject = {};
8057
8252
  return toObject;
8058
8253
  }
8059
- function liveServerSetupCompleteFromVertex() {
8254
+ function liveServerSetupCompleteFromVertex(fromObject) {
8060
8255
  const toObject = {};
8256
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8257
+ if (fromSessionId != null) {
8258
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
8259
+ }
8061
8260
  return toObject;
8062
8261
  }
8063
8262
  function videoMetadataFromMldev$1(fromObject) {
@@ -8810,7 +9009,7 @@ function liveServerMessageFromVertex(fromObject) {
8810
9009
  'setupComplete',
8811
9010
  ]);
8812
9011
  if (fromSetupComplete != null) {
8813
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex());
9012
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromVertex(fromSetupComplete));
8814
9013
  }
8815
9014
  const fromServerContent = getValueByPath(fromObject, [
8816
9015
  'serverContent',
@@ -9378,6 +9577,10 @@ function toolToMldev$1(fromObject) {
9378
9577
  if (fromCodeExecution != null) {
9379
9578
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
9380
9579
  }
9580
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9581
+ if (fromComputerUse != null) {
9582
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
9583
+ }
9381
9584
  return toObject;
9382
9585
  }
9383
9586
  function functionCallingConfigToMldev(fromObject) {
@@ -10467,6 +10670,10 @@ function toolToVertex(fromObject) {
10467
10670
  if (fromCodeExecution != null) {
10468
10671
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10469
10672
  }
10673
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10674
+ if (fromComputerUse != null) {
10675
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
10676
+ }
10470
10677
  return toObject;
10471
10678
  }
10472
10679
  function functionCallingConfigToVertex(fromObject) {
@@ -11850,7 +12057,7 @@ function modelFromMldev(fromObject) {
11850
12057
  }
11851
12058
  return toObject;
11852
12059
  }
11853
- function listModelsResponseFromMldev(apiClient, fromObject) {
12060
+ function listModelsResponseFromMldev(fromObject) {
11854
12061
  const toObject = {};
11855
12062
  const fromNextPageToken = getValueByPath(fromObject, [
11856
12063
  'nextPageToken',
@@ -12494,7 +12701,7 @@ function modelFromVertex(fromObject) {
12494
12701
  }
12495
12702
  return toObject;
12496
12703
  }
12497
- function listModelsResponseFromVertex(apiClient, fromObject) {
12704
+ function listModelsResponseFromVertex(fromObject) {
12498
12705
  const toObject = {};
12499
12706
  const fromNextPageToken = getValueByPath(fromObject, [
12500
12707
  'nextPageToken',
@@ -12620,7 +12827,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12620
12827
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12621
12828
  const USER_AGENT_HEADER = 'User-Agent';
12622
12829
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12623
- const SDK_VERSION = '1.7.0'; // x-release-please-version
12830
+ const SDK_VERSION = '1.8.0'; // x-release-please-version
12624
12831
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12625
12832
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12626
12833
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14954,7 +15161,7 @@ class Models extends BaseModule {
14954
15161
  return httpResponse.json();
14955
15162
  });
14956
15163
  return response.then((apiResponse) => {
14957
- const resp = listModelsResponseFromVertex(this.apiClient, apiResponse);
15164
+ const resp = listModelsResponseFromVertex(apiResponse);
14958
15165
  const typedResp = new ListModelsResponse();
14959
15166
  Object.assign(typedResp, resp);
14960
15167
  return typedResp;
@@ -14980,7 +15187,7 @@ class Models extends BaseModule {
14980
15187
  return httpResponse.json();
14981
15188
  });
14982
15189
  return response.then((apiResponse) => {
14983
- const resp = listModelsResponseFromMldev(this.apiClient, apiResponse);
15190
+ const resp = listModelsResponseFromMldev(apiResponse);
14984
15191
  const typedResp = new ListModelsResponse();
14985
15192
  Object.assign(typedResp, resp);
14986
15193
  return typedResp;
@@ -15990,6 +16197,10 @@ function toolToMldev(fromObject) {
15990
16197
  if (fromCodeExecution != null) {
15991
16198
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
15992
16199
  }
16200
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16201
+ if (fromComputerUse != null) {
16202
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
16203
+ }
15993
16204
  return toObject;
15994
16205
  }
15995
16206
  function sessionResumptionConfigToMldev(fromObject) {
@@ -16580,6 +16791,9 @@ function tuningDatasetToMldev(fromObject) {
16580
16791
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
16581
16792
  throw new Error('gcsUri parameter is not supported in Gemini API.');
16582
16793
  }
16794
+ if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
16795
+ throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
16796
+ }
16583
16797
  const fromExamples = getValueByPath(fromObject, ['examples']);
16584
16798
  if (fromExamples != null) {
16585
16799
  let transformedList = fromExamples;
@@ -16693,17 +16907,29 @@ function tuningDatasetToVertex(fromObject, parentObject) {
16693
16907
  if (parentObject !== undefined && fromGcsUri != null) {
16694
16908
  setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
16695
16909
  }
16910
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
16911
+ 'vertexDatasetResource',
16912
+ ]);
16913
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
16914
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
16915
+ }
16696
16916
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
16697
16917
  throw new Error('examples parameter is not supported in Vertex AI.');
16698
16918
  }
16699
16919
  return toObject;
16700
16920
  }
16701
- function tuningValidationDatasetToVertex(fromObject) {
16921
+ function tuningValidationDatasetToVertex(fromObject, parentObject) {
16702
16922
  const toObject = {};
16703
16923
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
16704
16924
  if (fromGcsUri != null) {
16705
16925
  setValueByPath(toObject, ['validationDatasetUri'], fromGcsUri);
16706
16926
  }
16927
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
16928
+ 'vertexDatasetResource',
16929
+ ]);
16930
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
16931
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
16932
+ }
16707
16933
  return toObject;
16708
16934
  }
16709
16935
  function createTuningJobConfigToVertex(fromObject, parentObject) {
@@ -16712,7 +16938,7 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
16712
16938
  'validationDataset',
16713
16939
  ]);
16714
16940
  if (parentObject !== undefined && fromValidationDataset != null) {
16715
- setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
16941
+ setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
16716
16942
  }
16717
16943
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
16718
16944
  'tunedModelDisplayName',
@@ -16844,6 +17070,14 @@ function tuningJobFromMldev(fromObject) {
16844
17070
  if (fromPipelineJob != null) {
16845
17071
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
16846
17072
  }
17073
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17074
+ if (fromSatisfiesPzi != null) {
17075
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17076
+ }
17077
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17078
+ if (fromSatisfiesPzs != null) {
17079
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17080
+ }
16847
17081
  const fromServiceAccount = getValueByPath(fromObject, [
16848
17082
  'serviceAccount',
16849
17083
  ]);
@@ -17024,6 +17258,14 @@ function tuningJobFromVertex(fromObject) {
17024
17258
  if (fromPipelineJob != null) {
17025
17259
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
17026
17260
  }
17261
+ const fromSatisfiesPzi = getValueByPath(fromObject, ['satisfiesPzi']);
17262
+ if (fromSatisfiesPzi != null) {
17263
+ setValueByPath(toObject, ['satisfiesPzi'], fromSatisfiesPzi);
17264
+ }
17265
+ const fromSatisfiesPzs = getValueByPath(fromObject, ['satisfiesPzs']);
17266
+ if (fromSatisfiesPzs != null) {
17267
+ setValueByPath(toObject, ['satisfiesPzs'], fromSatisfiesPzs);
17268
+ }
17027
17269
  const fromServiceAccount = getValueByPath(fromObject, [
17028
17270
  'serviceAccount',
17029
17271
  ]);
@@ -17552,5 +17794,5 @@ class GoogleGenAI {
17552
17794
  }
17553
17795
  }
17554
17796
 
17555
- 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 };
17797
+ 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 };
17556
17798
  //# sourceMappingURL=index.mjs.map