@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.
@@ -50,18 +50,18 @@ function getDefaultBaseUrls() {
50
50
  * 2. Base URLs set via the latest call to setDefaultBaseUrls.
51
51
  * 3. Base URLs set via environment variables.
52
52
  */
53
- function getBaseUrl(options, vertexBaseUrlFromEnv, geminiBaseUrlFromEnv) {
54
- var _a, _b, _c;
55
- if (!((_a = options.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl)) {
53
+ function getBaseUrl(httpOptions, vertexai, vertexBaseUrlFromEnv, geminiBaseUrlFromEnv) {
54
+ var _a, _b;
55
+ if (!(httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl)) {
56
56
  const defaultBaseUrls = getDefaultBaseUrls();
57
- if (options.vertexai) {
58
- return (_b = defaultBaseUrls.vertexUrl) !== null && _b !== void 0 ? _b : vertexBaseUrlFromEnv;
57
+ if (vertexai) {
58
+ return (_a = defaultBaseUrls.vertexUrl) !== null && _a !== void 0 ? _a : vertexBaseUrlFromEnv;
59
59
  }
60
60
  else {
61
- return (_c = defaultBaseUrls.geminiUrl) !== null && _c !== void 0 ? _c : geminiBaseUrlFromEnv;
61
+ return (_b = defaultBaseUrls.geminiUrl) !== null && _b !== void 0 ? _b : geminiBaseUrlFromEnv;
62
62
  }
63
63
  }
64
- return options.httpOptions.baseUrl;
64
+ return httpOptions.baseUrl;
65
65
  }
66
66
 
67
67
  /**
@@ -196,6 +196,20 @@ function getValueByPath(data, keys) {
196
196
  * Copyright 2025 Google LLC
197
197
  * SPDX-License-Identifier: Apache-2.0
198
198
  */
199
+ function tBytes$1(fromBytes) {
200
+ if (typeof fromBytes !== 'string') {
201
+ throw new Error('fromImageBytes must be a string');
202
+ }
203
+ // TODO(b/389133914): Remove dummy bytes converter.
204
+ return fromBytes;
205
+ }
206
+
207
+ /**
208
+ * @license
209
+ * Copyright 2025 Google LLC
210
+ * SPDX-License-Identifier: Apache-2.0
211
+ */
212
+ // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
199
213
  /** Required. Outcome of the code execution. */
200
214
  var Outcome;
201
215
  (function (Outcome) {
@@ -1689,6 +1703,65 @@ class LiveServerMessage {
1689
1703
  return data.length > 0 ? btoa(data) : undefined;
1690
1704
  }
1691
1705
  }
1706
+ /** A video generation long-running operation. */
1707
+ class GenerateVideosOperation {
1708
+ /**
1709
+ * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
1710
+ * @internal
1711
+ */
1712
+ _fromAPIResponse({ apiResponse, isVertexAI, }) {
1713
+ const operation = new GenerateVideosOperation();
1714
+ operation.name = apiResponse['name'];
1715
+ operation.metadata = apiResponse['metadata'];
1716
+ operation.done = apiResponse['done'];
1717
+ operation.error = apiResponse['error'];
1718
+ if (isVertexAI) {
1719
+ const response = apiResponse['response'];
1720
+ if (response) {
1721
+ const operationResponse = new GenerateVideosResponse();
1722
+ const responseVideos = response['videos'];
1723
+ operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1724
+ return {
1725
+ video: {
1726
+ uri: generatedVideo['gcsUri'],
1727
+ videoBytes: generatedVideo['bytesBase64Encoded']
1728
+ ? tBytes$1(generatedVideo['bytesBase64Encoded'])
1729
+ : undefined,
1730
+ mimeType: generatedVideo['mimeType'],
1731
+ },
1732
+ };
1733
+ });
1734
+ operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1735
+ operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1736
+ operation.response = operationResponse;
1737
+ }
1738
+ }
1739
+ else {
1740
+ const response = apiResponse['response'];
1741
+ if (response) {
1742
+ const operationResponse = new GenerateVideosResponse();
1743
+ const generatedVideoResponse = response['generateVideoResponse'];
1744
+ const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
1745
+ operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
1746
+ const video = generatedVideo['video'];
1747
+ return {
1748
+ video: {
1749
+ uri: video === null || video === void 0 ? void 0 : video['uri'],
1750
+ videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
1751
+ ? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
1752
+ : undefined,
1753
+ mimeType: generatedVideo['encoding'],
1754
+ },
1755
+ };
1756
+ });
1757
+ operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
1758
+ operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
1759
+ operation.response = operationResponse;
1760
+ }
1761
+ }
1762
+ return operation;
1763
+ }
1764
+ }
1692
1765
  /** Client generated response to a `ToolCall` received from the server.
1693
1766
 
1694
1767
  Individual `FunctionResponse` objects are matched to the respective
@@ -2250,11 +2323,7 @@ function tTuningJobStatus(status) {
2250
2323
  }
2251
2324
  }
2252
2325
  function tBytes(fromImageBytes) {
2253
- if (typeof fromImageBytes !== 'string') {
2254
- throw new Error('fromImageBytes must be a string');
2255
- }
2256
- // TODO(b/389133914): Remove dummy bytes converter.
2257
- return fromImageBytes;
2326
+ return tBytes$1(fromImageBytes);
2258
2327
  }
2259
2328
  function _isFile(origin) {
2260
2329
  return (origin !== null &&
@@ -2417,6 +2486,9 @@ function tBatchJobSource(apiClient, src) {
2417
2486
  throw new Error(`Unsupported source: ${src}`);
2418
2487
  }
2419
2488
  function tBatchJobDestination(dest) {
2489
+ if (typeof dest !== 'string') {
2490
+ return dest;
2491
+ }
2420
2492
  const destString = dest;
2421
2493
  if (destString.startsWith('gs://')) {
2422
2494
  return {
@@ -3402,10 +3474,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3402
3474
  }
3403
3475
  return toObject;
3404
3476
  }
3405
- function jobErrorFromMldev() {
3406
- const toObject = {};
3407
- return toObject;
3408
- }
3409
3477
  function videoMetadataFromMldev$2(fromObject) {
3410
3478
  const toObject = {};
3411
3479
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -3610,6 +3678,12 @@ function candidateFromMldev$1(fromObject) {
3610
3678
  }
3611
3679
  function generateContentResponseFromMldev$1(fromObject) {
3612
3680
  const toObject = {};
3681
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3682
+ 'sdkHttpResponse',
3683
+ ]);
3684
+ if (fromSdkHttpResponse != null) {
3685
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3686
+ }
3613
3687
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
3614
3688
  if (fromCandidates != null) {
3615
3689
  let transformedList = fromCandidates;
@@ -3638,6 +3712,22 @@ function generateContentResponseFromMldev$1(fromObject) {
3638
3712
  }
3639
3713
  return toObject;
3640
3714
  }
3715
+ function jobErrorFromMldev(fromObject) {
3716
+ const toObject = {};
3717
+ const fromDetails = getValueByPath(fromObject, ['details']);
3718
+ if (fromDetails != null) {
3719
+ setValueByPath(toObject, ['details'], fromDetails);
3720
+ }
3721
+ const fromCode = getValueByPath(fromObject, ['code']);
3722
+ if (fromCode != null) {
3723
+ setValueByPath(toObject, ['code'], fromCode);
3724
+ }
3725
+ const fromMessage = getValueByPath(fromObject, ['message']);
3726
+ if (fromMessage != null) {
3727
+ setValueByPath(toObject, ['message'], fromMessage);
3728
+ }
3729
+ return toObject;
3730
+ }
3641
3731
  function inlinedResponseFromMldev(fromObject) {
3642
3732
  const toObject = {};
3643
3733
  const fromResponse = getValueByPath(fromObject, ['response']);
@@ -3646,7 +3736,7 @@ function inlinedResponseFromMldev(fromObject) {
3646
3736
  }
3647
3737
  const fromError = getValueByPath(fromObject, ['error']);
3648
3738
  if (fromError != null) {
3649
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3739
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3650
3740
  }
3651
3741
  return toObject;
3652
3742
  }
@@ -3721,6 +3811,12 @@ function batchJobFromMldev(fromObject) {
3721
3811
  }
3722
3812
  function listBatchJobsResponseFromMldev(fromObject) {
3723
3813
  const toObject = {};
3814
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3815
+ 'sdkHttpResponse',
3816
+ ]);
3817
+ if (fromSdkHttpResponse != null) {
3818
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3819
+ }
3724
3820
  const fromNextPageToken = getValueByPath(fromObject, [
3725
3821
  'nextPageToken',
3726
3822
  ]);
@@ -3751,7 +3847,7 @@ function deleteResourceJobFromMldev(fromObject) {
3751
3847
  }
3752
3848
  const fromError = getValueByPath(fromObject, ['error']);
3753
3849
  if (fromError != null) {
3754
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3850
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3755
3851
  }
3756
3852
  return toObject;
3757
3853
  }
@@ -3862,6 +3958,12 @@ function batchJobFromVertex(fromObject) {
3862
3958
  }
3863
3959
  function listBatchJobsResponseFromVertex(fromObject) {
3864
3960
  const toObject = {};
3961
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3962
+ 'sdkHttpResponse',
3963
+ ]);
3964
+ if (fromSdkHttpResponse != null) {
3965
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3966
+ }
3865
3967
  const fromNextPageToken = getValueByPath(fromObject, [
3866
3968
  'nextPageToken',
3867
3969
  ]);
@@ -3904,9 +4006,6 @@ function deleteResourceJobFromVertex(fromObject) {
3904
4006
  * Copyright 2025 Google LLC
3905
4007
  * SPDX-License-Identifier: Apache-2.0
3906
4008
  */
3907
- /**
3908
- * Pagers for the GenAI List APIs.
3909
- */
3910
4009
  var PagedItem;
3911
4010
  (function (PagedItem) {
3912
4011
  PagedItem["PAGED_ITEM_BATCH_JOBS"] = "batchJobs";
@@ -3929,9 +4028,10 @@ class Pager {
3929
4028
  var _a, _b;
3930
4029
  this.nameInternal = name;
3931
4030
  this.pageInternal = response[this.nameInternal] || [];
4031
+ this.sdkHttpResponseInternal = response === null || response === void 0 ? void 0 : response.sdkHttpResponse;
3932
4032
  this.idxInternal = 0;
3933
4033
  let requestParams = { config: {} };
3934
- if (!params) {
4034
+ if (!params || Object.keys(params).length === 0) {
3935
4035
  requestParams = { config: {} };
3936
4036
  }
3937
4037
  else if (typeof params === 'object') {
@@ -3975,6 +4075,12 @@ class Pager {
3975
4075
  get pageSize() {
3976
4076
  return this.pageInternalSize;
3977
4077
  }
4078
+ /**
4079
+ * Returns the headers of the API response.
4080
+ */
4081
+ get sdkHttpResponse() {
4082
+ return this.sdkHttpResponseInternal;
4083
+ }
3978
4084
  /**
3979
4085
  * Returns the parameters when making the API request for the next page.
3980
4086
  *
@@ -4344,7 +4450,13 @@ class Batches extends BaseModule {
4344
4450
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
4345
4451
  })
4346
4452
  .then((httpResponse) => {
4347
- return httpResponse.json();
4453
+ return httpResponse.json().then((jsonResponse) => {
4454
+ const response = jsonResponse;
4455
+ response.sdkHttpResponse = {
4456
+ headers: httpResponse.headers,
4457
+ };
4458
+ return response;
4459
+ });
4348
4460
  });
4349
4461
  return response.then((apiResponse) => {
4350
4462
  const resp = listBatchJobsResponseFromVertex(apiResponse);
@@ -4370,7 +4482,13 @@ class Batches extends BaseModule {
4370
4482
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
4371
4483
  })
4372
4484
  .then((httpResponse) => {
4373
- return httpResponse.json();
4485
+ return httpResponse.json().then((jsonResponse) => {
4486
+ const response = jsonResponse;
4487
+ response.sdkHttpResponse = {
4488
+ headers: httpResponse.headers,
4489
+ };
4490
+ return response;
4491
+ });
4374
4492
  });
4375
4493
  return response.then((apiResponse) => {
4376
4494
  const resp = listBatchJobsResponseFromMldev(apiResponse);
@@ -5423,6 +5541,12 @@ function deleteCachedContentResponseFromMldev() {
5423
5541
  }
5424
5542
  function listCachedContentsResponseFromMldev(fromObject) {
5425
5543
  const toObject = {};
5544
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
5545
+ 'sdkHttpResponse',
5546
+ ]);
5547
+ if (fromSdkHttpResponse != null) {
5548
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
5549
+ }
5426
5550
  const fromNextPageToken = getValueByPath(fromObject, [
5427
5551
  'nextPageToken',
5428
5552
  ]);
@@ -5483,6 +5607,12 @@ function deleteCachedContentResponseFromVertex() {
5483
5607
  }
5484
5608
  function listCachedContentsResponseFromVertex(fromObject) {
5485
5609
  const toObject = {};
5610
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
5611
+ 'sdkHttpResponse',
5612
+ ]);
5613
+ if (fromSdkHttpResponse != null) {
5614
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
5615
+ }
5486
5616
  const fromNextPageToken = getValueByPath(fromObject, [
5487
5617
  'nextPageToken',
5488
5618
  ]);
@@ -5835,7 +5965,13 @@ class Caches extends BaseModule {
5835
5965
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
5836
5966
  })
5837
5967
  .then((httpResponse) => {
5838
- return httpResponse.json();
5968
+ return httpResponse.json().then((jsonResponse) => {
5969
+ const response = jsonResponse;
5970
+ response.sdkHttpResponse = {
5971
+ headers: httpResponse.headers,
5972
+ };
5973
+ return response;
5974
+ });
5839
5975
  });
5840
5976
  return response.then((apiResponse) => {
5841
5977
  const resp = listCachedContentsResponseFromVertex(apiResponse);
@@ -5861,7 +5997,13 @@ class Caches extends BaseModule {
5861
5997
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
5862
5998
  })
5863
5999
  .then((httpResponse) => {
5864
- return httpResponse.json();
6000
+ return httpResponse.json().then((jsonResponse) => {
6001
+ const response = jsonResponse;
6002
+ response.sdkHttpResponse = {
6003
+ headers: httpResponse.headers,
6004
+ };
6005
+ return response;
6006
+ });
5865
6007
  });
5866
6008
  return response.then((apiResponse) => {
5867
6009
  const resp = listCachedContentsResponseFromMldev(apiResponse);
@@ -6499,6 +6641,12 @@ function fileFromMldev(fromObject) {
6499
6641
  }
6500
6642
  function listFilesResponseFromMldev(fromObject) {
6501
6643
  const toObject = {};
6644
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6645
+ 'sdkHttpResponse',
6646
+ ]);
6647
+ if (fromSdkHttpResponse != null) {
6648
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6649
+ }
6502
6650
  const fromNextPageToken = getValueByPath(fromObject, [
6503
6651
  'nextPageToken',
6504
6652
  ]);
@@ -6517,8 +6665,14 @@ function listFilesResponseFromMldev(fromObject) {
6517
6665
  }
6518
6666
  return toObject;
6519
6667
  }
6520
- function createFileResponseFromMldev() {
6668
+ function createFileResponseFromMldev(fromObject) {
6521
6669
  const toObject = {};
6670
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6671
+ 'sdkHttpResponse',
6672
+ ]);
6673
+ if (fromSdkHttpResponse != null) {
6674
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6675
+ }
6522
6676
  return toObject;
6523
6677
  }
6524
6678
  function deleteFileResponseFromMldev() {
@@ -6654,7 +6808,13 @@ class Files extends BaseModule {
6654
6808
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
6655
6809
  })
6656
6810
  .then((httpResponse) => {
6657
- return httpResponse.json();
6811
+ return httpResponse.json().then((jsonResponse) => {
6812
+ const response = jsonResponse;
6813
+ response.sdkHttpResponse = {
6814
+ headers: httpResponse.headers,
6815
+ };
6816
+ return response;
6817
+ });
6658
6818
  });
6659
6819
  return response.then((apiResponse) => {
6660
6820
  const resp = listFilesResponseFromMldev(apiResponse);
@@ -6691,8 +6851,8 @@ class Files extends BaseModule {
6691
6851
  .then((httpResponse) => {
6692
6852
  return httpResponse.json();
6693
6853
  });
6694
- return response.then(() => {
6695
- const resp = createFileResponseFromMldev();
6854
+ return response.then((apiResponse) => {
6855
+ const resp = createFileResponseFromMldev(apiResponse);
6696
6856
  const typedResp = new CreateFileResponse();
6697
6857
  Object.assign(typedResp, resp);
6698
6858
  return typedResp;
@@ -6810,14 +6970,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
6810
6970
  }
6811
6971
  return toObject;
6812
6972
  }
6813
- function prebuiltVoiceConfigToVertex$1(fromObject) {
6814
- const toObject = {};
6815
- const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
6816
- if (fromVoiceName != null) {
6817
- setValueByPath(toObject, ['voiceName'], fromVoiceName);
6818
- }
6819
- return toObject;
6820
- }
6821
6973
  function voiceConfigToMldev$2(fromObject) {
6822
6974
  const toObject = {};
6823
6975
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
@@ -6828,16 +6980,6 @@ function voiceConfigToMldev$2(fromObject) {
6828
6980
  }
6829
6981
  return toObject;
6830
6982
  }
6831
- function voiceConfigToVertex$1(fromObject) {
6832
- const toObject = {};
6833
- const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
6834
- 'prebuiltVoiceConfig',
6835
- ]);
6836
- if (fromPrebuiltVoiceConfig != null) {
6837
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
6838
- }
6839
- return toObject;
6840
- }
6841
6983
  function speakerVoiceConfigToMldev$2(fromObject) {
6842
6984
  const toObject = {};
6843
6985
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
@@ -6884,21 +7026,6 @@ function speechConfigToMldev$2(fromObject) {
6884
7026
  }
6885
7027
  return toObject;
6886
7028
  }
6887
- function speechConfigToVertex$1(fromObject) {
6888
- const toObject = {};
6889
- const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
6890
- if (fromVoiceConfig != null) {
6891
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
6892
- }
6893
- if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
6894
- throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
6895
- }
6896
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
6897
- if (fromLanguageCode != null) {
6898
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
6899
- }
6900
- return toObject;
6901
- }
6902
7029
  function videoMetadataToMldev$2(fromObject) {
6903
7030
  const toObject = {};
6904
7031
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -6915,22 +7042,6 @@ function videoMetadataToMldev$2(fromObject) {
6915
7042
  }
6916
7043
  return toObject;
6917
7044
  }
6918
- function videoMetadataToVertex$1(fromObject) {
6919
- const toObject = {};
6920
- const fromFps = getValueByPath(fromObject, ['fps']);
6921
- if (fromFps != null) {
6922
- setValueByPath(toObject, ['fps'], fromFps);
6923
- }
6924
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
6925
- if (fromEndOffset != null) {
6926
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
6927
- }
6928
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
6929
- if (fromStartOffset != null) {
6930
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
6931
- }
6932
- return toObject;
6933
- }
6934
7045
  function blobToMldev$2(fromObject) {
6935
7046
  const toObject = {};
6936
7047
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -6946,22 +7057,6 @@ function blobToMldev$2(fromObject) {
6946
7057
  }
6947
7058
  return toObject;
6948
7059
  }
6949
- function blobToVertex$1(fromObject) {
6950
- const toObject = {};
6951
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
6952
- if (fromDisplayName != null) {
6953
- setValueByPath(toObject, ['displayName'], fromDisplayName);
6954
- }
6955
- const fromData = getValueByPath(fromObject, ['data']);
6956
- if (fromData != null) {
6957
- setValueByPath(toObject, ['data'], fromData);
6958
- }
6959
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6960
- if (fromMimeType != null) {
6961
- setValueByPath(toObject, ['mimeType'], fromMimeType);
6962
- }
6963
- return toObject;
6964
- }
6965
7060
  function fileDataToMldev$2(fromObject) {
6966
7061
  const toObject = {};
6967
7062
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -6977,22 +7072,6 @@ function fileDataToMldev$2(fromObject) {
6977
7072
  }
6978
7073
  return toObject;
6979
7074
  }
6980
- function fileDataToVertex$1(fromObject) {
6981
- const toObject = {};
6982
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
6983
- if (fromDisplayName != null) {
6984
- setValueByPath(toObject, ['displayName'], fromDisplayName);
6985
- }
6986
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
6987
- if (fromFileUri != null) {
6988
- setValueByPath(toObject, ['fileUri'], fromFileUri);
6989
- }
6990
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6991
- if (fromMimeType != null) {
6992
- setValueByPath(toObject, ['mimeType'], fromMimeType);
6993
- }
6994
- return toObject;
6995
- }
6996
7075
  function partToMldev$2(fromObject) {
6997
7076
  const toObject = {};
6998
7077
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7047,60 +7126,6 @@ function partToMldev$2(fromObject) {
7047
7126
  }
7048
7127
  return toObject;
7049
7128
  }
7050
- function partToVertex$1(fromObject) {
7051
- const toObject = {};
7052
- const fromVideoMetadata = getValueByPath(fromObject, [
7053
- 'videoMetadata',
7054
- ]);
7055
- if (fromVideoMetadata != null) {
7056
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7057
- }
7058
- const fromThought = getValueByPath(fromObject, ['thought']);
7059
- if (fromThought != null) {
7060
- setValueByPath(toObject, ['thought'], fromThought);
7061
- }
7062
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7063
- if (fromInlineData != null) {
7064
- setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7065
- }
7066
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7067
- if (fromFileData != null) {
7068
- setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7069
- }
7070
- const fromThoughtSignature = getValueByPath(fromObject, [
7071
- 'thoughtSignature',
7072
- ]);
7073
- if (fromThoughtSignature != null) {
7074
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7075
- }
7076
- const fromCodeExecutionResult = getValueByPath(fromObject, [
7077
- 'codeExecutionResult',
7078
- ]);
7079
- if (fromCodeExecutionResult != null) {
7080
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7081
- }
7082
- const fromExecutableCode = getValueByPath(fromObject, [
7083
- 'executableCode',
7084
- ]);
7085
- if (fromExecutableCode != null) {
7086
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7087
- }
7088
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7089
- if (fromFunctionCall != null) {
7090
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7091
- }
7092
- const fromFunctionResponse = getValueByPath(fromObject, [
7093
- 'functionResponse',
7094
- ]);
7095
- if (fromFunctionResponse != null) {
7096
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7097
- }
7098
- const fromText = getValueByPath(fromObject, ['text']);
7099
- if (fromText != null) {
7100
- setValueByPath(toObject, ['text'], fromText);
7101
- }
7102
- return toObject;
7103
- }
7104
7129
  function contentToMldev$2(fromObject) {
7105
7130
  const toObject = {};
7106
7131
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -7119,24 +7144,6 @@ function contentToMldev$2(fromObject) {
7119
7144
  }
7120
7145
  return toObject;
7121
7146
  }
7122
- function contentToVertex$1(fromObject) {
7123
- const toObject = {};
7124
- const fromParts = getValueByPath(fromObject, ['parts']);
7125
- if (fromParts != null) {
7126
- let transformedList = fromParts;
7127
- if (Array.isArray(transformedList)) {
7128
- transformedList = transformedList.map((item) => {
7129
- return partToVertex$1(item);
7130
- });
7131
- }
7132
- setValueByPath(toObject, ['parts'], transformedList);
7133
- }
7134
- const fromRole = getValueByPath(fromObject, ['role']);
7135
- if (fromRole != null) {
7136
- setValueByPath(toObject, ['role'], fromRole);
7137
- }
7138
- return toObject;
7139
- }
7140
7147
  function functionDeclarationToMldev$2(fromObject) {
7141
7148
  const toObject = {};
7142
7149
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
@@ -7173,62 +7180,15 @@ function functionDeclarationToMldev$2(fromObject) {
7173
7180
  }
7174
7181
  return toObject;
7175
7182
  }
7176
- function functionDeclarationToVertex$1(fromObject) {
7183
+ function intervalToMldev$2(fromObject) {
7177
7184
  const toObject = {};
7178
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7179
- throw new Error('behavior parameter is not supported in Vertex AI.');
7180
- }
7181
- const fromDescription = getValueByPath(fromObject, ['description']);
7182
- if (fromDescription != null) {
7183
- setValueByPath(toObject, ['description'], fromDescription);
7185
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
7186
+ if (fromStartTime != null) {
7187
+ setValueByPath(toObject, ['startTime'], fromStartTime);
7184
7188
  }
7185
- const fromName = getValueByPath(fromObject, ['name']);
7186
- if (fromName != null) {
7187
- setValueByPath(toObject, ['name'], fromName);
7188
- }
7189
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7190
- if (fromParameters != null) {
7191
- setValueByPath(toObject, ['parameters'], fromParameters);
7192
- }
7193
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7194
- 'parametersJsonSchema',
7195
- ]);
7196
- if (fromParametersJsonSchema != null) {
7197
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7198
- }
7199
- const fromResponse = getValueByPath(fromObject, ['response']);
7200
- if (fromResponse != null) {
7201
- setValueByPath(toObject, ['response'], fromResponse);
7202
- }
7203
- const fromResponseJsonSchema = getValueByPath(fromObject, [
7204
- 'responseJsonSchema',
7205
- ]);
7206
- if (fromResponseJsonSchema != null) {
7207
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7208
- }
7209
- return toObject;
7210
- }
7211
- function intervalToMldev$2(fromObject) {
7212
- const toObject = {};
7213
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7214
- if (fromStartTime != null) {
7215
- setValueByPath(toObject, ['startTime'], fromStartTime);
7216
- }
7217
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7218
- if (fromEndTime != null) {
7219
- setValueByPath(toObject, ['endTime'], fromEndTime);
7220
- }
7221
- return toObject;
7222
- }
7223
- function intervalToVertex$1(fromObject) {
7224
- const toObject = {};
7225
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7226
- if (fromStartTime != null) {
7227
- setValueByPath(toObject, ['startTime'], fromStartTime);
7228
- }
7229
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7230
- if (fromEndTime != null) {
7231
- setValueByPath(toObject, ['endTime'], fromEndTime);
7189
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
7190
+ if (fromEndTime != null) {
7191
+ setValueByPath(toObject, ['endTime'], fromEndTime);
7232
7192
  }
7233
7193
  return toObject;
7234
7194
  }
@@ -7242,16 +7202,6 @@ function googleSearchToMldev$2(fromObject) {
7242
7202
  }
7243
7203
  return toObject;
7244
7204
  }
7245
- function googleSearchToVertex$1(fromObject) {
7246
- const toObject = {};
7247
- const fromTimeRangeFilter = getValueByPath(fromObject, [
7248
- 'timeRangeFilter',
7249
- ]);
7250
- if (fromTimeRangeFilter != null) {
7251
- setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7252
- }
7253
- return toObject;
7254
- }
7255
7205
  function dynamicRetrievalConfigToMldev$2(fromObject) {
7256
7206
  const toObject = {};
7257
7207
  const fromMode = getValueByPath(fromObject, ['mode']);
@@ -7266,20 +7216,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
7266
7216
  }
7267
7217
  return toObject;
7268
7218
  }
7269
- function dynamicRetrievalConfigToVertex$1(fromObject) {
7270
- const toObject = {};
7271
- const fromMode = getValueByPath(fromObject, ['mode']);
7272
- if (fromMode != null) {
7273
- setValueByPath(toObject, ['mode'], fromMode);
7274
- }
7275
- const fromDynamicThreshold = getValueByPath(fromObject, [
7276
- 'dynamicThreshold',
7277
- ]);
7278
- if (fromDynamicThreshold != null) {
7279
- setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7280
- }
7281
- return toObject;
7282
- }
7283
7219
  function googleSearchRetrievalToMldev$2(fromObject) {
7284
7220
  const toObject = {};
7285
7221
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
@@ -7290,76 +7226,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
7290
7226
  }
7291
7227
  return toObject;
7292
7228
  }
7293
- function googleSearchRetrievalToVertex$1(fromObject) {
7294
- const toObject = {};
7295
- const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7296
- 'dynamicRetrievalConfig',
7297
- ]);
7298
- if (fromDynamicRetrievalConfig != null) {
7299
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7300
- }
7301
- return toObject;
7302
- }
7303
- function enterpriseWebSearchToVertex$1() {
7304
- const toObject = {};
7305
- return toObject;
7306
- }
7307
- function apiKeyConfigToVertex$1(fromObject) {
7308
- const toObject = {};
7309
- const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7310
- if (fromApiKeyString != null) {
7311
- setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7312
- }
7313
- return toObject;
7314
- }
7315
- function authConfigToVertex$1(fromObject) {
7316
- const toObject = {};
7317
- const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7318
- if (fromApiKeyConfig != null) {
7319
- setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7320
- }
7321
- const fromAuthType = getValueByPath(fromObject, ['authType']);
7322
- if (fromAuthType != null) {
7323
- setValueByPath(toObject, ['authType'], fromAuthType);
7324
- }
7325
- const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7326
- 'googleServiceAccountConfig',
7327
- ]);
7328
- if (fromGoogleServiceAccountConfig != null) {
7329
- setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7330
- }
7331
- const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7332
- 'httpBasicAuthConfig',
7333
- ]);
7334
- if (fromHttpBasicAuthConfig != null) {
7335
- setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7336
- }
7337
- const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7338
- if (fromOauthConfig != null) {
7339
- setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7340
- }
7341
- const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7342
- if (fromOidcConfig != null) {
7343
- setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7344
- }
7345
- return toObject;
7346
- }
7347
- function googleMapsToVertex$1(fromObject) {
7348
- const toObject = {};
7349
- const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7350
- if (fromAuthConfig != null) {
7351
- setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7352
- }
7353
- return toObject;
7354
- }
7355
7229
  function urlContextToMldev$2() {
7356
7230
  const toObject = {};
7357
7231
  return toObject;
7358
7232
  }
7359
- function urlContextToVertex$1() {
7360
- const toObject = {};
7361
- return toObject;
7362
- }
7363
7233
  function toolToMldev$2(fromObject) {
7364
7234
  const toObject = {};
7365
7235
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7409,60 +7279,6 @@ function toolToMldev$2(fromObject) {
7409
7279
  }
7410
7280
  return toObject;
7411
7281
  }
7412
- function toolToVertex$1(fromObject) {
7413
- const toObject = {};
7414
- const fromFunctionDeclarations = getValueByPath(fromObject, [
7415
- 'functionDeclarations',
7416
- ]);
7417
- if (fromFunctionDeclarations != null) {
7418
- let transformedList = fromFunctionDeclarations;
7419
- if (Array.isArray(transformedList)) {
7420
- transformedList = transformedList.map((item) => {
7421
- return functionDeclarationToVertex$1(item);
7422
- });
7423
- }
7424
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
7425
- }
7426
- const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7427
- if (fromRetrieval != null) {
7428
- setValueByPath(toObject, ['retrieval'], fromRetrieval);
7429
- }
7430
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7431
- if (fromGoogleSearch != null) {
7432
- setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7433
- }
7434
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7435
- 'googleSearchRetrieval',
7436
- ]);
7437
- if (fromGoogleSearchRetrieval != null) {
7438
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7439
- }
7440
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7441
- 'enterpriseWebSearch',
7442
- ]);
7443
- if (fromEnterpriseWebSearch != null) {
7444
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
7445
- }
7446
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7447
- if (fromGoogleMaps != null) {
7448
- setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
7449
- }
7450
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7451
- if (fromUrlContext != null) {
7452
- setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
7453
- }
7454
- const fromCodeExecution = getValueByPath(fromObject, [
7455
- 'codeExecution',
7456
- ]);
7457
- if (fromCodeExecution != null) {
7458
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7459
- }
7460
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7461
- if (fromComputerUse != null) {
7462
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7463
- }
7464
- return toObject;
7465
- }
7466
7282
  function sessionResumptionConfigToMldev$1(fromObject) {
7467
7283
  const toObject = {};
7468
7284
  const fromHandle = getValueByPath(fromObject, ['handle']);
@@ -7474,26 +7290,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7474
7290
  }
7475
7291
  return toObject;
7476
7292
  }
7477
- function sessionResumptionConfigToVertex(fromObject) {
7478
- const toObject = {};
7479
- const fromHandle = getValueByPath(fromObject, ['handle']);
7480
- if (fromHandle != null) {
7481
- setValueByPath(toObject, ['handle'], fromHandle);
7482
- }
7483
- const fromTransparent = getValueByPath(fromObject, ['transparent']);
7484
- if (fromTransparent != null) {
7485
- setValueByPath(toObject, ['transparent'], fromTransparent);
7486
- }
7487
- return toObject;
7488
- }
7489
7293
  function audioTranscriptionConfigToMldev$1() {
7490
7294
  const toObject = {};
7491
7295
  return toObject;
7492
7296
  }
7493
- function audioTranscriptionConfigToVertex() {
7494
- const toObject = {};
7495
- return toObject;
7496
- }
7497
7297
  function automaticActivityDetectionToMldev$1(fromObject) {
7498
7298
  const toObject = {};
7499
7299
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
@@ -7526,38 +7326,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
7526
7326
  }
7527
7327
  return toObject;
7528
7328
  }
7529
- function automaticActivityDetectionToVertex(fromObject) {
7530
- const toObject = {};
7531
- const fromDisabled = getValueByPath(fromObject, ['disabled']);
7532
- if (fromDisabled != null) {
7533
- setValueByPath(toObject, ['disabled'], fromDisabled);
7534
- }
7535
- const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
7536
- 'startOfSpeechSensitivity',
7537
- ]);
7538
- if (fromStartOfSpeechSensitivity != null) {
7539
- setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
7540
- }
7541
- const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
7542
- 'endOfSpeechSensitivity',
7543
- ]);
7544
- if (fromEndOfSpeechSensitivity != null) {
7545
- setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
7546
- }
7547
- const fromPrefixPaddingMs = getValueByPath(fromObject, [
7548
- 'prefixPaddingMs',
7549
- ]);
7550
- if (fromPrefixPaddingMs != null) {
7551
- setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
7552
- }
7553
- const fromSilenceDurationMs = getValueByPath(fromObject, [
7554
- 'silenceDurationMs',
7555
- ]);
7556
- if (fromSilenceDurationMs != null) {
7557
- setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
7558
- }
7559
- return toObject;
7560
- }
7561
7329
  function realtimeInputConfigToMldev$1(fromObject) {
7562
7330
  const toObject = {};
7563
7331
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
@@ -7578,26 +7346,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
7578
7346
  }
7579
7347
  return toObject;
7580
7348
  }
7581
- function realtimeInputConfigToVertex(fromObject) {
7582
- const toObject = {};
7583
- const fromAutomaticActivityDetection = getValueByPath(fromObject, [
7584
- 'automaticActivityDetection',
7585
- ]);
7586
- if (fromAutomaticActivityDetection != null) {
7587
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
7588
- }
7589
- const fromActivityHandling = getValueByPath(fromObject, [
7590
- 'activityHandling',
7591
- ]);
7592
- if (fromActivityHandling != null) {
7593
- setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
7594
- }
7595
- const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
7596
- if (fromTurnCoverage != null) {
7597
- setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
7598
- }
7599
- return toObject;
7600
- }
7601
7349
  function slidingWindowToMldev$1(fromObject) {
7602
7350
  const toObject = {};
7603
7351
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
@@ -7606,14 +7354,6 @@ function slidingWindowToMldev$1(fromObject) {
7606
7354
  }
7607
7355
  return toObject;
7608
7356
  }
7609
- function slidingWindowToVertex(fromObject) {
7610
- const toObject = {};
7611
- const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
7612
- if (fromTargetTokens != null) {
7613
- setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
7614
- }
7615
- return toObject;
7616
- }
7617
7357
  function contextWindowCompressionConfigToMldev$1(fromObject) {
7618
7358
  const toObject = {};
7619
7359
  const fromTriggerTokens = getValueByPath(fromObject, [
@@ -7630,22 +7370,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
7630
7370
  }
7631
7371
  return toObject;
7632
7372
  }
7633
- function contextWindowCompressionConfigToVertex(fromObject) {
7634
- const toObject = {};
7635
- const fromTriggerTokens = getValueByPath(fromObject, [
7636
- 'triggerTokens',
7637
- ]);
7638
- if (fromTriggerTokens != null) {
7639
- setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
7640
- }
7641
- const fromSlidingWindow = getValueByPath(fromObject, [
7642
- 'slidingWindow',
7643
- ]);
7644
- if (fromSlidingWindow != null) {
7645
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
7646
- }
7647
- return toObject;
7648
- }
7649
7373
  function proactivityConfigToMldev$1(fromObject) {
7650
7374
  const toObject = {};
7651
7375
  const fromProactiveAudio = getValueByPath(fromObject, [
@@ -7656,16 +7380,6 @@ function proactivityConfigToMldev$1(fromObject) {
7656
7380
  }
7657
7381
  return toObject;
7658
7382
  }
7659
- function proactivityConfigToVertex(fromObject) {
7660
- const toObject = {};
7661
- const fromProactiveAudio = getValueByPath(fromObject, [
7662
- 'proactiveAudio',
7663
- ]);
7664
- if (fromProactiveAudio != null) {
7665
- setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
7666
- }
7667
- return toObject;
7668
- }
7669
7383
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
7670
7384
  const toObject = {};
7671
7385
  const fromGenerationConfig = getValueByPath(fromObject, [
@@ -7770,110 +7484,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
7770
7484
  }
7771
7485
  return toObject;
7772
7486
  }
7773
- function liveConnectConfigToVertex(fromObject, parentObject) {
7774
- const toObject = {};
7775
- const fromGenerationConfig = getValueByPath(fromObject, [
7776
- 'generationConfig',
7777
- ]);
7778
- if (parentObject !== undefined && fromGenerationConfig != null) {
7779
- setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
7780
- }
7781
- const fromResponseModalities = getValueByPath(fromObject, [
7782
- 'responseModalities',
7783
- ]);
7784
- if (parentObject !== undefined && fromResponseModalities != null) {
7785
- setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
7786
- }
7787
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
7788
- if (parentObject !== undefined && fromTemperature != null) {
7789
- setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
7790
- }
7791
- const fromTopP = getValueByPath(fromObject, ['topP']);
7792
- if (parentObject !== undefined && fromTopP != null) {
7793
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
7794
- }
7795
- const fromTopK = getValueByPath(fromObject, ['topK']);
7796
- if (parentObject !== undefined && fromTopK != null) {
7797
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
7798
- }
7799
- const fromMaxOutputTokens = getValueByPath(fromObject, [
7800
- 'maxOutputTokens',
7801
- ]);
7802
- if (parentObject !== undefined && fromMaxOutputTokens != null) {
7803
- setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
7804
- }
7805
- const fromMediaResolution = getValueByPath(fromObject, [
7806
- 'mediaResolution',
7807
- ]);
7808
- if (parentObject !== undefined && fromMediaResolution != null) {
7809
- setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
7810
- }
7811
- const fromSeed = getValueByPath(fromObject, ['seed']);
7812
- if (parentObject !== undefined && fromSeed != null) {
7813
- setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
7814
- }
7815
- const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7816
- if (parentObject !== undefined && fromSpeechConfig != null) {
7817
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
7818
- }
7819
- const fromEnableAffectiveDialog = getValueByPath(fromObject, [
7820
- 'enableAffectiveDialog',
7821
- ]);
7822
- if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
7823
- setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
7824
- }
7825
- const fromSystemInstruction = getValueByPath(fromObject, [
7826
- 'systemInstruction',
7827
- ]);
7828
- if (parentObject !== undefined && fromSystemInstruction != null) {
7829
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
7830
- }
7831
- const fromTools = getValueByPath(fromObject, ['tools']);
7832
- if (parentObject !== undefined && fromTools != null) {
7833
- let transformedList = tTools(fromTools);
7834
- if (Array.isArray(transformedList)) {
7835
- transformedList = transformedList.map((item) => {
7836
- return toolToVertex$1(tTool(item));
7837
- });
7838
- }
7839
- setValueByPath(parentObject, ['setup', 'tools'], transformedList);
7840
- }
7841
- const fromSessionResumption = getValueByPath(fromObject, [
7842
- 'sessionResumption',
7843
- ]);
7844
- if (parentObject !== undefined && fromSessionResumption != null) {
7845
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
7846
- }
7847
- const fromInputAudioTranscription = getValueByPath(fromObject, [
7848
- 'inputAudioTranscription',
7849
- ]);
7850
- if (parentObject !== undefined && fromInputAudioTranscription != null) {
7851
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
7852
- }
7853
- const fromOutputAudioTranscription = getValueByPath(fromObject, [
7854
- 'outputAudioTranscription',
7855
- ]);
7856
- if (parentObject !== undefined && fromOutputAudioTranscription != null) {
7857
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
7858
- }
7859
- const fromRealtimeInputConfig = getValueByPath(fromObject, [
7860
- 'realtimeInputConfig',
7861
- ]);
7862
- if (parentObject !== undefined && fromRealtimeInputConfig != null) {
7863
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
7864
- }
7865
- const fromContextWindowCompression = getValueByPath(fromObject, [
7866
- 'contextWindowCompression',
7867
- ]);
7868
- if (parentObject !== undefined && fromContextWindowCompression != null) {
7869
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
7870
- }
7871
- const fromProactivity = getValueByPath(fromObject, ['proactivity']);
7872
- if (parentObject !== undefined && fromProactivity != null) {
7873
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
7874
- }
7875
- return toObject;
7876
- }
7877
7487
  function liveConnectParametersToMldev(apiClient, fromObject) {
7878
7488
  const toObject = {};
7879
7489
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -7886,34 +7496,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
7886
7496
  }
7887
7497
  return toObject;
7888
7498
  }
7889
- function liveConnectParametersToVertex(apiClient, fromObject) {
7890
- const toObject = {};
7891
- const fromModel = getValueByPath(fromObject, ['model']);
7892
- if (fromModel != null) {
7893
- setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
7894
- }
7895
- const fromConfig = getValueByPath(fromObject, ['config']);
7896
- if (fromConfig != null) {
7897
- setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
7898
- }
7899
- return toObject;
7900
- }
7901
7499
  function activityStartToMldev() {
7902
7500
  const toObject = {};
7903
7501
  return toObject;
7904
7502
  }
7905
- function activityStartToVertex() {
7906
- const toObject = {};
7907
- return toObject;
7908
- }
7909
7503
  function activityEndToMldev() {
7910
7504
  const toObject = {};
7911
7505
  return toObject;
7912
7506
  }
7913
- function activityEndToVertex() {
7914
- const toObject = {};
7915
- return toObject;
7916
- }
7917
7507
  function liveSendRealtimeInputParametersToMldev(fromObject) {
7918
7508
  const toObject = {};
7919
7509
  const fromMedia = getValueByPath(fromObject, ['media']);
@@ -7950,43 +7540,1165 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
7950
7540
  }
7951
7541
  return toObject;
7952
7542
  }
7953
- function liveSendRealtimeInputParametersToVertex(fromObject) {
7543
+ function weightedPromptToMldev(fromObject) {
7954
7544
  const toObject = {};
7955
- const fromMedia = getValueByPath(fromObject, ['media']);
7956
- if (fromMedia != null) {
7957
- setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
7545
+ const fromText = getValueByPath(fromObject, ['text']);
7546
+ if (fromText != null) {
7547
+ setValueByPath(toObject, ['text'], fromText);
7958
7548
  }
7959
- const fromAudio = getValueByPath(fromObject, ['audio']);
7960
- if (fromAudio != null) {
7961
- setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
7549
+ const fromWeight = getValueByPath(fromObject, ['weight']);
7550
+ if (fromWeight != null) {
7551
+ setValueByPath(toObject, ['weight'], fromWeight);
7552
+ }
7553
+ return toObject;
7554
+ }
7555
+ function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
7556
+ const toObject = {};
7557
+ const fromWeightedPrompts = getValueByPath(fromObject, [
7558
+ 'weightedPrompts',
7559
+ ]);
7560
+ if (fromWeightedPrompts != null) {
7561
+ let transformedList = fromWeightedPrompts;
7562
+ if (Array.isArray(transformedList)) {
7563
+ transformedList = transformedList.map((item) => {
7564
+ return weightedPromptToMldev(item);
7565
+ });
7566
+ }
7567
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
7568
+ }
7569
+ return toObject;
7570
+ }
7571
+ function liveMusicGenerationConfigToMldev(fromObject) {
7572
+ const toObject = {};
7573
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
7574
+ if (fromTemperature != null) {
7575
+ setValueByPath(toObject, ['temperature'], fromTemperature);
7576
+ }
7577
+ const fromTopK = getValueByPath(fromObject, ['topK']);
7578
+ if (fromTopK != null) {
7579
+ setValueByPath(toObject, ['topK'], fromTopK);
7580
+ }
7581
+ const fromSeed = getValueByPath(fromObject, ['seed']);
7582
+ if (fromSeed != null) {
7583
+ setValueByPath(toObject, ['seed'], fromSeed);
7584
+ }
7585
+ const fromGuidance = getValueByPath(fromObject, ['guidance']);
7586
+ if (fromGuidance != null) {
7587
+ setValueByPath(toObject, ['guidance'], fromGuidance);
7588
+ }
7589
+ const fromBpm = getValueByPath(fromObject, ['bpm']);
7590
+ if (fromBpm != null) {
7591
+ setValueByPath(toObject, ['bpm'], fromBpm);
7592
+ }
7593
+ const fromDensity = getValueByPath(fromObject, ['density']);
7594
+ if (fromDensity != null) {
7595
+ setValueByPath(toObject, ['density'], fromDensity);
7596
+ }
7597
+ const fromBrightness = getValueByPath(fromObject, ['brightness']);
7598
+ if (fromBrightness != null) {
7599
+ setValueByPath(toObject, ['brightness'], fromBrightness);
7600
+ }
7601
+ const fromScale = getValueByPath(fromObject, ['scale']);
7602
+ if (fromScale != null) {
7603
+ setValueByPath(toObject, ['scale'], fromScale);
7604
+ }
7605
+ const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
7606
+ if (fromMuteBass != null) {
7607
+ setValueByPath(toObject, ['muteBass'], fromMuteBass);
7608
+ }
7609
+ const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
7610
+ if (fromMuteDrums != null) {
7611
+ setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
7612
+ }
7613
+ const fromOnlyBassAndDrums = getValueByPath(fromObject, [
7614
+ 'onlyBassAndDrums',
7615
+ ]);
7616
+ if (fromOnlyBassAndDrums != null) {
7617
+ setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
7618
+ }
7619
+ return toObject;
7620
+ }
7621
+ function liveMusicSetConfigParametersToMldev(fromObject) {
7622
+ const toObject = {};
7623
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
7624
+ 'musicGenerationConfig',
7625
+ ]);
7626
+ if (fromMusicGenerationConfig != null) {
7627
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
7628
+ }
7629
+ return toObject;
7630
+ }
7631
+ function liveMusicClientSetupToMldev(fromObject) {
7632
+ const toObject = {};
7633
+ const fromModel = getValueByPath(fromObject, ['model']);
7634
+ if (fromModel != null) {
7635
+ setValueByPath(toObject, ['model'], fromModel);
7636
+ }
7637
+ return toObject;
7638
+ }
7639
+ function liveMusicClientContentToMldev(fromObject) {
7640
+ const toObject = {};
7641
+ const fromWeightedPrompts = getValueByPath(fromObject, [
7642
+ 'weightedPrompts',
7643
+ ]);
7644
+ if (fromWeightedPrompts != null) {
7645
+ let transformedList = fromWeightedPrompts;
7646
+ if (Array.isArray(transformedList)) {
7647
+ transformedList = transformedList.map((item) => {
7648
+ return weightedPromptToMldev(item);
7649
+ });
7650
+ }
7651
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
7652
+ }
7653
+ return toObject;
7654
+ }
7655
+ function liveMusicClientMessageToMldev(fromObject) {
7656
+ const toObject = {};
7657
+ const fromSetup = getValueByPath(fromObject, ['setup']);
7658
+ if (fromSetup != null) {
7659
+ setValueByPath(toObject, ['setup'], liveMusicClientSetupToMldev(fromSetup));
7660
+ }
7661
+ const fromClientContent = getValueByPath(fromObject, [
7662
+ 'clientContent',
7663
+ ]);
7664
+ if (fromClientContent != null) {
7665
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentToMldev(fromClientContent));
7666
+ }
7667
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
7668
+ 'musicGenerationConfig',
7669
+ ]);
7670
+ if (fromMusicGenerationConfig != null) {
7671
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
7672
+ }
7673
+ const fromPlaybackControl = getValueByPath(fromObject, [
7674
+ 'playbackControl',
7675
+ ]);
7676
+ if (fromPlaybackControl != null) {
7677
+ setValueByPath(toObject, ['playbackControl'], fromPlaybackControl);
7678
+ }
7679
+ return toObject;
7680
+ }
7681
+ function prebuiltVoiceConfigToVertex$1(fromObject) {
7682
+ const toObject = {};
7683
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
7684
+ if (fromVoiceName != null) {
7685
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
7686
+ }
7687
+ return toObject;
7688
+ }
7689
+ function voiceConfigToVertex$1(fromObject) {
7690
+ const toObject = {};
7691
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
7692
+ 'prebuiltVoiceConfig',
7693
+ ]);
7694
+ if (fromPrebuiltVoiceConfig != null) {
7695
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
7696
+ }
7697
+ return toObject;
7698
+ }
7699
+ function speechConfigToVertex$1(fromObject) {
7700
+ const toObject = {};
7701
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7702
+ if (fromVoiceConfig != null) {
7703
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
7704
+ }
7705
+ if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7706
+ throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7707
+ }
7708
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7709
+ if (fromLanguageCode != null) {
7710
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7711
+ }
7712
+ return toObject;
7713
+ }
7714
+ function videoMetadataToVertex$1(fromObject) {
7715
+ const toObject = {};
7716
+ const fromFps = getValueByPath(fromObject, ['fps']);
7717
+ if (fromFps != null) {
7718
+ setValueByPath(toObject, ['fps'], fromFps);
7719
+ }
7720
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
7721
+ if (fromEndOffset != null) {
7722
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
7723
+ }
7724
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
7725
+ if (fromStartOffset != null) {
7726
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
7727
+ }
7728
+ return toObject;
7729
+ }
7730
+ function blobToVertex$1(fromObject) {
7731
+ const toObject = {};
7732
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7733
+ if (fromDisplayName != null) {
7734
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
7735
+ }
7736
+ const fromData = getValueByPath(fromObject, ['data']);
7737
+ if (fromData != null) {
7738
+ setValueByPath(toObject, ['data'], fromData);
7739
+ }
7740
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7741
+ if (fromMimeType != null) {
7742
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
7743
+ }
7744
+ return toObject;
7745
+ }
7746
+ function fileDataToVertex$1(fromObject) {
7747
+ const toObject = {};
7748
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7749
+ if (fromDisplayName != null) {
7750
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
7751
+ }
7752
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7753
+ if (fromFileUri != null) {
7754
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
7755
+ }
7756
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7757
+ if (fromMimeType != null) {
7758
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
7759
+ }
7760
+ return toObject;
7761
+ }
7762
+ function partToVertex$1(fromObject) {
7763
+ const toObject = {};
7764
+ const fromVideoMetadata = getValueByPath(fromObject, [
7765
+ 'videoMetadata',
7766
+ ]);
7767
+ if (fromVideoMetadata != null) {
7768
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7769
+ }
7770
+ const fromThought = getValueByPath(fromObject, ['thought']);
7771
+ if (fromThought != null) {
7772
+ setValueByPath(toObject, ['thought'], fromThought);
7773
+ }
7774
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7775
+ if (fromInlineData != null) {
7776
+ setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7777
+ }
7778
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
7779
+ if (fromFileData != null) {
7780
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7781
+ }
7782
+ const fromThoughtSignature = getValueByPath(fromObject, [
7783
+ 'thoughtSignature',
7784
+ ]);
7785
+ if (fromThoughtSignature != null) {
7786
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7787
+ }
7788
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
7789
+ 'codeExecutionResult',
7790
+ ]);
7791
+ if (fromCodeExecutionResult != null) {
7792
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7793
+ }
7794
+ const fromExecutableCode = getValueByPath(fromObject, [
7795
+ 'executableCode',
7796
+ ]);
7797
+ if (fromExecutableCode != null) {
7798
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7799
+ }
7800
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7801
+ if (fromFunctionCall != null) {
7802
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7803
+ }
7804
+ const fromFunctionResponse = getValueByPath(fromObject, [
7805
+ 'functionResponse',
7806
+ ]);
7807
+ if (fromFunctionResponse != null) {
7808
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7809
+ }
7810
+ const fromText = getValueByPath(fromObject, ['text']);
7811
+ if (fromText != null) {
7812
+ setValueByPath(toObject, ['text'], fromText);
7813
+ }
7814
+ return toObject;
7815
+ }
7816
+ function contentToVertex$1(fromObject) {
7817
+ const toObject = {};
7818
+ const fromParts = getValueByPath(fromObject, ['parts']);
7819
+ if (fromParts != null) {
7820
+ let transformedList = fromParts;
7821
+ if (Array.isArray(transformedList)) {
7822
+ transformedList = transformedList.map((item) => {
7823
+ return partToVertex$1(item);
7824
+ });
7825
+ }
7826
+ setValueByPath(toObject, ['parts'], transformedList);
7827
+ }
7828
+ const fromRole = getValueByPath(fromObject, ['role']);
7829
+ if (fromRole != null) {
7830
+ setValueByPath(toObject, ['role'], fromRole);
7831
+ }
7832
+ return toObject;
7833
+ }
7834
+ function functionDeclarationToVertex$1(fromObject) {
7835
+ const toObject = {};
7836
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7837
+ throw new Error('behavior parameter is not supported in Vertex AI.');
7838
+ }
7839
+ const fromDescription = getValueByPath(fromObject, ['description']);
7840
+ if (fromDescription != null) {
7841
+ setValueByPath(toObject, ['description'], fromDescription);
7842
+ }
7843
+ const fromName = getValueByPath(fromObject, ['name']);
7844
+ if (fromName != null) {
7845
+ setValueByPath(toObject, ['name'], fromName);
7846
+ }
7847
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
7848
+ if (fromParameters != null) {
7849
+ setValueByPath(toObject, ['parameters'], fromParameters);
7850
+ }
7851
+ const fromParametersJsonSchema = getValueByPath(fromObject, [
7852
+ 'parametersJsonSchema',
7853
+ ]);
7854
+ if (fromParametersJsonSchema != null) {
7855
+ setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7856
+ }
7857
+ const fromResponse = getValueByPath(fromObject, ['response']);
7858
+ if (fromResponse != null) {
7859
+ setValueByPath(toObject, ['response'], fromResponse);
7860
+ }
7861
+ const fromResponseJsonSchema = getValueByPath(fromObject, [
7862
+ 'responseJsonSchema',
7863
+ ]);
7864
+ if (fromResponseJsonSchema != null) {
7865
+ setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7866
+ }
7867
+ return toObject;
7868
+ }
7869
+ function intervalToVertex$1(fromObject) {
7870
+ const toObject = {};
7871
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
7872
+ if (fromStartTime != null) {
7873
+ setValueByPath(toObject, ['startTime'], fromStartTime);
7874
+ }
7875
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
7876
+ if (fromEndTime != null) {
7877
+ setValueByPath(toObject, ['endTime'], fromEndTime);
7878
+ }
7879
+ return toObject;
7880
+ }
7881
+ function googleSearchToVertex$1(fromObject) {
7882
+ const toObject = {};
7883
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
7884
+ 'timeRangeFilter',
7885
+ ]);
7886
+ if (fromTimeRangeFilter != null) {
7887
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7888
+ }
7889
+ return toObject;
7890
+ }
7891
+ function dynamicRetrievalConfigToVertex$1(fromObject) {
7892
+ const toObject = {};
7893
+ const fromMode = getValueByPath(fromObject, ['mode']);
7894
+ if (fromMode != null) {
7895
+ setValueByPath(toObject, ['mode'], fromMode);
7896
+ }
7897
+ const fromDynamicThreshold = getValueByPath(fromObject, [
7898
+ 'dynamicThreshold',
7899
+ ]);
7900
+ if (fromDynamicThreshold != null) {
7901
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7902
+ }
7903
+ return toObject;
7904
+ }
7905
+ function googleSearchRetrievalToVertex$1(fromObject) {
7906
+ const toObject = {};
7907
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7908
+ 'dynamicRetrievalConfig',
7909
+ ]);
7910
+ if (fromDynamicRetrievalConfig != null) {
7911
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7912
+ }
7913
+ return toObject;
7914
+ }
7915
+ function enterpriseWebSearchToVertex$1() {
7916
+ const toObject = {};
7917
+ return toObject;
7918
+ }
7919
+ function apiKeyConfigToVertex$1(fromObject) {
7920
+ const toObject = {};
7921
+ const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7922
+ if (fromApiKeyString != null) {
7923
+ setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7924
+ }
7925
+ return toObject;
7926
+ }
7927
+ function authConfigToVertex$1(fromObject) {
7928
+ const toObject = {};
7929
+ const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7930
+ if (fromApiKeyConfig != null) {
7931
+ setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7932
+ }
7933
+ const fromAuthType = getValueByPath(fromObject, ['authType']);
7934
+ if (fromAuthType != null) {
7935
+ setValueByPath(toObject, ['authType'], fromAuthType);
7936
+ }
7937
+ const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7938
+ 'googleServiceAccountConfig',
7939
+ ]);
7940
+ if (fromGoogleServiceAccountConfig != null) {
7941
+ setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7942
+ }
7943
+ const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7944
+ 'httpBasicAuthConfig',
7945
+ ]);
7946
+ if (fromHttpBasicAuthConfig != null) {
7947
+ setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7948
+ }
7949
+ const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7950
+ if (fromOauthConfig != null) {
7951
+ setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7952
+ }
7953
+ const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7954
+ if (fromOidcConfig != null) {
7955
+ setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7956
+ }
7957
+ return toObject;
7958
+ }
7959
+ function googleMapsToVertex$1(fromObject) {
7960
+ const toObject = {};
7961
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7962
+ if (fromAuthConfig != null) {
7963
+ setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7964
+ }
7965
+ return toObject;
7966
+ }
7967
+ function urlContextToVertex$1() {
7968
+ const toObject = {};
7969
+ return toObject;
7970
+ }
7971
+ function toolToVertex$1(fromObject) {
7972
+ const toObject = {};
7973
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
7974
+ 'functionDeclarations',
7975
+ ]);
7976
+ if (fromFunctionDeclarations != null) {
7977
+ let transformedList = fromFunctionDeclarations;
7978
+ if (Array.isArray(transformedList)) {
7979
+ transformedList = transformedList.map((item) => {
7980
+ return functionDeclarationToVertex$1(item);
7981
+ });
7982
+ }
7983
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
7984
+ }
7985
+ const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7986
+ if (fromRetrieval != null) {
7987
+ setValueByPath(toObject, ['retrieval'], fromRetrieval);
7988
+ }
7989
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7990
+ if (fromGoogleSearch != null) {
7991
+ setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7992
+ }
7993
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7994
+ 'googleSearchRetrieval',
7995
+ ]);
7996
+ if (fromGoogleSearchRetrieval != null) {
7997
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7998
+ }
7999
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
8000
+ 'enterpriseWebSearch',
8001
+ ]);
8002
+ if (fromEnterpriseWebSearch != null) {
8003
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8004
+ }
8005
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8006
+ if (fromGoogleMaps != null) {
8007
+ setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
8008
+ }
8009
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8010
+ if (fromUrlContext != null) {
8011
+ setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8012
+ }
8013
+ const fromCodeExecution = getValueByPath(fromObject, [
8014
+ 'codeExecution',
8015
+ ]);
8016
+ if (fromCodeExecution != null) {
8017
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8018
+ }
8019
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8020
+ if (fromComputerUse != null) {
8021
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8022
+ }
8023
+ return toObject;
8024
+ }
8025
+ function sessionResumptionConfigToVertex(fromObject) {
8026
+ const toObject = {};
8027
+ const fromHandle = getValueByPath(fromObject, ['handle']);
8028
+ if (fromHandle != null) {
8029
+ setValueByPath(toObject, ['handle'], fromHandle);
8030
+ }
8031
+ const fromTransparent = getValueByPath(fromObject, ['transparent']);
8032
+ if (fromTransparent != null) {
8033
+ setValueByPath(toObject, ['transparent'], fromTransparent);
8034
+ }
8035
+ return toObject;
8036
+ }
8037
+ function audioTranscriptionConfigToVertex() {
8038
+ const toObject = {};
8039
+ return toObject;
8040
+ }
8041
+ function automaticActivityDetectionToVertex(fromObject) {
8042
+ const toObject = {};
8043
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
8044
+ if (fromDisabled != null) {
8045
+ setValueByPath(toObject, ['disabled'], fromDisabled);
8046
+ }
8047
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
8048
+ 'startOfSpeechSensitivity',
8049
+ ]);
8050
+ if (fromStartOfSpeechSensitivity != null) {
8051
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
8052
+ }
8053
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
8054
+ 'endOfSpeechSensitivity',
8055
+ ]);
8056
+ if (fromEndOfSpeechSensitivity != null) {
8057
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
8058
+ }
8059
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
8060
+ 'prefixPaddingMs',
8061
+ ]);
8062
+ if (fromPrefixPaddingMs != null) {
8063
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
8064
+ }
8065
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
8066
+ 'silenceDurationMs',
8067
+ ]);
8068
+ if (fromSilenceDurationMs != null) {
8069
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
8070
+ }
8071
+ return toObject;
8072
+ }
8073
+ function realtimeInputConfigToVertex(fromObject) {
8074
+ const toObject = {};
8075
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
8076
+ 'automaticActivityDetection',
8077
+ ]);
8078
+ if (fromAutomaticActivityDetection != null) {
8079
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
8080
+ }
8081
+ const fromActivityHandling = getValueByPath(fromObject, [
8082
+ 'activityHandling',
8083
+ ]);
8084
+ if (fromActivityHandling != null) {
8085
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
8086
+ }
8087
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
8088
+ if (fromTurnCoverage != null) {
8089
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
8090
+ }
8091
+ return toObject;
8092
+ }
8093
+ function slidingWindowToVertex(fromObject) {
8094
+ const toObject = {};
8095
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
8096
+ if (fromTargetTokens != null) {
8097
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
8098
+ }
8099
+ return toObject;
8100
+ }
8101
+ function contextWindowCompressionConfigToVertex(fromObject) {
8102
+ const toObject = {};
8103
+ const fromTriggerTokens = getValueByPath(fromObject, [
8104
+ 'triggerTokens',
8105
+ ]);
8106
+ if (fromTriggerTokens != null) {
8107
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
8108
+ }
8109
+ const fromSlidingWindow = getValueByPath(fromObject, [
8110
+ 'slidingWindow',
8111
+ ]);
8112
+ if (fromSlidingWindow != null) {
8113
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8114
+ }
8115
+ return toObject;
8116
+ }
8117
+ function proactivityConfigToVertex(fromObject) {
8118
+ const toObject = {};
8119
+ const fromProactiveAudio = getValueByPath(fromObject, [
8120
+ 'proactiveAudio',
8121
+ ]);
8122
+ if (fromProactiveAudio != null) {
8123
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8124
+ }
8125
+ return toObject;
8126
+ }
8127
+ function liveConnectConfigToVertex(fromObject, parentObject) {
8128
+ const toObject = {};
8129
+ const fromGenerationConfig = getValueByPath(fromObject, [
8130
+ 'generationConfig',
8131
+ ]);
8132
+ if (parentObject !== undefined && fromGenerationConfig != null) {
8133
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8134
+ }
8135
+ const fromResponseModalities = getValueByPath(fromObject, [
8136
+ 'responseModalities',
8137
+ ]);
8138
+ if (parentObject !== undefined && fromResponseModalities != null) {
8139
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8140
+ }
8141
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8142
+ if (parentObject !== undefined && fromTemperature != null) {
8143
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8144
+ }
8145
+ const fromTopP = getValueByPath(fromObject, ['topP']);
8146
+ if (parentObject !== undefined && fromTopP != null) {
8147
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8148
+ }
8149
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8150
+ if (parentObject !== undefined && fromTopK != null) {
8151
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8152
+ }
8153
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
8154
+ 'maxOutputTokens',
8155
+ ]);
8156
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
8157
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8158
+ }
8159
+ const fromMediaResolution = getValueByPath(fromObject, [
8160
+ 'mediaResolution',
8161
+ ]);
8162
+ if (parentObject !== undefined && fromMediaResolution != null) {
8163
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8164
+ }
8165
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8166
+ if (parentObject !== undefined && fromSeed != null) {
8167
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8168
+ }
8169
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8170
+ if (parentObject !== undefined && fromSpeechConfig != null) {
8171
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8172
+ }
8173
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8174
+ 'enableAffectiveDialog',
8175
+ ]);
8176
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8177
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8178
+ }
8179
+ const fromSystemInstruction = getValueByPath(fromObject, [
8180
+ 'systemInstruction',
8181
+ ]);
8182
+ if (parentObject !== undefined && fromSystemInstruction != null) {
8183
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8184
+ }
8185
+ const fromTools = getValueByPath(fromObject, ['tools']);
8186
+ if (parentObject !== undefined && fromTools != null) {
8187
+ let transformedList = tTools(fromTools);
8188
+ if (Array.isArray(transformedList)) {
8189
+ transformedList = transformedList.map((item) => {
8190
+ return toolToVertex$1(tTool(item));
8191
+ });
8192
+ }
8193
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8194
+ }
8195
+ const fromSessionResumption = getValueByPath(fromObject, [
8196
+ 'sessionResumption',
8197
+ ]);
8198
+ if (parentObject !== undefined && fromSessionResumption != null) {
8199
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8200
+ }
8201
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
8202
+ 'inputAudioTranscription',
8203
+ ]);
8204
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
8205
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8206
+ }
8207
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
8208
+ 'outputAudioTranscription',
8209
+ ]);
8210
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8211
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8212
+ }
8213
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
8214
+ 'realtimeInputConfig',
8215
+ ]);
8216
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8217
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8218
+ }
8219
+ const fromContextWindowCompression = getValueByPath(fromObject, [
8220
+ 'contextWindowCompression',
8221
+ ]);
8222
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
8223
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8224
+ }
8225
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8226
+ if (parentObject !== undefined && fromProactivity != null) {
8227
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8228
+ }
8229
+ return toObject;
8230
+ }
8231
+ function liveConnectParametersToVertex(apiClient, fromObject) {
8232
+ const toObject = {};
8233
+ const fromModel = getValueByPath(fromObject, ['model']);
8234
+ if (fromModel != null) {
8235
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8236
+ }
8237
+ const fromConfig = getValueByPath(fromObject, ['config']);
8238
+ if (fromConfig != null) {
8239
+ setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8240
+ }
8241
+ return toObject;
8242
+ }
8243
+ function activityStartToVertex() {
8244
+ const toObject = {};
8245
+ return toObject;
8246
+ }
8247
+ function activityEndToVertex() {
8248
+ const toObject = {};
8249
+ return toObject;
8250
+ }
8251
+ function liveSendRealtimeInputParametersToVertex(fromObject) {
8252
+ const toObject = {};
8253
+ const fromMedia = getValueByPath(fromObject, ['media']);
8254
+ if (fromMedia != null) {
8255
+ setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8256
+ }
8257
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8258
+ if (fromAudio != null) {
8259
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8260
+ }
8261
+ const fromAudioStreamEnd = getValueByPath(fromObject, [
8262
+ 'audioStreamEnd',
8263
+ ]);
8264
+ if (fromAudioStreamEnd != null) {
8265
+ setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8266
+ }
8267
+ const fromVideo = getValueByPath(fromObject, ['video']);
8268
+ if (fromVideo != null) {
8269
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8270
+ }
8271
+ const fromText = getValueByPath(fromObject, ['text']);
8272
+ if (fromText != null) {
8273
+ setValueByPath(toObject, ['text'], fromText);
8274
+ }
8275
+ const fromActivityStart = getValueByPath(fromObject, [
8276
+ 'activityStart',
8277
+ ]);
8278
+ if (fromActivityStart != null) {
8279
+ setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8280
+ }
8281
+ const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8282
+ if (fromActivityEnd != null) {
8283
+ setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8284
+ }
8285
+ return toObject;
8286
+ }
8287
+ function liveServerSetupCompleteFromMldev() {
8288
+ const toObject = {};
8289
+ return toObject;
8290
+ }
8291
+ function videoMetadataFromMldev$1(fromObject) {
8292
+ const toObject = {};
8293
+ const fromFps = getValueByPath(fromObject, ['fps']);
8294
+ if (fromFps != null) {
8295
+ setValueByPath(toObject, ['fps'], fromFps);
8296
+ }
8297
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8298
+ if (fromEndOffset != null) {
8299
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8300
+ }
8301
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8302
+ if (fromStartOffset != null) {
8303
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8304
+ }
8305
+ return toObject;
8306
+ }
8307
+ function blobFromMldev$1(fromObject) {
8308
+ const toObject = {};
8309
+ const fromData = getValueByPath(fromObject, ['data']);
8310
+ if (fromData != null) {
8311
+ setValueByPath(toObject, ['data'], fromData);
8312
+ }
8313
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8314
+ if (fromMimeType != null) {
8315
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8316
+ }
8317
+ return toObject;
8318
+ }
8319
+ function fileDataFromMldev$1(fromObject) {
8320
+ const toObject = {};
8321
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8322
+ if (fromFileUri != null) {
8323
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8324
+ }
8325
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8326
+ if (fromMimeType != null) {
8327
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8328
+ }
8329
+ return toObject;
8330
+ }
8331
+ function partFromMldev$1(fromObject) {
8332
+ const toObject = {};
8333
+ const fromVideoMetadata = getValueByPath(fromObject, [
8334
+ 'videoMetadata',
8335
+ ]);
8336
+ if (fromVideoMetadata != null) {
8337
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8338
+ }
8339
+ const fromThought = getValueByPath(fromObject, ['thought']);
8340
+ if (fromThought != null) {
8341
+ setValueByPath(toObject, ['thought'], fromThought);
8342
+ }
8343
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8344
+ if (fromInlineData != null) {
8345
+ setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8346
+ }
8347
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8348
+ if (fromFileData != null) {
8349
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8350
+ }
8351
+ const fromThoughtSignature = getValueByPath(fromObject, [
8352
+ 'thoughtSignature',
8353
+ ]);
8354
+ if (fromThoughtSignature != null) {
8355
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8356
+ }
8357
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8358
+ 'codeExecutionResult',
8359
+ ]);
8360
+ if (fromCodeExecutionResult != null) {
8361
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8362
+ }
8363
+ const fromExecutableCode = getValueByPath(fromObject, [
8364
+ 'executableCode',
8365
+ ]);
8366
+ if (fromExecutableCode != null) {
8367
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8368
+ }
8369
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8370
+ if (fromFunctionCall != null) {
8371
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8372
+ }
8373
+ const fromFunctionResponse = getValueByPath(fromObject, [
8374
+ 'functionResponse',
8375
+ ]);
8376
+ if (fromFunctionResponse != null) {
8377
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8378
+ }
8379
+ const fromText = getValueByPath(fromObject, ['text']);
8380
+ if (fromText != null) {
8381
+ setValueByPath(toObject, ['text'], fromText);
8382
+ }
8383
+ return toObject;
8384
+ }
8385
+ function contentFromMldev$1(fromObject) {
8386
+ const toObject = {};
8387
+ const fromParts = getValueByPath(fromObject, ['parts']);
8388
+ if (fromParts != null) {
8389
+ let transformedList = fromParts;
8390
+ if (Array.isArray(transformedList)) {
8391
+ transformedList = transformedList.map((item) => {
8392
+ return partFromMldev$1(item);
8393
+ });
8394
+ }
8395
+ setValueByPath(toObject, ['parts'], transformedList);
8396
+ }
8397
+ const fromRole = getValueByPath(fromObject, ['role']);
8398
+ if (fromRole != null) {
8399
+ setValueByPath(toObject, ['role'], fromRole);
8400
+ }
8401
+ return toObject;
8402
+ }
8403
+ function transcriptionFromMldev(fromObject) {
8404
+ const toObject = {};
8405
+ const fromText = getValueByPath(fromObject, ['text']);
8406
+ if (fromText != null) {
8407
+ setValueByPath(toObject, ['text'], fromText);
8408
+ }
8409
+ const fromFinished = getValueByPath(fromObject, ['finished']);
8410
+ if (fromFinished != null) {
8411
+ setValueByPath(toObject, ['finished'], fromFinished);
8412
+ }
8413
+ return toObject;
8414
+ }
8415
+ function urlMetadataFromMldev$1(fromObject) {
8416
+ const toObject = {};
8417
+ const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8418
+ if (fromRetrievedUrl != null) {
8419
+ setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8420
+ }
8421
+ const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8422
+ 'urlRetrievalStatus',
8423
+ ]);
8424
+ if (fromUrlRetrievalStatus != null) {
8425
+ setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8426
+ }
8427
+ return toObject;
8428
+ }
8429
+ function urlContextMetadataFromMldev$1(fromObject) {
8430
+ const toObject = {};
8431
+ const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8432
+ if (fromUrlMetadata != null) {
8433
+ let transformedList = fromUrlMetadata;
8434
+ if (Array.isArray(transformedList)) {
8435
+ transformedList = transformedList.map((item) => {
8436
+ return urlMetadataFromMldev$1(item);
8437
+ });
8438
+ }
8439
+ setValueByPath(toObject, ['urlMetadata'], transformedList);
8440
+ }
8441
+ return toObject;
8442
+ }
8443
+ function liveServerContentFromMldev(fromObject) {
8444
+ const toObject = {};
8445
+ const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8446
+ if (fromModelTurn != null) {
8447
+ setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8448
+ }
8449
+ const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8450
+ if (fromTurnComplete != null) {
8451
+ setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8452
+ }
8453
+ const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8454
+ if (fromInterrupted != null) {
8455
+ setValueByPath(toObject, ['interrupted'], fromInterrupted);
8456
+ }
8457
+ const fromGroundingMetadata = getValueByPath(fromObject, [
8458
+ 'groundingMetadata',
8459
+ ]);
8460
+ if (fromGroundingMetadata != null) {
8461
+ setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8462
+ }
8463
+ const fromGenerationComplete = getValueByPath(fromObject, [
8464
+ 'generationComplete',
8465
+ ]);
8466
+ if (fromGenerationComplete != null) {
8467
+ setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8468
+ }
8469
+ const fromInputTranscription = getValueByPath(fromObject, [
8470
+ 'inputTranscription',
8471
+ ]);
8472
+ if (fromInputTranscription != null) {
8473
+ setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8474
+ }
8475
+ const fromOutputTranscription = getValueByPath(fromObject, [
8476
+ 'outputTranscription',
8477
+ ]);
8478
+ if (fromOutputTranscription != null) {
8479
+ setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8480
+ }
8481
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
8482
+ 'urlContextMetadata',
8483
+ ]);
8484
+ if (fromUrlContextMetadata != null) {
8485
+ setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8486
+ }
8487
+ return toObject;
8488
+ }
8489
+ function functionCallFromMldev(fromObject) {
8490
+ const toObject = {};
8491
+ const fromId = getValueByPath(fromObject, ['id']);
8492
+ if (fromId != null) {
8493
+ setValueByPath(toObject, ['id'], fromId);
8494
+ }
8495
+ const fromArgs = getValueByPath(fromObject, ['args']);
8496
+ if (fromArgs != null) {
8497
+ setValueByPath(toObject, ['args'], fromArgs);
8498
+ }
8499
+ const fromName = getValueByPath(fromObject, ['name']);
8500
+ if (fromName != null) {
8501
+ setValueByPath(toObject, ['name'], fromName);
8502
+ }
8503
+ return toObject;
8504
+ }
8505
+ function liveServerToolCallFromMldev(fromObject) {
8506
+ const toObject = {};
8507
+ const fromFunctionCalls = getValueByPath(fromObject, [
8508
+ 'functionCalls',
8509
+ ]);
8510
+ if (fromFunctionCalls != null) {
8511
+ let transformedList = fromFunctionCalls;
8512
+ if (Array.isArray(transformedList)) {
8513
+ transformedList = transformedList.map((item) => {
8514
+ return functionCallFromMldev(item);
8515
+ });
8516
+ }
8517
+ setValueByPath(toObject, ['functionCalls'], transformedList);
8518
+ }
8519
+ return toObject;
8520
+ }
8521
+ function liveServerToolCallCancellationFromMldev(fromObject) {
8522
+ const toObject = {};
8523
+ const fromIds = getValueByPath(fromObject, ['ids']);
8524
+ if (fromIds != null) {
8525
+ setValueByPath(toObject, ['ids'], fromIds);
8526
+ }
8527
+ return toObject;
8528
+ }
8529
+ function modalityTokenCountFromMldev(fromObject) {
8530
+ const toObject = {};
8531
+ const fromModality = getValueByPath(fromObject, ['modality']);
8532
+ if (fromModality != null) {
8533
+ setValueByPath(toObject, ['modality'], fromModality);
8534
+ }
8535
+ const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8536
+ if (fromTokenCount != null) {
8537
+ setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8538
+ }
8539
+ return toObject;
8540
+ }
8541
+ function usageMetadataFromMldev(fromObject) {
8542
+ const toObject = {};
8543
+ const fromPromptTokenCount = getValueByPath(fromObject, [
8544
+ 'promptTokenCount',
8545
+ ]);
8546
+ if (fromPromptTokenCount != null) {
8547
+ setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8548
+ }
8549
+ const fromCachedContentTokenCount = getValueByPath(fromObject, [
8550
+ 'cachedContentTokenCount',
8551
+ ]);
8552
+ if (fromCachedContentTokenCount != null) {
8553
+ setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8554
+ }
8555
+ const fromResponseTokenCount = getValueByPath(fromObject, [
8556
+ 'responseTokenCount',
8557
+ ]);
8558
+ if (fromResponseTokenCount != null) {
8559
+ setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8560
+ }
8561
+ const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8562
+ 'toolUsePromptTokenCount',
8563
+ ]);
8564
+ if (fromToolUsePromptTokenCount != null) {
8565
+ setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8566
+ }
8567
+ const fromThoughtsTokenCount = getValueByPath(fromObject, [
8568
+ 'thoughtsTokenCount',
8569
+ ]);
8570
+ if (fromThoughtsTokenCount != null) {
8571
+ setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8572
+ }
8573
+ const fromTotalTokenCount = getValueByPath(fromObject, [
8574
+ 'totalTokenCount',
8575
+ ]);
8576
+ if (fromTotalTokenCount != null) {
8577
+ setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8578
+ }
8579
+ const fromPromptTokensDetails = getValueByPath(fromObject, [
8580
+ 'promptTokensDetails',
8581
+ ]);
8582
+ if (fromPromptTokensDetails != null) {
8583
+ let transformedList = fromPromptTokensDetails;
8584
+ if (Array.isArray(transformedList)) {
8585
+ transformedList = transformedList.map((item) => {
8586
+ return modalityTokenCountFromMldev(item);
8587
+ });
8588
+ }
8589
+ setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8590
+ }
8591
+ const fromCacheTokensDetails = getValueByPath(fromObject, [
8592
+ 'cacheTokensDetails',
8593
+ ]);
8594
+ if (fromCacheTokensDetails != null) {
8595
+ let transformedList = fromCacheTokensDetails;
8596
+ if (Array.isArray(transformedList)) {
8597
+ transformedList = transformedList.map((item) => {
8598
+ return modalityTokenCountFromMldev(item);
8599
+ });
8600
+ }
8601
+ setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8602
+ }
8603
+ const fromResponseTokensDetails = getValueByPath(fromObject, [
8604
+ 'responseTokensDetails',
8605
+ ]);
8606
+ if (fromResponseTokensDetails != null) {
8607
+ let transformedList = fromResponseTokensDetails;
8608
+ if (Array.isArray(transformedList)) {
8609
+ transformedList = transformedList.map((item) => {
8610
+ return modalityTokenCountFromMldev(item);
8611
+ });
8612
+ }
8613
+ setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8614
+ }
8615
+ const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8616
+ 'toolUsePromptTokensDetails',
8617
+ ]);
8618
+ if (fromToolUsePromptTokensDetails != null) {
8619
+ let transformedList = fromToolUsePromptTokensDetails;
8620
+ if (Array.isArray(transformedList)) {
8621
+ transformedList = transformedList.map((item) => {
8622
+ return modalityTokenCountFromMldev(item);
8623
+ });
8624
+ }
8625
+ setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8626
+ }
8627
+ return toObject;
8628
+ }
8629
+ function liveServerGoAwayFromMldev(fromObject) {
8630
+ const toObject = {};
8631
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8632
+ if (fromTimeLeft != null) {
8633
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8634
+ }
8635
+ return toObject;
8636
+ }
8637
+ function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8638
+ const toObject = {};
8639
+ const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8640
+ if (fromNewHandle != null) {
8641
+ setValueByPath(toObject, ['newHandle'], fromNewHandle);
8642
+ }
8643
+ const fromResumable = getValueByPath(fromObject, ['resumable']);
8644
+ if (fromResumable != null) {
8645
+ setValueByPath(toObject, ['resumable'], fromResumable);
8646
+ }
8647
+ const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8648
+ 'lastConsumedClientMessageIndex',
8649
+ ]);
8650
+ if (fromLastConsumedClientMessageIndex != null) {
8651
+ setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
8652
+ }
8653
+ return toObject;
8654
+ }
8655
+ function liveServerMessageFromMldev(fromObject) {
8656
+ const toObject = {};
8657
+ const fromSetupComplete = getValueByPath(fromObject, [
8658
+ 'setupComplete',
8659
+ ]);
8660
+ if (fromSetupComplete != null) {
8661
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
7962
8662
  }
7963
- const fromAudioStreamEnd = getValueByPath(fromObject, [
7964
- 'audioStreamEnd',
8663
+ const fromServerContent = getValueByPath(fromObject, [
8664
+ 'serverContent',
7965
8665
  ]);
7966
- if (fromAudioStreamEnd != null) {
7967
- setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8666
+ if (fromServerContent != null) {
8667
+ setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
7968
8668
  }
7969
- const fromVideo = getValueByPath(fromObject, ['video']);
7970
- if (fromVideo != null) {
7971
- setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8669
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8670
+ if (fromToolCall != null) {
8671
+ setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
7972
8672
  }
7973
- const fromText = getValueByPath(fromObject, ['text']);
7974
- if (fromText != null) {
7975
- setValueByPath(toObject, ['text'], fromText);
8673
+ const fromToolCallCancellation = getValueByPath(fromObject, [
8674
+ 'toolCallCancellation',
8675
+ ]);
8676
+ if (fromToolCallCancellation != null) {
8677
+ setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
7976
8678
  }
7977
- const fromActivityStart = getValueByPath(fromObject, [
7978
- 'activityStart',
8679
+ const fromUsageMetadata = getValueByPath(fromObject, [
8680
+ 'usageMetadata',
7979
8681
  ]);
7980
- if (fromActivityStart != null) {
7981
- setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8682
+ if (fromUsageMetadata != null) {
8683
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
7982
8684
  }
7983
- const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
7984
- if (fromActivityEnd != null) {
7985
- setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8685
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
8686
+ if (fromGoAway != null) {
8687
+ setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
8688
+ }
8689
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8690
+ 'sessionResumptionUpdate',
8691
+ ]);
8692
+ if (fromSessionResumptionUpdate != null) {
8693
+ setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
7986
8694
  }
7987
8695
  return toObject;
7988
8696
  }
7989
- function weightedPromptToMldev(fromObject) {
8697
+ function liveMusicServerSetupCompleteFromMldev() {
8698
+ const toObject = {};
8699
+ return toObject;
8700
+ }
8701
+ function weightedPromptFromMldev(fromObject) {
7990
8702
  const toObject = {};
7991
8703
  const fromText = getValueByPath(fromObject, ['text']);
7992
8704
  if (fromText != null) {
@@ -7998,7 +8710,7 @@ function weightedPromptToMldev(fromObject) {
7998
8710
  }
7999
8711
  return toObject;
8000
8712
  }
8001
- function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
8713
+ function liveMusicClientContentFromMldev(fromObject) {
8002
8714
  const toObject = {};
8003
8715
  const fromWeightedPrompts = getValueByPath(fromObject, [
8004
8716
  'weightedPrompts',
@@ -8007,14 +8719,14 @@ function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
8007
8719
  let transformedList = fromWeightedPrompts;
8008
8720
  if (Array.isArray(transformedList)) {
8009
8721
  transformedList = transformedList.map((item) => {
8010
- return weightedPromptToMldev(item);
8722
+ return weightedPromptFromMldev(item);
8011
8723
  });
8012
8724
  }
8013
8725
  setValueByPath(toObject, ['weightedPrompts'], transformedList);
8014
8726
  }
8015
8727
  return toObject;
8016
8728
  }
8017
- function liveMusicGenerationConfigToMldev(fromObject) {
8729
+ function liveMusicGenerationConfigFromMldev(fromObject) {
8018
8730
  const toObject = {};
8019
8731
  const fromTemperature = getValueByPath(fromObject, ['temperature']);
8020
8732
  if (fromTemperature != null) {
@@ -8064,68 +8776,88 @@ function liveMusicGenerationConfigToMldev(fromObject) {
8064
8776
  }
8065
8777
  return toObject;
8066
8778
  }
8067
- function liveMusicSetConfigParametersToMldev(fromObject) {
8779
+ function liveMusicSourceMetadataFromMldev(fromObject) {
8068
8780
  const toObject = {};
8781
+ const fromClientContent = getValueByPath(fromObject, [
8782
+ 'clientContent',
8783
+ ]);
8784
+ if (fromClientContent != null) {
8785
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
8786
+ }
8069
8787
  const fromMusicGenerationConfig = getValueByPath(fromObject, [
8070
8788
  'musicGenerationConfig',
8071
8789
  ]);
8072
8790
  if (fromMusicGenerationConfig != null) {
8073
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
8791
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
8074
8792
  }
8075
8793
  return toObject;
8076
8794
  }
8077
- function liveMusicClientSetupToMldev(fromObject) {
8795
+ function audioChunkFromMldev(fromObject) {
8078
8796
  const toObject = {};
8079
- const fromModel = getValueByPath(fromObject, ['model']);
8080
- if (fromModel != null) {
8081
- setValueByPath(toObject, ['model'], fromModel);
8797
+ const fromData = getValueByPath(fromObject, ['data']);
8798
+ if (fromData != null) {
8799
+ setValueByPath(toObject, ['data'], fromData);
8800
+ }
8801
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8802
+ if (fromMimeType != null) {
8803
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8804
+ }
8805
+ const fromSourceMetadata = getValueByPath(fromObject, [
8806
+ 'sourceMetadata',
8807
+ ]);
8808
+ if (fromSourceMetadata != null) {
8809
+ setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
8082
8810
  }
8083
8811
  return toObject;
8084
8812
  }
8085
- function liveMusicClientContentToMldev(fromObject) {
8813
+ function liveMusicServerContentFromMldev(fromObject) {
8086
8814
  const toObject = {};
8087
- const fromWeightedPrompts = getValueByPath(fromObject, [
8088
- 'weightedPrompts',
8089
- ]);
8090
- if (fromWeightedPrompts != null) {
8091
- let transformedList = fromWeightedPrompts;
8815
+ const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
8816
+ if (fromAudioChunks != null) {
8817
+ let transformedList = fromAudioChunks;
8092
8818
  if (Array.isArray(transformedList)) {
8093
8819
  transformedList = transformedList.map((item) => {
8094
- return weightedPromptToMldev(item);
8820
+ return audioChunkFromMldev(item);
8095
8821
  });
8096
8822
  }
8097
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
8823
+ setValueByPath(toObject, ['audioChunks'], transformedList);
8098
8824
  }
8099
8825
  return toObject;
8100
8826
  }
8101
- function liveMusicClientMessageToMldev(fromObject) {
8827
+ function liveMusicFilteredPromptFromMldev(fromObject) {
8102
8828
  const toObject = {};
8103
- const fromSetup = getValueByPath(fromObject, ['setup']);
8104
- if (fromSetup != null) {
8105
- setValueByPath(toObject, ['setup'], liveMusicClientSetupToMldev(fromSetup));
8829
+ const fromText = getValueByPath(fromObject, ['text']);
8830
+ if (fromText != null) {
8831
+ setValueByPath(toObject, ['text'], fromText);
8106
8832
  }
8107
- const fromClientContent = getValueByPath(fromObject, [
8108
- 'clientContent',
8833
+ const fromFilteredReason = getValueByPath(fromObject, [
8834
+ 'filteredReason',
8109
8835
  ]);
8110
- if (fromClientContent != null) {
8111
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentToMldev(fromClientContent));
8836
+ if (fromFilteredReason != null) {
8837
+ setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
8112
8838
  }
8113
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
8114
- 'musicGenerationConfig',
8839
+ return toObject;
8840
+ }
8841
+ function liveMusicServerMessageFromMldev(fromObject) {
8842
+ const toObject = {};
8843
+ const fromSetupComplete = getValueByPath(fromObject, [
8844
+ 'setupComplete',
8115
8845
  ]);
8116
- if (fromMusicGenerationConfig != null) {
8117
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
8846
+ if (fromSetupComplete != null) {
8847
+ setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
8118
8848
  }
8119
- const fromPlaybackControl = getValueByPath(fromObject, [
8120
- 'playbackControl',
8849
+ const fromServerContent = getValueByPath(fromObject, [
8850
+ 'serverContent',
8121
8851
  ]);
8122
- if (fromPlaybackControl != null) {
8123
- setValueByPath(toObject, ['playbackControl'], fromPlaybackControl);
8852
+ if (fromServerContent != null) {
8853
+ setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
8854
+ }
8855
+ const fromFilteredPrompt = getValueByPath(fromObject, [
8856
+ 'filteredPrompt',
8857
+ ]);
8858
+ if (fromFilteredPrompt != null) {
8859
+ setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
8124
8860
  }
8125
- return toObject;
8126
- }
8127
- function liveServerSetupCompleteFromMldev() {
8128
- const toObject = {};
8129
8861
  return toObject;
8130
8862
  }
8131
8863
  function liveServerSetupCompleteFromVertex(fromObject) {
@@ -8136,22 +8868,6 @@ function liveServerSetupCompleteFromVertex(fromObject) {
8136
8868
  }
8137
8869
  return toObject;
8138
8870
  }
8139
- function videoMetadataFromMldev$1(fromObject) {
8140
- const toObject = {};
8141
- const fromFps = getValueByPath(fromObject, ['fps']);
8142
- if (fromFps != null) {
8143
- setValueByPath(toObject, ['fps'], fromFps);
8144
- }
8145
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8146
- if (fromEndOffset != null) {
8147
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
8148
- }
8149
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8150
- if (fromStartOffset != null) {
8151
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
8152
- }
8153
- return toObject;
8154
- }
8155
8871
  function videoMetadataFromVertex$1(fromObject) {
8156
8872
  const toObject = {};
8157
8873
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -8168,18 +8884,6 @@ function videoMetadataFromVertex$1(fromObject) {
8168
8884
  }
8169
8885
  return toObject;
8170
8886
  }
8171
- function blobFromMldev$1(fromObject) {
8172
- const toObject = {};
8173
- const fromData = getValueByPath(fromObject, ['data']);
8174
- if (fromData != null) {
8175
- setValueByPath(toObject, ['data'], fromData);
8176
- }
8177
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8178
- if (fromMimeType != null) {
8179
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8180
- }
8181
- return toObject;
8182
- }
8183
8887
  function blobFromVertex$1(fromObject) {
8184
8888
  const toObject = {};
8185
8889
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
@@ -8196,18 +8900,6 @@ function blobFromVertex$1(fromObject) {
8196
8900
  }
8197
8901
  return toObject;
8198
8902
  }
8199
- function fileDataFromMldev$1(fromObject) {
8200
- const toObject = {};
8201
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8202
- if (fromFileUri != null) {
8203
- setValueByPath(toObject, ['fileUri'], fromFileUri);
8204
- }
8205
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8206
- if (fromMimeType != null) {
8207
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8208
- }
8209
- return toObject;
8210
- }
8211
8903
  function fileDataFromVertex$1(fromObject) {
8212
8904
  const toObject = {};
8213
8905
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
@@ -8224,60 +8916,6 @@ function fileDataFromVertex$1(fromObject) {
8224
8916
  }
8225
8917
  return toObject;
8226
8918
  }
8227
- function partFromMldev$1(fromObject) {
8228
- const toObject = {};
8229
- const fromVideoMetadata = getValueByPath(fromObject, [
8230
- 'videoMetadata',
8231
- ]);
8232
- if (fromVideoMetadata != null) {
8233
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8234
- }
8235
- const fromThought = getValueByPath(fromObject, ['thought']);
8236
- if (fromThought != null) {
8237
- setValueByPath(toObject, ['thought'], fromThought);
8238
- }
8239
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8240
- if (fromInlineData != null) {
8241
- setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8242
- }
8243
- const fromFileData = getValueByPath(fromObject, ['fileData']);
8244
- if (fromFileData != null) {
8245
- setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8246
- }
8247
- const fromThoughtSignature = getValueByPath(fromObject, [
8248
- 'thoughtSignature',
8249
- ]);
8250
- if (fromThoughtSignature != null) {
8251
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8252
- }
8253
- const fromCodeExecutionResult = getValueByPath(fromObject, [
8254
- 'codeExecutionResult',
8255
- ]);
8256
- if (fromCodeExecutionResult != null) {
8257
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8258
- }
8259
- const fromExecutableCode = getValueByPath(fromObject, [
8260
- 'executableCode',
8261
- ]);
8262
- if (fromExecutableCode != null) {
8263
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8264
- }
8265
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8266
- if (fromFunctionCall != null) {
8267
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8268
- }
8269
- const fromFunctionResponse = getValueByPath(fromObject, [
8270
- 'functionResponse',
8271
- ]);
8272
- if (fromFunctionResponse != null) {
8273
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8274
- }
8275
- const fromText = getValueByPath(fromObject, ['text']);
8276
- if (fromText != null) {
8277
- setValueByPath(toObject, ['text'], fromText);
8278
- }
8279
- return toObject;
8280
- }
8281
8919
  function partFromVertex$1(fromObject) {
8282
8920
  const toObject = {};
8283
8921
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -8327,26 +8965,8 @@ function partFromVertex$1(fromObject) {
8327
8965
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8328
8966
  }
8329
8967
  const fromText = getValueByPath(fromObject, ['text']);
8330
- if (fromText != null) {
8331
- setValueByPath(toObject, ['text'], fromText);
8332
- }
8333
- return toObject;
8334
- }
8335
- function contentFromMldev$1(fromObject) {
8336
- const toObject = {};
8337
- const fromParts = getValueByPath(fromObject, ['parts']);
8338
- if (fromParts != null) {
8339
- let transformedList = fromParts;
8340
- if (Array.isArray(transformedList)) {
8341
- transformedList = transformedList.map((item) => {
8342
- return partFromMldev$1(item);
8343
- });
8344
- }
8345
- setValueByPath(toObject, ['parts'], transformedList);
8346
- }
8347
- const fromRole = getValueByPath(fromObject, ['role']);
8348
- if (fromRole != null) {
8349
- setValueByPath(toObject, ['role'], fromRole);
8968
+ if (fromText != null) {
8969
+ setValueByPath(toObject, ['text'], fromText);
8350
8970
  }
8351
8971
  return toObject;
8352
8972
  }
@@ -8368,18 +8988,6 @@ function contentFromVertex$1(fromObject) {
8368
8988
  }
8369
8989
  return toObject;
8370
8990
  }
8371
- function transcriptionFromMldev(fromObject) {
8372
- const toObject = {};
8373
- const fromText = getValueByPath(fromObject, ['text']);
8374
- if (fromText != null) {
8375
- setValueByPath(toObject, ['text'], fromText);
8376
- }
8377
- const fromFinished = getValueByPath(fromObject, ['finished']);
8378
- if (fromFinished != null) {
8379
- setValueByPath(toObject, ['finished'], fromFinished);
8380
- }
8381
- return toObject;
8382
- }
8383
8991
  function transcriptionFromVertex(fromObject) {
8384
8992
  const toObject = {};
8385
8993
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8392,80 +9000,6 @@ function transcriptionFromVertex(fromObject) {
8392
9000
  }
8393
9001
  return toObject;
8394
9002
  }
8395
- function urlMetadataFromMldev$1(fromObject) {
8396
- const toObject = {};
8397
- const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8398
- if (fromRetrievedUrl != null) {
8399
- setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8400
- }
8401
- const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8402
- 'urlRetrievalStatus',
8403
- ]);
8404
- if (fromUrlRetrievalStatus != null) {
8405
- setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8406
- }
8407
- return toObject;
8408
- }
8409
- function urlContextMetadataFromMldev$1(fromObject) {
8410
- const toObject = {};
8411
- const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8412
- if (fromUrlMetadata != null) {
8413
- let transformedList = fromUrlMetadata;
8414
- if (Array.isArray(transformedList)) {
8415
- transformedList = transformedList.map((item) => {
8416
- return urlMetadataFromMldev$1(item);
8417
- });
8418
- }
8419
- setValueByPath(toObject, ['urlMetadata'], transformedList);
8420
- }
8421
- return toObject;
8422
- }
8423
- function liveServerContentFromMldev(fromObject) {
8424
- const toObject = {};
8425
- const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8426
- if (fromModelTurn != null) {
8427
- setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8428
- }
8429
- const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8430
- if (fromTurnComplete != null) {
8431
- setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8432
- }
8433
- const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8434
- if (fromInterrupted != null) {
8435
- setValueByPath(toObject, ['interrupted'], fromInterrupted);
8436
- }
8437
- const fromGroundingMetadata = getValueByPath(fromObject, [
8438
- 'groundingMetadata',
8439
- ]);
8440
- if (fromGroundingMetadata != null) {
8441
- setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8442
- }
8443
- const fromGenerationComplete = getValueByPath(fromObject, [
8444
- 'generationComplete',
8445
- ]);
8446
- if (fromGenerationComplete != null) {
8447
- setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8448
- }
8449
- const fromInputTranscription = getValueByPath(fromObject, [
8450
- 'inputTranscription',
8451
- ]);
8452
- if (fromInputTranscription != null) {
8453
- setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8454
- }
8455
- const fromOutputTranscription = getValueByPath(fromObject, [
8456
- 'outputTranscription',
8457
- ]);
8458
- if (fromOutputTranscription != null) {
8459
- setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8460
- }
8461
- const fromUrlContextMetadata = getValueByPath(fromObject, [
8462
- 'urlContextMetadata',
8463
- ]);
8464
- if (fromUrlContextMetadata != null) {
8465
- setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8466
- }
8467
- return toObject;
8468
- }
8469
9003
  function liveServerContentFromVertex(fromObject) {
8470
9004
  const toObject = {};
8471
9005
  const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
@@ -8506,22 +9040,6 @@ function liveServerContentFromVertex(fromObject) {
8506
9040
  }
8507
9041
  return toObject;
8508
9042
  }
8509
- function functionCallFromMldev(fromObject) {
8510
- const toObject = {};
8511
- const fromId = getValueByPath(fromObject, ['id']);
8512
- if (fromId != null) {
8513
- setValueByPath(toObject, ['id'], fromId);
8514
- }
8515
- const fromArgs = getValueByPath(fromObject, ['args']);
8516
- if (fromArgs != null) {
8517
- setValueByPath(toObject, ['args'], fromArgs);
8518
- }
8519
- const fromName = getValueByPath(fromObject, ['name']);
8520
- if (fromName != null) {
8521
- setValueByPath(toObject, ['name'], fromName);
8522
- }
8523
- return toObject;
8524
- }
8525
9043
  function functionCallFromVertex(fromObject) {
8526
9044
  const toObject = {};
8527
9045
  const fromArgs = getValueByPath(fromObject, ['args']);
@@ -8534,22 +9052,6 @@ function functionCallFromVertex(fromObject) {
8534
9052
  }
8535
9053
  return toObject;
8536
9054
  }
8537
- function liveServerToolCallFromMldev(fromObject) {
8538
- const toObject = {};
8539
- const fromFunctionCalls = getValueByPath(fromObject, [
8540
- 'functionCalls',
8541
- ]);
8542
- if (fromFunctionCalls != null) {
8543
- let transformedList = fromFunctionCalls;
8544
- if (Array.isArray(transformedList)) {
8545
- transformedList = transformedList.map((item) => {
8546
- return functionCallFromMldev(item);
8547
- });
8548
- }
8549
- setValueByPath(toObject, ['functionCalls'], transformedList);
8550
- }
8551
- return toObject;
8552
- }
8553
9055
  function liveServerToolCallFromVertex(fromObject) {
8554
9056
  const toObject = {};
8555
9057
  const fromFunctionCalls = getValueByPath(fromObject, [
@@ -8566,14 +9068,6 @@ function liveServerToolCallFromVertex(fromObject) {
8566
9068
  }
8567
9069
  return toObject;
8568
9070
  }
8569
- function liveServerToolCallCancellationFromMldev(fromObject) {
8570
- const toObject = {};
8571
- const fromIds = getValueByPath(fromObject, ['ids']);
8572
- if (fromIds != null) {
8573
- setValueByPath(toObject, ['ids'], fromIds);
8574
- }
8575
- return toObject;
8576
- }
8577
9071
  function liveServerToolCallCancellationFromVertex(fromObject) {
8578
9072
  const toObject = {};
8579
9073
  const fromIds = getValueByPath(fromObject, ['ids']);
@@ -8582,18 +9076,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
8582
9076
  }
8583
9077
  return toObject;
8584
9078
  }
8585
- function modalityTokenCountFromMldev(fromObject) {
8586
- const toObject = {};
8587
- const fromModality = getValueByPath(fromObject, ['modality']);
8588
- if (fromModality != null) {
8589
- setValueByPath(toObject, ['modality'], fromModality);
8590
- }
8591
- const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8592
- if (fromTokenCount != null) {
8593
- setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8594
- }
8595
- return toObject;
8596
- }
8597
9079
  function modalityTokenCountFromVertex(fromObject) {
8598
9080
  const toObject = {};
8599
9081
  const fromModality = getValueByPath(fromObject, ['modality']);
@@ -8606,94 +9088,6 @@ function modalityTokenCountFromVertex(fromObject) {
8606
9088
  }
8607
9089
  return toObject;
8608
9090
  }
8609
- function usageMetadataFromMldev(fromObject) {
8610
- const toObject = {};
8611
- const fromPromptTokenCount = getValueByPath(fromObject, [
8612
- 'promptTokenCount',
8613
- ]);
8614
- if (fromPromptTokenCount != null) {
8615
- setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8616
- }
8617
- const fromCachedContentTokenCount = getValueByPath(fromObject, [
8618
- 'cachedContentTokenCount',
8619
- ]);
8620
- if (fromCachedContentTokenCount != null) {
8621
- setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8622
- }
8623
- const fromResponseTokenCount = getValueByPath(fromObject, [
8624
- 'responseTokenCount',
8625
- ]);
8626
- if (fromResponseTokenCount != null) {
8627
- setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8628
- }
8629
- const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8630
- 'toolUsePromptTokenCount',
8631
- ]);
8632
- if (fromToolUsePromptTokenCount != null) {
8633
- setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8634
- }
8635
- const fromThoughtsTokenCount = getValueByPath(fromObject, [
8636
- 'thoughtsTokenCount',
8637
- ]);
8638
- if (fromThoughtsTokenCount != null) {
8639
- setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8640
- }
8641
- const fromTotalTokenCount = getValueByPath(fromObject, [
8642
- 'totalTokenCount',
8643
- ]);
8644
- if (fromTotalTokenCount != null) {
8645
- setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8646
- }
8647
- const fromPromptTokensDetails = getValueByPath(fromObject, [
8648
- 'promptTokensDetails',
8649
- ]);
8650
- if (fromPromptTokensDetails != null) {
8651
- let transformedList = fromPromptTokensDetails;
8652
- if (Array.isArray(transformedList)) {
8653
- transformedList = transformedList.map((item) => {
8654
- return modalityTokenCountFromMldev(item);
8655
- });
8656
- }
8657
- setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8658
- }
8659
- const fromCacheTokensDetails = getValueByPath(fromObject, [
8660
- 'cacheTokensDetails',
8661
- ]);
8662
- if (fromCacheTokensDetails != null) {
8663
- let transformedList = fromCacheTokensDetails;
8664
- if (Array.isArray(transformedList)) {
8665
- transformedList = transformedList.map((item) => {
8666
- return modalityTokenCountFromMldev(item);
8667
- });
8668
- }
8669
- setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8670
- }
8671
- const fromResponseTokensDetails = getValueByPath(fromObject, [
8672
- 'responseTokensDetails',
8673
- ]);
8674
- if (fromResponseTokensDetails != null) {
8675
- let transformedList = fromResponseTokensDetails;
8676
- if (Array.isArray(transformedList)) {
8677
- transformedList = transformedList.map((item) => {
8678
- return modalityTokenCountFromMldev(item);
8679
- });
8680
- }
8681
- setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8682
- }
8683
- const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8684
- 'toolUsePromptTokensDetails',
8685
- ]);
8686
- if (fromToolUsePromptTokensDetails != null) {
8687
- let transformedList = fromToolUsePromptTokensDetails;
8688
- if (Array.isArray(transformedList)) {
8689
- transformedList = transformedList.map((item) => {
8690
- return modalityTokenCountFromMldev(item);
8691
- });
8692
- }
8693
- setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8694
- }
8695
- return toObject;
8696
- }
8697
9091
  function usageMetadataFromVertex(fromObject) {
8698
9092
  const toObject = {};
8699
9093
  const fromPromptTokenCount = getValueByPath(fromObject, [
@@ -8784,39 +9178,13 @@ function usageMetadataFromVertex(fromObject) {
8784
9178
  if (fromTrafficType != null) {
8785
9179
  setValueByPath(toObject, ['trafficType'], fromTrafficType);
8786
9180
  }
8787
- return toObject;
8788
- }
8789
- function liveServerGoAwayFromMldev(fromObject) {
8790
- const toObject = {};
8791
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8792
- if (fromTimeLeft != null) {
8793
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8794
- }
8795
- return toObject;
8796
- }
8797
- function liveServerGoAwayFromVertex(fromObject) {
8798
- const toObject = {};
8799
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8800
- if (fromTimeLeft != null) {
8801
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8802
- }
8803
- return toObject;
8804
- }
8805
- function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8806
- const toObject = {};
8807
- const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8808
- if (fromNewHandle != null) {
8809
- setValueByPath(toObject, ['newHandle'], fromNewHandle);
8810
- }
8811
- const fromResumable = getValueByPath(fromObject, ['resumable']);
8812
- if (fromResumable != null) {
8813
- setValueByPath(toObject, ['resumable'], fromResumable);
8814
- }
8815
- const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8816
- 'lastConsumedClientMessageIndex',
8817
- ]);
8818
- if (fromLastConsumedClientMessageIndex != null) {
8819
- setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
9181
+ return toObject;
9182
+ }
9183
+ function liveServerGoAwayFromVertex(fromObject) {
9184
+ const toObject = {};
9185
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9186
+ if (fromTimeLeft != null) {
9187
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8820
9188
  }
8821
9189
  return toObject;
8822
9190
  }
@@ -8838,48 +9206,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
8838
9206
  }
8839
9207
  return toObject;
8840
9208
  }
8841
- function liveServerMessageFromMldev(fromObject) {
8842
- const toObject = {};
8843
- const fromSetupComplete = getValueByPath(fromObject, [
8844
- 'setupComplete',
8845
- ]);
8846
- if (fromSetupComplete != null) {
8847
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8848
- }
8849
- const fromServerContent = getValueByPath(fromObject, [
8850
- 'serverContent',
8851
- ]);
8852
- if (fromServerContent != null) {
8853
- setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
8854
- }
8855
- const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8856
- if (fromToolCall != null) {
8857
- setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
8858
- }
8859
- const fromToolCallCancellation = getValueByPath(fromObject, [
8860
- 'toolCallCancellation',
8861
- ]);
8862
- if (fromToolCallCancellation != null) {
8863
- setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
8864
- }
8865
- const fromUsageMetadata = getValueByPath(fromObject, [
8866
- 'usageMetadata',
8867
- ]);
8868
- if (fromUsageMetadata != null) {
8869
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
8870
- }
8871
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
8872
- if (fromGoAway != null) {
8873
- setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
8874
- }
8875
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8876
- 'sessionResumptionUpdate',
8877
- ]);
8878
- if (fromSessionResumptionUpdate != null) {
8879
- setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
8880
- }
8881
- return toObject;
8882
- }
8883
9209
  function liveServerMessageFromVertex(fromObject) {
8884
9210
  const toObject = {};
8885
9211
  const fromSetupComplete = getValueByPath(fromObject, [
@@ -8922,172 +9248,6 @@ function liveServerMessageFromVertex(fromObject) {
8922
9248
  }
8923
9249
  return toObject;
8924
9250
  }
8925
- function liveMusicServerSetupCompleteFromMldev() {
8926
- const toObject = {};
8927
- return toObject;
8928
- }
8929
- function weightedPromptFromMldev(fromObject) {
8930
- const toObject = {};
8931
- const fromText = getValueByPath(fromObject, ['text']);
8932
- if (fromText != null) {
8933
- setValueByPath(toObject, ['text'], fromText);
8934
- }
8935
- const fromWeight = getValueByPath(fromObject, ['weight']);
8936
- if (fromWeight != null) {
8937
- setValueByPath(toObject, ['weight'], fromWeight);
8938
- }
8939
- return toObject;
8940
- }
8941
- function liveMusicClientContentFromMldev(fromObject) {
8942
- const toObject = {};
8943
- const fromWeightedPrompts = getValueByPath(fromObject, [
8944
- 'weightedPrompts',
8945
- ]);
8946
- if (fromWeightedPrompts != null) {
8947
- let transformedList = fromWeightedPrompts;
8948
- if (Array.isArray(transformedList)) {
8949
- transformedList = transformedList.map((item) => {
8950
- return weightedPromptFromMldev(item);
8951
- });
8952
- }
8953
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
8954
- }
8955
- return toObject;
8956
- }
8957
- function liveMusicGenerationConfigFromMldev(fromObject) {
8958
- const toObject = {};
8959
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
8960
- if (fromTemperature != null) {
8961
- setValueByPath(toObject, ['temperature'], fromTemperature);
8962
- }
8963
- const fromTopK = getValueByPath(fromObject, ['topK']);
8964
- if (fromTopK != null) {
8965
- setValueByPath(toObject, ['topK'], fromTopK);
8966
- }
8967
- const fromSeed = getValueByPath(fromObject, ['seed']);
8968
- if (fromSeed != null) {
8969
- setValueByPath(toObject, ['seed'], fromSeed);
8970
- }
8971
- const fromGuidance = getValueByPath(fromObject, ['guidance']);
8972
- if (fromGuidance != null) {
8973
- setValueByPath(toObject, ['guidance'], fromGuidance);
8974
- }
8975
- const fromBpm = getValueByPath(fromObject, ['bpm']);
8976
- if (fromBpm != null) {
8977
- setValueByPath(toObject, ['bpm'], fromBpm);
8978
- }
8979
- const fromDensity = getValueByPath(fromObject, ['density']);
8980
- if (fromDensity != null) {
8981
- setValueByPath(toObject, ['density'], fromDensity);
8982
- }
8983
- const fromBrightness = getValueByPath(fromObject, ['brightness']);
8984
- if (fromBrightness != null) {
8985
- setValueByPath(toObject, ['brightness'], fromBrightness);
8986
- }
8987
- const fromScale = getValueByPath(fromObject, ['scale']);
8988
- if (fromScale != null) {
8989
- setValueByPath(toObject, ['scale'], fromScale);
8990
- }
8991
- const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
8992
- if (fromMuteBass != null) {
8993
- setValueByPath(toObject, ['muteBass'], fromMuteBass);
8994
- }
8995
- const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
8996
- if (fromMuteDrums != null) {
8997
- setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
8998
- }
8999
- const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9000
- 'onlyBassAndDrums',
9001
- ]);
9002
- if (fromOnlyBassAndDrums != null) {
9003
- setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9004
- }
9005
- return toObject;
9006
- }
9007
- function liveMusicSourceMetadataFromMldev(fromObject) {
9008
- const toObject = {};
9009
- const fromClientContent = getValueByPath(fromObject, [
9010
- 'clientContent',
9011
- ]);
9012
- if (fromClientContent != null) {
9013
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9014
- }
9015
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
9016
- 'musicGenerationConfig',
9017
- ]);
9018
- if (fromMusicGenerationConfig != null) {
9019
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9020
- }
9021
- return toObject;
9022
- }
9023
- function audioChunkFromMldev(fromObject) {
9024
- const toObject = {};
9025
- const fromData = getValueByPath(fromObject, ['data']);
9026
- if (fromData != null) {
9027
- setValueByPath(toObject, ['data'], fromData);
9028
- }
9029
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9030
- if (fromMimeType != null) {
9031
- setValueByPath(toObject, ['mimeType'], fromMimeType);
9032
- }
9033
- const fromSourceMetadata = getValueByPath(fromObject, [
9034
- 'sourceMetadata',
9035
- ]);
9036
- if (fromSourceMetadata != null) {
9037
- setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9038
- }
9039
- return toObject;
9040
- }
9041
- function liveMusicServerContentFromMldev(fromObject) {
9042
- const toObject = {};
9043
- const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9044
- if (fromAudioChunks != null) {
9045
- let transformedList = fromAudioChunks;
9046
- if (Array.isArray(transformedList)) {
9047
- transformedList = transformedList.map((item) => {
9048
- return audioChunkFromMldev(item);
9049
- });
9050
- }
9051
- setValueByPath(toObject, ['audioChunks'], transformedList);
9052
- }
9053
- return toObject;
9054
- }
9055
- function liveMusicFilteredPromptFromMldev(fromObject) {
9056
- const toObject = {};
9057
- const fromText = getValueByPath(fromObject, ['text']);
9058
- if (fromText != null) {
9059
- setValueByPath(toObject, ['text'], fromText);
9060
- }
9061
- const fromFilteredReason = getValueByPath(fromObject, [
9062
- 'filteredReason',
9063
- ]);
9064
- if (fromFilteredReason != null) {
9065
- setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9066
- }
9067
- return toObject;
9068
- }
9069
- function liveMusicServerMessageFromMldev(fromObject) {
9070
- const toObject = {};
9071
- const fromSetupComplete = getValueByPath(fromObject, [
9072
- 'setupComplete',
9073
- ]);
9074
- if (fromSetupComplete != null) {
9075
- setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9076
- }
9077
- const fromServerContent = getValueByPath(fromObject, [
9078
- 'serverContent',
9079
- ]);
9080
- if (fromServerContent != null) {
9081
- setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9082
- }
9083
- const fromFilteredPrompt = getValueByPath(fromObject, [
9084
- 'filteredPrompt',
9085
- ]);
9086
- if (fromFilteredPrompt != null) {
9087
- setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9088
- }
9089
- return toObject;
9090
- }
9091
9251
 
9092
9252
  /**
9093
9253
  * @license
@@ -9880,6 +10040,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
9880
10040
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
9881
10041
  throw new Error('addWatermark parameter is not supported in Gemini API.');
9882
10042
  }
10043
+ if (getValueByPath(fromObject, ['imageSize']) !== undefined) {
10044
+ throw new Error('imageSize parameter is not supported in Gemini API.');
10045
+ }
9883
10046
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
9884
10047
  throw new Error('enhancePrompt parameter is not supported in Gemini API.');
9885
10048
  }
@@ -10956,6 +11119,10 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
10956
11119
  if (parentObject !== undefined && fromAddWatermark != null) {
10957
11120
  setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
10958
11121
  }
11122
+ const fromImageSize = getValueByPath(fromObject, ['imageSize']);
11123
+ if (parentObject !== undefined && fromImageSize != null) {
11124
+ setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
11125
+ }
10959
11126
  const fromEnhancePrompt = getValueByPath(fromObject, [
10960
11127
  'enhancePrompt',
10961
11128
  ]);
@@ -11168,6 +11335,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
11168
11335
  if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11169
11336
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11170
11337
  }
11338
+ const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
11339
+ if (parentObject !== undefined && fromAddWatermark != null) {
11340
+ setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
11341
+ }
11171
11342
  const fromEditMode = getValueByPath(fromObject, ['editMode']);
11172
11343
  if (parentObject !== undefined && fromEditMode != null) {
11173
11344
  setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
@@ -11742,6 +11913,12 @@ function candidateFromMldev(fromObject) {
11742
11913
  }
11743
11914
  function generateContentResponseFromMldev(fromObject) {
11744
11915
  const toObject = {};
11916
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
11917
+ 'sdkHttpResponse',
11918
+ ]);
11919
+ if (fromSdkHttpResponse != null) {
11920
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
11921
+ }
11745
11922
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
11746
11923
  if (fromCandidates != null) {
11747
11924
  let transformedList = fromCandidates;
@@ -11936,6 +12113,12 @@ function modelFromMldev(fromObject) {
11936
12113
  }
11937
12114
  function listModelsResponseFromMldev(fromObject) {
11938
12115
  const toObject = {};
12116
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12117
+ 'sdkHttpResponse',
12118
+ ]);
12119
+ if (fromSdkHttpResponse != null) {
12120
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12121
+ }
11939
12122
  const fromNextPageToken = getValueByPath(fromObject, [
11940
12123
  'nextPageToken',
11941
12124
  ]);
@@ -11972,7 +12155,7 @@ function countTokensResponseFromMldev(fromObject) {
11972
12155
  }
11973
12156
  return toObject;
11974
12157
  }
11975
- function videoFromMldev$1(fromObject) {
12158
+ function videoFromMldev(fromObject) {
11976
12159
  const toObject = {};
11977
12160
  const fromUri = getValueByPath(fromObject, ['video', 'uri']);
11978
12161
  if (fromUri != null) {
@@ -11991,15 +12174,15 @@ function videoFromMldev$1(fromObject) {
11991
12174
  }
11992
12175
  return toObject;
11993
12176
  }
11994
- function generatedVideoFromMldev$1(fromObject) {
12177
+ function generatedVideoFromMldev(fromObject) {
11995
12178
  const toObject = {};
11996
12179
  const fromVideo = getValueByPath(fromObject, ['_self']);
11997
12180
  if (fromVideo != null) {
11998
- setValueByPath(toObject, ['video'], videoFromMldev$1(fromVideo));
12181
+ setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
11999
12182
  }
12000
12183
  return toObject;
12001
12184
  }
12002
- function generateVideosResponseFromMldev$1(fromObject) {
12185
+ function generateVideosResponseFromMldev(fromObject) {
12003
12186
  const toObject = {};
12004
12187
  const fromGeneratedVideos = getValueByPath(fromObject, [
12005
12188
  'generatedSamples',
@@ -12008,7 +12191,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
12008
12191
  let transformedList = fromGeneratedVideos;
12009
12192
  if (Array.isArray(transformedList)) {
12010
12193
  transformedList = transformedList.map((item) => {
12011
- return generatedVideoFromMldev$1(item);
12194
+ return generatedVideoFromMldev(item);
12012
12195
  });
12013
12196
  }
12014
12197
  setValueByPath(toObject, ['generatedVideos'], transformedList);
@@ -12027,7 +12210,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
12027
12210
  }
12028
12211
  return toObject;
12029
12212
  }
12030
- function generateVideosOperationFromMldev$1(fromObject) {
12213
+ function generateVideosOperationFromMldev(fromObject) {
12031
12214
  const toObject = {};
12032
12215
  const fromName = getValueByPath(fromObject, ['name']);
12033
12216
  if (fromName != null) {
@@ -12050,7 +12233,7 @@ function generateVideosOperationFromMldev$1(fromObject) {
12050
12233
  'generateVideoResponse',
12051
12234
  ]);
12052
12235
  if (fromResponse != null) {
12053
- setValueByPath(toObject, ['response'], generateVideosResponseFromMldev$1(fromResponse));
12236
+ setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
12054
12237
  }
12055
12238
  return toObject;
12056
12239
  }
@@ -12268,6 +12451,12 @@ function candidateFromVertex(fromObject) {
12268
12451
  }
12269
12452
  function generateContentResponseFromVertex(fromObject) {
12270
12453
  const toObject = {};
12454
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12455
+ 'sdkHttpResponse',
12456
+ ]);
12457
+ if (fromSdkHttpResponse != null) {
12458
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12459
+ }
12271
12460
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12272
12461
  if (fromCandidates != null) {
12273
12462
  let transformedList = fromCandidates;
@@ -12580,6 +12769,12 @@ function modelFromVertex(fromObject) {
12580
12769
  }
12581
12770
  function listModelsResponseFromVertex(fromObject) {
12582
12771
  const toObject = {};
12772
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12773
+ 'sdkHttpResponse',
12774
+ ]);
12775
+ if (fromSdkHttpResponse != null) {
12776
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12777
+ }
12583
12778
  const fromNextPageToken = getValueByPath(fromObject, [
12584
12779
  'nextPageToken',
12585
12780
  ]);
@@ -12618,7 +12813,7 @@ function computeTokensResponseFromVertex(fromObject) {
12618
12813
  }
12619
12814
  return toObject;
12620
12815
  }
12621
- function videoFromVertex$1(fromObject) {
12816
+ function videoFromVertex(fromObject) {
12622
12817
  const toObject = {};
12623
12818
  const fromUri = getValueByPath(fromObject, ['gcsUri']);
12624
12819
  if (fromUri != null) {
@@ -12636,22 +12831,22 @@ function videoFromVertex$1(fromObject) {
12636
12831
  }
12637
12832
  return toObject;
12638
12833
  }
12639
- function generatedVideoFromVertex$1(fromObject) {
12834
+ function generatedVideoFromVertex(fromObject) {
12640
12835
  const toObject = {};
12641
12836
  const fromVideo = getValueByPath(fromObject, ['_self']);
12642
12837
  if (fromVideo != null) {
12643
- setValueByPath(toObject, ['video'], videoFromVertex$1(fromVideo));
12838
+ setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
12644
12839
  }
12645
12840
  return toObject;
12646
12841
  }
12647
- function generateVideosResponseFromVertex$1(fromObject) {
12842
+ function generateVideosResponseFromVertex(fromObject) {
12648
12843
  const toObject = {};
12649
12844
  const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
12650
12845
  if (fromGeneratedVideos != null) {
12651
12846
  let transformedList = fromGeneratedVideos;
12652
12847
  if (Array.isArray(transformedList)) {
12653
12848
  transformedList = transformedList.map((item) => {
12654
- return generatedVideoFromVertex$1(item);
12849
+ return generatedVideoFromVertex(item);
12655
12850
  });
12656
12851
  }
12657
12852
  setValueByPath(toObject, ['generatedVideos'], transformedList);
@@ -12670,7 +12865,7 @@ function generateVideosResponseFromVertex$1(fromObject) {
12670
12865
  }
12671
12866
  return toObject;
12672
12867
  }
12673
- function generateVideosOperationFromVertex$1(fromObject) {
12868
+ function generateVideosOperationFromVertex(fromObject) {
12674
12869
  const toObject = {};
12675
12870
  const fromName = getValueByPath(fromObject, ['name']);
12676
12871
  if (fromName != null) {
@@ -12690,7 +12885,7 @@ function generateVideosOperationFromVertex$1(fromObject) {
12690
12885
  }
12691
12886
  const fromResponse = getValueByPath(fromObject, ['response']);
12692
12887
  if (fromResponse != null) {
12693
- setValueByPath(toObject, ['response'], generateVideosResponseFromVertex$1(fromResponse));
12888
+ setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
12694
12889
  }
12695
12890
  return toObject;
12696
12891
  }
@@ -12704,7 +12899,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12704
12899
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12705
12900
  const USER_AGENT_HEADER = 'User-Agent';
12706
12901
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12707
- const SDK_VERSION = '1.9.0'; // x-release-please-version
12902
+ const SDK_VERSION = '1.11.0'; // x-release-please-version
12708
12903
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12709
12904
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12710
12905
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13276,6 +13471,9 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
13276
13471
  */
13277
13472
  // TODO: b/416041229 - Determine how to retrieve the MCP package version.
13278
13473
  const MCP_LABEL = 'mcp_used/unknown';
13474
+ // Whether MCP tool usage is detected from mcpToTool. This is used for
13475
+ // telemetry.
13476
+ let hasMcpToolUsageFromMcpToTool = false;
13279
13477
  // Checks whether the list of tools contains any MCP tools.
13280
13478
  function hasMcpToolUsage(tools) {
13281
13479
  for (const tool of tools) {
@@ -13286,25 +13484,13 @@ function hasMcpToolUsage(tools) {
13286
13484
  return true;
13287
13485
  }
13288
13486
  }
13289
- return false;
13487
+ return hasMcpToolUsageFromMcpToTool;
13290
13488
  }
13291
13489
  // Sets the MCP version label in the Google API client header.
13292
13490
  function setMcpUsageHeader(headers) {
13293
- var _a;
13294
- const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
13295
- headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
13296
- }
13297
- // Checks whether the list of tools contains any MCP clients. Will return true
13298
- // if there is at least one MCP client.
13299
- function hasMcpClientTools(params) {
13300
- var _a, _b, _c;
13301
- 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;
13302
- }
13303
- // Checks whether the list of tools contains any non-MCP tools. Will return true
13304
- // if there is at least one non-MCP tool.
13305
- function hasNonMcpTools(params) {
13306
- var _a, _b, _c;
13307
- 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);
13491
+ var _a;
13492
+ const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
13493
+ headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
13308
13494
  }
13309
13495
  // Returns true if the object is a MCP CallableTool, otherwise false.
13310
13496
  function isMcpCallableTool(object) {
@@ -13443,6 +13629,8 @@ function isMcpClient(client) {
13443
13629
  * versions.
13444
13630
  */
13445
13631
  function mcpToTool(...args) {
13632
+ // Set MCP usage for telemetry.
13633
+ hasMcpToolUsageFromMcpToTool = true;
13446
13634
  if (args.length === 0) {
13447
13635
  throw new Error('No MCP clients provided');
13448
13636
  }
@@ -13788,6 +13976,12 @@ class Live {
13788
13976
  */
13789
13977
  async connect(params) {
13790
13978
  var _a, _b, _c, _d, _e, _f;
13979
+ // TODO: b/404946746 - Support per request HTTP options.
13980
+ if (params.config && params.config.httpOptions) {
13981
+ throw new Error('The Live module does not support httpOptions at request-level in' +
13982
+ ' LiveConnectConfig yet. Please use the client-level httpOptions' +
13983
+ ' configuration instead.');
13984
+ }
13791
13985
  const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
13792
13986
  const apiVersion = this.apiClient.getApiVersion();
13793
13987
  let url;
@@ -14156,6 +14350,18 @@ function shouldDisableAfc(config) {
14156
14350
  function isCallableTool(tool) {
14157
14351
  return 'callTool' in tool && typeof tool.callTool === 'function';
14158
14352
  }
14353
+ // Checks whether the list of tools contains any CallableTools. Will return true
14354
+ // if there is at least one CallableTool.
14355
+ function hasCallableTools(params) {
14356
+ var _a, _b, _c;
14357
+ 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;
14358
+ }
14359
+ // Checks whether the list of tools contains any non-callable tools. Will return
14360
+ // true if there is at least one non-Callable tool.
14361
+ function hasNonCallableTools(params) {
14362
+ var _a, _b, _c;
14363
+ 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;
14364
+ }
14159
14365
  /**
14160
14366
  * Returns whether to append automatic function calling history to the
14161
14367
  * response.
@@ -14214,12 +14420,12 @@ class Models extends BaseModule {
14214
14420
  */
14215
14421
  this.generateContent = async (params) => {
14216
14422
  var _a, _b, _c, _d, _e;
14217
- const transformedParams = await this.processParamsForMcpUsage(params);
14423
+ const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14218
14424
  this.maybeMoveToResponseJsonSchem(params);
14219
- if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
14425
+ if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
14220
14426
  return await this.generateContentInternal(transformedParams);
14221
14427
  }
14222
- if (hasNonMcpTools(params)) {
14428
+ if (hasNonCallableTools(params)) {
14223
14429
  throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
14224
14430
  }
14225
14431
  let response;
@@ -14304,7 +14510,7 @@ class Models extends BaseModule {
14304
14510
  this.generateContentStream = async (params) => {
14305
14511
  this.maybeMoveToResponseJsonSchem(params);
14306
14512
  if (shouldDisableAfc(params.config)) {
14307
- const transformedParams = await this.processParamsForMcpUsage(params);
14513
+ const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14308
14514
  return await this.generateContentStreamInternal(transformedParams);
14309
14515
  }
14310
14516
  else {
@@ -14453,6 +14659,32 @@ class Models extends BaseModule {
14453
14659
  };
14454
14660
  return await this.upscaleImageInternal(apiParams);
14455
14661
  };
14662
+ /**
14663
+ * Generates videos based on a text description and configuration.
14664
+ *
14665
+ * @param params - The parameters for generating videos.
14666
+ * @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
14667
+ *
14668
+ * @example
14669
+ * ```ts
14670
+ * const operation = await ai.models.generateVideos({
14671
+ * model: 'veo-2.0-generate-001',
14672
+ * prompt: 'A neon hologram of a cat driving at top speed',
14673
+ * config: {
14674
+ * numberOfVideos: 1
14675
+ * });
14676
+ *
14677
+ * while (!operation.done) {
14678
+ * await new Promise(resolve => setTimeout(resolve, 10000));
14679
+ * operation = await ai.operations.getVideosOperation({operation: operation});
14680
+ * }
14681
+ *
14682
+ * console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
14683
+ * ```
14684
+ */
14685
+ this.generateVideos = async (params) => {
14686
+ return await this.generateVideosInternal(params);
14687
+ };
14456
14688
  }
14457
14689
  /**
14458
14690
  * This logic is needed for GenerateContentConfig only.
@@ -14478,7 +14710,7 @@ class Models extends BaseModule {
14478
14710
  * modify the original params. Also sets the MCP usage header if there are
14479
14711
  * MCP tools in the parameters.
14480
14712
  */
14481
- async processParamsForMcpUsage(params) {
14713
+ async processParamsMaybeAddMcpUsage(params) {
14482
14714
  var _a, _b, _c;
14483
14715
  const tools = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools;
14484
14716
  if (!tools) {
@@ -14545,7 +14777,7 @@ class Models extends BaseModule {
14545
14777
  remoteCallCount++;
14546
14778
  wereFunctionsCalled = false;
14547
14779
  }
14548
- const transformedParams = yield __await(models.processParamsForMcpUsage(params));
14780
+ const transformedParams = yield __await(models.processParamsMaybeAddMcpUsage(params));
14549
14781
  const response = yield __await(models.generateContentStreamInternal(transformedParams));
14550
14782
  const functionResponses = [];
14551
14783
  const responseContents = [];
@@ -14633,7 +14865,13 @@ class Models extends BaseModule {
14633
14865
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14634
14866
  })
14635
14867
  .then((httpResponse) => {
14636
- return httpResponse.json();
14868
+ return httpResponse.json().then((jsonResponse) => {
14869
+ const response = jsonResponse;
14870
+ response.sdkHttpResponse = {
14871
+ headers: httpResponse.headers,
14872
+ };
14873
+ return response;
14874
+ });
14637
14875
  });
14638
14876
  return response.then((apiResponse) => {
14639
14877
  const resp = generateContentResponseFromVertex(apiResponse);
@@ -14659,7 +14897,13 @@ class Models extends BaseModule {
14659
14897
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
14660
14898
  })
14661
14899
  .then((httpResponse) => {
14662
- return httpResponse.json();
14900
+ return httpResponse.json().then((jsonResponse) => {
14901
+ const response = jsonResponse;
14902
+ response.sdkHttpResponse = {
14903
+ headers: httpResponse.headers,
14904
+ };
14905
+ return response;
14906
+ });
14663
14907
  });
14664
14908
  return response.then((apiResponse) => {
14665
14909
  const resp = generateContentResponseFromMldev(apiResponse);
@@ -14699,6 +14943,9 @@ class Models extends BaseModule {
14699
14943
  _d = false;
14700
14944
  const chunk = _c;
14701
14945
  const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
14946
+ resp['sdkHttpResponse'] = {
14947
+ headers: chunk.headers,
14948
+ };
14702
14949
  const typedResp = new GenerateContentResponse();
14703
14950
  Object.assign(typedResp, resp);
14704
14951
  yield yield __await(typedResp);
@@ -14739,6 +14986,9 @@ class Models extends BaseModule {
14739
14986
  _d = false;
14740
14987
  const chunk = _c;
14741
14988
  const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
14989
+ resp['sdkHttpResponse'] = {
14990
+ headers: chunk.headers,
14991
+ };
14742
14992
  const typedResp = new GenerateContentResponse();
14743
14993
  Object.assign(typedResp, resp);
14744
14994
  yield yield __await(typedResp);
@@ -15065,7 +15315,13 @@ class Models extends BaseModule {
15065
15315
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
15066
15316
  })
15067
15317
  .then((httpResponse) => {
15068
- return httpResponse.json();
15318
+ return httpResponse.json().then((jsonResponse) => {
15319
+ const response = jsonResponse;
15320
+ response.sdkHttpResponse = {
15321
+ headers: httpResponse.headers,
15322
+ };
15323
+ return response;
15324
+ });
15069
15325
  });
15070
15326
  return response.then((apiResponse) => {
15071
15327
  const resp = listModelsResponseFromVertex(apiResponse);
@@ -15091,7 +15347,13 @@ class Models extends BaseModule {
15091
15347
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
15092
15348
  })
15093
15349
  .then((httpResponse) => {
15094
- return httpResponse.json();
15350
+ return httpResponse.json().then((jsonResponse) => {
15351
+ const response = jsonResponse;
15352
+ response.sdkHttpResponse = {
15353
+ headers: httpResponse.headers,
15354
+ };
15355
+ return response;
15356
+ });
15095
15357
  });
15096
15358
  return response.then((apiResponse) => {
15097
15359
  const resp = listModelsResponseFromMldev(apiResponse);
@@ -15391,7 +15653,7 @@ class Models extends BaseModule {
15391
15653
  * console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
15392
15654
  * ```
15393
15655
  */
15394
- async generateVideos(params) {
15656
+ async generateVideosInternal(params) {
15395
15657
  var _a, _b, _c, _d;
15396
15658
  let response;
15397
15659
  let path = '';
@@ -15416,8 +15678,10 @@ class Models extends BaseModule {
15416
15678
  return httpResponse.json();
15417
15679
  });
15418
15680
  return response.then((apiResponse) => {
15419
- const resp = generateVideosOperationFromVertex$1(apiResponse);
15420
- return resp;
15681
+ const resp = generateVideosOperationFromVertex(apiResponse);
15682
+ const typedResp = new GenerateVideosOperation();
15683
+ Object.assign(typedResp, resp);
15684
+ return typedResp;
15421
15685
  });
15422
15686
  }
15423
15687
  else {
@@ -15440,8 +15704,10 @@ class Models extends BaseModule {
15440
15704
  return httpResponse.json();
15441
15705
  });
15442
15706
  return response.then((apiResponse) => {
15443
- const resp = generateVideosOperationFromMldev$1(apiResponse);
15444
- return resp;
15707
+ const resp = generateVideosOperationFromMldev(apiResponse);
15708
+ const typedResp = new GenerateVideosOperation();
15709
+ Object.assign(typedResp, resp);
15710
+ return typedResp;
15445
15711
  });
15446
15712
  }
15447
15713
  }
@@ -15499,164 +15765,6 @@ function fetchPredictOperationParametersToVertex(fromObject) {
15499
15765
  }
15500
15766
  return toObject;
15501
15767
  }
15502
- function videoFromMldev(fromObject) {
15503
- const toObject = {};
15504
- const fromUri = getValueByPath(fromObject, ['video', 'uri']);
15505
- if (fromUri != null) {
15506
- setValueByPath(toObject, ['uri'], fromUri);
15507
- }
15508
- const fromVideoBytes = getValueByPath(fromObject, [
15509
- 'video',
15510
- 'encodedVideo',
15511
- ]);
15512
- if (fromVideoBytes != null) {
15513
- setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
15514
- }
15515
- const fromMimeType = getValueByPath(fromObject, ['encoding']);
15516
- if (fromMimeType != null) {
15517
- setValueByPath(toObject, ['mimeType'], fromMimeType);
15518
- }
15519
- return toObject;
15520
- }
15521
- function generatedVideoFromMldev(fromObject) {
15522
- const toObject = {};
15523
- const fromVideo = getValueByPath(fromObject, ['_self']);
15524
- if (fromVideo != null) {
15525
- setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
15526
- }
15527
- return toObject;
15528
- }
15529
- function generateVideosResponseFromMldev(fromObject) {
15530
- const toObject = {};
15531
- const fromGeneratedVideos = getValueByPath(fromObject, [
15532
- 'generatedSamples',
15533
- ]);
15534
- if (fromGeneratedVideos != null) {
15535
- let transformedList = fromGeneratedVideos;
15536
- if (Array.isArray(transformedList)) {
15537
- transformedList = transformedList.map((item) => {
15538
- return generatedVideoFromMldev(item);
15539
- });
15540
- }
15541
- setValueByPath(toObject, ['generatedVideos'], transformedList);
15542
- }
15543
- const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
15544
- 'raiMediaFilteredCount',
15545
- ]);
15546
- if (fromRaiMediaFilteredCount != null) {
15547
- setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
15548
- }
15549
- const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
15550
- 'raiMediaFilteredReasons',
15551
- ]);
15552
- if (fromRaiMediaFilteredReasons != null) {
15553
- setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
15554
- }
15555
- return toObject;
15556
- }
15557
- function generateVideosOperationFromMldev(fromObject) {
15558
- const toObject = {};
15559
- const fromName = getValueByPath(fromObject, ['name']);
15560
- if (fromName != null) {
15561
- setValueByPath(toObject, ['name'], fromName);
15562
- }
15563
- const fromMetadata = getValueByPath(fromObject, ['metadata']);
15564
- if (fromMetadata != null) {
15565
- setValueByPath(toObject, ['metadata'], fromMetadata);
15566
- }
15567
- const fromDone = getValueByPath(fromObject, ['done']);
15568
- if (fromDone != null) {
15569
- setValueByPath(toObject, ['done'], fromDone);
15570
- }
15571
- const fromError = getValueByPath(fromObject, ['error']);
15572
- if (fromError != null) {
15573
- setValueByPath(toObject, ['error'], fromError);
15574
- }
15575
- const fromResponse = getValueByPath(fromObject, [
15576
- 'response',
15577
- 'generateVideoResponse',
15578
- ]);
15579
- if (fromResponse != null) {
15580
- setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
15581
- }
15582
- return toObject;
15583
- }
15584
- function videoFromVertex(fromObject) {
15585
- const toObject = {};
15586
- const fromUri = getValueByPath(fromObject, ['gcsUri']);
15587
- if (fromUri != null) {
15588
- setValueByPath(toObject, ['uri'], fromUri);
15589
- }
15590
- const fromVideoBytes = getValueByPath(fromObject, [
15591
- 'bytesBase64Encoded',
15592
- ]);
15593
- if (fromVideoBytes != null) {
15594
- setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
15595
- }
15596
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15597
- if (fromMimeType != null) {
15598
- setValueByPath(toObject, ['mimeType'], fromMimeType);
15599
- }
15600
- return toObject;
15601
- }
15602
- function generatedVideoFromVertex(fromObject) {
15603
- const toObject = {};
15604
- const fromVideo = getValueByPath(fromObject, ['_self']);
15605
- if (fromVideo != null) {
15606
- setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
15607
- }
15608
- return toObject;
15609
- }
15610
- function generateVideosResponseFromVertex(fromObject) {
15611
- const toObject = {};
15612
- const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
15613
- if (fromGeneratedVideos != null) {
15614
- let transformedList = fromGeneratedVideos;
15615
- if (Array.isArray(transformedList)) {
15616
- transformedList = transformedList.map((item) => {
15617
- return generatedVideoFromVertex(item);
15618
- });
15619
- }
15620
- setValueByPath(toObject, ['generatedVideos'], transformedList);
15621
- }
15622
- const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
15623
- 'raiMediaFilteredCount',
15624
- ]);
15625
- if (fromRaiMediaFilteredCount != null) {
15626
- setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
15627
- }
15628
- const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
15629
- 'raiMediaFilteredReasons',
15630
- ]);
15631
- if (fromRaiMediaFilteredReasons != null) {
15632
- setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
15633
- }
15634
- return toObject;
15635
- }
15636
- function generateVideosOperationFromVertex(fromObject) {
15637
- const toObject = {};
15638
- const fromName = getValueByPath(fromObject, ['name']);
15639
- if (fromName != null) {
15640
- setValueByPath(toObject, ['name'], fromName);
15641
- }
15642
- const fromMetadata = getValueByPath(fromObject, ['metadata']);
15643
- if (fromMetadata != null) {
15644
- setValueByPath(toObject, ['metadata'], fromMetadata);
15645
- }
15646
- const fromDone = getValueByPath(fromObject, ['done']);
15647
- if (fromDone != null) {
15648
- setValueByPath(toObject, ['done'], fromDone);
15649
- }
15650
- const fromError = getValueByPath(fromObject, ['error']);
15651
- if (fromError != null) {
15652
- setValueByPath(toObject, ['error'], fromError);
15653
- }
15654
- const fromResponse = getValueByPath(fromObject, ['response']);
15655
- if (fromResponse != null) {
15656
- setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
15657
- }
15658
- return toObject;
15659
- }
15660
15768
 
15661
15769
  /**
15662
15770
  * @license
@@ -15686,17 +15794,64 @@ class Operations extends BaseModule {
15686
15794
  if (config && 'httpOptions' in config) {
15687
15795
  httpOptions = config.httpOptions;
15688
15796
  }
15689
- return this.fetchPredictVideosOperationInternal({
15797
+ const rawOperation = await this.fetchPredictVideosOperationInternal({
15798
+ operationName: operation.name,
15799
+ resourceName: resourceName,
15800
+ config: { httpOptions: httpOptions },
15801
+ });
15802
+ return operation._fromAPIResponse({
15803
+ apiResponse: rawOperation,
15804
+ isVertexAI: true,
15805
+ });
15806
+ }
15807
+ else {
15808
+ const rawOperation = await this.getVideosOperationInternal({
15809
+ operationName: operation.name,
15810
+ config: config,
15811
+ });
15812
+ return operation._fromAPIResponse({
15813
+ apiResponse: rawOperation,
15814
+ isVertexAI: false,
15815
+ });
15816
+ }
15817
+ }
15818
+ /**
15819
+ * Gets the status of a long-running operation.
15820
+ *
15821
+ * @param parameters The parameters for the get operation request.
15822
+ * @return The updated Operation object, with the latest status or result.
15823
+ */
15824
+ async get(parameters) {
15825
+ const operation = parameters.operation;
15826
+ const config = parameters.config;
15827
+ if (operation.name === undefined || operation.name === '') {
15828
+ throw new Error('Operation name is required.');
15829
+ }
15830
+ if (this.apiClient.isVertexAI()) {
15831
+ const resourceName = operation.name.split('/operations/')[0];
15832
+ let httpOptions = undefined;
15833
+ if (config && 'httpOptions' in config) {
15834
+ httpOptions = config.httpOptions;
15835
+ }
15836
+ const rawOperation = await this.fetchPredictVideosOperationInternal({
15690
15837
  operationName: operation.name,
15691
15838
  resourceName: resourceName,
15692
15839
  config: { httpOptions: httpOptions },
15693
15840
  });
15841
+ return operation._fromAPIResponse({
15842
+ apiResponse: rawOperation,
15843
+ isVertexAI: true,
15844
+ });
15694
15845
  }
15695
15846
  else {
15696
- return this.getVideosOperationInternal({
15847
+ const rawOperation = await this.getVideosOperationInternal({
15697
15848
  operationName: operation.name,
15698
15849
  config: config,
15699
15850
  });
15851
+ return operation._fromAPIResponse({
15852
+ apiResponse: rawOperation,
15853
+ isVertexAI: false,
15854
+ });
15700
15855
  }
15701
15856
  }
15702
15857
  async getVideosOperationInternal(params) {
@@ -15723,10 +15878,7 @@ class Operations extends BaseModule {
15723
15878
  .then((httpResponse) => {
15724
15879
  return httpResponse.json();
15725
15880
  });
15726
- return response.then((apiResponse) => {
15727
- const resp = generateVideosOperationFromVertex(apiResponse);
15728
- return resp;
15729
- });
15881
+ return response;
15730
15882
  }
15731
15883
  else {
15732
15884
  const body = getOperationParametersToMldev(params);
@@ -15747,10 +15899,7 @@ class Operations extends BaseModule {
15747
15899
  .then((httpResponse) => {
15748
15900
  return httpResponse.json();
15749
15901
  });
15750
- return response.then((apiResponse) => {
15751
- const resp = generateVideosOperationFromMldev(apiResponse);
15752
- return resp;
15753
- });
15902
+ return response;
15754
15903
  }
15755
15904
  }
15756
15905
  async fetchPredictVideosOperationInternal(params) {
@@ -15777,10 +15926,7 @@ class Operations extends BaseModule {
15777
15926
  .then((httpResponse) => {
15778
15927
  return httpResponse.json();
15779
15928
  });
15780
- return response.then((apiResponse) => {
15781
- const resp = generateVideosOperationFromVertex(apiResponse);
15782
- return resp;
15783
- });
15929
+ return response;
15784
15930
  }
15785
15931
  else {
15786
15932
  throw new Error('This method is only supported by the Vertex AI.');
@@ -17181,6 +17327,12 @@ function tuningJobFromMldev(fromObject) {
17181
17327
  }
17182
17328
  function listTuningJobsResponseFromMldev(fromObject) {
17183
17329
  const toObject = {};
17330
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
17331
+ 'sdkHttpResponse',
17332
+ ]);
17333
+ if (fromSdkHttpResponse != null) {
17334
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
17335
+ }
17184
17336
  const fromNextPageToken = getValueByPath(fromObject, [
17185
17337
  'nextPageToken',
17186
17338
  ]);
@@ -17199,7 +17351,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
17199
17351
  }
17200
17352
  return toObject;
17201
17353
  }
17202
- function operationFromMldev(fromObject) {
17354
+ function tuningOperationFromMldev(fromObject) {
17203
17355
  const toObject = {};
17204
17356
  const fromName = getValueByPath(fromObject, ['name']);
17205
17357
  if (fromName != null) {
@@ -17369,6 +17521,12 @@ function tuningJobFromVertex(fromObject) {
17369
17521
  }
17370
17522
  function listTuningJobsResponseFromVertex(fromObject) {
17371
17523
  const toObject = {};
17524
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
17525
+ 'sdkHttpResponse',
17526
+ ]);
17527
+ if (fromSdkHttpResponse != null) {
17528
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
17529
+ }
17372
17530
  const fromNextPageToken = getValueByPath(fromObject, [
17373
17531
  'nextPageToken',
17374
17532
  ]);
@@ -17529,7 +17687,13 @@ class Tunings extends BaseModule {
17529
17687
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
17530
17688
  })
17531
17689
  .then((httpResponse) => {
17532
- return httpResponse.json();
17690
+ return httpResponse.json().then((jsonResponse) => {
17691
+ const response = jsonResponse;
17692
+ response.sdkHttpResponse = {
17693
+ headers: httpResponse.headers,
17694
+ };
17695
+ return response;
17696
+ });
17533
17697
  });
17534
17698
  return response.then((apiResponse) => {
17535
17699
  const resp = listTuningJobsResponseFromVertex(apiResponse);
@@ -17555,7 +17719,13 @@ class Tunings extends BaseModule {
17555
17719
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
17556
17720
  })
17557
17721
  .then((httpResponse) => {
17558
- return httpResponse.json();
17722
+ return httpResponse.json().then((jsonResponse) => {
17723
+ const response = jsonResponse;
17724
+ response.sdkHttpResponse = {
17725
+ headers: httpResponse.headers,
17726
+ };
17727
+ return response;
17728
+ });
17559
17729
  });
17560
17730
  return response.then((apiResponse) => {
17561
17731
  const resp = listTuningJobsResponseFromMldev(apiResponse);
@@ -17626,7 +17796,7 @@ class Tunings extends BaseModule {
17626
17796
  return httpResponse.json();
17627
17797
  });
17628
17798
  return response.then((apiResponse) => {
17629
- const resp = operationFromMldev(apiResponse);
17799
+ const resp = tuningOperationFromMldev(apiResponse);
17630
17800
  return resp;
17631
17801
  });
17632
17802
  }
@@ -17980,7 +18150,7 @@ class GoogleGenAI {
17980
18150
  this.apiKey = undefined;
17981
18151
  }
17982
18152
  }
17983
- const baseUrl = getBaseUrl(options, getEnv('GOOGLE_VERTEX_BASE_URL'), getEnv('GOOGLE_GEMINI_BASE_URL'));
18153
+ const baseUrl = getBaseUrl(options.httpOptions, options.vertexai, getEnv('GOOGLE_VERTEX_BASE_URL'), getEnv('GOOGLE_GEMINI_BASE_URL'));
17984
18154
  if (baseUrl) {
17985
18155
  if (options.httpOptions) {
17986
18156
  options.httpOptions.baseUrl = baseUrl;
@@ -18039,5 +18209,5 @@ function getApiKeyFromEnv() {
18039
18209
  return envGoogleApiKey || envGeminiApiKey;
18040
18210
  }
18041
18211
 
18042
- export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
18212
+ export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
18043
18213
  //# sourceMappingURL=index.mjs.map