@google/genai 1.9.0 → 1.11.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
@@ -162,6 +162,20 @@ function getValueByPath(data, keys) {
162
162
  * Copyright 2025 Google LLC
163
163
  * SPDX-License-Identifier: Apache-2.0
164
164
  */
165
+ function tBytes$1(fromBytes) {
166
+ if (typeof fromBytes !== 'string') {
167
+ throw new Error('fromImageBytes must be a string');
168
+ }
169
+ // TODO(b/389133914): Remove dummy bytes converter.
170
+ return fromBytes;
171
+ }
172
+
173
+ /**
174
+ * @license
175
+ * Copyright 2025 Google LLC
176
+ * SPDX-License-Identifier: Apache-2.0
177
+ */
178
+ // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
165
179
  /** Required. Outcome of the code execution. */
166
180
  exports.Outcome = void 0;
167
181
  (function (Outcome) {
@@ -1655,6 +1669,65 @@ class LiveServerMessage {
1655
1669
  return data.length > 0 ? btoa(data) : undefined;
1656
1670
  }
1657
1671
  }
1672
+ /** A video generation long-running operation. */
1673
+ class GenerateVideosOperation {
1674
+ /**
1675
+ * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
1676
+ * @internal
1677
+ */
1678
+ _fromAPIResponse({ apiResponse, isVertexAI, }) {
1679
+ const operation = new GenerateVideosOperation();
1680
+ operation.name = apiResponse['name'];
1681
+ operation.metadata = apiResponse['metadata'];
1682
+ operation.done = apiResponse['done'];
1683
+ operation.error = apiResponse['error'];
1684
+ if (isVertexAI) {
1685
+ const response = apiResponse['response'];
1686
+ if (response) {
1687
+ const operationResponse = new GenerateVideosResponse();
1688
+ const responseVideos = response['videos'];
1689
+ operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1690
+ return {
1691
+ video: {
1692
+ uri: generatedVideo['gcsUri'],
1693
+ videoBytes: generatedVideo['bytesBase64Encoded']
1694
+ ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1695
+ : undefined,
1696
+ mimeType: generatedVideo['mimeType'],
1697
+ },
1698
+ };
1699
+ });
1700
+ operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1701
+ operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1702
+ operation.response = operationResponse;
1703
+ }
1704
+ }
1705
+ else {
1706
+ const response = apiResponse['response'];
1707
+ if (response) {
1708
+ const operationResponse = new GenerateVideosResponse();
1709
+ const generatedVideoResponse = response['generateVideoResponse'];
1710
+ const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1711
+ operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1712
+ const video = generatedVideo['video'];
1713
+ return {
1714
+ video: {
1715
+ uri: video === null || video === void 0 ? void 0 : video['uri'],
1716
+ videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1717
+ ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1718
+ : undefined,
1719
+ mimeType: generatedVideo['encoding'],
1720
+ },
1721
+ };
1722
+ });
1723
+ operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1724
+ operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1725
+ operation.response = operationResponse;
1726
+ }
1727
+ }
1728
+ return operation;
1729
+ }
1730
+ }
1658
1731
  /** Client generated response to a `ToolCall` received from the server.
1659
1732
 
1660
1733
  Individual `FunctionResponse` objects are matched to the respective
@@ -2216,11 +2289,7 @@ function tTuningJobStatus(status) {
2216
2289
  }
2217
2290
  }
2218
2291
  function tBytes(fromImageBytes) {
2219
- if (typeof fromImageBytes !== 'string') {
2220
- throw new Error('fromImageBytes must be a string');
2221
- }
2222
- // TODO(b/389133914): Remove dummy bytes converter.
2223
- return fromImageBytes;
2292
+ return tBytes$1(fromImageBytes);
2224
2293
  }
2225
2294
  function _isFile(origin) {
2226
2295
  return (origin !== null &&
@@ -2383,6 +2452,9 @@ function tBatchJobSource(apiClient, src) {
2383
2452
  throw new Error(`Unsupported source: ${src}`);
2384
2453
  }
2385
2454
  function tBatchJobDestination(dest) {
2455
+ if (typeof dest !== 'string') {
2456
+ return dest;
2457
+ }
2386
2458
  const destString = dest;
2387
2459
  if (destString.startsWith('gs://')) {
2388
2460
  return {
@@ -3368,10 +3440,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3368
3440
  }
3369
3441
  return toObject;
3370
3442
  }
3371
- function jobErrorFromMldev() {
3372
- const toObject = {};
3373
- return toObject;
3374
- }
3375
3443
  function videoMetadataFromMldev$2(fromObject) {
3376
3444
  const toObject = {};
3377
3445
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -3576,6 +3644,12 @@ function candidateFromMldev$1(fromObject) {
3576
3644
  }
3577
3645
  function generateContentResponseFromMldev$1(fromObject) {
3578
3646
  const toObject = {};
3647
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3648
+ 'sdkHttpResponse',
3649
+ ]);
3650
+ if (fromSdkHttpResponse != null) {
3651
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3652
+ }
3579
3653
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
3580
3654
  if (fromCandidates != null) {
3581
3655
  let transformedList = fromCandidates;
@@ -3604,6 +3678,22 @@ function generateContentResponseFromMldev$1(fromObject) {
3604
3678
  }
3605
3679
  return toObject;
3606
3680
  }
3681
+ function jobErrorFromMldev(fromObject) {
3682
+ const toObject = {};
3683
+ const fromDetails = getValueByPath(fromObject, ['details']);
3684
+ if (fromDetails != null) {
3685
+ setValueByPath(toObject, ['details'], fromDetails);
3686
+ }
3687
+ const fromCode = getValueByPath(fromObject, ['code']);
3688
+ if (fromCode != null) {
3689
+ setValueByPath(toObject, ['code'], fromCode);
3690
+ }
3691
+ const fromMessage = getValueByPath(fromObject, ['message']);
3692
+ if (fromMessage != null) {
3693
+ setValueByPath(toObject, ['message'], fromMessage);
3694
+ }
3695
+ return toObject;
3696
+ }
3607
3697
  function inlinedResponseFromMldev(fromObject) {
3608
3698
  const toObject = {};
3609
3699
  const fromResponse = getValueByPath(fromObject, ['response']);
@@ -3612,7 +3702,7 @@ function inlinedResponseFromMldev(fromObject) {
3612
3702
  }
3613
3703
  const fromError = getValueByPath(fromObject, ['error']);
3614
3704
  if (fromError != null) {
3615
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3705
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3616
3706
  }
3617
3707
  return toObject;
3618
3708
  }
@@ -3687,6 +3777,12 @@ function batchJobFromMldev(fromObject) {
3687
3777
  }
3688
3778
  function listBatchJobsResponseFromMldev(fromObject) {
3689
3779
  const toObject = {};
3780
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3781
+ 'sdkHttpResponse',
3782
+ ]);
3783
+ if (fromSdkHttpResponse != null) {
3784
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3785
+ }
3690
3786
  const fromNextPageToken = getValueByPath(fromObject, [
3691
3787
  'nextPageToken',
3692
3788
  ]);
@@ -3717,7 +3813,7 @@ function deleteResourceJobFromMldev(fromObject) {
3717
3813
  }
3718
3814
  const fromError = getValueByPath(fromObject, ['error']);
3719
3815
  if (fromError != null) {
3720
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3816
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3721
3817
  }
3722
3818
  return toObject;
3723
3819
  }
@@ -3828,6 +3924,12 @@ function batchJobFromVertex(fromObject) {
3828
3924
  }
3829
3925
  function listBatchJobsResponseFromVertex(fromObject) {
3830
3926
  const toObject = {};
3927
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3928
+ 'sdkHttpResponse',
3929
+ ]);
3930
+ if (fromSdkHttpResponse != null) {
3931
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3932
+ }
3831
3933
  const fromNextPageToken = getValueByPath(fromObject, [
3832
3934
  'nextPageToken',
3833
3935
  ]);
@@ -3870,9 +3972,6 @@ function deleteResourceJobFromVertex(fromObject) {
3870
3972
  * Copyright 2025 Google LLC
3871
3973
  * SPDX-License-Identifier: Apache-2.0
3872
3974
  */
3873
- /**
3874
- * Pagers for the GenAI List APIs.
3875
- */
3876
3975
  exports.PagedItem = void 0;
3877
3976
  (function (PagedItem) {
3878
3977
  PagedItem["PAGED_ITEM_BATCH_JOBS"] = "batchJobs";
@@ -3895,9 +3994,10 @@ class Pager {
3895
3994
  var _a, _b;
3896
3995
  this.nameInternal = name;
3897
3996
  this.pageInternal = response[this.nameInternal] || [];
3997
+ this.sdkHttpResponseInternal = response === null || response === void 0 ? void 0 : response.sdkHttpResponse;
3898
3998
  this.idxInternal = 0;
3899
3999
  let requestParams = { config: {} };
3900
- if (!params) {
4000
+ if (!params || Object.keys(params).length === 0) {
3901
4001
  requestParams = { config: {} };
3902
4002
  }
3903
4003
  else if (typeof params === 'object') {
@@ -3941,6 +4041,12 @@ class Pager {
3941
4041
  get pageSize() {
3942
4042
  return this.pageInternalSize;
3943
4043
  }
4044
+ /**
4045
+ * Returns the headers of the API response.
4046
+ */
4047
+ get sdkHttpResponse() {
4048
+ return this.sdkHttpResponseInternal;
4049
+ }
3944
4050
  /**
3945
4051
  * Returns the parameters when making the API request for the next page.
3946
4052
  *
@@ -4310,7 +4416,13 @@ class Batches extends BaseModule {
4310
4416
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4311
4417
  })
4312
4418
  .then((httpResponse) => {
4313
- return httpResponse.json();
4419
+ return httpResponse.json().then((jsonResponse) => {
4420
+ const response = jsonResponse;
4421
+ response.sdkHttpResponse = {
4422
+ headers: httpResponse.headers,
4423
+ };
4424
+ return response;
4425
+ });
4314
4426
  });
4315
4427
  return response.then((apiResponse) => {
4316
4428
  const resp = listBatchJobsResponseFromVertex(apiResponse);
@@ -4336,7 +4448,13 @@ class Batches extends BaseModule {
4336
4448
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4337
4449
  })
4338
4450
  .then((httpResponse) => {
4339
- return httpResponse.json();
4451
+ return httpResponse.json().then((jsonResponse) => {
4452
+ const response = jsonResponse;
4453
+ response.sdkHttpResponse = {
4454
+ headers: httpResponse.headers,
4455
+ };
4456
+ return response;
4457
+ });
4340
4458
  });
4341
4459
  return response.then((apiResponse) => {
4342
4460
  const resp = listBatchJobsResponseFromMldev(apiResponse);
@@ -5389,6 +5507,12 @@ function deleteCachedContentResponseFromMldev() {
5389
5507
  }
5390
5508
  function listCachedContentsResponseFromMldev(fromObject) {
5391
5509
  const toObject = {};
5510
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
5511
+ 'sdkHttpResponse',
5512
+ ]);
5513
+ if (fromSdkHttpResponse != null) {
5514
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
5515
+ }
5392
5516
  const fromNextPageToken = getValueByPath(fromObject, [
5393
5517
  'nextPageToken',
5394
5518
  ]);
@@ -5449,6 +5573,12 @@ function deleteCachedContentResponseFromVertex() {
5449
5573
  }
5450
5574
  function listCachedContentsResponseFromVertex(fromObject) {
5451
5575
  const toObject = {};
5576
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
5577
+ 'sdkHttpResponse',
5578
+ ]);
5579
+ if (fromSdkHttpResponse != null) {
5580
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
5581
+ }
5452
5582
  const fromNextPageToken = getValueByPath(fromObject, [
5453
5583
  'nextPageToken',
5454
5584
  ]);
@@ -5801,7 +5931,13 @@ class Caches extends BaseModule {
5801
5931
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
5802
5932
  })
5803
5933
  .then((httpResponse) => {
5804
- return httpResponse.json();
5934
+ return httpResponse.json().then((jsonResponse) => {
5935
+ const response = jsonResponse;
5936
+ response.sdkHttpResponse = {
5937
+ headers: httpResponse.headers,
5938
+ };
5939
+ return response;
5940
+ });
5805
5941
  });
5806
5942
  return response.then((apiResponse) => {
5807
5943
  const resp = listCachedContentsResponseFromVertex(apiResponse);
@@ -5827,7 +5963,13 @@ class Caches extends BaseModule {
5827
5963
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
5828
5964
  })
5829
5965
  .then((httpResponse) => {
5830
- return httpResponse.json();
5966
+ return httpResponse.json().then((jsonResponse) => {
5967
+ const response = jsonResponse;
5968
+ response.sdkHttpResponse = {
5969
+ headers: httpResponse.headers,
5970
+ };
5971
+ return response;
5972
+ });
5831
5973
  });
5832
5974
  return response.then((apiResponse) => {
5833
5975
  const resp = listCachedContentsResponseFromMldev(apiResponse);
@@ -6250,7 +6392,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6250
6392
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6251
6393
  const USER_AGENT_HEADER = 'User-Agent';
6252
6394
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6253
- const SDK_VERSION = '1.9.0'; // x-release-please-version
6395
+ const SDK_VERSION = '1.11.0'; // x-release-please-version
6254
6396
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6255
6397
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6256
6398
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7162,6 +7304,12 @@ function fileFromMldev(fromObject) {
7162
7304
  }
7163
7305
  function listFilesResponseFromMldev(fromObject) {
7164
7306
  const toObject = {};
7307
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
7308
+ 'sdkHttpResponse',
7309
+ ]);
7310
+ if (fromSdkHttpResponse != null) {
7311
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
7312
+ }
7165
7313
  const fromNextPageToken = getValueByPath(fromObject, [
7166
7314
  'nextPageToken',
7167
7315
  ]);
@@ -7180,8 +7328,14 @@ function listFilesResponseFromMldev(fromObject) {
7180
7328
  }
7181
7329
  return toObject;
7182
7330
  }
7183
- function createFileResponseFromMldev() {
7331
+ function createFileResponseFromMldev(fromObject) {
7184
7332
  const toObject = {};
7333
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
7334
+ 'sdkHttpResponse',
7335
+ ]);
7336
+ if (fromSdkHttpResponse != null) {
7337
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
7338
+ }
7185
7339
  return toObject;
7186
7340
  }
7187
7341
  function deleteFileResponseFromMldev() {
@@ -7317,7 +7471,13 @@ class Files extends BaseModule {
7317
7471
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
7318
7472
  })
7319
7473
  .then((httpResponse) => {
7320
- return httpResponse.json();
7474
+ return httpResponse.json().then((jsonResponse) => {
7475
+ const response = jsonResponse;
7476
+ response.sdkHttpResponse = {
7477
+ headers: httpResponse.headers,
7478
+ };
7479
+ return response;
7480
+ });
7321
7481
  });
7322
7482
  return response.then((apiResponse) => {
7323
7483
  const resp = listFilesResponseFromMldev(apiResponse);
@@ -7354,8 +7514,8 @@ class Files extends BaseModule {
7354
7514
  .then((httpResponse) => {
7355
7515
  return httpResponse.json();
7356
7516
  });
7357
- return response.then(() => {
7358
- const resp = createFileResponseFromMldev();
7517
+ return response.then((apiResponse) => {
7518
+ const resp = createFileResponseFromMldev(apiResponse);
7359
7519
  const typedResp = new CreateFileResponse();
7360
7520
  Object.assign(typedResp, resp);
7361
7521
  return typedResp;
@@ -7473,14 +7633,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
7473
7633
  }
7474
7634
  return toObject;
7475
7635
  }
7476
- function prebuiltVoiceConfigToVertex$1(fromObject) {
7477
- const toObject = {};
7478
- const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
7479
- if (fromVoiceName != null) {
7480
- setValueByPath(toObject, ['voiceName'], fromVoiceName);
7481
- }
7482
- return toObject;
7483
- }
7484
7636
  function voiceConfigToMldev$2(fromObject) {
7485
7637
  const toObject = {};
7486
7638
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
@@ -7491,16 +7643,6 @@ function voiceConfigToMldev$2(fromObject) {
7491
7643
  }
7492
7644
  return toObject;
7493
7645
  }
7494
- function voiceConfigToVertex$1(fromObject) {
7495
- const toObject = {};
7496
- const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
7497
- 'prebuiltVoiceConfig',
7498
- ]);
7499
- if (fromPrebuiltVoiceConfig != null) {
7500
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
7501
- }
7502
- return toObject;
7503
- }
7504
7646
  function speakerVoiceConfigToMldev$2(fromObject) {
7505
7647
  const toObject = {};
7506
7648
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
@@ -7547,21 +7689,6 @@ function speechConfigToMldev$2(fromObject) {
7547
7689
  }
7548
7690
  return toObject;
7549
7691
  }
7550
- function speechConfigToVertex$1(fromObject) {
7551
- const toObject = {};
7552
- const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7553
- if (fromVoiceConfig != null) {
7554
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
7555
- }
7556
- if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7557
- throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7558
- }
7559
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7560
- if (fromLanguageCode != null) {
7561
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7562
- }
7563
- return toObject;
7564
- }
7565
7692
  function videoMetadataToMldev$2(fromObject) {
7566
7693
  const toObject = {};
7567
7694
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -7578,22 +7705,6 @@ function videoMetadataToMldev$2(fromObject) {
7578
7705
  }
7579
7706
  return toObject;
7580
7707
  }
7581
- function videoMetadataToVertex$1(fromObject) {
7582
- const toObject = {};
7583
- const fromFps = getValueByPath(fromObject, ['fps']);
7584
- if (fromFps != null) {
7585
- setValueByPath(toObject, ['fps'], fromFps);
7586
- }
7587
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
7588
- if (fromEndOffset != null) {
7589
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7590
- }
7591
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
7592
- if (fromStartOffset != null) {
7593
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7594
- }
7595
- return toObject;
7596
- }
7597
7708
  function blobToMldev$2(fromObject) {
7598
7709
  const toObject = {};
7599
7710
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7609,22 +7720,6 @@ function blobToMldev$2(fromObject) {
7609
7720
  }
7610
7721
  return toObject;
7611
7722
  }
7612
- function blobToVertex$1(fromObject) {
7613
- const toObject = {};
7614
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7615
- if (fromDisplayName != null) {
7616
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7617
- }
7618
- const fromData = getValueByPath(fromObject, ['data']);
7619
- if (fromData != null) {
7620
- setValueByPath(toObject, ['data'], fromData);
7621
- }
7622
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7623
- if (fromMimeType != null) {
7624
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7625
- }
7626
- return toObject;
7627
- }
7628
7723
  function fileDataToMldev$2(fromObject) {
7629
7724
  const toObject = {};
7630
7725
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7640,22 +7735,6 @@ function fileDataToMldev$2(fromObject) {
7640
7735
  }
7641
7736
  return toObject;
7642
7737
  }
7643
- function fileDataToVertex$1(fromObject) {
7644
- const toObject = {};
7645
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7646
- if (fromDisplayName != null) {
7647
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7648
- }
7649
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7650
- if (fromFileUri != null) {
7651
- setValueByPath(toObject, ['fileUri'], fromFileUri);
7652
- }
7653
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7654
- if (fromMimeType != null) {
7655
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7656
- }
7657
- return toObject;
7658
- }
7659
7738
  function partToMldev$2(fromObject) {
7660
7739
  const toObject = {};
7661
7740
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7710,60 +7789,6 @@ function partToMldev$2(fromObject) {
7710
7789
  }
7711
7790
  return toObject;
7712
7791
  }
7713
- function partToVertex$1(fromObject) {
7714
- const toObject = {};
7715
- const fromVideoMetadata = getValueByPath(fromObject, [
7716
- 'videoMetadata',
7717
- ]);
7718
- if (fromVideoMetadata != null) {
7719
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7720
- }
7721
- const fromThought = getValueByPath(fromObject, ['thought']);
7722
- if (fromThought != null) {
7723
- setValueByPath(toObject, ['thought'], fromThought);
7724
- }
7725
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7726
- if (fromInlineData != null) {
7727
- setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7728
- }
7729
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7730
- if (fromFileData != null) {
7731
- setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7732
- }
7733
- const fromThoughtSignature = getValueByPath(fromObject, [
7734
- 'thoughtSignature',
7735
- ]);
7736
- if (fromThoughtSignature != null) {
7737
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7738
- }
7739
- const fromCodeExecutionResult = getValueByPath(fromObject, [
7740
- 'codeExecutionResult',
7741
- ]);
7742
- if (fromCodeExecutionResult != null) {
7743
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7744
- }
7745
- const fromExecutableCode = getValueByPath(fromObject, [
7746
- 'executableCode',
7747
- ]);
7748
- if (fromExecutableCode != null) {
7749
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7750
- }
7751
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7752
- if (fromFunctionCall != null) {
7753
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7754
- }
7755
- const fromFunctionResponse = getValueByPath(fromObject, [
7756
- 'functionResponse',
7757
- ]);
7758
- if (fromFunctionResponse != null) {
7759
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7760
- }
7761
- const fromText = getValueByPath(fromObject, ['text']);
7762
- if (fromText != null) {
7763
- setValueByPath(toObject, ['text'], fromText);
7764
- }
7765
- return toObject;
7766
- }
7767
7792
  function contentToMldev$2(fromObject) {
7768
7793
  const toObject = {};
7769
7794
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -7782,24 +7807,6 @@ function contentToMldev$2(fromObject) {
7782
7807
  }
7783
7808
  return toObject;
7784
7809
  }
7785
- function contentToVertex$1(fromObject) {
7786
- const toObject = {};
7787
- const fromParts = getValueByPath(fromObject, ['parts']);
7788
- if (fromParts != null) {
7789
- let transformedList = fromParts;
7790
- if (Array.isArray(transformedList)) {
7791
- transformedList = transformedList.map((item) => {
7792
- return partToVertex$1(item);
7793
- });
7794
- }
7795
- setValueByPath(toObject, ['parts'], transformedList);
7796
- }
7797
- const fromRole = getValueByPath(fromObject, ['role']);
7798
- if (fromRole != null) {
7799
- setValueByPath(toObject, ['role'], fromRole);
7800
- }
7801
- return toObject;
7802
- }
7803
7810
  function functionDeclarationToMldev$2(fromObject) {
7804
7811
  const toObject = {};
7805
7812
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
@@ -7836,62 +7843,15 @@ function functionDeclarationToMldev$2(fromObject) {
7836
7843
  }
7837
7844
  return toObject;
7838
7845
  }
7839
- function functionDeclarationToVertex$1(fromObject) {
7846
+ function intervalToMldev$2(fromObject) {
7840
7847
  const toObject = {};
7841
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7842
- throw new Error('behavior parameter is not supported in Vertex AI.');
7843
- }
7844
- const fromDescription = getValueByPath(fromObject, ['description']);
7845
- if (fromDescription != null) {
7846
- setValueByPath(toObject, ['description'], fromDescription);
7847
- }
7848
- const fromName = getValueByPath(fromObject, ['name']);
7849
- if (fromName != null) {
7850
- setValueByPath(toObject, ['name'], fromName);
7848
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
7849
+ if (fromStartTime != null) {
7850
+ setValueByPath(toObject, ['startTime'], fromStartTime);
7851
7851
  }
7852
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7853
- if (fromParameters != null) {
7854
- setValueByPath(toObject, ['parameters'], fromParameters);
7855
- }
7856
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7857
- 'parametersJsonSchema',
7858
- ]);
7859
- if (fromParametersJsonSchema != null) {
7860
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7861
- }
7862
- const fromResponse = getValueByPath(fromObject, ['response']);
7863
- if (fromResponse != null) {
7864
- setValueByPath(toObject, ['response'], fromResponse);
7865
- }
7866
- const fromResponseJsonSchema = getValueByPath(fromObject, [
7867
- 'responseJsonSchema',
7868
- ]);
7869
- if (fromResponseJsonSchema != null) {
7870
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7871
- }
7872
- return toObject;
7873
- }
7874
- function intervalToMldev$2(fromObject) {
7875
- const toObject = {};
7876
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7877
- if (fromStartTime != null) {
7878
- setValueByPath(toObject, ['startTime'], fromStartTime);
7879
- }
7880
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7881
- if (fromEndTime != null) {
7882
- setValueByPath(toObject, ['endTime'], fromEndTime);
7883
- }
7884
- return toObject;
7885
- }
7886
- function intervalToVertex$1(fromObject) {
7887
- const toObject = {};
7888
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7889
- if (fromStartTime != null) {
7890
- setValueByPath(toObject, ['startTime'], fromStartTime);
7891
- }
7892
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7893
- if (fromEndTime != null) {
7894
- setValueByPath(toObject, ['endTime'], fromEndTime);
7852
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
7853
+ if (fromEndTime != null) {
7854
+ setValueByPath(toObject, ['endTime'], fromEndTime);
7895
7855
  }
7896
7856
  return toObject;
7897
7857
  }
@@ -7905,16 +7865,6 @@ function googleSearchToMldev$2(fromObject) {
7905
7865
  }
7906
7866
  return toObject;
7907
7867
  }
7908
- function googleSearchToVertex$1(fromObject) {
7909
- const toObject = {};
7910
- const fromTimeRangeFilter = getValueByPath(fromObject, [
7911
- 'timeRangeFilter',
7912
- ]);
7913
- if (fromTimeRangeFilter != null) {
7914
- setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7915
- }
7916
- return toObject;
7917
- }
7918
7868
  function dynamicRetrievalConfigToMldev$2(fromObject) {
7919
7869
  const toObject = {};
7920
7870
  const fromMode = getValueByPath(fromObject, ['mode']);
@@ -7929,20 +7879,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
7929
7879
  }
7930
7880
  return toObject;
7931
7881
  }
7932
- function dynamicRetrievalConfigToVertex$1(fromObject) {
7933
- const toObject = {};
7934
- const fromMode = getValueByPath(fromObject, ['mode']);
7935
- if (fromMode != null) {
7936
- setValueByPath(toObject, ['mode'], fromMode);
7937
- }
7938
- const fromDynamicThreshold = getValueByPath(fromObject, [
7939
- 'dynamicThreshold',
7940
- ]);
7941
- if (fromDynamicThreshold != null) {
7942
- setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7943
- }
7944
- return toObject;
7945
- }
7946
7882
  function googleSearchRetrievalToMldev$2(fromObject) {
7947
7883
  const toObject = {};
7948
7884
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
@@ -7953,76 +7889,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
7953
7889
  }
7954
7890
  return toObject;
7955
7891
  }
7956
- function googleSearchRetrievalToVertex$1(fromObject) {
7957
- const toObject = {};
7958
- const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7959
- 'dynamicRetrievalConfig',
7960
- ]);
7961
- if (fromDynamicRetrievalConfig != null) {
7962
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7963
- }
7964
- return toObject;
7965
- }
7966
- function enterpriseWebSearchToVertex$1() {
7967
- const toObject = {};
7968
- return toObject;
7969
- }
7970
- function apiKeyConfigToVertex$1(fromObject) {
7971
- const toObject = {};
7972
- const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7973
- if (fromApiKeyString != null) {
7974
- setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7975
- }
7976
- return toObject;
7977
- }
7978
- function authConfigToVertex$1(fromObject) {
7979
- const toObject = {};
7980
- const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7981
- if (fromApiKeyConfig != null) {
7982
- setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7983
- }
7984
- const fromAuthType = getValueByPath(fromObject, ['authType']);
7985
- if (fromAuthType != null) {
7986
- setValueByPath(toObject, ['authType'], fromAuthType);
7987
- }
7988
- const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7989
- 'googleServiceAccountConfig',
7990
- ]);
7991
- if (fromGoogleServiceAccountConfig != null) {
7992
- setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7993
- }
7994
- const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7995
- 'httpBasicAuthConfig',
7996
- ]);
7997
- if (fromHttpBasicAuthConfig != null) {
7998
- setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7999
- }
8000
- const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
8001
- if (fromOauthConfig != null) {
8002
- setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
8003
- }
8004
- const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
8005
- if (fromOidcConfig != null) {
8006
- setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
8007
- }
8008
- return toObject;
8009
- }
8010
- function googleMapsToVertex$1(fromObject) {
8011
- const toObject = {};
8012
- const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
8013
- if (fromAuthConfig != null) {
8014
- setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
8015
- }
8016
- return toObject;
8017
- }
8018
7892
  function urlContextToMldev$2() {
8019
7893
  const toObject = {};
8020
7894
  return toObject;
8021
7895
  }
8022
- function urlContextToVertex$1() {
8023
- const toObject = {};
8024
- return toObject;
8025
- }
8026
7896
  function toolToMldev$2(fromObject) {
8027
7897
  const toObject = {};
8028
7898
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -8072,60 +7942,6 @@ function toolToMldev$2(fromObject) {
8072
7942
  }
8073
7943
  return toObject;
8074
7944
  }
8075
- function toolToVertex$1(fromObject) {
8076
- const toObject = {};
8077
- const fromFunctionDeclarations = getValueByPath(fromObject, [
8078
- 'functionDeclarations',
8079
- ]);
8080
- if (fromFunctionDeclarations != null) {
8081
- let transformedList = fromFunctionDeclarations;
8082
- if (Array.isArray(transformedList)) {
8083
- transformedList = transformedList.map((item) => {
8084
- return functionDeclarationToVertex$1(item);
8085
- });
8086
- }
8087
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
8088
- }
8089
- const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
8090
- if (fromRetrieval != null) {
8091
- setValueByPath(toObject, ['retrieval'], fromRetrieval);
8092
- }
8093
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8094
- if (fromGoogleSearch != null) {
8095
- setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
8096
- }
8097
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8098
- 'googleSearchRetrieval',
8099
- ]);
8100
- if (fromGoogleSearchRetrieval != null) {
8101
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
8102
- }
8103
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
8104
- 'enterpriseWebSearch',
8105
- ]);
8106
- if (fromEnterpriseWebSearch != null) {
8107
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8108
- }
8109
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8110
- if (fromGoogleMaps != null) {
8111
- setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
8112
- }
8113
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8114
- if (fromUrlContext != null) {
8115
- setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8116
- }
8117
- const fromCodeExecution = getValueByPath(fromObject, [
8118
- 'codeExecution',
8119
- ]);
8120
- if (fromCodeExecution != null) {
8121
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8122
- }
8123
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8124
- if (fromComputerUse != null) {
8125
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8126
- }
8127
- return toObject;
8128
- }
8129
7945
  function sessionResumptionConfigToMldev$1(fromObject) {
8130
7946
  const toObject = {};
8131
7947
  const fromHandle = getValueByPath(fromObject, ['handle']);
@@ -8137,26 +7953,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8137
7953
  }
8138
7954
  return toObject;
8139
7955
  }
8140
- function sessionResumptionConfigToVertex(fromObject) {
8141
- const toObject = {};
8142
- const fromHandle = getValueByPath(fromObject, ['handle']);
8143
- if (fromHandle != null) {
8144
- setValueByPath(toObject, ['handle'], fromHandle);
8145
- }
8146
- const fromTransparent = getValueByPath(fromObject, ['transparent']);
8147
- if (fromTransparent != null) {
8148
- setValueByPath(toObject, ['transparent'], fromTransparent);
8149
- }
8150
- return toObject;
8151
- }
8152
7956
  function audioTranscriptionConfigToMldev$1() {
8153
7957
  const toObject = {};
8154
7958
  return toObject;
8155
7959
  }
8156
- function audioTranscriptionConfigToVertex() {
8157
- const toObject = {};
8158
- return toObject;
8159
- }
8160
7960
  function automaticActivityDetectionToMldev$1(fromObject) {
8161
7961
  const toObject = {};
8162
7962
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
@@ -8189,38 +7989,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
8189
7989
  }
8190
7990
  return toObject;
8191
7991
  }
8192
- function automaticActivityDetectionToVertex(fromObject) {
8193
- const toObject = {};
8194
- const fromDisabled = getValueByPath(fromObject, ['disabled']);
8195
- if (fromDisabled != null) {
8196
- setValueByPath(toObject, ['disabled'], fromDisabled);
8197
- }
8198
- const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
8199
- 'startOfSpeechSensitivity',
8200
- ]);
8201
- if (fromStartOfSpeechSensitivity != null) {
8202
- setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
8203
- }
8204
- const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
8205
- 'endOfSpeechSensitivity',
8206
- ]);
8207
- if (fromEndOfSpeechSensitivity != null) {
8208
- setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
8209
- }
8210
- const fromPrefixPaddingMs = getValueByPath(fromObject, [
8211
- 'prefixPaddingMs',
8212
- ]);
8213
- if (fromPrefixPaddingMs != null) {
8214
- setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
8215
- }
8216
- const fromSilenceDurationMs = getValueByPath(fromObject, [
8217
- 'silenceDurationMs',
8218
- ]);
8219
- if (fromSilenceDurationMs != null) {
8220
- setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
8221
- }
8222
- return toObject;
8223
- }
8224
7992
  function realtimeInputConfigToMldev$1(fromObject) {
8225
7993
  const toObject = {};
8226
7994
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
@@ -8241,26 +8009,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
8241
8009
  }
8242
8010
  return toObject;
8243
8011
  }
8244
- function realtimeInputConfigToVertex(fromObject) {
8245
- const toObject = {};
8246
- const fromAutomaticActivityDetection = getValueByPath(fromObject, [
8247
- 'automaticActivityDetection',
8248
- ]);
8249
- if (fromAutomaticActivityDetection != null) {
8250
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
8251
- }
8252
- const fromActivityHandling = getValueByPath(fromObject, [
8253
- 'activityHandling',
8254
- ]);
8255
- if (fromActivityHandling != null) {
8256
- setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
8257
- }
8258
- const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
8259
- if (fromTurnCoverage != null) {
8260
- setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
8261
- }
8262
- return toObject;
8263
- }
8264
8012
  function slidingWindowToMldev$1(fromObject) {
8265
8013
  const toObject = {};
8266
8014
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
@@ -8269,15 +8017,7 @@ function slidingWindowToMldev$1(fromObject) {
8269
8017
  }
8270
8018
  return toObject;
8271
8019
  }
8272
- function slidingWindowToVertex(fromObject) {
8273
- const toObject = {};
8274
- const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
8275
- if (fromTargetTokens != null) {
8276
- setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
8277
- }
8278
- return toObject;
8279
- }
8280
- function contextWindowCompressionConfigToMldev$1(fromObject) {
8020
+ function contextWindowCompressionConfigToMldev$1(fromObject) {
8281
8021
  const toObject = {};
8282
8022
  const fromTriggerTokens = getValueByPath(fromObject, [
8283
8023
  'triggerTokens',
@@ -8293,22 +8033,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
8293
8033
  }
8294
8034
  return toObject;
8295
8035
  }
8296
- function contextWindowCompressionConfigToVertex(fromObject) {
8297
- const toObject = {};
8298
- const fromTriggerTokens = getValueByPath(fromObject, [
8299
- 'triggerTokens',
8300
- ]);
8301
- if (fromTriggerTokens != null) {
8302
- setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
8303
- }
8304
- const fromSlidingWindow = getValueByPath(fromObject, [
8305
- 'slidingWindow',
8306
- ]);
8307
- if (fromSlidingWindow != null) {
8308
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8309
- }
8310
- return toObject;
8311
- }
8312
8036
  function proactivityConfigToMldev$1(fromObject) {
8313
8037
  const toObject = {};
8314
8038
  const fromProactiveAudio = getValueByPath(fromObject, [
@@ -8319,16 +8043,6 @@ function proactivityConfigToMldev$1(fromObject) {
8319
8043
  }
8320
8044
  return toObject;
8321
8045
  }
8322
- function proactivityConfigToVertex(fromObject) {
8323
- const toObject = {};
8324
- const fromProactiveAudio = getValueByPath(fromObject, [
8325
- 'proactiveAudio',
8326
- ]);
8327
- if (fromProactiveAudio != null) {
8328
- setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8329
- }
8330
- return toObject;
8331
- }
8332
8046
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
8333
8047
  const toObject = {};
8334
8048
  const fromGenerationConfig = getValueByPath(fromObject, [
@@ -8433,110 +8147,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
8433
8147
  }
8434
8148
  return toObject;
8435
8149
  }
8436
- function liveConnectConfigToVertex(fromObject, parentObject) {
8437
- const toObject = {};
8438
- const fromGenerationConfig = getValueByPath(fromObject, [
8439
- 'generationConfig',
8440
- ]);
8441
- if (parentObject !== undefined && fromGenerationConfig != null) {
8442
- setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8443
- }
8444
- const fromResponseModalities = getValueByPath(fromObject, [
8445
- 'responseModalities',
8446
- ]);
8447
- if (parentObject !== undefined && fromResponseModalities != null) {
8448
- setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8449
- }
8450
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
8451
- if (parentObject !== undefined && fromTemperature != null) {
8452
- setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8453
- }
8454
- const fromTopP = getValueByPath(fromObject, ['topP']);
8455
- if (parentObject !== undefined && fromTopP != null) {
8456
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8457
- }
8458
- const fromTopK = getValueByPath(fromObject, ['topK']);
8459
- if (parentObject !== undefined && fromTopK != null) {
8460
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8461
- }
8462
- const fromMaxOutputTokens = getValueByPath(fromObject, [
8463
- 'maxOutputTokens',
8464
- ]);
8465
- if (parentObject !== undefined && fromMaxOutputTokens != null) {
8466
- setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8467
- }
8468
- const fromMediaResolution = getValueByPath(fromObject, [
8469
- 'mediaResolution',
8470
- ]);
8471
- if (parentObject !== undefined && fromMediaResolution != null) {
8472
- setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8473
- }
8474
- const fromSeed = getValueByPath(fromObject, ['seed']);
8475
- if (parentObject !== undefined && fromSeed != null) {
8476
- setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8477
- }
8478
- const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8479
- if (parentObject !== undefined && fromSpeechConfig != null) {
8480
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8481
- }
8482
- const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8483
- 'enableAffectiveDialog',
8484
- ]);
8485
- if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8486
- setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8487
- }
8488
- const fromSystemInstruction = getValueByPath(fromObject, [
8489
- 'systemInstruction',
8490
- ]);
8491
- if (parentObject !== undefined && fromSystemInstruction != null) {
8492
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8493
- }
8494
- const fromTools = getValueByPath(fromObject, ['tools']);
8495
- if (parentObject !== undefined && fromTools != null) {
8496
- let transformedList = tTools(fromTools);
8497
- if (Array.isArray(transformedList)) {
8498
- transformedList = transformedList.map((item) => {
8499
- return toolToVertex$1(tTool(item));
8500
- });
8501
- }
8502
- setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8503
- }
8504
- const fromSessionResumption = getValueByPath(fromObject, [
8505
- 'sessionResumption',
8506
- ]);
8507
- if (parentObject !== undefined && fromSessionResumption != null) {
8508
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8509
- }
8510
- const fromInputAudioTranscription = getValueByPath(fromObject, [
8511
- 'inputAudioTranscription',
8512
- ]);
8513
- if (parentObject !== undefined && fromInputAudioTranscription != null) {
8514
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8515
- }
8516
- const fromOutputAudioTranscription = getValueByPath(fromObject, [
8517
- 'outputAudioTranscription',
8518
- ]);
8519
- if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8520
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8521
- }
8522
- const fromRealtimeInputConfig = getValueByPath(fromObject, [
8523
- 'realtimeInputConfig',
8524
- ]);
8525
- if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8526
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8527
- }
8528
- const fromContextWindowCompression = getValueByPath(fromObject, [
8529
- 'contextWindowCompression',
8530
- ]);
8531
- if (parentObject !== undefined && fromContextWindowCompression != null) {
8532
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8533
- }
8534
- const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8535
- if (parentObject !== undefined && fromProactivity != null) {
8536
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8537
- }
8538
- return toObject;
8539
- }
8540
8150
  function liveConnectParametersToMldev(apiClient, fromObject) {
8541
8151
  const toObject = {};
8542
8152
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -8549,34 +8159,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
8549
8159
  }
8550
8160
  return toObject;
8551
8161
  }
8552
- function liveConnectParametersToVertex(apiClient, fromObject) {
8553
- const toObject = {};
8554
- const fromModel = getValueByPath(fromObject, ['model']);
8555
- if (fromModel != null) {
8556
- setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8557
- }
8558
- const fromConfig = getValueByPath(fromObject, ['config']);
8559
- if (fromConfig != null) {
8560
- setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8561
- }
8562
- return toObject;
8563
- }
8564
8162
  function activityStartToMldev() {
8565
8163
  const toObject = {};
8566
8164
  return toObject;
8567
8165
  }
8568
- function activityStartToVertex() {
8569
- const toObject = {};
8570
- return toObject;
8571
- }
8572
8166
  function activityEndToMldev() {
8573
8167
  const toObject = {};
8574
8168
  return toObject;
8575
8169
  }
8576
- function activityEndToVertex() {
8577
- const toObject = {};
8578
- return toObject;
8579
- }
8580
8170
  function liveSendRealtimeInputParametersToMldev(fromObject) {
8581
8171
  const toObject = {};
8582
8172
  const fromMedia = getValueByPath(fromObject, ['media']);
@@ -8613,43 +8203,1165 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
8613
8203
  }
8614
8204
  return toObject;
8615
8205
  }
8616
- function liveSendRealtimeInputParametersToVertex(fromObject) {
8206
+ function weightedPromptToMldev(fromObject) {
8617
8207
  const toObject = {};
8618
- const fromMedia = getValueByPath(fromObject, ['media']);
8619
- if (fromMedia != null) {
8620
- setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8208
+ const fromText = getValueByPath(fromObject, ['text']);
8209
+ if (fromText != null) {
8210
+ setValueByPath(toObject, ['text'], fromText);
8621
8211
  }
8622
- const fromAudio = getValueByPath(fromObject, ['audio']);
8623
- if (fromAudio != null) {
8624
- setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8212
+ const fromWeight = getValueByPath(fromObject, ['weight']);
8213
+ if (fromWeight != null) {
8214
+ setValueByPath(toObject, ['weight'], fromWeight);
8215
+ }
8216
+ return toObject;
8217
+ }
8218
+ function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
8219
+ const toObject = {};
8220
+ const fromWeightedPrompts = getValueByPath(fromObject, [
8221
+ 'weightedPrompts',
8222
+ ]);
8223
+ if (fromWeightedPrompts != null) {
8224
+ let transformedList = fromWeightedPrompts;
8225
+ if (Array.isArray(transformedList)) {
8226
+ transformedList = transformedList.map((item) => {
8227
+ return weightedPromptToMldev(item);
8228
+ });
8229
+ }
8230
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
8231
+ }
8232
+ return toObject;
8233
+ }
8234
+ function liveMusicGenerationConfigToMldev(fromObject) {
8235
+ const toObject = {};
8236
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8237
+ if (fromTemperature != null) {
8238
+ setValueByPath(toObject, ['temperature'], fromTemperature);
8239
+ }
8240
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8241
+ if (fromTopK != null) {
8242
+ setValueByPath(toObject, ['topK'], fromTopK);
8243
+ }
8244
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8245
+ if (fromSeed != null) {
8246
+ setValueByPath(toObject, ['seed'], fromSeed);
8247
+ }
8248
+ const fromGuidance = getValueByPath(fromObject, ['guidance']);
8249
+ if (fromGuidance != null) {
8250
+ setValueByPath(toObject, ['guidance'], fromGuidance);
8251
+ }
8252
+ const fromBpm = getValueByPath(fromObject, ['bpm']);
8253
+ if (fromBpm != null) {
8254
+ setValueByPath(toObject, ['bpm'], fromBpm);
8255
+ }
8256
+ const fromDensity = getValueByPath(fromObject, ['density']);
8257
+ if (fromDensity != null) {
8258
+ setValueByPath(toObject, ['density'], fromDensity);
8259
+ }
8260
+ const fromBrightness = getValueByPath(fromObject, ['brightness']);
8261
+ if (fromBrightness != null) {
8262
+ setValueByPath(toObject, ['brightness'], fromBrightness);
8263
+ }
8264
+ const fromScale = getValueByPath(fromObject, ['scale']);
8265
+ if (fromScale != null) {
8266
+ setValueByPath(toObject, ['scale'], fromScale);
8267
+ }
8268
+ const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
8269
+ if (fromMuteBass != null) {
8270
+ setValueByPath(toObject, ['muteBass'], fromMuteBass);
8271
+ }
8272
+ const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
8273
+ if (fromMuteDrums != null) {
8274
+ setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
8275
+ }
8276
+ const fromOnlyBassAndDrums = getValueByPath(fromObject, [
8277
+ 'onlyBassAndDrums',
8278
+ ]);
8279
+ if (fromOnlyBassAndDrums != null) {
8280
+ setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
8281
+ }
8282
+ return toObject;
8283
+ }
8284
+ function liveMusicSetConfigParametersToMldev(fromObject) {
8285
+ const toObject = {};
8286
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
8287
+ 'musicGenerationConfig',
8288
+ ]);
8289
+ if (fromMusicGenerationConfig != null) {
8290
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
8291
+ }
8292
+ return toObject;
8293
+ }
8294
+ function liveMusicClientSetupToMldev(fromObject) {
8295
+ const toObject = {};
8296
+ const fromModel = getValueByPath(fromObject, ['model']);
8297
+ if (fromModel != null) {
8298
+ setValueByPath(toObject, ['model'], fromModel);
8299
+ }
8300
+ return toObject;
8301
+ }
8302
+ function liveMusicClientContentToMldev(fromObject) {
8303
+ const toObject = {};
8304
+ const fromWeightedPrompts = getValueByPath(fromObject, [
8305
+ 'weightedPrompts',
8306
+ ]);
8307
+ if (fromWeightedPrompts != null) {
8308
+ let transformedList = fromWeightedPrompts;
8309
+ if (Array.isArray(transformedList)) {
8310
+ transformedList = transformedList.map((item) => {
8311
+ return weightedPromptToMldev(item);
8312
+ });
8313
+ }
8314
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
8315
+ }
8316
+ return toObject;
8317
+ }
8318
+ function liveMusicClientMessageToMldev(fromObject) {
8319
+ const toObject = {};
8320
+ const fromSetup = getValueByPath(fromObject, ['setup']);
8321
+ if (fromSetup != null) {
8322
+ setValueByPath(toObject, ['setup'], liveMusicClientSetupToMldev(fromSetup));
8323
+ }
8324
+ const fromClientContent = getValueByPath(fromObject, [
8325
+ 'clientContent',
8326
+ ]);
8327
+ if (fromClientContent != null) {
8328
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentToMldev(fromClientContent));
8329
+ }
8330
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
8331
+ 'musicGenerationConfig',
8332
+ ]);
8333
+ if (fromMusicGenerationConfig != null) {
8334
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
8335
+ }
8336
+ const fromPlaybackControl = getValueByPath(fromObject, [
8337
+ 'playbackControl',
8338
+ ]);
8339
+ if (fromPlaybackControl != null) {
8340
+ setValueByPath(toObject, ['playbackControl'], fromPlaybackControl);
8341
+ }
8342
+ return toObject;
8343
+ }
8344
+ function prebuiltVoiceConfigToVertex$1(fromObject) {
8345
+ const toObject = {};
8346
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
8347
+ if (fromVoiceName != null) {
8348
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
8349
+ }
8350
+ return toObject;
8351
+ }
8352
+ function voiceConfigToVertex$1(fromObject) {
8353
+ const toObject = {};
8354
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
8355
+ 'prebuiltVoiceConfig',
8356
+ ]);
8357
+ if (fromPrebuiltVoiceConfig != null) {
8358
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
8359
+ }
8360
+ return toObject;
8361
+ }
8362
+ function speechConfigToVertex$1(fromObject) {
8363
+ const toObject = {};
8364
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8365
+ if (fromVoiceConfig != null) {
8366
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8367
+ }
8368
+ if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
8369
+ throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
8370
+ }
8371
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
8372
+ if (fromLanguageCode != null) {
8373
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8374
+ }
8375
+ return toObject;
8376
+ }
8377
+ function videoMetadataToVertex$1(fromObject) {
8378
+ const toObject = {};
8379
+ const fromFps = getValueByPath(fromObject, ['fps']);
8380
+ if (fromFps != null) {
8381
+ setValueByPath(toObject, ['fps'], fromFps);
8382
+ }
8383
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8384
+ if (fromEndOffset != null) {
8385
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8386
+ }
8387
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8388
+ if (fromStartOffset != null) {
8389
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8390
+ }
8391
+ return toObject;
8392
+ }
8393
+ function blobToVertex$1(fromObject) {
8394
+ const toObject = {};
8395
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8396
+ if (fromDisplayName != null) {
8397
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8398
+ }
8399
+ const fromData = getValueByPath(fromObject, ['data']);
8400
+ if (fromData != null) {
8401
+ setValueByPath(toObject, ['data'], fromData);
8402
+ }
8403
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8404
+ if (fromMimeType != null) {
8405
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8406
+ }
8407
+ return toObject;
8408
+ }
8409
+ function fileDataToVertex$1(fromObject) {
8410
+ const toObject = {};
8411
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8412
+ if (fromDisplayName != null) {
8413
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8414
+ }
8415
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8416
+ if (fromFileUri != null) {
8417
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8418
+ }
8419
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8420
+ if (fromMimeType != null) {
8421
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8422
+ }
8423
+ return toObject;
8424
+ }
8425
+ function partToVertex$1(fromObject) {
8426
+ const toObject = {};
8427
+ const fromVideoMetadata = getValueByPath(fromObject, [
8428
+ 'videoMetadata',
8429
+ ]);
8430
+ if (fromVideoMetadata != null) {
8431
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
8432
+ }
8433
+ const fromThought = getValueByPath(fromObject, ['thought']);
8434
+ if (fromThought != null) {
8435
+ setValueByPath(toObject, ['thought'], fromThought);
8436
+ }
8437
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8438
+ if (fromInlineData != null) {
8439
+ setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
8440
+ }
8441
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8442
+ if (fromFileData != null) {
8443
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
8444
+ }
8445
+ const fromThoughtSignature = getValueByPath(fromObject, [
8446
+ 'thoughtSignature',
8447
+ ]);
8448
+ if (fromThoughtSignature != null) {
8449
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8450
+ }
8451
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8452
+ 'codeExecutionResult',
8453
+ ]);
8454
+ if (fromCodeExecutionResult != null) {
8455
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8456
+ }
8457
+ const fromExecutableCode = getValueByPath(fromObject, [
8458
+ 'executableCode',
8459
+ ]);
8460
+ if (fromExecutableCode != null) {
8461
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8462
+ }
8463
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8464
+ if (fromFunctionCall != null) {
8465
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8466
+ }
8467
+ const fromFunctionResponse = getValueByPath(fromObject, [
8468
+ 'functionResponse',
8469
+ ]);
8470
+ if (fromFunctionResponse != null) {
8471
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8472
+ }
8473
+ const fromText = getValueByPath(fromObject, ['text']);
8474
+ if (fromText != null) {
8475
+ setValueByPath(toObject, ['text'], fromText);
8476
+ }
8477
+ return toObject;
8478
+ }
8479
+ function contentToVertex$1(fromObject) {
8480
+ const toObject = {};
8481
+ const fromParts = getValueByPath(fromObject, ['parts']);
8482
+ if (fromParts != null) {
8483
+ let transformedList = fromParts;
8484
+ if (Array.isArray(transformedList)) {
8485
+ transformedList = transformedList.map((item) => {
8486
+ return partToVertex$1(item);
8487
+ });
8488
+ }
8489
+ setValueByPath(toObject, ['parts'], transformedList);
8490
+ }
8491
+ const fromRole = getValueByPath(fromObject, ['role']);
8492
+ if (fromRole != null) {
8493
+ setValueByPath(toObject, ['role'], fromRole);
8494
+ }
8495
+ return toObject;
8496
+ }
8497
+ function functionDeclarationToVertex$1(fromObject) {
8498
+ const toObject = {};
8499
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8500
+ throw new Error('behavior parameter is not supported in Vertex AI.');
8501
+ }
8502
+ const fromDescription = getValueByPath(fromObject, ['description']);
8503
+ if (fromDescription != null) {
8504
+ setValueByPath(toObject, ['description'], fromDescription);
8505
+ }
8506
+ const fromName = getValueByPath(fromObject, ['name']);
8507
+ if (fromName != null) {
8508
+ setValueByPath(toObject, ['name'], fromName);
8509
+ }
8510
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
8511
+ if (fromParameters != null) {
8512
+ setValueByPath(toObject, ['parameters'], fromParameters);
8513
+ }
8514
+ const fromParametersJsonSchema = getValueByPath(fromObject, [
8515
+ 'parametersJsonSchema',
8516
+ ]);
8517
+ if (fromParametersJsonSchema != null) {
8518
+ setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
8519
+ }
8520
+ const fromResponse = getValueByPath(fromObject, ['response']);
8521
+ if (fromResponse != null) {
8522
+ setValueByPath(toObject, ['response'], fromResponse);
8523
+ }
8524
+ const fromResponseJsonSchema = getValueByPath(fromObject, [
8525
+ 'responseJsonSchema',
8526
+ ]);
8527
+ if (fromResponseJsonSchema != null) {
8528
+ setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
8529
+ }
8530
+ return toObject;
8531
+ }
8532
+ function intervalToVertex$1(fromObject) {
8533
+ const toObject = {};
8534
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
8535
+ if (fromStartTime != null) {
8536
+ setValueByPath(toObject, ['startTime'], fromStartTime);
8537
+ }
8538
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
8539
+ if (fromEndTime != null) {
8540
+ setValueByPath(toObject, ['endTime'], fromEndTime);
8541
+ }
8542
+ return toObject;
8543
+ }
8544
+ function googleSearchToVertex$1(fromObject) {
8545
+ const toObject = {};
8546
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
8547
+ 'timeRangeFilter',
8548
+ ]);
8549
+ if (fromTimeRangeFilter != null) {
8550
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
8551
+ }
8552
+ return toObject;
8553
+ }
8554
+ function dynamicRetrievalConfigToVertex$1(fromObject) {
8555
+ const toObject = {};
8556
+ const fromMode = getValueByPath(fromObject, ['mode']);
8557
+ if (fromMode != null) {
8558
+ setValueByPath(toObject, ['mode'], fromMode);
8559
+ }
8560
+ const fromDynamicThreshold = getValueByPath(fromObject, [
8561
+ 'dynamicThreshold',
8562
+ ]);
8563
+ if (fromDynamicThreshold != null) {
8564
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
8565
+ }
8566
+ return toObject;
8567
+ }
8568
+ function googleSearchRetrievalToVertex$1(fromObject) {
8569
+ const toObject = {};
8570
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
8571
+ 'dynamicRetrievalConfig',
8572
+ ]);
8573
+ if (fromDynamicRetrievalConfig != null) {
8574
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
8575
+ }
8576
+ return toObject;
8577
+ }
8578
+ function enterpriseWebSearchToVertex$1() {
8579
+ const toObject = {};
8580
+ return toObject;
8581
+ }
8582
+ function apiKeyConfigToVertex$1(fromObject) {
8583
+ const toObject = {};
8584
+ const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
8585
+ if (fromApiKeyString != null) {
8586
+ setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
8587
+ }
8588
+ return toObject;
8589
+ }
8590
+ function authConfigToVertex$1(fromObject) {
8591
+ const toObject = {};
8592
+ const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
8593
+ if (fromApiKeyConfig != null) {
8594
+ setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
8595
+ }
8596
+ const fromAuthType = getValueByPath(fromObject, ['authType']);
8597
+ if (fromAuthType != null) {
8598
+ setValueByPath(toObject, ['authType'], fromAuthType);
8599
+ }
8600
+ const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
8601
+ 'googleServiceAccountConfig',
8602
+ ]);
8603
+ if (fromGoogleServiceAccountConfig != null) {
8604
+ setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
8605
+ }
8606
+ const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
8607
+ 'httpBasicAuthConfig',
8608
+ ]);
8609
+ if (fromHttpBasicAuthConfig != null) {
8610
+ setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
8611
+ }
8612
+ const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
8613
+ if (fromOauthConfig != null) {
8614
+ setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
8615
+ }
8616
+ const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
8617
+ if (fromOidcConfig != null) {
8618
+ setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
8619
+ }
8620
+ return toObject;
8621
+ }
8622
+ function googleMapsToVertex$1(fromObject) {
8623
+ const toObject = {};
8624
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
8625
+ if (fromAuthConfig != null) {
8626
+ setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
8627
+ }
8628
+ return toObject;
8629
+ }
8630
+ function urlContextToVertex$1() {
8631
+ const toObject = {};
8632
+ return toObject;
8633
+ }
8634
+ function toolToVertex$1(fromObject) {
8635
+ const toObject = {};
8636
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
8637
+ 'functionDeclarations',
8638
+ ]);
8639
+ if (fromFunctionDeclarations != null) {
8640
+ let transformedList = fromFunctionDeclarations;
8641
+ if (Array.isArray(transformedList)) {
8642
+ transformedList = transformedList.map((item) => {
8643
+ return functionDeclarationToVertex$1(item);
8644
+ });
8645
+ }
8646
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
8647
+ }
8648
+ const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
8649
+ if (fromRetrieval != null) {
8650
+ setValueByPath(toObject, ['retrieval'], fromRetrieval);
8651
+ }
8652
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8653
+ if (fromGoogleSearch != null) {
8654
+ setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
8655
+ }
8656
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8657
+ 'googleSearchRetrieval',
8658
+ ]);
8659
+ if (fromGoogleSearchRetrieval != null) {
8660
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
8661
+ }
8662
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
8663
+ 'enterpriseWebSearch',
8664
+ ]);
8665
+ if (fromEnterpriseWebSearch != null) {
8666
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8667
+ }
8668
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8669
+ if (fromGoogleMaps != null) {
8670
+ setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
8671
+ }
8672
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8673
+ if (fromUrlContext != null) {
8674
+ setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8675
+ }
8676
+ const fromCodeExecution = getValueByPath(fromObject, [
8677
+ 'codeExecution',
8678
+ ]);
8679
+ if (fromCodeExecution != null) {
8680
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8681
+ }
8682
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8683
+ if (fromComputerUse != null) {
8684
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8685
+ }
8686
+ return toObject;
8687
+ }
8688
+ function sessionResumptionConfigToVertex(fromObject) {
8689
+ const toObject = {};
8690
+ const fromHandle = getValueByPath(fromObject, ['handle']);
8691
+ if (fromHandle != null) {
8692
+ setValueByPath(toObject, ['handle'], fromHandle);
8693
+ }
8694
+ const fromTransparent = getValueByPath(fromObject, ['transparent']);
8695
+ if (fromTransparent != null) {
8696
+ setValueByPath(toObject, ['transparent'], fromTransparent);
8697
+ }
8698
+ return toObject;
8699
+ }
8700
+ function audioTranscriptionConfigToVertex() {
8701
+ const toObject = {};
8702
+ return toObject;
8703
+ }
8704
+ function automaticActivityDetectionToVertex(fromObject) {
8705
+ const toObject = {};
8706
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
8707
+ if (fromDisabled != null) {
8708
+ setValueByPath(toObject, ['disabled'], fromDisabled);
8709
+ }
8710
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
8711
+ 'startOfSpeechSensitivity',
8712
+ ]);
8713
+ if (fromStartOfSpeechSensitivity != null) {
8714
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
8715
+ }
8716
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
8717
+ 'endOfSpeechSensitivity',
8718
+ ]);
8719
+ if (fromEndOfSpeechSensitivity != null) {
8720
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
8721
+ }
8722
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
8723
+ 'prefixPaddingMs',
8724
+ ]);
8725
+ if (fromPrefixPaddingMs != null) {
8726
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
8727
+ }
8728
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
8729
+ 'silenceDurationMs',
8730
+ ]);
8731
+ if (fromSilenceDurationMs != null) {
8732
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
8733
+ }
8734
+ return toObject;
8735
+ }
8736
+ function realtimeInputConfigToVertex(fromObject) {
8737
+ const toObject = {};
8738
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
8739
+ 'automaticActivityDetection',
8740
+ ]);
8741
+ if (fromAutomaticActivityDetection != null) {
8742
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
8743
+ }
8744
+ const fromActivityHandling = getValueByPath(fromObject, [
8745
+ 'activityHandling',
8746
+ ]);
8747
+ if (fromActivityHandling != null) {
8748
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
8749
+ }
8750
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
8751
+ if (fromTurnCoverage != null) {
8752
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
8753
+ }
8754
+ return toObject;
8755
+ }
8756
+ function slidingWindowToVertex(fromObject) {
8757
+ const toObject = {};
8758
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
8759
+ if (fromTargetTokens != null) {
8760
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
8761
+ }
8762
+ return toObject;
8763
+ }
8764
+ function contextWindowCompressionConfigToVertex(fromObject) {
8765
+ const toObject = {};
8766
+ const fromTriggerTokens = getValueByPath(fromObject, [
8767
+ 'triggerTokens',
8768
+ ]);
8769
+ if (fromTriggerTokens != null) {
8770
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
8771
+ }
8772
+ const fromSlidingWindow = getValueByPath(fromObject, [
8773
+ 'slidingWindow',
8774
+ ]);
8775
+ if (fromSlidingWindow != null) {
8776
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8777
+ }
8778
+ return toObject;
8779
+ }
8780
+ function proactivityConfigToVertex(fromObject) {
8781
+ const toObject = {};
8782
+ const fromProactiveAudio = getValueByPath(fromObject, [
8783
+ 'proactiveAudio',
8784
+ ]);
8785
+ if (fromProactiveAudio != null) {
8786
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8787
+ }
8788
+ return toObject;
8789
+ }
8790
+ function liveConnectConfigToVertex(fromObject, parentObject) {
8791
+ const toObject = {};
8792
+ const fromGenerationConfig = getValueByPath(fromObject, [
8793
+ 'generationConfig',
8794
+ ]);
8795
+ if (parentObject !== undefined && fromGenerationConfig != null) {
8796
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8797
+ }
8798
+ const fromResponseModalities = getValueByPath(fromObject, [
8799
+ 'responseModalities',
8800
+ ]);
8801
+ if (parentObject !== undefined && fromResponseModalities != null) {
8802
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8803
+ }
8804
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8805
+ if (parentObject !== undefined && fromTemperature != null) {
8806
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8807
+ }
8808
+ const fromTopP = getValueByPath(fromObject, ['topP']);
8809
+ if (parentObject !== undefined && fromTopP != null) {
8810
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8811
+ }
8812
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8813
+ if (parentObject !== undefined && fromTopK != null) {
8814
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8815
+ }
8816
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
8817
+ 'maxOutputTokens',
8818
+ ]);
8819
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
8820
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8821
+ }
8822
+ const fromMediaResolution = getValueByPath(fromObject, [
8823
+ 'mediaResolution',
8824
+ ]);
8825
+ if (parentObject !== undefined && fromMediaResolution != null) {
8826
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8827
+ }
8828
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8829
+ if (parentObject !== undefined && fromSeed != null) {
8830
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8831
+ }
8832
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8833
+ if (parentObject !== undefined && fromSpeechConfig != null) {
8834
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8835
+ }
8836
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8837
+ 'enableAffectiveDialog',
8838
+ ]);
8839
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8840
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8841
+ }
8842
+ const fromSystemInstruction = getValueByPath(fromObject, [
8843
+ 'systemInstruction',
8844
+ ]);
8845
+ if (parentObject !== undefined && fromSystemInstruction != null) {
8846
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8847
+ }
8848
+ const fromTools = getValueByPath(fromObject, ['tools']);
8849
+ if (parentObject !== undefined && fromTools != null) {
8850
+ let transformedList = tTools(fromTools);
8851
+ if (Array.isArray(transformedList)) {
8852
+ transformedList = transformedList.map((item) => {
8853
+ return toolToVertex$1(tTool(item));
8854
+ });
8855
+ }
8856
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8857
+ }
8858
+ const fromSessionResumption = getValueByPath(fromObject, [
8859
+ 'sessionResumption',
8860
+ ]);
8861
+ if (parentObject !== undefined && fromSessionResumption != null) {
8862
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8863
+ }
8864
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
8865
+ 'inputAudioTranscription',
8866
+ ]);
8867
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
8868
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8869
+ }
8870
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
8871
+ 'outputAudioTranscription',
8872
+ ]);
8873
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8874
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8875
+ }
8876
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
8877
+ 'realtimeInputConfig',
8878
+ ]);
8879
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8880
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8881
+ }
8882
+ const fromContextWindowCompression = getValueByPath(fromObject, [
8883
+ 'contextWindowCompression',
8884
+ ]);
8885
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
8886
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8887
+ }
8888
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8889
+ if (parentObject !== undefined && fromProactivity != null) {
8890
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8891
+ }
8892
+ return toObject;
8893
+ }
8894
+ function liveConnectParametersToVertex(apiClient, fromObject) {
8895
+ const toObject = {};
8896
+ const fromModel = getValueByPath(fromObject, ['model']);
8897
+ if (fromModel != null) {
8898
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8899
+ }
8900
+ const fromConfig = getValueByPath(fromObject, ['config']);
8901
+ if (fromConfig != null) {
8902
+ setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8903
+ }
8904
+ return toObject;
8905
+ }
8906
+ function activityStartToVertex() {
8907
+ const toObject = {};
8908
+ return toObject;
8909
+ }
8910
+ function activityEndToVertex() {
8911
+ const toObject = {};
8912
+ return toObject;
8913
+ }
8914
+ function liveSendRealtimeInputParametersToVertex(fromObject) {
8915
+ const toObject = {};
8916
+ const fromMedia = getValueByPath(fromObject, ['media']);
8917
+ if (fromMedia != null) {
8918
+ setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8919
+ }
8920
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8921
+ if (fromAudio != null) {
8922
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8923
+ }
8924
+ const fromAudioStreamEnd = getValueByPath(fromObject, [
8925
+ 'audioStreamEnd',
8926
+ ]);
8927
+ if (fromAudioStreamEnd != null) {
8928
+ setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8929
+ }
8930
+ const fromVideo = getValueByPath(fromObject, ['video']);
8931
+ if (fromVideo != null) {
8932
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8933
+ }
8934
+ const fromText = getValueByPath(fromObject, ['text']);
8935
+ if (fromText != null) {
8936
+ setValueByPath(toObject, ['text'], fromText);
8937
+ }
8938
+ const fromActivityStart = getValueByPath(fromObject, [
8939
+ 'activityStart',
8940
+ ]);
8941
+ if (fromActivityStart != null) {
8942
+ setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8943
+ }
8944
+ const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8945
+ if (fromActivityEnd != null) {
8946
+ setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8947
+ }
8948
+ return toObject;
8949
+ }
8950
+ function liveServerSetupCompleteFromMldev() {
8951
+ const toObject = {};
8952
+ return toObject;
8953
+ }
8954
+ function videoMetadataFromMldev$1(fromObject) {
8955
+ const toObject = {};
8956
+ const fromFps = getValueByPath(fromObject, ['fps']);
8957
+ if (fromFps != null) {
8958
+ setValueByPath(toObject, ['fps'], fromFps);
8959
+ }
8960
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8961
+ if (fromEndOffset != null) {
8962
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8963
+ }
8964
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8965
+ if (fromStartOffset != null) {
8966
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8967
+ }
8968
+ return toObject;
8969
+ }
8970
+ function blobFromMldev$1(fromObject) {
8971
+ const toObject = {};
8972
+ const fromData = getValueByPath(fromObject, ['data']);
8973
+ if (fromData != null) {
8974
+ setValueByPath(toObject, ['data'], fromData);
8975
+ }
8976
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8977
+ if (fromMimeType != null) {
8978
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8979
+ }
8980
+ return toObject;
8981
+ }
8982
+ function fileDataFromMldev$1(fromObject) {
8983
+ const toObject = {};
8984
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8985
+ if (fromFileUri != null) {
8986
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8987
+ }
8988
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8989
+ if (fromMimeType != null) {
8990
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8991
+ }
8992
+ return toObject;
8993
+ }
8994
+ function partFromMldev$1(fromObject) {
8995
+ const toObject = {};
8996
+ const fromVideoMetadata = getValueByPath(fromObject, [
8997
+ 'videoMetadata',
8998
+ ]);
8999
+ if (fromVideoMetadata != null) {
9000
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
9001
+ }
9002
+ const fromThought = getValueByPath(fromObject, ['thought']);
9003
+ if (fromThought != null) {
9004
+ setValueByPath(toObject, ['thought'], fromThought);
9005
+ }
9006
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9007
+ if (fromInlineData != null) {
9008
+ setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
9009
+ }
9010
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
9011
+ if (fromFileData != null) {
9012
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
9013
+ }
9014
+ const fromThoughtSignature = getValueByPath(fromObject, [
9015
+ 'thoughtSignature',
9016
+ ]);
9017
+ if (fromThoughtSignature != null) {
9018
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
9019
+ }
9020
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
9021
+ 'codeExecutionResult',
9022
+ ]);
9023
+ if (fromCodeExecutionResult != null) {
9024
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
9025
+ }
9026
+ const fromExecutableCode = getValueByPath(fromObject, [
9027
+ 'executableCode',
9028
+ ]);
9029
+ if (fromExecutableCode != null) {
9030
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
9031
+ }
9032
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
9033
+ if (fromFunctionCall != null) {
9034
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
9035
+ }
9036
+ const fromFunctionResponse = getValueByPath(fromObject, [
9037
+ 'functionResponse',
9038
+ ]);
9039
+ if (fromFunctionResponse != null) {
9040
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
9041
+ }
9042
+ const fromText = getValueByPath(fromObject, ['text']);
9043
+ if (fromText != null) {
9044
+ setValueByPath(toObject, ['text'], fromText);
9045
+ }
9046
+ return toObject;
9047
+ }
9048
+ function contentFromMldev$1(fromObject) {
9049
+ const toObject = {};
9050
+ const fromParts = getValueByPath(fromObject, ['parts']);
9051
+ if (fromParts != null) {
9052
+ let transformedList = fromParts;
9053
+ if (Array.isArray(transformedList)) {
9054
+ transformedList = transformedList.map((item) => {
9055
+ return partFromMldev$1(item);
9056
+ });
9057
+ }
9058
+ setValueByPath(toObject, ['parts'], transformedList);
9059
+ }
9060
+ const fromRole = getValueByPath(fromObject, ['role']);
9061
+ if (fromRole != null) {
9062
+ setValueByPath(toObject, ['role'], fromRole);
9063
+ }
9064
+ return toObject;
9065
+ }
9066
+ function transcriptionFromMldev(fromObject) {
9067
+ const toObject = {};
9068
+ const fromText = getValueByPath(fromObject, ['text']);
9069
+ if (fromText != null) {
9070
+ setValueByPath(toObject, ['text'], fromText);
9071
+ }
9072
+ const fromFinished = getValueByPath(fromObject, ['finished']);
9073
+ if (fromFinished != null) {
9074
+ setValueByPath(toObject, ['finished'], fromFinished);
9075
+ }
9076
+ return toObject;
9077
+ }
9078
+ function urlMetadataFromMldev$1(fromObject) {
9079
+ const toObject = {};
9080
+ const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
9081
+ if (fromRetrievedUrl != null) {
9082
+ setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
9083
+ }
9084
+ const fromUrlRetrievalStatus = getValueByPath(fromObject, [
9085
+ 'urlRetrievalStatus',
9086
+ ]);
9087
+ if (fromUrlRetrievalStatus != null) {
9088
+ setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
9089
+ }
9090
+ return toObject;
9091
+ }
9092
+ function urlContextMetadataFromMldev$1(fromObject) {
9093
+ const toObject = {};
9094
+ const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
9095
+ if (fromUrlMetadata != null) {
9096
+ let transformedList = fromUrlMetadata;
9097
+ if (Array.isArray(transformedList)) {
9098
+ transformedList = transformedList.map((item) => {
9099
+ return urlMetadataFromMldev$1(item);
9100
+ });
9101
+ }
9102
+ setValueByPath(toObject, ['urlMetadata'], transformedList);
9103
+ }
9104
+ return toObject;
9105
+ }
9106
+ function liveServerContentFromMldev(fromObject) {
9107
+ const toObject = {};
9108
+ const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
9109
+ if (fromModelTurn != null) {
9110
+ setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
9111
+ }
9112
+ const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
9113
+ if (fromTurnComplete != null) {
9114
+ setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
9115
+ }
9116
+ const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
9117
+ if (fromInterrupted != null) {
9118
+ setValueByPath(toObject, ['interrupted'], fromInterrupted);
9119
+ }
9120
+ const fromGroundingMetadata = getValueByPath(fromObject, [
9121
+ 'groundingMetadata',
9122
+ ]);
9123
+ if (fromGroundingMetadata != null) {
9124
+ setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
9125
+ }
9126
+ const fromGenerationComplete = getValueByPath(fromObject, [
9127
+ 'generationComplete',
9128
+ ]);
9129
+ if (fromGenerationComplete != null) {
9130
+ setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
9131
+ }
9132
+ const fromInputTranscription = getValueByPath(fromObject, [
9133
+ 'inputTranscription',
9134
+ ]);
9135
+ if (fromInputTranscription != null) {
9136
+ setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
9137
+ }
9138
+ const fromOutputTranscription = getValueByPath(fromObject, [
9139
+ 'outputTranscription',
9140
+ ]);
9141
+ if (fromOutputTranscription != null) {
9142
+ setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
9143
+ }
9144
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
9145
+ 'urlContextMetadata',
9146
+ ]);
9147
+ if (fromUrlContextMetadata != null) {
9148
+ setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9149
+ }
9150
+ return toObject;
9151
+ }
9152
+ function functionCallFromMldev(fromObject) {
9153
+ const toObject = {};
9154
+ const fromId = getValueByPath(fromObject, ['id']);
9155
+ if (fromId != null) {
9156
+ setValueByPath(toObject, ['id'], fromId);
9157
+ }
9158
+ const fromArgs = getValueByPath(fromObject, ['args']);
9159
+ if (fromArgs != null) {
9160
+ setValueByPath(toObject, ['args'], fromArgs);
9161
+ }
9162
+ const fromName = getValueByPath(fromObject, ['name']);
9163
+ if (fromName != null) {
9164
+ setValueByPath(toObject, ['name'], fromName);
9165
+ }
9166
+ return toObject;
9167
+ }
9168
+ function liveServerToolCallFromMldev(fromObject) {
9169
+ const toObject = {};
9170
+ const fromFunctionCalls = getValueByPath(fromObject, [
9171
+ 'functionCalls',
9172
+ ]);
9173
+ if (fromFunctionCalls != null) {
9174
+ let transformedList = fromFunctionCalls;
9175
+ if (Array.isArray(transformedList)) {
9176
+ transformedList = transformedList.map((item) => {
9177
+ return functionCallFromMldev(item);
9178
+ });
9179
+ }
9180
+ setValueByPath(toObject, ['functionCalls'], transformedList);
9181
+ }
9182
+ return toObject;
9183
+ }
9184
+ function liveServerToolCallCancellationFromMldev(fromObject) {
9185
+ const toObject = {};
9186
+ const fromIds = getValueByPath(fromObject, ['ids']);
9187
+ if (fromIds != null) {
9188
+ setValueByPath(toObject, ['ids'], fromIds);
9189
+ }
9190
+ return toObject;
9191
+ }
9192
+ function modalityTokenCountFromMldev(fromObject) {
9193
+ const toObject = {};
9194
+ const fromModality = getValueByPath(fromObject, ['modality']);
9195
+ if (fromModality != null) {
9196
+ setValueByPath(toObject, ['modality'], fromModality);
9197
+ }
9198
+ const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
9199
+ if (fromTokenCount != null) {
9200
+ setValueByPath(toObject, ['tokenCount'], fromTokenCount);
9201
+ }
9202
+ return toObject;
9203
+ }
9204
+ function usageMetadataFromMldev(fromObject) {
9205
+ const toObject = {};
9206
+ const fromPromptTokenCount = getValueByPath(fromObject, [
9207
+ 'promptTokenCount',
9208
+ ]);
9209
+ if (fromPromptTokenCount != null) {
9210
+ setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
9211
+ }
9212
+ const fromCachedContentTokenCount = getValueByPath(fromObject, [
9213
+ 'cachedContentTokenCount',
9214
+ ]);
9215
+ if (fromCachedContentTokenCount != null) {
9216
+ setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
9217
+ }
9218
+ const fromResponseTokenCount = getValueByPath(fromObject, [
9219
+ 'responseTokenCount',
9220
+ ]);
9221
+ if (fromResponseTokenCount != null) {
9222
+ setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
9223
+ }
9224
+ const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
9225
+ 'toolUsePromptTokenCount',
9226
+ ]);
9227
+ if (fromToolUsePromptTokenCount != null) {
9228
+ setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
9229
+ }
9230
+ const fromThoughtsTokenCount = getValueByPath(fromObject, [
9231
+ 'thoughtsTokenCount',
9232
+ ]);
9233
+ if (fromThoughtsTokenCount != null) {
9234
+ setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
9235
+ }
9236
+ const fromTotalTokenCount = getValueByPath(fromObject, [
9237
+ 'totalTokenCount',
9238
+ ]);
9239
+ if (fromTotalTokenCount != null) {
9240
+ setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
9241
+ }
9242
+ const fromPromptTokensDetails = getValueByPath(fromObject, [
9243
+ 'promptTokensDetails',
9244
+ ]);
9245
+ if (fromPromptTokensDetails != null) {
9246
+ let transformedList = fromPromptTokensDetails;
9247
+ if (Array.isArray(transformedList)) {
9248
+ transformedList = transformedList.map((item) => {
9249
+ return modalityTokenCountFromMldev(item);
9250
+ });
9251
+ }
9252
+ setValueByPath(toObject, ['promptTokensDetails'], transformedList);
9253
+ }
9254
+ const fromCacheTokensDetails = getValueByPath(fromObject, [
9255
+ 'cacheTokensDetails',
9256
+ ]);
9257
+ if (fromCacheTokensDetails != null) {
9258
+ let transformedList = fromCacheTokensDetails;
9259
+ if (Array.isArray(transformedList)) {
9260
+ transformedList = transformedList.map((item) => {
9261
+ return modalityTokenCountFromMldev(item);
9262
+ });
9263
+ }
9264
+ setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
9265
+ }
9266
+ const fromResponseTokensDetails = getValueByPath(fromObject, [
9267
+ 'responseTokensDetails',
9268
+ ]);
9269
+ if (fromResponseTokensDetails != null) {
9270
+ let transformedList = fromResponseTokensDetails;
9271
+ if (Array.isArray(transformedList)) {
9272
+ transformedList = transformedList.map((item) => {
9273
+ return modalityTokenCountFromMldev(item);
9274
+ });
9275
+ }
9276
+ setValueByPath(toObject, ['responseTokensDetails'], transformedList);
9277
+ }
9278
+ const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
9279
+ 'toolUsePromptTokensDetails',
9280
+ ]);
9281
+ if (fromToolUsePromptTokensDetails != null) {
9282
+ let transformedList = fromToolUsePromptTokensDetails;
9283
+ if (Array.isArray(transformedList)) {
9284
+ transformedList = transformedList.map((item) => {
9285
+ return modalityTokenCountFromMldev(item);
9286
+ });
9287
+ }
9288
+ setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
9289
+ }
9290
+ return toObject;
9291
+ }
9292
+ function liveServerGoAwayFromMldev(fromObject) {
9293
+ const toObject = {};
9294
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9295
+ if (fromTimeLeft != null) {
9296
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9297
+ }
9298
+ return toObject;
9299
+ }
9300
+ function liveServerSessionResumptionUpdateFromMldev(fromObject) {
9301
+ const toObject = {};
9302
+ const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
9303
+ if (fromNewHandle != null) {
9304
+ setValueByPath(toObject, ['newHandle'], fromNewHandle);
9305
+ }
9306
+ const fromResumable = getValueByPath(fromObject, ['resumable']);
9307
+ if (fromResumable != null) {
9308
+ setValueByPath(toObject, ['resumable'], fromResumable);
9309
+ }
9310
+ const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
9311
+ 'lastConsumedClientMessageIndex',
9312
+ ]);
9313
+ if (fromLastConsumedClientMessageIndex != null) {
9314
+ setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
9315
+ }
9316
+ return toObject;
9317
+ }
9318
+ function liveServerMessageFromMldev(fromObject) {
9319
+ const toObject = {};
9320
+ const fromSetupComplete = getValueByPath(fromObject, [
9321
+ 'setupComplete',
9322
+ ]);
9323
+ if (fromSetupComplete != null) {
9324
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8625
9325
  }
8626
- const fromAudioStreamEnd = getValueByPath(fromObject, [
8627
- 'audioStreamEnd',
9326
+ const fromServerContent = getValueByPath(fromObject, [
9327
+ 'serverContent',
8628
9328
  ]);
8629
- if (fromAudioStreamEnd != null) {
8630
- setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
9329
+ if (fromServerContent != null) {
9330
+ setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
8631
9331
  }
8632
- const fromVideo = getValueByPath(fromObject, ['video']);
8633
- if (fromVideo != null) {
8634
- setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
9332
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
9333
+ if (fromToolCall != null) {
9334
+ setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
8635
9335
  }
8636
- const fromText = getValueByPath(fromObject, ['text']);
8637
- if (fromText != null) {
8638
- setValueByPath(toObject, ['text'], fromText);
9336
+ const fromToolCallCancellation = getValueByPath(fromObject, [
9337
+ 'toolCallCancellation',
9338
+ ]);
9339
+ if (fromToolCallCancellation != null) {
9340
+ setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
8639
9341
  }
8640
- const fromActivityStart = getValueByPath(fromObject, [
8641
- 'activityStart',
9342
+ const fromUsageMetadata = getValueByPath(fromObject, [
9343
+ 'usageMetadata',
8642
9344
  ]);
8643
- if (fromActivityStart != null) {
8644
- setValueByPath(toObject, ['activityStart'], activityStartToVertex());
9345
+ if (fromUsageMetadata != null) {
9346
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
8645
9347
  }
8646
- const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8647
- if (fromActivityEnd != null) {
8648
- setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
9348
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
9349
+ if (fromGoAway != null) {
9350
+ setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
9351
+ }
9352
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
9353
+ 'sessionResumptionUpdate',
9354
+ ]);
9355
+ if (fromSessionResumptionUpdate != null) {
9356
+ setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
8649
9357
  }
8650
9358
  return toObject;
8651
9359
  }
8652
- function weightedPromptToMldev(fromObject) {
9360
+ function liveMusicServerSetupCompleteFromMldev() {
9361
+ const toObject = {};
9362
+ return toObject;
9363
+ }
9364
+ function weightedPromptFromMldev(fromObject) {
8653
9365
  const toObject = {};
8654
9366
  const fromText = getValueByPath(fromObject, ['text']);
8655
9367
  if (fromText != null) {
@@ -8661,7 +9373,7 @@ function weightedPromptToMldev(fromObject) {
8661
9373
  }
8662
9374
  return toObject;
8663
9375
  }
8664
- function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
9376
+ function liveMusicClientContentFromMldev(fromObject) {
8665
9377
  const toObject = {};
8666
9378
  const fromWeightedPrompts = getValueByPath(fromObject, [
8667
9379
  'weightedPrompts',
@@ -8670,14 +9382,14 @@ function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
8670
9382
  let transformedList = fromWeightedPrompts;
8671
9383
  if (Array.isArray(transformedList)) {
8672
9384
  transformedList = transformedList.map((item) => {
8673
- return weightedPromptToMldev(item);
9385
+ return weightedPromptFromMldev(item);
8674
9386
  });
8675
9387
  }
8676
9388
  setValueByPath(toObject, ['weightedPrompts'], transformedList);
8677
9389
  }
8678
9390
  return toObject;
8679
9391
  }
8680
- function liveMusicGenerationConfigToMldev(fromObject) {
9392
+ function liveMusicGenerationConfigFromMldev(fromObject) {
8681
9393
  const toObject = {};
8682
9394
  const fromTemperature = getValueByPath(fromObject, ['temperature']);
8683
9395
  if (fromTemperature != null) {
@@ -8727,68 +9439,88 @@ function liveMusicGenerationConfigToMldev(fromObject) {
8727
9439
  }
8728
9440
  return toObject;
8729
9441
  }
8730
- function liveMusicSetConfigParametersToMldev(fromObject) {
9442
+ function liveMusicSourceMetadataFromMldev(fromObject) {
8731
9443
  const toObject = {};
9444
+ const fromClientContent = getValueByPath(fromObject, [
9445
+ 'clientContent',
9446
+ ]);
9447
+ if (fromClientContent != null) {
9448
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9449
+ }
8732
9450
  const fromMusicGenerationConfig = getValueByPath(fromObject, [
8733
9451
  'musicGenerationConfig',
8734
9452
  ]);
8735
9453
  if (fromMusicGenerationConfig != null) {
8736
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
9454
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
8737
9455
  }
8738
9456
  return toObject;
8739
9457
  }
8740
- function liveMusicClientSetupToMldev(fromObject) {
9458
+ function audioChunkFromMldev(fromObject) {
8741
9459
  const toObject = {};
8742
- const fromModel = getValueByPath(fromObject, ['model']);
8743
- if (fromModel != null) {
8744
- setValueByPath(toObject, ['model'], fromModel);
9460
+ const fromData = getValueByPath(fromObject, ['data']);
9461
+ if (fromData != null) {
9462
+ setValueByPath(toObject, ['data'], fromData);
9463
+ }
9464
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9465
+ if (fromMimeType != null) {
9466
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9467
+ }
9468
+ const fromSourceMetadata = getValueByPath(fromObject, [
9469
+ 'sourceMetadata',
9470
+ ]);
9471
+ if (fromSourceMetadata != null) {
9472
+ setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
8745
9473
  }
8746
9474
  return toObject;
8747
9475
  }
8748
- function liveMusicClientContentToMldev(fromObject) {
9476
+ function liveMusicServerContentFromMldev(fromObject) {
8749
9477
  const toObject = {};
8750
- const fromWeightedPrompts = getValueByPath(fromObject, [
8751
- 'weightedPrompts',
8752
- ]);
8753
- if (fromWeightedPrompts != null) {
8754
- let transformedList = fromWeightedPrompts;
9478
+ const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9479
+ if (fromAudioChunks != null) {
9480
+ let transformedList = fromAudioChunks;
8755
9481
  if (Array.isArray(transformedList)) {
8756
9482
  transformedList = transformedList.map((item) => {
8757
- return weightedPromptToMldev(item);
9483
+ return audioChunkFromMldev(item);
8758
9484
  });
8759
9485
  }
8760
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
9486
+ setValueByPath(toObject, ['audioChunks'], transformedList);
8761
9487
  }
8762
9488
  return toObject;
8763
9489
  }
8764
- function liveMusicClientMessageToMldev(fromObject) {
9490
+ function liveMusicFilteredPromptFromMldev(fromObject) {
8765
9491
  const toObject = {};
8766
- const fromSetup = getValueByPath(fromObject, ['setup']);
8767
- if (fromSetup != null) {
8768
- setValueByPath(toObject, ['setup'], liveMusicClientSetupToMldev(fromSetup));
9492
+ const fromText = getValueByPath(fromObject, ['text']);
9493
+ if (fromText != null) {
9494
+ setValueByPath(toObject, ['text'], fromText);
8769
9495
  }
8770
- const fromClientContent = getValueByPath(fromObject, [
8771
- 'clientContent',
9496
+ const fromFilteredReason = getValueByPath(fromObject, [
9497
+ 'filteredReason',
8772
9498
  ]);
8773
- if (fromClientContent != null) {
8774
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentToMldev(fromClientContent));
9499
+ if (fromFilteredReason != null) {
9500
+ setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
8775
9501
  }
8776
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
8777
- 'musicGenerationConfig',
9502
+ return toObject;
9503
+ }
9504
+ function liveMusicServerMessageFromMldev(fromObject) {
9505
+ const toObject = {};
9506
+ const fromSetupComplete = getValueByPath(fromObject, [
9507
+ 'setupComplete',
8778
9508
  ]);
8779
- if (fromMusicGenerationConfig != null) {
8780
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
9509
+ if (fromSetupComplete != null) {
9510
+ setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
8781
9511
  }
8782
- const fromPlaybackControl = getValueByPath(fromObject, [
8783
- 'playbackControl',
9512
+ const fromServerContent = getValueByPath(fromObject, [
9513
+ 'serverContent',
8784
9514
  ]);
8785
- if (fromPlaybackControl != null) {
8786
- setValueByPath(toObject, ['playbackControl'], fromPlaybackControl);
9515
+ if (fromServerContent != null) {
9516
+ setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9517
+ }
9518
+ const fromFilteredPrompt = getValueByPath(fromObject, [
9519
+ 'filteredPrompt',
9520
+ ]);
9521
+ if (fromFilteredPrompt != null) {
9522
+ setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
8787
9523
  }
8788
- return toObject;
8789
- }
8790
- function liveServerSetupCompleteFromMldev() {
8791
- const toObject = {};
8792
9524
  return toObject;
8793
9525
  }
8794
9526
  function liveServerSetupCompleteFromVertex(fromObject) {
@@ -8799,22 +9531,6 @@ function liveServerSetupCompleteFromVertex(fromObject) {
8799
9531
  }
8800
9532
  return toObject;
8801
9533
  }
8802
- function videoMetadataFromMldev$1(fromObject) {
8803
- const toObject = {};
8804
- const fromFps = getValueByPath(fromObject, ['fps']);
8805
- if (fromFps != null) {
8806
- setValueByPath(toObject, ['fps'], fromFps);
8807
- }
8808
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8809
- if (fromEndOffset != null) {
8810
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
8811
- }
8812
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8813
- if (fromStartOffset != null) {
8814
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
8815
- }
8816
- return toObject;
8817
- }
8818
9534
  function videoMetadataFromVertex$1(fromObject) {
8819
9535
  const toObject = {};
8820
9536
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -8831,18 +9547,6 @@ function videoMetadataFromVertex$1(fromObject) {
8831
9547
  }
8832
9548
  return toObject;
8833
9549
  }
8834
- function blobFromMldev$1(fromObject) {
8835
- const toObject = {};
8836
- const fromData = getValueByPath(fromObject, ['data']);
8837
- if (fromData != null) {
8838
- setValueByPath(toObject, ['data'], fromData);
8839
- }
8840
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8841
- if (fromMimeType != null) {
8842
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8843
- }
8844
- return toObject;
8845
- }
8846
9550
  function blobFromVertex$1(fromObject) {
8847
9551
  const toObject = {};
8848
9552
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
@@ -8859,18 +9563,6 @@ function blobFromVertex$1(fromObject) {
8859
9563
  }
8860
9564
  return toObject;
8861
9565
  }
8862
- function fileDataFromMldev$1(fromObject) {
8863
- const toObject = {};
8864
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8865
- if (fromFileUri != null) {
8866
- setValueByPath(toObject, ['fileUri'], fromFileUri);
8867
- }
8868
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8869
- if (fromMimeType != null) {
8870
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8871
- }
8872
- return toObject;
8873
- }
8874
9566
  function fileDataFromVertex$1(fromObject) {
8875
9567
  const toObject = {};
8876
9568
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
@@ -8887,60 +9579,6 @@ function fileDataFromVertex$1(fromObject) {
8887
9579
  }
8888
9580
  return toObject;
8889
9581
  }
8890
- function partFromMldev$1(fromObject) {
8891
- const toObject = {};
8892
- const fromVideoMetadata = getValueByPath(fromObject, [
8893
- 'videoMetadata',
8894
- ]);
8895
- if (fromVideoMetadata != null) {
8896
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8897
- }
8898
- const fromThought = getValueByPath(fromObject, ['thought']);
8899
- if (fromThought != null) {
8900
- setValueByPath(toObject, ['thought'], fromThought);
8901
- }
8902
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8903
- if (fromInlineData != null) {
8904
- setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8905
- }
8906
- const fromFileData = getValueByPath(fromObject, ['fileData']);
8907
- if (fromFileData != null) {
8908
- setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8909
- }
8910
- const fromThoughtSignature = getValueByPath(fromObject, [
8911
- 'thoughtSignature',
8912
- ]);
8913
- if (fromThoughtSignature != null) {
8914
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8915
- }
8916
- const fromCodeExecutionResult = getValueByPath(fromObject, [
8917
- 'codeExecutionResult',
8918
- ]);
8919
- if (fromCodeExecutionResult != null) {
8920
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8921
- }
8922
- const fromExecutableCode = getValueByPath(fromObject, [
8923
- 'executableCode',
8924
- ]);
8925
- if (fromExecutableCode != null) {
8926
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8927
- }
8928
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8929
- if (fromFunctionCall != null) {
8930
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8931
- }
8932
- const fromFunctionResponse = getValueByPath(fromObject, [
8933
- 'functionResponse',
8934
- ]);
8935
- if (fromFunctionResponse != null) {
8936
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8937
- }
8938
- const fromText = getValueByPath(fromObject, ['text']);
8939
- if (fromText != null) {
8940
- setValueByPath(toObject, ['text'], fromText);
8941
- }
8942
- return toObject;
8943
- }
8944
9582
  function partFromVertex$1(fromObject) {
8945
9583
  const toObject = {};
8946
9584
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -8990,26 +9628,8 @@ function partFromVertex$1(fromObject) {
8990
9628
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8991
9629
  }
8992
9630
  const fromText = getValueByPath(fromObject, ['text']);
8993
- if (fromText != null) {
8994
- setValueByPath(toObject, ['text'], fromText);
8995
- }
8996
- return toObject;
8997
- }
8998
- function contentFromMldev$1(fromObject) {
8999
- const toObject = {};
9000
- const fromParts = getValueByPath(fromObject, ['parts']);
9001
- if (fromParts != null) {
9002
- let transformedList = fromParts;
9003
- if (Array.isArray(transformedList)) {
9004
- transformedList = transformedList.map((item) => {
9005
- return partFromMldev$1(item);
9006
- });
9007
- }
9008
- setValueByPath(toObject, ['parts'], transformedList);
9009
- }
9010
- const fromRole = getValueByPath(fromObject, ['role']);
9011
- if (fromRole != null) {
9012
- setValueByPath(toObject, ['role'], fromRole);
9631
+ if (fromText != null) {
9632
+ setValueByPath(toObject, ['text'], fromText);
9013
9633
  }
9014
9634
  return toObject;
9015
9635
  }
@@ -9031,18 +9651,6 @@ function contentFromVertex$1(fromObject) {
9031
9651
  }
9032
9652
  return toObject;
9033
9653
  }
9034
- function transcriptionFromMldev(fromObject) {
9035
- const toObject = {};
9036
- const fromText = getValueByPath(fromObject, ['text']);
9037
- if (fromText != null) {
9038
- setValueByPath(toObject, ['text'], fromText);
9039
- }
9040
- const fromFinished = getValueByPath(fromObject, ['finished']);
9041
- if (fromFinished != null) {
9042
- setValueByPath(toObject, ['finished'], fromFinished);
9043
- }
9044
- return toObject;
9045
- }
9046
9654
  function transcriptionFromVertex(fromObject) {
9047
9655
  const toObject = {};
9048
9656
  const fromText = getValueByPath(fromObject, ['text']);
@@ -9055,80 +9663,6 @@ function transcriptionFromVertex(fromObject) {
9055
9663
  }
9056
9664
  return toObject;
9057
9665
  }
9058
- function urlMetadataFromMldev$1(fromObject) {
9059
- const toObject = {};
9060
- const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
9061
- if (fromRetrievedUrl != null) {
9062
- setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
9063
- }
9064
- const fromUrlRetrievalStatus = getValueByPath(fromObject, [
9065
- 'urlRetrievalStatus',
9066
- ]);
9067
- if (fromUrlRetrievalStatus != null) {
9068
- setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
9069
- }
9070
- return toObject;
9071
- }
9072
- function urlContextMetadataFromMldev$1(fromObject) {
9073
- const toObject = {};
9074
- const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
9075
- if (fromUrlMetadata != null) {
9076
- let transformedList = fromUrlMetadata;
9077
- if (Array.isArray(transformedList)) {
9078
- transformedList = transformedList.map((item) => {
9079
- return urlMetadataFromMldev$1(item);
9080
- });
9081
- }
9082
- setValueByPath(toObject, ['urlMetadata'], transformedList);
9083
- }
9084
- return toObject;
9085
- }
9086
- function liveServerContentFromMldev(fromObject) {
9087
- const toObject = {};
9088
- const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
9089
- if (fromModelTurn != null) {
9090
- setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
9091
- }
9092
- const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
9093
- if (fromTurnComplete != null) {
9094
- setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
9095
- }
9096
- const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
9097
- if (fromInterrupted != null) {
9098
- setValueByPath(toObject, ['interrupted'], fromInterrupted);
9099
- }
9100
- const fromGroundingMetadata = getValueByPath(fromObject, [
9101
- 'groundingMetadata',
9102
- ]);
9103
- if (fromGroundingMetadata != null) {
9104
- setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
9105
- }
9106
- const fromGenerationComplete = getValueByPath(fromObject, [
9107
- 'generationComplete',
9108
- ]);
9109
- if (fromGenerationComplete != null) {
9110
- setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
9111
- }
9112
- const fromInputTranscription = getValueByPath(fromObject, [
9113
- 'inputTranscription',
9114
- ]);
9115
- if (fromInputTranscription != null) {
9116
- setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
9117
- }
9118
- const fromOutputTranscription = getValueByPath(fromObject, [
9119
- 'outputTranscription',
9120
- ]);
9121
- if (fromOutputTranscription != null) {
9122
- setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
9123
- }
9124
- const fromUrlContextMetadata = getValueByPath(fromObject, [
9125
- 'urlContextMetadata',
9126
- ]);
9127
- if (fromUrlContextMetadata != null) {
9128
- setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9129
- }
9130
- return toObject;
9131
- }
9132
9666
  function liveServerContentFromVertex(fromObject) {
9133
9667
  const toObject = {};
9134
9668
  const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
@@ -9169,22 +9703,6 @@ function liveServerContentFromVertex(fromObject) {
9169
9703
  }
9170
9704
  return toObject;
9171
9705
  }
9172
- function functionCallFromMldev(fromObject) {
9173
- const toObject = {};
9174
- const fromId = getValueByPath(fromObject, ['id']);
9175
- if (fromId != null) {
9176
- setValueByPath(toObject, ['id'], fromId);
9177
- }
9178
- const fromArgs = getValueByPath(fromObject, ['args']);
9179
- if (fromArgs != null) {
9180
- setValueByPath(toObject, ['args'], fromArgs);
9181
- }
9182
- const fromName = getValueByPath(fromObject, ['name']);
9183
- if (fromName != null) {
9184
- setValueByPath(toObject, ['name'], fromName);
9185
- }
9186
- return toObject;
9187
- }
9188
9706
  function functionCallFromVertex(fromObject) {
9189
9707
  const toObject = {};
9190
9708
  const fromArgs = getValueByPath(fromObject, ['args']);
@@ -9197,22 +9715,6 @@ function functionCallFromVertex(fromObject) {
9197
9715
  }
9198
9716
  return toObject;
9199
9717
  }
9200
- function liveServerToolCallFromMldev(fromObject) {
9201
- const toObject = {};
9202
- const fromFunctionCalls = getValueByPath(fromObject, [
9203
- 'functionCalls',
9204
- ]);
9205
- if (fromFunctionCalls != null) {
9206
- let transformedList = fromFunctionCalls;
9207
- if (Array.isArray(transformedList)) {
9208
- transformedList = transformedList.map((item) => {
9209
- return functionCallFromMldev(item);
9210
- });
9211
- }
9212
- setValueByPath(toObject, ['functionCalls'], transformedList);
9213
- }
9214
- return toObject;
9215
- }
9216
9718
  function liveServerToolCallFromVertex(fromObject) {
9217
9719
  const toObject = {};
9218
9720
  const fromFunctionCalls = getValueByPath(fromObject, [
@@ -9229,14 +9731,6 @@ function liveServerToolCallFromVertex(fromObject) {
9229
9731
  }
9230
9732
  return toObject;
9231
9733
  }
9232
- function liveServerToolCallCancellationFromMldev(fromObject) {
9233
- const toObject = {};
9234
- const fromIds = getValueByPath(fromObject, ['ids']);
9235
- if (fromIds != null) {
9236
- setValueByPath(toObject, ['ids'], fromIds);
9237
- }
9238
- return toObject;
9239
- }
9240
9734
  function liveServerToolCallCancellationFromVertex(fromObject) {
9241
9735
  const toObject = {};
9242
9736
  const fromIds = getValueByPath(fromObject, ['ids']);
@@ -9245,18 +9739,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
9245
9739
  }
9246
9740
  return toObject;
9247
9741
  }
9248
- function modalityTokenCountFromMldev(fromObject) {
9249
- const toObject = {};
9250
- const fromModality = getValueByPath(fromObject, ['modality']);
9251
- if (fromModality != null) {
9252
- setValueByPath(toObject, ['modality'], fromModality);
9253
- }
9254
- const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
9255
- if (fromTokenCount != null) {
9256
- setValueByPath(toObject, ['tokenCount'], fromTokenCount);
9257
- }
9258
- return toObject;
9259
- }
9260
9742
  function modalityTokenCountFromVertex(fromObject) {
9261
9743
  const toObject = {};
9262
9744
  const fromModality = getValueByPath(fromObject, ['modality']);
@@ -9269,94 +9751,6 @@ function modalityTokenCountFromVertex(fromObject) {
9269
9751
  }
9270
9752
  return toObject;
9271
9753
  }
9272
- function usageMetadataFromMldev(fromObject) {
9273
- const toObject = {};
9274
- const fromPromptTokenCount = getValueByPath(fromObject, [
9275
- 'promptTokenCount',
9276
- ]);
9277
- if (fromPromptTokenCount != null) {
9278
- setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
9279
- }
9280
- const fromCachedContentTokenCount = getValueByPath(fromObject, [
9281
- 'cachedContentTokenCount',
9282
- ]);
9283
- if (fromCachedContentTokenCount != null) {
9284
- setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
9285
- }
9286
- const fromResponseTokenCount = getValueByPath(fromObject, [
9287
- 'responseTokenCount',
9288
- ]);
9289
- if (fromResponseTokenCount != null) {
9290
- setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
9291
- }
9292
- const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
9293
- 'toolUsePromptTokenCount',
9294
- ]);
9295
- if (fromToolUsePromptTokenCount != null) {
9296
- setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
9297
- }
9298
- const fromThoughtsTokenCount = getValueByPath(fromObject, [
9299
- 'thoughtsTokenCount',
9300
- ]);
9301
- if (fromThoughtsTokenCount != null) {
9302
- setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
9303
- }
9304
- const fromTotalTokenCount = getValueByPath(fromObject, [
9305
- 'totalTokenCount',
9306
- ]);
9307
- if (fromTotalTokenCount != null) {
9308
- setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
9309
- }
9310
- const fromPromptTokensDetails = getValueByPath(fromObject, [
9311
- 'promptTokensDetails',
9312
- ]);
9313
- if (fromPromptTokensDetails != null) {
9314
- let transformedList = fromPromptTokensDetails;
9315
- if (Array.isArray(transformedList)) {
9316
- transformedList = transformedList.map((item) => {
9317
- return modalityTokenCountFromMldev(item);
9318
- });
9319
- }
9320
- setValueByPath(toObject, ['promptTokensDetails'], transformedList);
9321
- }
9322
- const fromCacheTokensDetails = getValueByPath(fromObject, [
9323
- 'cacheTokensDetails',
9324
- ]);
9325
- if (fromCacheTokensDetails != null) {
9326
- let transformedList = fromCacheTokensDetails;
9327
- if (Array.isArray(transformedList)) {
9328
- transformedList = transformedList.map((item) => {
9329
- return modalityTokenCountFromMldev(item);
9330
- });
9331
- }
9332
- setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
9333
- }
9334
- const fromResponseTokensDetails = getValueByPath(fromObject, [
9335
- 'responseTokensDetails',
9336
- ]);
9337
- if (fromResponseTokensDetails != null) {
9338
- let transformedList = fromResponseTokensDetails;
9339
- if (Array.isArray(transformedList)) {
9340
- transformedList = transformedList.map((item) => {
9341
- return modalityTokenCountFromMldev(item);
9342
- });
9343
- }
9344
- setValueByPath(toObject, ['responseTokensDetails'], transformedList);
9345
- }
9346
- const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
9347
- 'toolUsePromptTokensDetails',
9348
- ]);
9349
- if (fromToolUsePromptTokensDetails != null) {
9350
- let transformedList = fromToolUsePromptTokensDetails;
9351
- if (Array.isArray(transformedList)) {
9352
- transformedList = transformedList.map((item) => {
9353
- return modalityTokenCountFromMldev(item);
9354
- });
9355
- }
9356
- setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
9357
- }
9358
- return toObject;
9359
- }
9360
9754
  function usageMetadataFromVertex(fromObject) {
9361
9755
  const toObject = {};
9362
9756
  const fromPromptTokenCount = getValueByPath(fromObject, [
@@ -9447,39 +9841,13 @@ function usageMetadataFromVertex(fromObject) {
9447
9841
  if (fromTrafficType != null) {
9448
9842
  setValueByPath(toObject, ['trafficType'], fromTrafficType);
9449
9843
  }
9450
- return toObject;
9451
- }
9452
- function liveServerGoAwayFromMldev(fromObject) {
9453
- const toObject = {};
9454
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9455
- if (fromTimeLeft != null) {
9456
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9457
- }
9458
- return toObject;
9459
- }
9460
- function liveServerGoAwayFromVertex(fromObject) {
9461
- const toObject = {};
9462
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9463
- if (fromTimeLeft != null) {
9464
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9465
- }
9466
- return toObject;
9467
- }
9468
- function liveServerSessionResumptionUpdateFromMldev(fromObject) {
9469
- const toObject = {};
9470
- const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
9471
- if (fromNewHandle != null) {
9472
- setValueByPath(toObject, ['newHandle'], fromNewHandle);
9473
- }
9474
- const fromResumable = getValueByPath(fromObject, ['resumable']);
9475
- if (fromResumable != null) {
9476
- setValueByPath(toObject, ['resumable'], fromResumable);
9477
- }
9478
- const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
9479
- 'lastConsumedClientMessageIndex',
9480
- ]);
9481
- if (fromLastConsumedClientMessageIndex != null) {
9482
- setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
9844
+ return toObject;
9845
+ }
9846
+ function liveServerGoAwayFromVertex(fromObject) {
9847
+ const toObject = {};
9848
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9849
+ if (fromTimeLeft != null) {
9850
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9483
9851
  }
9484
9852
  return toObject;
9485
9853
  }
@@ -9501,48 +9869,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
9501
9869
  }
9502
9870
  return toObject;
9503
9871
  }
9504
- function liveServerMessageFromMldev(fromObject) {
9505
- const toObject = {};
9506
- const fromSetupComplete = getValueByPath(fromObject, [
9507
- 'setupComplete',
9508
- ]);
9509
- if (fromSetupComplete != null) {
9510
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
9511
- }
9512
- const fromServerContent = getValueByPath(fromObject, [
9513
- 'serverContent',
9514
- ]);
9515
- if (fromServerContent != null) {
9516
- setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
9517
- }
9518
- const fromToolCall = getValueByPath(fromObject, ['toolCall']);
9519
- if (fromToolCall != null) {
9520
- setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
9521
- }
9522
- const fromToolCallCancellation = getValueByPath(fromObject, [
9523
- 'toolCallCancellation',
9524
- ]);
9525
- if (fromToolCallCancellation != null) {
9526
- setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
9527
- }
9528
- const fromUsageMetadata = getValueByPath(fromObject, [
9529
- 'usageMetadata',
9530
- ]);
9531
- if (fromUsageMetadata != null) {
9532
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
9533
- }
9534
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
9535
- if (fromGoAway != null) {
9536
- setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
9537
- }
9538
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
9539
- 'sessionResumptionUpdate',
9540
- ]);
9541
- if (fromSessionResumptionUpdate != null) {
9542
- setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
9543
- }
9544
- return toObject;
9545
- }
9546
9872
  function liveServerMessageFromVertex(fromObject) {
9547
9873
  const toObject = {};
9548
9874
  const fromSetupComplete = getValueByPath(fromObject, [
@@ -9585,172 +9911,6 @@ function liveServerMessageFromVertex(fromObject) {
9585
9911
  }
9586
9912
  return toObject;
9587
9913
  }
9588
- function liveMusicServerSetupCompleteFromMldev() {
9589
- const toObject = {};
9590
- return toObject;
9591
- }
9592
- function weightedPromptFromMldev(fromObject) {
9593
- const toObject = {};
9594
- const fromText = getValueByPath(fromObject, ['text']);
9595
- if (fromText != null) {
9596
- setValueByPath(toObject, ['text'], fromText);
9597
- }
9598
- const fromWeight = getValueByPath(fromObject, ['weight']);
9599
- if (fromWeight != null) {
9600
- setValueByPath(toObject, ['weight'], fromWeight);
9601
- }
9602
- return toObject;
9603
- }
9604
- function liveMusicClientContentFromMldev(fromObject) {
9605
- const toObject = {};
9606
- const fromWeightedPrompts = getValueByPath(fromObject, [
9607
- 'weightedPrompts',
9608
- ]);
9609
- if (fromWeightedPrompts != null) {
9610
- let transformedList = fromWeightedPrompts;
9611
- if (Array.isArray(transformedList)) {
9612
- transformedList = transformedList.map((item) => {
9613
- return weightedPromptFromMldev(item);
9614
- });
9615
- }
9616
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
9617
- }
9618
- return toObject;
9619
- }
9620
- function liveMusicGenerationConfigFromMldev(fromObject) {
9621
- const toObject = {};
9622
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
9623
- if (fromTemperature != null) {
9624
- setValueByPath(toObject, ['temperature'], fromTemperature);
9625
- }
9626
- const fromTopK = getValueByPath(fromObject, ['topK']);
9627
- if (fromTopK != null) {
9628
- setValueByPath(toObject, ['topK'], fromTopK);
9629
- }
9630
- const fromSeed = getValueByPath(fromObject, ['seed']);
9631
- if (fromSeed != null) {
9632
- setValueByPath(toObject, ['seed'], fromSeed);
9633
- }
9634
- const fromGuidance = getValueByPath(fromObject, ['guidance']);
9635
- if (fromGuidance != null) {
9636
- setValueByPath(toObject, ['guidance'], fromGuidance);
9637
- }
9638
- const fromBpm = getValueByPath(fromObject, ['bpm']);
9639
- if (fromBpm != null) {
9640
- setValueByPath(toObject, ['bpm'], fromBpm);
9641
- }
9642
- const fromDensity = getValueByPath(fromObject, ['density']);
9643
- if (fromDensity != null) {
9644
- setValueByPath(toObject, ['density'], fromDensity);
9645
- }
9646
- const fromBrightness = getValueByPath(fromObject, ['brightness']);
9647
- if (fromBrightness != null) {
9648
- setValueByPath(toObject, ['brightness'], fromBrightness);
9649
- }
9650
- const fromScale = getValueByPath(fromObject, ['scale']);
9651
- if (fromScale != null) {
9652
- setValueByPath(toObject, ['scale'], fromScale);
9653
- }
9654
- const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
9655
- if (fromMuteBass != null) {
9656
- setValueByPath(toObject, ['muteBass'], fromMuteBass);
9657
- }
9658
- const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
9659
- if (fromMuteDrums != null) {
9660
- setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
9661
- }
9662
- const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9663
- 'onlyBassAndDrums',
9664
- ]);
9665
- if (fromOnlyBassAndDrums != null) {
9666
- setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9667
- }
9668
- return toObject;
9669
- }
9670
- function liveMusicSourceMetadataFromMldev(fromObject) {
9671
- const toObject = {};
9672
- const fromClientContent = getValueByPath(fromObject, [
9673
- 'clientContent',
9674
- ]);
9675
- if (fromClientContent != null) {
9676
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9677
- }
9678
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
9679
- 'musicGenerationConfig',
9680
- ]);
9681
- if (fromMusicGenerationConfig != null) {
9682
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9683
- }
9684
- return toObject;
9685
- }
9686
- function audioChunkFromMldev(fromObject) {
9687
- const toObject = {};
9688
- const fromData = getValueByPath(fromObject, ['data']);
9689
- if (fromData != null) {
9690
- setValueByPath(toObject, ['data'], fromData);
9691
- }
9692
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9693
- if (fromMimeType != null) {
9694
- setValueByPath(toObject, ['mimeType'], fromMimeType);
9695
- }
9696
- const fromSourceMetadata = getValueByPath(fromObject, [
9697
- 'sourceMetadata',
9698
- ]);
9699
- if (fromSourceMetadata != null) {
9700
- setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9701
- }
9702
- return toObject;
9703
- }
9704
- function liveMusicServerContentFromMldev(fromObject) {
9705
- const toObject = {};
9706
- const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9707
- if (fromAudioChunks != null) {
9708
- let transformedList = fromAudioChunks;
9709
- if (Array.isArray(transformedList)) {
9710
- transformedList = transformedList.map((item) => {
9711
- return audioChunkFromMldev(item);
9712
- });
9713
- }
9714
- setValueByPath(toObject, ['audioChunks'], transformedList);
9715
- }
9716
- return toObject;
9717
- }
9718
- function liveMusicFilteredPromptFromMldev(fromObject) {
9719
- const toObject = {};
9720
- const fromText = getValueByPath(fromObject, ['text']);
9721
- if (fromText != null) {
9722
- setValueByPath(toObject, ['text'], fromText);
9723
- }
9724
- const fromFilteredReason = getValueByPath(fromObject, [
9725
- 'filteredReason',
9726
- ]);
9727
- if (fromFilteredReason != null) {
9728
- setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9729
- }
9730
- return toObject;
9731
- }
9732
- function liveMusicServerMessageFromMldev(fromObject) {
9733
- const toObject = {};
9734
- const fromSetupComplete = getValueByPath(fromObject, [
9735
- 'setupComplete',
9736
- ]);
9737
- if (fromSetupComplete != null) {
9738
- setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9739
- }
9740
- const fromServerContent = getValueByPath(fromObject, [
9741
- 'serverContent',
9742
- ]);
9743
- if (fromServerContent != null) {
9744
- setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9745
- }
9746
- const fromFilteredPrompt = getValueByPath(fromObject, [
9747
- 'filteredPrompt',
9748
- ]);
9749
- if (fromFilteredPrompt != null) {
9750
- setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9751
- }
9752
- return toObject;
9753
- }
9754
9914
 
9755
9915
  /**
9756
9916
  * @license
@@ -10543,6 +10703,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
10543
10703
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
10544
10704
  throw new Error('addWatermark parameter is not supported in Gemini API.');
10545
10705
  }
10706
+ if (getValueByPath(fromObject, ['imageSize']) !== undefined) {
10707
+ throw new Error('imageSize parameter is not supported in Gemini API.');
10708
+ }
10546
10709
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
10547
10710
  throw new Error('enhancePrompt parameter is not supported in Gemini API.');
10548
10711
  }
@@ -11619,6 +11782,10 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
11619
11782
  if (parentObject !== undefined && fromAddWatermark != null) {
11620
11783
  setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
11621
11784
  }
11785
+ const fromImageSize = getValueByPath(fromObject, ['imageSize']);
11786
+ if (parentObject !== undefined && fromImageSize != null) {
11787
+ setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
11788
+ }
11622
11789
  const fromEnhancePrompt = getValueByPath(fromObject, [
11623
11790
  'enhancePrompt',
11624
11791
  ]);
@@ -11831,6 +11998,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
11831
11998
  if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11832
11999
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11833
12000
  }
12001
+ const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
12002
+ if (parentObject !== undefined && fromAddWatermark != null) {
12003
+ setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
12004
+ }
11834
12005
  const fromEditMode = getValueByPath(fromObject, ['editMode']);
11835
12006
  if (parentObject !== undefined && fromEditMode != null) {
11836
12007
  setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
@@ -12405,6 +12576,12 @@ function candidateFromMldev(fromObject) {
12405
12576
  }
12406
12577
  function generateContentResponseFromMldev(fromObject) {
12407
12578
  const toObject = {};
12579
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12580
+ 'sdkHttpResponse',
12581
+ ]);
12582
+ if (fromSdkHttpResponse != null) {
12583
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12584
+ }
12408
12585
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12409
12586
  if (fromCandidates != null) {
12410
12587
  let transformedList = fromCandidates;
@@ -12599,6 +12776,12 @@ function modelFromMldev(fromObject) {
12599
12776
  }
12600
12777
  function listModelsResponseFromMldev(fromObject) {
12601
12778
  const toObject = {};
12779
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12780
+ 'sdkHttpResponse',
12781
+ ]);
12782
+ if (fromSdkHttpResponse != null) {
12783
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12784
+ }
12602
12785
  const fromNextPageToken = getValueByPath(fromObject, [
12603
12786
  'nextPageToken',
12604
12787
  ]);
@@ -12635,7 +12818,7 @@ function countTokensResponseFromMldev(fromObject) {
12635
12818
  }
12636
12819
  return toObject;
12637
12820
  }
12638
- function videoFromMldev$1(fromObject) {
12821
+ function videoFromMldev(fromObject) {
12639
12822
  const toObject = {};
12640
12823
  const fromUri = getValueByPath(fromObject, ['video', 'uri']);
12641
12824
  if (fromUri != null) {
@@ -12654,15 +12837,15 @@ function videoFromMldev$1(fromObject) {
12654
12837
  }
12655
12838
  return toObject;
12656
12839
  }
12657
- function generatedVideoFromMldev$1(fromObject) {
12840
+ function generatedVideoFromMldev(fromObject) {
12658
12841
  const toObject = {};
12659
12842
  const fromVideo = getValueByPath(fromObject, ['_self']);
12660
12843
  if (fromVideo != null) {
12661
- setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
12844
+ setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
12662
12845
  }
12663
12846
  return toObject;
12664
12847
  }
12665
- function generateVideosResponseFromMldev$1(fromObject) {
12848
+ function generateVideosResponseFromMldev(fromObject) {
12666
12849
  const toObject = {};
12667
12850
  const fromGeneratedVideos = getValueByPath(fromObject, [
12668
12851
  'generatedSamples',
@@ -12671,7 +12854,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
12671
12854
  let transformedList = fromGeneratedVideos;
12672
12855
  if (Array.isArray(transformedList)) {
12673
12856
  transformedList = transformedList.map((item) => {
12674
- return generatedVideoFromMldev$1(item);
12857
+ return generatedVideoFromMldev(item);
12675
12858
  });
12676
12859
  }
12677
12860
  setValueByPath(toObject, ['generatedVideos'], transformedList);
@@ -12690,7 +12873,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
12690
12873
  }
12691
12874
  return toObject;
12692
12875
  }
12693
- function generateVideosOperationFromMldev$1(fromObject) {
12876
+ function generateVideosOperationFromMldev(fromObject) {
12694
12877
  const toObject = {};
12695
12878
  const fromName = getValueByPath(fromObject, ['name']);
12696
12879
  if (fromName != null) {
@@ -12713,7 +12896,7 @@ function generateVideosOperationFromMldev$1(fromObject) {
12713
12896
  'generateVideoResponse',
12714
12897
  ]);
12715
12898
  if (fromResponse != null) {
12716
- setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
12899
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
12717
12900
  }
12718
12901
  return toObject;
12719
12902
  }
@@ -12931,6 +13114,12 @@ function candidateFromVertex(fromObject) {
12931
13114
  }
12932
13115
  function generateContentResponseFromVertex(fromObject) {
12933
13116
  const toObject = {};
13117
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
13118
+ 'sdkHttpResponse',
13119
+ ]);
13120
+ if (fromSdkHttpResponse != null) {
13121
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
13122
+ }
12934
13123
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12935
13124
  if (fromCandidates != null) {
12936
13125
  let transformedList = fromCandidates;
@@ -13243,6 +13432,12 @@ function modelFromVertex(fromObject) {
13243
13432
  }
13244
13433
  function listModelsResponseFromVertex(fromObject) {
13245
13434
  const toObject = {};
13435
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
13436
+ 'sdkHttpResponse',
13437
+ ]);
13438
+ if (fromSdkHttpResponse != null) {
13439
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
13440
+ }
13246
13441
  const fromNextPageToken = getValueByPath(fromObject, [
13247
13442
  'nextPageToken',
13248
13443
  ]);
@@ -13281,7 +13476,7 @@ function computeTokensResponseFromVertex(fromObject) {
13281
13476
  }
13282
13477
  return toObject;
13283
13478
  }
13284
- function videoFromVertex$1(fromObject) {
13479
+ function videoFromVertex(fromObject) {
13285
13480
  const toObject = {};
13286
13481
  const fromUri = getValueByPath(fromObject, ['gcsUri']);
13287
13482
  if (fromUri != null) {
@@ -13299,22 +13494,22 @@ function videoFromVertex$1(fromObject) {
13299
13494
  }
13300
13495
  return toObject;
13301
13496
  }
13302
- function generatedVideoFromVertex$1(fromObject) {
13497
+ function generatedVideoFromVertex(fromObject) {
13303
13498
  const toObject = {};
13304
13499
  const fromVideo = getValueByPath(fromObject, ['_self']);
13305
13500
  if (fromVideo != null) {
13306
- setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
13501
+ setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
13307
13502
  }
13308
13503
  return toObject;
13309
13504
  }
13310
- function generateVideosResponseFromVertex$1(fromObject) {
13505
+ function generateVideosResponseFromVertex(fromObject) {
13311
13506
  const toObject = {};
13312
13507
  const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
13313
13508
  if (fromGeneratedVideos != null) {
13314
13509
  let transformedList = fromGeneratedVideos;
13315
13510
  if (Array.isArray(transformedList)) {
13316
13511
  transformedList = transformedList.map((item) => {
13317
- return generatedVideoFromVertex$1(item);
13512
+ return generatedVideoFromVertex(item);
13318
13513
  });
13319
13514
  }
13320
13515
  setValueByPath(toObject, ['generatedVideos'], transformedList);
@@ -13333,7 +13528,7 @@ function generateVideosResponseFromVertex$1(fromObject) {
13333
13528
  }
13334
13529
  return toObject;
13335
13530
  }
13336
- function generateVideosOperationFromVertex$1(fromObject) {
13531
+ function generateVideosOperationFromVertex(fromObject) {
13337
13532
  const toObject = {};
13338
13533
  const fromName = getValueByPath(fromObject, ['name']);
13339
13534
  if (fromName != null) {
@@ -13353,7 +13548,7 @@ function generateVideosOperationFromVertex$1(fromObject) {
13353
13548
  }
13354
13549
  const fromResponse = getValueByPath(fromObject, ['response']);
13355
13550
  if (fromResponse != null) {
13356
- setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
13551
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
13357
13552
  }
13358
13553
  return toObject;
13359
13554
  }
@@ -13365,6 +13560,9 @@ function generateVideosOperationFromVertex$1(fromObject) {
13365
13560
  */
13366
13561
  // TODO: b/416041229 - Determine how to retrieve the MCP package version.
13367
13562
  const MCP_LABEL = 'mcp_used/unknown';
13563
+ // Whether MCP tool usage is detected from mcpToTool. This is used for
13564
+ // telemetry.
13565
+ let hasMcpToolUsageFromMcpToTool = false;
13368
13566
  // Checks whether the list of tools contains any MCP tools.
13369
13567
  function hasMcpToolUsage(tools) {
13370
13568
  for (const tool of tools) {
@@ -13375,25 +13573,13 @@ function hasMcpToolUsage(tools) {
13375
13573
  return true;
13376
13574
  }
13377
13575
  }
13378
- return false;
13576
+ return hasMcpToolUsageFromMcpToTool;
13379
13577
  }
13380
13578
  // Sets the MCP version label in the Google API client header.
13381
13579
  function setMcpUsageHeader(headers) {
13382
- var _a;
13383
- const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
13384
- headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
13385
- }
13386
- // Checks whether the list of tools contains any MCP clients. Will return true
13387
- // if there is at least one MCP client.
13388
- function hasMcpClientTools(params) {
13389
- var _a, _b, _c;
13390
- return (_c = (_b = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools) === null || _b === void 0 ? void 0 : _b.some((tool) => isMcpCallableTool(tool))) !== null && _c !== void 0 ? _c : false;
13391
- }
13392
- // Checks whether the list of tools contains any non-MCP tools. Will return true
13393
- // if there is at least one non-MCP tool.
13394
- function hasNonMcpTools(params) {
13395
- var _a, _b, _c;
13396
- return ((_c = (_b = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools) === null || _b === void 0 ? void 0 : _b.some((tool) => !isMcpCallableTool(tool))) !== null && _c !== void 0 ? _c : false);
13580
+ var _a;
13581
+ const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
13582
+ headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
13397
13583
  }
13398
13584
  // Returns true if the object is a MCP CallableTool, otherwise false.
13399
13585
  function isMcpCallableTool(object) {
@@ -13532,6 +13718,8 @@ function isMcpClient(client) {
13532
13718
  * versions.
13533
13719
  */
13534
13720
  function mcpToTool(...args) {
13721
+ // Set MCP usage for telemetry.
13722
+ hasMcpToolUsageFromMcpToTool = true;
13535
13723
  if (args.length === 0) {
13536
13724
  throw new Error('No MCP clients provided');
13537
13725
  }
@@ -13877,6 +14065,12 @@ class Live {
13877
14065
  */
13878
14066
  async connect(params) {
13879
14067
  var _a, _b, _c, _d, _e, _f;
14068
+ // TODO: b/404946746 - Support per request HTTP options.
14069
+ if (params.config && params.config.httpOptions) {
14070
+ throw new Error('The Live module does not support httpOptions at request-level in' +
14071
+ ' LiveConnectConfig yet. Please use the client-level httpOptions' +
14072
+ ' configuration instead.');
14073
+ }
13880
14074
  const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
13881
14075
  const apiVersion = this.apiClient.getApiVersion();
13882
14076
  let url;
@@ -14245,6 +14439,18 @@ function shouldDisableAfc(config) {
14245
14439
  function isCallableTool(tool) {
14246
14440
  return 'callTool' in tool && typeof tool.callTool === 'function';
14247
14441
  }
14442
+ // Checks whether the list of tools contains any CallableTools. Will return true
14443
+ // if there is at least one CallableTool.
14444
+ function hasCallableTools(params) {
14445
+ var _a, _b, _c;
14446
+ return (_c = (_b = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools) === null || _b === void 0 ? void 0 : _b.some((tool) => isCallableTool(tool))) !== null && _c !== void 0 ? _c : false;
14447
+ }
14448
+ // Checks whether the list of tools contains any non-callable tools. Will return
14449
+ // true if there is at least one non-Callable tool.
14450
+ function hasNonCallableTools(params) {
14451
+ var _a, _b, _c;
14452
+ return (_c = (_b = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools) === null || _b === void 0 ? void 0 : _b.some((tool) => !isCallableTool(tool))) !== null && _c !== void 0 ? _c : false;
14453
+ }
14248
14454
  /**
14249
14455
  * Returns whether to append automatic function calling history to the
14250
14456
  * response.
@@ -14303,12 +14509,12 @@ class Models extends BaseModule {
14303
14509
  */
14304
14510
  this.generateContent = async (params) => {
14305
14511
  var _a, _b, _c, _d, _e;
14306
- const transformedParams = await this.processParamsForMcpUsage(params);
14512
+ const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14307
14513
  this.maybeMoveToResponseJsonSchem(params);
14308
- if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
14514
+ if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
14309
14515
  return await this.generateContentInternal(transformedParams);
14310
14516
  }
14311
- if (hasNonMcpTools(params)) {
14517
+ if (hasNonCallableTools(params)) {
14312
14518
  throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
14313
14519
  }
14314
14520
  let response;
@@ -14393,7 +14599,7 @@ class Models extends BaseModule {
14393
14599
  this.generateContentStream = async (params) => {
14394
14600
  this.maybeMoveToResponseJsonSchem(params);
14395
14601
  if (shouldDisableAfc(params.config)) {
14396
- const transformedParams = await this.processParamsForMcpUsage(params);
14602
+ const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14397
14603
  return await this.generateContentStreamInternal(transformedParams);
14398
14604
  }
14399
14605
  else {
@@ -14542,6 +14748,32 @@ class Models extends BaseModule {
14542
14748
  };
14543
14749
  return await this.upscaleImageInternal(apiParams);
14544
14750
  };
14751
+ /**
14752
+ * Generates videos based on a text description and configuration.
14753
+ *
14754
+ * @param params - The parameters for generating videos.
14755
+ * @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
14756
+ *
14757
+ * @example
14758
+ * ```ts
14759
+ * const operation = await ai.models.generateVideos({
14760
+ * model: 'veo-2.0-generate-001',
14761
+ * prompt: 'A neon hologram of a cat driving at top speed',
14762
+ * config: {
14763
+ * numberOfVideos: 1
14764
+ * });
14765
+ *
14766
+ * while (!operation.done) {
14767
+ * await new Promise(resolve => setTimeout(resolve, 10000));
14768
+ * operation = await ai.operations.getVideosOperation({operation: operation});
14769
+ * }
14770
+ *
14771
+ * console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
14772
+ * ```
14773
+ */
14774
+ this.generateVideos = async (params) => {
14775
+ return await this.generateVideosInternal(params);
14776
+ };
14545
14777
  }
14546
14778
  /**
14547
14779
  * This logic is needed for GenerateContentConfig only.
@@ -14567,7 +14799,7 @@ class Models extends BaseModule {
14567
14799
  * modify the original params. Also sets the MCP usage header if there are
14568
14800
  * MCP tools in the parameters.
14569
14801
  */
14570
- async processParamsForMcpUsage(params) {
14802
+ async processParamsMaybeAddMcpUsage(params) {
14571
14803
  var _a, _b, _c;
14572
14804
  const tools = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools;
14573
14805
  if (!tools) {
@@ -14634,7 +14866,7 @@ class Models extends BaseModule {
14634
14866
  remoteCallCount++;
14635
14867
  wereFunctionsCalled = false;
14636
14868
  }
14637
- const transformedParams = yield __await(models.processParamsForMcpUsage(params));
14869
+ const transformedParams = yield __await(models.processParamsMaybeAddMcpUsage(params));
14638
14870
  const response = yield __await(models.generateContentStreamInternal(transformedParams));
14639
14871
  const functionResponses = [];
14640
14872
  const responseContents = [];
@@ -14722,7 +14954,13 @@ class Models extends BaseModule {
14722
14954
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14723
14955
  })
14724
14956
  .then((httpResponse) => {
14725
- return httpResponse.json();
14957
+ return httpResponse.json().then((jsonResponse) => {
14958
+ const response = jsonResponse;
14959
+ response.sdkHttpResponse = {
14960
+ headers: httpResponse.headers,
14961
+ };
14962
+ return response;
14963
+ });
14726
14964
  });
14727
14965
  return response.then((apiResponse) => {
14728
14966
  const resp = generateContentResponseFromVertex(apiResponse);
@@ -14748,7 +14986,13 @@ class Models extends BaseModule {
14748
14986
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
14749
14987
  })
14750
14988
  .then((httpResponse) => {
14751
- return httpResponse.json();
14989
+ return httpResponse.json().then((jsonResponse) => {
14990
+ const response = jsonResponse;
14991
+ response.sdkHttpResponse = {
14992
+ headers: httpResponse.headers,
14993
+ };
14994
+ return response;
14995
+ });
14752
14996
  });
14753
14997
  return response.then((apiResponse) => {
14754
14998
  const resp = generateContentResponseFromMldev(apiResponse);
@@ -14788,6 +15032,9 @@ class Models extends BaseModule {
14788
15032
  _d = false;
14789
15033
  const chunk = _c;
14790
15034
  const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
15035
+ resp['sdkHttpResponse'] = {
15036
+ headers: chunk.headers,
15037
+ };
14791
15038
  const typedResp = new GenerateContentResponse();
14792
15039
  Object.assign(typedResp, resp);
14793
15040
  yield yield __await(typedResp);
@@ -14828,6 +15075,9 @@ class Models extends BaseModule {
14828
15075
  _d = false;
14829
15076
  const chunk = _c;
14830
15077
  const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
15078
+ resp['sdkHttpResponse'] = {
15079
+ headers: chunk.headers,
15080
+ };
14831
15081
  const typedResp = new GenerateContentResponse();
14832
15082
  Object.assign(typedResp, resp);
14833
15083
  yield yield __await(typedResp);
@@ -15154,7 +15404,13 @@ class Models extends BaseModule {
15154
15404
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
15155
15405
  })
15156
15406
  .then((httpResponse) => {
15157
- return httpResponse.json();
15407
+ return httpResponse.json().then((jsonResponse) => {
15408
+ const response = jsonResponse;
15409
+ response.sdkHttpResponse = {
15410
+ headers: httpResponse.headers,
15411
+ };
15412
+ return response;
15413
+ });
15158
15414
  });
15159
15415
  return response.then((apiResponse) => {
15160
15416
  const resp = listModelsResponseFromVertex(apiResponse);
@@ -15180,7 +15436,13 @@ class Models extends BaseModule {
15180
15436
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
15181
15437
  })
15182
15438
  .then((httpResponse) => {
15183
- return httpResponse.json();
15439
+ return httpResponse.json().then((jsonResponse) => {
15440
+ const response = jsonResponse;
15441
+ response.sdkHttpResponse = {
15442
+ headers: httpResponse.headers,
15443
+ };
15444
+ return response;
15445
+ });
15184
15446
  });
15185
15447
  return response.then((apiResponse) => {
15186
15448
  const resp = listModelsResponseFromMldev(apiResponse);
@@ -15480,7 +15742,7 @@ class Models extends BaseModule {
15480
15742
  * console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
15481
15743
  * ```
15482
15744
  */
15483
- async generateVideos(params) {
15745
+ async generateVideosInternal(params) {
15484
15746
  var _a, _b, _c, _d;
15485
15747
  let response;
15486
15748
  let path = '';
@@ -15505,8 +15767,10 @@ class Models extends BaseModule {
15505
15767
  return httpResponse.json();
15506
15768
  });
15507
15769
  return response.then((apiResponse) => {
15508
- const resp = generateVideosOperationFromVertex$1(apiResponse);
15509
- return resp;
15770
+ const resp = generateVideosOperationFromVertex(apiResponse);
15771
+ const typedResp = new GenerateVideosOperation();
15772
+ Object.assign(typedResp, resp);
15773
+ return typedResp;
15510
15774
  });
15511
15775
  }
15512
15776
  else {
@@ -15529,8 +15793,10 @@ class Models extends BaseModule {
15529
15793
  return httpResponse.json();
15530
15794
  });
15531
15795
  return response.then((apiResponse) => {
15532
- const resp = generateVideosOperationFromMldev$1(apiResponse);
15533
- return resp;
15796
+ const resp = generateVideosOperationFromMldev(apiResponse);
15797
+ const typedResp = new GenerateVideosOperation();
15798
+ Object.assign(typedResp, resp);
15799
+ return typedResp;
15534
15800
  });
15535
15801
  }
15536
15802
  }
@@ -15588,164 +15854,6 @@ function fetchPredictOperationParametersToVertex(fromObject) {
15588
15854
  }
15589
15855
  return toObject;
15590
15856
  }
15591
- function videoFromMldev(fromObject) {
15592
- const toObject = {};
15593
- const fromUri = getValueByPath(fromObject, ['video', 'uri']);
15594
- if (fromUri != null) {
15595
- setValueByPath(toObject, ['uri'], fromUri);
15596
- }
15597
- const fromVideoBytes = getValueByPath(fromObject, [
15598
- 'video',
15599
- 'encodedVideo',
15600
- ]);
15601
- if (fromVideoBytes != null) {
15602
- setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
15603
- }
15604
- const fromMimeType = getValueByPath(fromObject, ['encoding']);
15605
- if (fromMimeType != null) {
15606
- setValueByPath(toObject, ['mimeType'], fromMimeType);
15607
- }
15608
- return toObject;
15609
- }
15610
- function generatedVideoFromMldev(fromObject) {
15611
- const toObject = {};
15612
- const fromVideo = getValueByPath(fromObject, ['_self']);
15613
- if (fromVideo != null) {
15614
- setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
15615
- }
15616
- return toObject;
15617
- }
15618
- function generateVideosResponseFromMldev(fromObject) {
15619
- const toObject = {};
15620
- const fromGeneratedVideos = getValueByPath(fromObject, [
15621
- 'generatedSamples',
15622
- ]);
15623
- if (fromGeneratedVideos != null) {
15624
- let transformedList = fromGeneratedVideos;
15625
- if (Array.isArray(transformedList)) {
15626
- transformedList = transformedList.map((item) => {
15627
- return generatedVideoFromMldev(item);
15628
- });
15629
- }
15630
- setValueByPath(toObject, ['generatedVideos'], transformedList);
15631
- }
15632
- const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
15633
- 'raiMediaFilteredCount',
15634
- ]);
15635
- if (fromRaiMediaFilteredCount != null) {
15636
- setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
15637
- }
15638
- const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
15639
- 'raiMediaFilteredReasons',
15640
- ]);
15641
- if (fromRaiMediaFilteredReasons != null) {
15642
- setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
15643
- }
15644
- return toObject;
15645
- }
15646
- function generateVideosOperationFromMldev(fromObject) {
15647
- const toObject = {};
15648
- const fromName = getValueByPath(fromObject, ['name']);
15649
- if (fromName != null) {
15650
- setValueByPath(toObject, ['name'], fromName);
15651
- }
15652
- const fromMetadata = getValueByPath(fromObject, ['metadata']);
15653
- if (fromMetadata != null) {
15654
- setValueByPath(toObject, ['metadata'], fromMetadata);
15655
- }
15656
- const fromDone = getValueByPath(fromObject, ['done']);
15657
- if (fromDone != null) {
15658
- setValueByPath(toObject, ['done'], fromDone);
15659
- }
15660
- const fromError = getValueByPath(fromObject, ['error']);
15661
- if (fromError != null) {
15662
- setValueByPath(toObject, ['error'], fromError);
15663
- }
15664
- const fromResponse = getValueByPath(fromObject, [
15665
- 'response',
15666
- 'generateVideoResponse',
15667
- ]);
15668
- if (fromResponse != null) {
15669
- setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
15670
- }
15671
- return toObject;
15672
- }
15673
- function videoFromVertex(fromObject) {
15674
- const toObject = {};
15675
- const fromUri = getValueByPath(fromObject, ['gcsUri']);
15676
- if (fromUri != null) {
15677
- setValueByPath(toObject, ['uri'], fromUri);
15678
- }
15679
- const fromVideoBytes = getValueByPath(fromObject, [
15680
- 'bytesBase64Encoded',
15681
- ]);
15682
- if (fromVideoBytes != null) {
15683
- setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
15684
- }
15685
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15686
- if (fromMimeType != null) {
15687
- setValueByPath(toObject, ['mimeType'], fromMimeType);
15688
- }
15689
- return toObject;
15690
- }
15691
- function generatedVideoFromVertex(fromObject) {
15692
- const toObject = {};
15693
- const fromVideo = getValueByPath(fromObject, ['_self']);
15694
- if (fromVideo != null) {
15695
- setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
15696
- }
15697
- return toObject;
15698
- }
15699
- function generateVideosResponseFromVertex(fromObject) {
15700
- const toObject = {};
15701
- const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
15702
- if (fromGeneratedVideos != null) {
15703
- let transformedList = fromGeneratedVideos;
15704
- if (Array.isArray(transformedList)) {
15705
- transformedList = transformedList.map((item) => {
15706
- return generatedVideoFromVertex(item);
15707
- });
15708
- }
15709
- setValueByPath(toObject, ['generatedVideos'], transformedList);
15710
- }
15711
- const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
15712
- 'raiMediaFilteredCount',
15713
- ]);
15714
- if (fromRaiMediaFilteredCount != null) {
15715
- setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
15716
- }
15717
- const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
15718
- 'raiMediaFilteredReasons',
15719
- ]);
15720
- if (fromRaiMediaFilteredReasons != null) {
15721
- setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
15722
- }
15723
- return toObject;
15724
- }
15725
- function generateVideosOperationFromVertex(fromObject) {
15726
- const toObject = {};
15727
- const fromName = getValueByPath(fromObject, ['name']);
15728
- if (fromName != null) {
15729
- setValueByPath(toObject, ['name'], fromName);
15730
- }
15731
- const fromMetadata = getValueByPath(fromObject, ['metadata']);
15732
- if (fromMetadata != null) {
15733
- setValueByPath(toObject, ['metadata'], fromMetadata);
15734
- }
15735
- const fromDone = getValueByPath(fromObject, ['done']);
15736
- if (fromDone != null) {
15737
- setValueByPath(toObject, ['done'], fromDone);
15738
- }
15739
- const fromError = getValueByPath(fromObject, ['error']);
15740
- if (fromError != null) {
15741
- setValueByPath(toObject, ['error'], fromError);
15742
- }
15743
- const fromResponse = getValueByPath(fromObject, ['response']);
15744
- if (fromResponse != null) {
15745
- setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
15746
- }
15747
- return toObject;
15748
- }
15749
15857
 
15750
15858
  /**
15751
15859
  * @license
@@ -15775,17 +15883,64 @@ class Operations extends BaseModule {
15775
15883
  if (config && 'httpOptions' in config) {
15776
15884
  httpOptions = config.httpOptions;
15777
15885
  }
15778
- return this.fetchPredictVideosOperationInternal({
15886
+ const rawOperation = await this.fetchPredictVideosOperationInternal({
15887
+ operationName: operation.name,
15888
+ resourceName: resourceName,
15889
+ config: { httpOptions: httpOptions },
15890
+ });
15891
+ return operation._fromAPIResponse({
15892
+ apiResponse: rawOperation,
15893
+ isVertexAI: true,
15894
+ });
15895
+ }
15896
+ else {
15897
+ const rawOperation = await this.getVideosOperationInternal({
15898
+ operationName: operation.name,
15899
+ config: config,
15900
+ });
15901
+ return operation._fromAPIResponse({
15902
+ apiResponse: rawOperation,
15903
+ isVertexAI: false,
15904
+ });
15905
+ }
15906
+ }
15907
+ /**
15908
+ * Gets the status of a long-running operation.
15909
+ *
15910
+ * @param parameters The parameters for the get operation request.
15911
+ * @return The updated Operation object, with the latest status or result.
15912
+ */
15913
+ async get(parameters) {
15914
+ const operation = parameters.operation;
15915
+ const config = parameters.config;
15916
+ if (operation.name === undefined || operation.name === '') {
15917
+ throw new Error('Operation name is required.');
15918
+ }
15919
+ if (this.apiClient.isVertexAI()) {
15920
+ const resourceName = operation.name.split('/operations/')[0];
15921
+ let httpOptions = undefined;
15922
+ if (config && 'httpOptions' in config) {
15923
+ httpOptions = config.httpOptions;
15924
+ }
15925
+ const rawOperation = await this.fetchPredictVideosOperationInternal({
15779
15926
  operationName: operation.name,
15780
15927
  resourceName: resourceName,
15781
15928
  config: { httpOptions: httpOptions },
15782
15929
  });
15930
+ return operation._fromAPIResponse({
15931
+ apiResponse: rawOperation,
15932
+ isVertexAI: true,
15933
+ });
15783
15934
  }
15784
15935
  else {
15785
- return this.getVideosOperationInternal({
15936
+ const rawOperation = await this.getVideosOperationInternal({
15786
15937
  operationName: operation.name,
15787
15938
  config: config,
15788
15939
  });
15940
+ return operation._fromAPIResponse({
15941
+ apiResponse: rawOperation,
15942
+ isVertexAI: false,
15943
+ });
15789
15944
  }
15790
15945
  }
15791
15946
  async getVideosOperationInternal(params) {
@@ -15812,10 +15967,7 @@ class Operations extends BaseModule {
15812
15967
  .then((httpResponse) => {
15813
15968
  return httpResponse.json();
15814
15969
  });
15815
- return response.then((apiResponse) => {
15816
- const resp = generateVideosOperationFromVertex(apiResponse);
15817
- return resp;
15818
- });
15970
+ return response;
15819
15971
  }
15820
15972
  else {
15821
15973
  const body = getOperationParametersToMldev(params);
@@ -15836,10 +15988,7 @@ class Operations extends BaseModule {
15836
15988
  .then((httpResponse) => {
15837
15989
  return httpResponse.json();
15838
15990
  });
15839
- return response.then((apiResponse) => {
15840
- const resp = generateVideosOperationFromMldev(apiResponse);
15841
- return resp;
15842
- });
15991
+ return response;
15843
15992
  }
15844
15993
  }
15845
15994
  async fetchPredictVideosOperationInternal(params) {
@@ -15866,10 +16015,7 @@ class Operations extends BaseModule {
15866
16015
  .then((httpResponse) => {
15867
16016
  return httpResponse.json();
15868
16017
  });
15869
- return response.then((apiResponse) => {
15870
- const resp = generateVideosOperationFromVertex(apiResponse);
15871
- return resp;
15872
- });
16018
+ return response;
15873
16019
  }
15874
16020
  else {
15875
16021
  throw new Error('This method is only supported by the Vertex AI.');
@@ -17096,6 +17242,12 @@ function tuningJobFromMldev(fromObject) {
17096
17242
  }
17097
17243
  function listTuningJobsResponseFromMldev(fromObject) {
17098
17244
  const toObject = {};
17245
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
17246
+ 'sdkHttpResponse',
17247
+ ]);
17248
+ if (fromSdkHttpResponse != null) {
17249
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
17250
+ }
17099
17251
  const fromNextPageToken = getValueByPath(fromObject, [
17100
17252
  'nextPageToken',
17101
17253
  ]);
@@ -17114,7 +17266,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
17114
17266
  }
17115
17267
  return toObject;
17116
17268
  }
17117
- function operationFromMldev(fromObject) {
17269
+ function tuningOperationFromMldev(fromObject) {
17118
17270
  const toObject = {};
17119
17271
  const fromName = getValueByPath(fromObject, ['name']);
17120
17272
  if (fromName != null) {
@@ -17284,6 +17436,12 @@ function tuningJobFromVertex(fromObject) {
17284
17436
  }
17285
17437
  function listTuningJobsResponseFromVertex(fromObject) {
17286
17438
  const toObject = {};
17439
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
17440
+ 'sdkHttpResponse',
17441
+ ]);
17442
+ if (fromSdkHttpResponse != null) {
17443
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
17444
+ }
17287
17445
  const fromNextPageToken = getValueByPath(fromObject, [
17288
17446
  'nextPageToken',
17289
17447
  ]);
@@ -17444,7 +17602,13 @@ class Tunings extends BaseModule {
17444
17602
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
17445
17603
  })
17446
17604
  .then((httpResponse) => {
17447
- return httpResponse.json();
17605
+ return httpResponse.json().then((jsonResponse) => {
17606
+ const response = jsonResponse;
17607
+ response.sdkHttpResponse = {
17608
+ headers: httpResponse.headers,
17609
+ };
17610
+ return response;
17611
+ });
17448
17612
  });
17449
17613
  return response.then((apiResponse) => {
17450
17614
  const resp = listTuningJobsResponseFromVertex(apiResponse);
@@ -17470,7 +17634,13 @@ class Tunings extends BaseModule {
17470
17634
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
17471
17635
  })
17472
17636
  .then((httpResponse) => {
17473
- return httpResponse.json();
17637
+ return httpResponse.json().then((jsonResponse) => {
17638
+ const response = jsonResponse;
17639
+ response.sdkHttpResponse = {
17640
+ headers: httpResponse.headers,
17641
+ };
17642
+ return response;
17643
+ });
17474
17644
  });
17475
17645
  return response.then((apiResponse) => {
17476
17646
  const resp = listTuningJobsResponseFromMldev(apiResponse);
@@ -17541,7 +17711,7 @@ class Tunings extends BaseModule {
17541
17711
  return httpResponse.json();
17542
17712
  });
17543
17713
  return response.then((apiResponse) => {
17544
- const resp = operationFromMldev(apiResponse);
17714
+ const resp = tuningOperationFromMldev(apiResponse);
17545
17715
  return resp;
17546
17716
  });
17547
17717
  }
@@ -17663,6 +17833,7 @@ exports.GenerateContentResponse = GenerateContentResponse;
17663
17833
  exports.GenerateContentResponsePromptFeedback = GenerateContentResponsePromptFeedback;
17664
17834
  exports.GenerateContentResponseUsageMetadata = GenerateContentResponseUsageMetadata;
17665
17835
  exports.GenerateImagesResponse = GenerateImagesResponse;
17836
+ exports.GenerateVideosOperation = GenerateVideosOperation;
17666
17837
  exports.GenerateVideosResponse = GenerateVideosResponse;
17667
17838
  exports.GoogleGenAI = GoogleGenAI;
17668
17839
  exports.HttpResponse = HttpResponse;