@google/genai 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -12
- package/dist/genai.d.ts +112 -24
- package/dist/index.cjs +1637 -1466
- package/dist/index.mjs +1637 -1467
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1644 -1473
- package/dist/node/index.mjs +1644 -1474
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +112 -24
- package/dist/web/index.mjs +1645 -1475
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +112 -24
- package/package.json +2 -2
package/dist/node/index.cjs
CHANGED
|
@@ -72,18 +72,18 @@ function getDefaultBaseUrls() {
|
|
|
72
72
|
* 2. Base URLs set via the latest call to setDefaultBaseUrls.
|
|
73
73
|
* 3. Base URLs set via environment variables.
|
|
74
74
|
*/
|
|
75
|
-
function getBaseUrl(
|
|
76
|
-
var _a, _b
|
|
77
|
-
if (!(
|
|
75
|
+
function getBaseUrl(httpOptions, vertexai, vertexBaseUrlFromEnv, geminiBaseUrlFromEnv) {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
if (!(httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl)) {
|
|
78
78
|
const defaultBaseUrls = getDefaultBaseUrls();
|
|
79
|
-
if (
|
|
80
|
-
return (
|
|
79
|
+
if (vertexai) {
|
|
80
|
+
return (_a = defaultBaseUrls.vertexUrl) !== null && _a !== void 0 ? _a : vertexBaseUrlFromEnv;
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
return (
|
|
83
|
+
return (_b = defaultBaseUrls.geminiUrl) !== null && _b !== void 0 ? _b : geminiBaseUrlFromEnv;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return httpOptions.baseUrl;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -218,6 +218,20 @@ function getValueByPath(data, keys) {
|
|
|
218
218
|
* Copyright 2025 Google LLC
|
|
219
219
|
* SPDX-License-Identifier: Apache-2.0
|
|
220
220
|
*/
|
|
221
|
+
function tBytes$1(fromBytes) {
|
|
222
|
+
if (typeof fromBytes !== 'string') {
|
|
223
|
+
throw new Error('fromImageBytes must be a string');
|
|
224
|
+
}
|
|
225
|
+
// TODO(b/389133914): Remove dummy bytes converter.
|
|
226
|
+
return fromBytes;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @license
|
|
231
|
+
* Copyright 2025 Google LLC
|
|
232
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
233
|
+
*/
|
|
234
|
+
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
|
|
221
235
|
/** Required. Outcome of the code execution. */
|
|
222
236
|
exports.Outcome = void 0;
|
|
223
237
|
(function (Outcome) {
|
|
@@ -1711,6 +1725,65 @@ class LiveServerMessage {
|
|
|
1711
1725
|
return data.length > 0 ? btoa(data) : undefined;
|
|
1712
1726
|
}
|
|
1713
1727
|
}
|
|
1728
|
+
/** A video generation long-running operation. */
|
|
1729
|
+
class GenerateVideosOperation {
|
|
1730
|
+
/**
|
|
1731
|
+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
1732
|
+
* @internal
|
|
1733
|
+
*/
|
|
1734
|
+
_fromAPIResponse({ apiResponse, isVertexAI, }) {
|
|
1735
|
+
const operation = new GenerateVideosOperation();
|
|
1736
|
+
operation.name = apiResponse['name'];
|
|
1737
|
+
operation.metadata = apiResponse['metadata'];
|
|
1738
|
+
operation.done = apiResponse['done'];
|
|
1739
|
+
operation.error = apiResponse['error'];
|
|
1740
|
+
if (isVertexAI) {
|
|
1741
|
+
const response = apiResponse['response'];
|
|
1742
|
+
if (response) {
|
|
1743
|
+
const operationResponse = new GenerateVideosResponse();
|
|
1744
|
+
const responseVideos = response['videos'];
|
|
1745
|
+
operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
|
|
1746
|
+
return {
|
|
1747
|
+
video: {
|
|
1748
|
+
uri: generatedVideo['gcsUri'],
|
|
1749
|
+
videoBytes: generatedVideo['bytesBase64Encoded']
|
|
1750
|
+
? tBytes$1(generatedVideo['bytesBase64Encoded'])
|
|
1751
|
+
: undefined,
|
|
1752
|
+
mimeType: generatedVideo['mimeType'],
|
|
1753
|
+
},
|
|
1754
|
+
};
|
|
1755
|
+
});
|
|
1756
|
+
operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
|
|
1757
|
+
operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
|
|
1758
|
+
operation.response = operationResponse;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
else {
|
|
1762
|
+
const response = apiResponse['response'];
|
|
1763
|
+
if (response) {
|
|
1764
|
+
const operationResponse = new GenerateVideosResponse();
|
|
1765
|
+
const generatedVideoResponse = response['generateVideoResponse'];
|
|
1766
|
+
const responseVideos = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['generatedSamples'];
|
|
1767
|
+
operationResponse.generatedVideos = responseVideos === null || responseVideos === void 0 ? void 0 : responseVideos.map((generatedVideo) => {
|
|
1768
|
+
const video = generatedVideo['video'];
|
|
1769
|
+
return {
|
|
1770
|
+
video: {
|
|
1771
|
+
uri: video === null || video === void 0 ? void 0 : video['uri'],
|
|
1772
|
+
videoBytes: (video === null || video === void 0 ? void 0 : video['encodedVideo'])
|
|
1773
|
+
? tBytes$1(video === null || video === void 0 ? void 0 : video['encodedVideo'])
|
|
1774
|
+
: undefined,
|
|
1775
|
+
mimeType: generatedVideo['encoding'],
|
|
1776
|
+
},
|
|
1777
|
+
};
|
|
1778
|
+
});
|
|
1779
|
+
operationResponse.raiMediaFilteredCount = response['raiMediaFilteredCount'];
|
|
1780
|
+
operationResponse.raiMediaFilteredReasons = response['raiMediaFilteredReasons'];
|
|
1781
|
+
operation.response = operationResponse;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
return operation;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1714
1787
|
/** Client generated response to a `ToolCall` received from the server.
|
|
1715
1788
|
|
|
1716
1789
|
Individual `FunctionResponse` objects are matched to the respective
|
|
@@ -2272,11 +2345,7 @@ function tTuningJobStatus(status) {
|
|
|
2272
2345
|
}
|
|
2273
2346
|
}
|
|
2274
2347
|
function tBytes(fromImageBytes) {
|
|
2275
|
-
|
|
2276
|
-
throw new Error('fromImageBytes must be a string');
|
|
2277
|
-
}
|
|
2278
|
-
// TODO(b/389133914): Remove dummy bytes converter.
|
|
2279
|
-
return fromImageBytes;
|
|
2348
|
+
return tBytes$1(fromImageBytes);
|
|
2280
2349
|
}
|
|
2281
2350
|
function _isFile(origin) {
|
|
2282
2351
|
return (origin !== null &&
|
|
@@ -2439,6 +2508,9 @@ function tBatchJobSource(apiClient, src) {
|
|
|
2439
2508
|
throw new Error(`Unsupported source: ${src}`);
|
|
2440
2509
|
}
|
|
2441
2510
|
function tBatchJobDestination(dest) {
|
|
2511
|
+
if (typeof dest !== 'string') {
|
|
2512
|
+
return dest;
|
|
2513
|
+
}
|
|
2442
2514
|
const destString = dest;
|
|
2443
2515
|
if (destString.startsWith('gs://')) {
|
|
2444
2516
|
return {
|
|
@@ -3424,10 +3496,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
|
|
|
3424
3496
|
}
|
|
3425
3497
|
return toObject;
|
|
3426
3498
|
}
|
|
3427
|
-
function jobErrorFromMldev() {
|
|
3428
|
-
const toObject = {};
|
|
3429
|
-
return toObject;
|
|
3430
|
-
}
|
|
3431
3499
|
function videoMetadataFromMldev$2(fromObject) {
|
|
3432
3500
|
const toObject = {};
|
|
3433
3501
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
@@ -3632,6 +3700,12 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3632
3700
|
}
|
|
3633
3701
|
function generateContentResponseFromMldev$1(fromObject) {
|
|
3634
3702
|
const toObject = {};
|
|
3703
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3704
|
+
'sdkHttpResponse',
|
|
3705
|
+
]);
|
|
3706
|
+
if (fromSdkHttpResponse != null) {
|
|
3707
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3708
|
+
}
|
|
3635
3709
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
3636
3710
|
if (fromCandidates != null) {
|
|
3637
3711
|
let transformedList = fromCandidates;
|
|
@@ -3660,6 +3734,22 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
3660
3734
|
}
|
|
3661
3735
|
return toObject;
|
|
3662
3736
|
}
|
|
3737
|
+
function jobErrorFromMldev(fromObject) {
|
|
3738
|
+
const toObject = {};
|
|
3739
|
+
const fromDetails = getValueByPath(fromObject, ['details']);
|
|
3740
|
+
if (fromDetails != null) {
|
|
3741
|
+
setValueByPath(toObject, ['details'], fromDetails);
|
|
3742
|
+
}
|
|
3743
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
3744
|
+
if (fromCode != null) {
|
|
3745
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
3746
|
+
}
|
|
3747
|
+
const fromMessage = getValueByPath(fromObject, ['message']);
|
|
3748
|
+
if (fromMessage != null) {
|
|
3749
|
+
setValueByPath(toObject, ['message'], fromMessage);
|
|
3750
|
+
}
|
|
3751
|
+
return toObject;
|
|
3752
|
+
}
|
|
3663
3753
|
function inlinedResponseFromMldev(fromObject) {
|
|
3664
3754
|
const toObject = {};
|
|
3665
3755
|
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
@@ -3668,7 +3758,7 @@ function inlinedResponseFromMldev(fromObject) {
|
|
|
3668
3758
|
}
|
|
3669
3759
|
const fromError = getValueByPath(fromObject, ['error']);
|
|
3670
3760
|
if (fromError != null) {
|
|
3671
|
-
setValueByPath(toObject, ['error'], jobErrorFromMldev());
|
|
3761
|
+
setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
|
|
3672
3762
|
}
|
|
3673
3763
|
return toObject;
|
|
3674
3764
|
}
|
|
@@ -3743,6 +3833,12 @@ function batchJobFromMldev(fromObject) {
|
|
|
3743
3833
|
}
|
|
3744
3834
|
function listBatchJobsResponseFromMldev(fromObject) {
|
|
3745
3835
|
const toObject = {};
|
|
3836
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3837
|
+
'sdkHttpResponse',
|
|
3838
|
+
]);
|
|
3839
|
+
if (fromSdkHttpResponse != null) {
|
|
3840
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3841
|
+
}
|
|
3746
3842
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
3747
3843
|
'nextPageToken',
|
|
3748
3844
|
]);
|
|
@@ -3773,7 +3869,7 @@ function deleteResourceJobFromMldev(fromObject) {
|
|
|
3773
3869
|
}
|
|
3774
3870
|
const fromError = getValueByPath(fromObject, ['error']);
|
|
3775
3871
|
if (fromError != null) {
|
|
3776
|
-
setValueByPath(toObject, ['error'], jobErrorFromMldev());
|
|
3872
|
+
setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
|
|
3777
3873
|
}
|
|
3778
3874
|
return toObject;
|
|
3779
3875
|
}
|
|
@@ -3884,6 +3980,12 @@ function batchJobFromVertex(fromObject) {
|
|
|
3884
3980
|
}
|
|
3885
3981
|
function listBatchJobsResponseFromVertex(fromObject) {
|
|
3886
3982
|
const toObject = {};
|
|
3983
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3984
|
+
'sdkHttpResponse',
|
|
3985
|
+
]);
|
|
3986
|
+
if (fromSdkHttpResponse != null) {
|
|
3987
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3988
|
+
}
|
|
3887
3989
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
3888
3990
|
'nextPageToken',
|
|
3889
3991
|
]);
|
|
@@ -3926,9 +4028,6 @@ function deleteResourceJobFromVertex(fromObject) {
|
|
|
3926
4028
|
* Copyright 2025 Google LLC
|
|
3927
4029
|
* SPDX-License-Identifier: Apache-2.0
|
|
3928
4030
|
*/
|
|
3929
|
-
/**
|
|
3930
|
-
* Pagers for the GenAI List APIs.
|
|
3931
|
-
*/
|
|
3932
4031
|
exports.PagedItem = void 0;
|
|
3933
4032
|
(function (PagedItem) {
|
|
3934
4033
|
PagedItem["PAGED_ITEM_BATCH_JOBS"] = "batchJobs";
|
|
@@ -3951,9 +4050,10 @@ class Pager {
|
|
|
3951
4050
|
var _a, _b;
|
|
3952
4051
|
this.nameInternal = name;
|
|
3953
4052
|
this.pageInternal = response[this.nameInternal] || [];
|
|
4053
|
+
this.sdkHttpResponseInternal = response === null || response === void 0 ? void 0 : response.sdkHttpResponse;
|
|
3954
4054
|
this.idxInternal = 0;
|
|
3955
4055
|
let requestParams = { config: {} };
|
|
3956
|
-
if (!params) {
|
|
4056
|
+
if (!params || Object.keys(params).length === 0) {
|
|
3957
4057
|
requestParams = { config: {} };
|
|
3958
4058
|
}
|
|
3959
4059
|
else if (typeof params === 'object') {
|
|
@@ -3997,6 +4097,12 @@ class Pager {
|
|
|
3997
4097
|
get pageSize() {
|
|
3998
4098
|
return this.pageInternalSize;
|
|
3999
4099
|
}
|
|
4100
|
+
/**
|
|
4101
|
+
* Returns the headers of the API response.
|
|
4102
|
+
*/
|
|
4103
|
+
get sdkHttpResponse() {
|
|
4104
|
+
return this.sdkHttpResponseInternal;
|
|
4105
|
+
}
|
|
4000
4106
|
/**
|
|
4001
4107
|
* Returns the parameters when making the API request for the next page.
|
|
4002
4108
|
*
|
|
@@ -4366,7 +4472,13 @@ class Batches extends BaseModule {
|
|
|
4366
4472
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
4367
4473
|
})
|
|
4368
4474
|
.then((httpResponse) => {
|
|
4369
|
-
return httpResponse.json()
|
|
4475
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4476
|
+
const response = jsonResponse;
|
|
4477
|
+
response.sdkHttpResponse = {
|
|
4478
|
+
headers: httpResponse.headers,
|
|
4479
|
+
};
|
|
4480
|
+
return response;
|
|
4481
|
+
});
|
|
4370
4482
|
});
|
|
4371
4483
|
return response.then((apiResponse) => {
|
|
4372
4484
|
const resp = listBatchJobsResponseFromVertex(apiResponse);
|
|
@@ -4392,7 +4504,13 @@ class Batches extends BaseModule {
|
|
|
4392
4504
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
4393
4505
|
})
|
|
4394
4506
|
.then((httpResponse) => {
|
|
4395
|
-
return httpResponse.json()
|
|
4507
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4508
|
+
const response = jsonResponse;
|
|
4509
|
+
response.sdkHttpResponse = {
|
|
4510
|
+
headers: httpResponse.headers,
|
|
4511
|
+
};
|
|
4512
|
+
return response;
|
|
4513
|
+
});
|
|
4396
4514
|
});
|
|
4397
4515
|
return response.then((apiResponse) => {
|
|
4398
4516
|
const resp = listBatchJobsResponseFromMldev(apiResponse);
|
|
@@ -5445,6 +5563,12 @@ function deleteCachedContentResponseFromMldev() {
|
|
|
5445
5563
|
}
|
|
5446
5564
|
function listCachedContentsResponseFromMldev(fromObject) {
|
|
5447
5565
|
const toObject = {};
|
|
5566
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
5567
|
+
'sdkHttpResponse',
|
|
5568
|
+
]);
|
|
5569
|
+
if (fromSdkHttpResponse != null) {
|
|
5570
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
5571
|
+
}
|
|
5448
5572
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
5449
5573
|
'nextPageToken',
|
|
5450
5574
|
]);
|
|
@@ -5505,6 +5629,12 @@ function deleteCachedContentResponseFromVertex() {
|
|
|
5505
5629
|
}
|
|
5506
5630
|
function listCachedContentsResponseFromVertex(fromObject) {
|
|
5507
5631
|
const toObject = {};
|
|
5632
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
5633
|
+
'sdkHttpResponse',
|
|
5634
|
+
]);
|
|
5635
|
+
if (fromSdkHttpResponse != null) {
|
|
5636
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
5637
|
+
}
|
|
5508
5638
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
5509
5639
|
'nextPageToken',
|
|
5510
5640
|
]);
|
|
@@ -5857,7 +5987,13 @@ class Caches extends BaseModule {
|
|
|
5857
5987
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
5858
5988
|
})
|
|
5859
5989
|
.then((httpResponse) => {
|
|
5860
|
-
return httpResponse.json()
|
|
5990
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
5991
|
+
const response = jsonResponse;
|
|
5992
|
+
response.sdkHttpResponse = {
|
|
5993
|
+
headers: httpResponse.headers,
|
|
5994
|
+
};
|
|
5995
|
+
return response;
|
|
5996
|
+
});
|
|
5861
5997
|
});
|
|
5862
5998
|
return response.then((apiResponse) => {
|
|
5863
5999
|
const resp = listCachedContentsResponseFromVertex(apiResponse);
|
|
@@ -5883,7 +6019,13 @@ class Caches extends BaseModule {
|
|
|
5883
6019
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
5884
6020
|
})
|
|
5885
6021
|
.then((httpResponse) => {
|
|
5886
|
-
return httpResponse.json()
|
|
6022
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
6023
|
+
const response = jsonResponse;
|
|
6024
|
+
response.sdkHttpResponse = {
|
|
6025
|
+
headers: httpResponse.headers,
|
|
6026
|
+
};
|
|
6027
|
+
return response;
|
|
6028
|
+
});
|
|
5887
6029
|
});
|
|
5888
6030
|
return response.then((apiResponse) => {
|
|
5889
6031
|
const resp = listCachedContentsResponseFromMldev(apiResponse);
|
|
@@ -6521,6 +6663,12 @@ function fileFromMldev(fromObject) {
|
|
|
6521
6663
|
}
|
|
6522
6664
|
function listFilesResponseFromMldev(fromObject) {
|
|
6523
6665
|
const toObject = {};
|
|
6666
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
6667
|
+
'sdkHttpResponse',
|
|
6668
|
+
]);
|
|
6669
|
+
if (fromSdkHttpResponse != null) {
|
|
6670
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
6671
|
+
}
|
|
6524
6672
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
6525
6673
|
'nextPageToken',
|
|
6526
6674
|
]);
|
|
@@ -6539,8 +6687,14 @@ function listFilesResponseFromMldev(fromObject) {
|
|
|
6539
6687
|
}
|
|
6540
6688
|
return toObject;
|
|
6541
6689
|
}
|
|
6542
|
-
function createFileResponseFromMldev() {
|
|
6690
|
+
function createFileResponseFromMldev(fromObject) {
|
|
6543
6691
|
const toObject = {};
|
|
6692
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
6693
|
+
'sdkHttpResponse',
|
|
6694
|
+
]);
|
|
6695
|
+
if (fromSdkHttpResponse != null) {
|
|
6696
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
6697
|
+
}
|
|
6544
6698
|
return toObject;
|
|
6545
6699
|
}
|
|
6546
6700
|
function deleteFileResponseFromMldev() {
|
|
@@ -6676,7 +6830,13 @@ class Files extends BaseModule {
|
|
|
6676
6830
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
6677
6831
|
})
|
|
6678
6832
|
.then((httpResponse) => {
|
|
6679
|
-
return httpResponse.json()
|
|
6833
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
6834
|
+
const response = jsonResponse;
|
|
6835
|
+
response.sdkHttpResponse = {
|
|
6836
|
+
headers: httpResponse.headers,
|
|
6837
|
+
};
|
|
6838
|
+
return response;
|
|
6839
|
+
});
|
|
6680
6840
|
});
|
|
6681
6841
|
return response.then((apiResponse) => {
|
|
6682
6842
|
const resp = listFilesResponseFromMldev(apiResponse);
|
|
@@ -6713,8 +6873,8 @@ class Files extends BaseModule {
|
|
|
6713
6873
|
.then((httpResponse) => {
|
|
6714
6874
|
return httpResponse.json();
|
|
6715
6875
|
});
|
|
6716
|
-
return response.then(() => {
|
|
6717
|
-
const resp = createFileResponseFromMldev();
|
|
6876
|
+
return response.then((apiResponse) => {
|
|
6877
|
+
const resp = createFileResponseFromMldev(apiResponse);
|
|
6718
6878
|
const typedResp = new CreateFileResponse();
|
|
6719
6879
|
Object.assign(typedResp, resp);
|
|
6720
6880
|
return typedResp;
|
|
@@ -6832,14 +6992,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
|
|
|
6832
6992
|
}
|
|
6833
6993
|
return toObject;
|
|
6834
6994
|
}
|
|
6835
|
-
function prebuiltVoiceConfigToVertex$1(fromObject) {
|
|
6836
|
-
const toObject = {};
|
|
6837
|
-
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
6838
|
-
if (fromVoiceName != null) {
|
|
6839
|
-
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
6840
|
-
}
|
|
6841
|
-
return toObject;
|
|
6842
|
-
}
|
|
6843
6995
|
function voiceConfigToMldev$2(fromObject) {
|
|
6844
6996
|
const toObject = {};
|
|
6845
6997
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
@@ -6850,16 +7002,6 @@ function voiceConfigToMldev$2(fromObject) {
|
|
|
6850
7002
|
}
|
|
6851
7003
|
return toObject;
|
|
6852
7004
|
}
|
|
6853
|
-
function voiceConfigToVertex$1(fromObject) {
|
|
6854
|
-
const toObject = {};
|
|
6855
|
-
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
6856
|
-
'prebuiltVoiceConfig',
|
|
6857
|
-
]);
|
|
6858
|
-
if (fromPrebuiltVoiceConfig != null) {
|
|
6859
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
|
|
6860
|
-
}
|
|
6861
|
-
return toObject;
|
|
6862
|
-
}
|
|
6863
7005
|
function speakerVoiceConfigToMldev$2(fromObject) {
|
|
6864
7006
|
const toObject = {};
|
|
6865
7007
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
@@ -6906,21 +7048,6 @@ function speechConfigToMldev$2(fromObject) {
|
|
|
6906
7048
|
}
|
|
6907
7049
|
return toObject;
|
|
6908
7050
|
}
|
|
6909
|
-
function speechConfigToVertex$1(fromObject) {
|
|
6910
|
-
const toObject = {};
|
|
6911
|
-
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
6912
|
-
if (fromVoiceConfig != null) {
|
|
6913
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
6914
|
-
}
|
|
6915
|
-
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
6916
|
-
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
6917
|
-
}
|
|
6918
|
-
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
6919
|
-
if (fromLanguageCode != null) {
|
|
6920
|
-
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
6921
|
-
}
|
|
6922
|
-
return toObject;
|
|
6923
|
-
}
|
|
6924
7051
|
function videoMetadataToMldev$2(fromObject) {
|
|
6925
7052
|
const toObject = {};
|
|
6926
7053
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
@@ -6937,22 +7064,6 @@ function videoMetadataToMldev$2(fromObject) {
|
|
|
6937
7064
|
}
|
|
6938
7065
|
return toObject;
|
|
6939
7066
|
}
|
|
6940
|
-
function videoMetadataToVertex$1(fromObject) {
|
|
6941
|
-
const toObject = {};
|
|
6942
|
-
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
6943
|
-
if (fromFps != null) {
|
|
6944
|
-
setValueByPath(toObject, ['fps'], fromFps);
|
|
6945
|
-
}
|
|
6946
|
-
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
6947
|
-
if (fromEndOffset != null) {
|
|
6948
|
-
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
6949
|
-
}
|
|
6950
|
-
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
6951
|
-
if (fromStartOffset != null) {
|
|
6952
|
-
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
6953
|
-
}
|
|
6954
|
-
return toObject;
|
|
6955
|
-
}
|
|
6956
7067
|
function blobToMldev$2(fromObject) {
|
|
6957
7068
|
const toObject = {};
|
|
6958
7069
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6968,22 +7079,6 @@ function blobToMldev$2(fromObject) {
|
|
|
6968
7079
|
}
|
|
6969
7080
|
return toObject;
|
|
6970
7081
|
}
|
|
6971
|
-
function blobToVertex$1(fromObject) {
|
|
6972
|
-
const toObject = {};
|
|
6973
|
-
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
6974
|
-
if (fromDisplayName != null) {
|
|
6975
|
-
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
6976
|
-
}
|
|
6977
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
6978
|
-
if (fromData != null) {
|
|
6979
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
6980
|
-
}
|
|
6981
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
6982
|
-
if (fromMimeType != null) {
|
|
6983
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
6984
|
-
}
|
|
6985
|
-
return toObject;
|
|
6986
|
-
}
|
|
6987
7082
|
function fileDataToMldev$2(fromObject) {
|
|
6988
7083
|
const toObject = {};
|
|
6989
7084
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6999,22 +7094,6 @@ function fileDataToMldev$2(fromObject) {
|
|
|
6999
7094
|
}
|
|
7000
7095
|
return toObject;
|
|
7001
7096
|
}
|
|
7002
|
-
function fileDataToVertex$1(fromObject) {
|
|
7003
|
-
const toObject = {};
|
|
7004
|
-
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
7005
|
-
if (fromDisplayName != null) {
|
|
7006
|
-
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
7007
|
-
}
|
|
7008
|
-
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
7009
|
-
if (fromFileUri != null) {
|
|
7010
|
-
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
7011
|
-
}
|
|
7012
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7013
|
-
if (fromMimeType != null) {
|
|
7014
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7015
|
-
}
|
|
7016
|
-
return toObject;
|
|
7017
|
-
}
|
|
7018
7097
|
function partToMldev$2(fromObject) {
|
|
7019
7098
|
const toObject = {};
|
|
7020
7099
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -7069,60 +7148,6 @@ function partToMldev$2(fromObject) {
|
|
|
7069
7148
|
}
|
|
7070
7149
|
return toObject;
|
|
7071
7150
|
}
|
|
7072
|
-
function partToVertex$1(fromObject) {
|
|
7073
|
-
const toObject = {};
|
|
7074
|
-
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
7075
|
-
'videoMetadata',
|
|
7076
|
-
]);
|
|
7077
|
-
if (fromVideoMetadata != null) {
|
|
7078
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
|
|
7079
|
-
}
|
|
7080
|
-
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
7081
|
-
if (fromThought != null) {
|
|
7082
|
-
setValueByPath(toObject, ['thought'], fromThought);
|
|
7083
|
-
}
|
|
7084
|
-
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
7085
|
-
if (fromInlineData != null) {
|
|
7086
|
-
setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
|
|
7087
|
-
}
|
|
7088
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7089
|
-
if (fromFileData != null) {
|
|
7090
|
-
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
|
|
7091
|
-
}
|
|
7092
|
-
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
7093
|
-
'thoughtSignature',
|
|
7094
|
-
]);
|
|
7095
|
-
if (fromThoughtSignature != null) {
|
|
7096
|
-
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
7097
|
-
}
|
|
7098
|
-
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7099
|
-
'codeExecutionResult',
|
|
7100
|
-
]);
|
|
7101
|
-
if (fromCodeExecutionResult != null) {
|
|
7102
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
7103
|
-
}
|
|
7104
|
-
const fromExecutableCode = getValueByPath(fromObject, [
|
|
7105
|
-
'executableCode',
|
|
7106
|
-
]);
|
|
7107
|
-
if (fromExecutableCode != null) {
|
|
7108
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
7109
|
-
}
|
|
7110
|
-
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
7111
|
-
if (fromFunctionCall != null) {
|
|
7112
|
-
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
7113
|
-
}
|
|
7114
|
-
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
7115
|
-
'functionResponse',
|
|
7116
|
-
]);
|
|
7117
|
-
if (fromFunctionResponse != null) {
|
|
7118
|
-
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
7119
|
-
}
|
|
7120
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
7121
|
-
if (fromText != null) {
|
|
7122
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
7123
|
-
}
|
|
7124
|
-
return toObject;
|
|
7125
|
-
}
|
|
7126
7151
|
function contentToMldev$2(fromObject) {
|
|
7127
7152
|
const toObject = {};
|
|
7128
7153
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -7141,24 +7166,6 @@ function contentToMldev$2(fromObject) {
|
|
|
7141
7166
|
}
|
|
7142
7167
|
return toObject;
|
|
7143
7168
|
}
|
|
7144
|
-
function contentToVertex$1(fromObject) {
|
|
7145
|
-
const toObject = {};
|
|
7146
|
-
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7147
|
-
if (fromParts != null) {
|
|
7148
|
-
let transformedList = fromParts;
|
|
7149
|
-
if (Array.isArray(transformedList)) {
|
|
7150
|
-
transformedList = transformedList.map((item) => {
|
|
7151
|
-
return partToVertex$1(item);
|
|
7152
|
-
});
|
|
7153
|
-
}
|
|
7154
|
-
setValueByPath(toObject, ['parts'], transformedList);
|
|
7155
|
-
}
|
|
7156
|
-
const fromRole = getValueByPath(fromObject, ['role']);
|
|
7157
|
-
if (fromRole != null) {
|
|
7158
|
-
setValueByPath(toObject, ['role'], fromRole);
|
|
7159
|
-
}
|
|
7160
|
-
return toObject;
|
|
7161
|
-
}
|
|
7162
7169
|
function functionDeclarationToMldev$2(fromObject) {
|
|
7163
7170
|
const toObject = {};
|
|
7164
7171
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
@@ -7195,62 +7202,15 @@ function functionDeclarationToMldev$2(fromObject) {
|
|
|
7195
7202
|
}
|
|
7196
7203
|
return toObject;
|
|
7197
7204
|
}
|
|
7198
|
-
function
|
|
7205
|
+
function intervalToMldev$2(fromObject) {
|
|
7199
7206
|
const toObject = {};
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7204
|
-
if (fromDescription != null) {
|
|
7205
|
-
setValueByPath(toObject, ['description'], fromDescription);
|
|
7207
|
+
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7208
|
+
if (fromStartTime != null) {
|
|
7209
|
+
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7206
7210
|
}
|
|
7207
|
-
const
|
|
7208
|
-
if (
|
|
7209
|
-
setValueByPath(toObject, ['
|
|
7210
|
-
}
|
|
7211
|
-
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
7212
|
-
if (fromParameters != null) {
|
|
7213
|
-
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
7214
|
-
}
|
|
7215
|
-
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
7216
|
-
'parametersJsonSchema',
|
|
7217
|
-
]);
|
|
7218
|
-
if (fromParametersJsonSchema != null) {
|
|
7219
|
-
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
7220
|
-
}
|
|
7221
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
7222
|
-
if (fromResponse != null) {
|
|
7223
|
-
setValueByPath(toObject, ['response'], fromResponse);
|
|
7224
|
-
}
|
|
7225
|
-
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
7226
|
-
'responseJsonSchema',
|
|
7227
|
-
]);
|
|
7228
|
-
if (fromResponseJsonSchema != null) {
|
|
7229
|
-
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7230
|
-
}
|
|
7231
|
-
return toObject;
|
|
7232
|
-
}
|
|
7233
|
-
function intervalToMldev$2(fromObject) {
|
|
7234
|
-
const toObject = {};
|
|
7235
|
-
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7236
|
-
if (fromStartTime != null) {
|
|
7237
|
-
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7238
|
-
}
|
|
7239
|
-
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7240
|
-
if (fromEndTime != null) {
|
|
7241
|
-
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7242
|
-
}
|
|
7243
|
-
return toObject;
|
|
7244
|
-
}
|
|
7245
|
-
function intervalToVertex$1(fromObject) {
|
|
7246
|
-
const toObject = {};
|
|
7247
|
-
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7248
|
-
if (fromStartTime != null) {
|
|
7249
|
-
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7250
|
-
}
|
|
7251
|
-
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7252
|
-
if (fromEndTime != null) {
|
|
7253
|
-
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7211
|
+
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7212
|
+
if (fromEndTime != null) {
|
|
7213
|
+
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7254
7214
|
}
|
|
7255
7215
|
return toObject;
|
|
7256
7216
|
}
|
|
@@ -7264,16 +7224,6 @@ function googleSearchToMldev$2(fromObject) {
|
|
|
7264
7224
|
}
|
|
7265
7225
|
return toObject;
|
|
7266
7226
|
}
|
|
7267
|
-
function googleSearchToVertex$1(fromObject) {
|
|
7268
|
-
const toObject = {};
|
|
7269
|
-
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7270
|
-
'timeRangeFilter',
|
|
7271
|
-
]);
|
|
7272
|
-
if (fromTimeRangeFilter != null) {
|
|
7273
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
|
|
7274
|
-
}
|
|
7275
|
-
return toObject;
|
|
7276
|
-
}
|
|
7277
7227
|
function dynamicRetrievalConfigToMldev$2(fromObject) {
|
|
7278
7228
|
const toObject = {};
|
|
7279
7229
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
@@ -7288,20 +7238,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
|
|
|
7288
7238
|
}
|
|
7289
7239
|
return toObject;
|
|
7290
7240
|
}
|
|
7291
|
-
function dynamicRetrievalConfigToVertex$1(fromObject) {
|
|
7292
|
-
const toObject = {};
|
|
7293
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7294
|
-
if (fromMode != null) {
|
|
7295
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
7296
|
-
}
|
|
7297
|
-
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
7298
|
-
'dynamicThreshold',
|
|
7299
|
-
]);
|
|
7300
|
-
if (fromDynamicThreshold != null) {
|
|
7301
|
-
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
7302
|
-
}
|
|
7303
|
-
return toObject;
|
|
7304
|
-
}
|
|
7305
7241
|
function googleSearchRetrievalToMldev$2(fromObject) {
|
|
7306
7242
|
const toObject = {};
|
|
7307
7243
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -7312,76 +7248,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
|
|
|
7312
7248
|
}
|
|
7313
7249
|
return toObject;
|
|
7314
7250
|
}
|
|
7315
|
-
function googleSearchRetrievalToVertex$1(fromObject) {
|
|
7316
|
-
const toObject = {};
|
|
7317
|
-
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7318
|
-
'dynamicRetrievalConfig',
|
|
7319
|
-
]);
|
|
7320
|
-
if (fromDynamicRetrievalConfig != null) {
|
|
7321
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
|
|
7322
|
-
}
|
|
7323
|
-
return toObject;
|
|
7324
|
-
}
|
|
7325
|
-
function enterpriseWebSearchToVertex$1() {
|
|
7326
|
-
const toObject = {};
|
|
7327
|
-
return toObject;
|
|
7328
|
-
}
|
|
7329
|
-
function apiKeyConfigToVertex$1(fromObject) {
|
|
7330
|
-
const toObject = {};
|
|
7331
|
-
const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
|
|
7332
|
-
if (fromApiKeyString != null) {
|
|
7333
|
-
setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
|
|
7334
|
-
}
|
|
7335
|
-
return toObject;
|
|
7336
|
-
}
|
|
7337
|
-
function authConfigToVertex$1(fromObject) {
|
|
7338
|
-
const toObject = {};
|
|
7339
|
-
const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
|
|
7340
|
-
if (fromApiKeyConfig != null) {
|
|
7341
|
-
setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
|
|
7342
|
-
}
|
|
7343
|
-
const fromAuthType = getValueByPath(fromObject, ['authType']);
|
|
7344
|
-
if (fromAuthType != null) {
|
|
7345
|
-
setValueByPath(toObject, ['authType'], fromAuthType);
|
|
7346
|
-
}
|
|
7347
|
-
const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
|
|
7348
|
-
'googleServiceAccountConfig',
|
|
7349
|
-
]);
|
|
7350
|
-
if (fromGoogleServiceAccountConfig != null) {
|
|
7351
|
-
setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
|
|
7352
|
-
}
|
|
7353
|
-
const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
|
|
7354
|
-
'httpBasicAuthConfig',
|
|
7355
|
-
]);
|
|
7356
|
-
if (fromHttpBasicAuthConfig != null) {
|
|
7357
|
-
setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
|
|
7358
|
-
}
|
|
7359
|
-
const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
|
|
7360
|
-
if (fromOauthConfig != null) {
|
|
7361
|
-
setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
|
|
7362
|
-
}
|
|
7363
|
-
const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
|
|
7364
|
-
if (fromOidcConfig != null) {
|
|
7365
|
-
setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
|
|
7366
|
-
}
|
|
7367
|
-
return toObject;
|
|
7368
|
-
}
|
|
7369
|
-
function googleMapsToVertex$1(fromObject) {
|
|
7370
|
-
const toObject = {};
|
|
7371
|
-
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7372
|
-
if (fromAuthConfig != null) {
|
|
7373
|
-
setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
|
|
7374
|
-
}
|
|
7375
|
-
return toObject;
|
|
7376
|
-
}
|
|
7377
7251
|
function urlContextToMldev$2() {
|
|
7378
7252
|
const toObject = {};
|
|
7379
7253
|
return toObject;
|
|
7380
7254
|
}
|
|
7381
|
-
function urlContextToVertex$1() {
|
|
7382
|
-
const toObject = {};
|
|
7383
|
-
return toObject;
|
|
7384
|
-
}
|
|
7385
7255
|
function toolToMldev$2(fromObject) {
|
|
7386
7256
|
const toObject = {};
|
|
7387
7257
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
@@ -7431,60 +7301,6 @@ function toolToMldev$2(fromObject) {
|
|
|
7431
7301
|
}
|
|
7432
7302
|
return toObject;
|
|
7433
7303
|
}
|
|
7434
|
-
function toolToVertex$1(fromObject) {
|
|
7435
|
-
const toObject = {};
|
|
7436
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7437
|
-
'functionDeclarations',
|
|
7438
|
-
]);
|
|
7439
|
-
if (fromFunctionDeclarations != null) {
|
|
7440
|
-
let transformedList = fromFunctionDeclarations;
|
|
7441
|
-
if (Array.isArray(transformedList)) {
|
|
7442
|
-
transformedList = transformedList.map((item) => {
|
|
7443
|
-
return functionDeclarationToVertex$1(item);
|
|
7444
|
-
});
|
|
7445
|
-
}
|
|
7446
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7447
|
-
}
|
|
7448
|
-
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7449
|
-
if (fromRetrieval != null) {
|
|
7450
|
-
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7451
|
-
}
|
|
7452
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7453
|
-
if (fromGoogleSearch != null) {
|
|
7454
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
|
|
7455
|
-
}
|
|
7456
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7457
|
-
'googleSearchRetrieval',
|
|
7458
|
-
]);
|
|
7459
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7460
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
|
|
7461
|
-
}
|
|
7462
|
-
const fromEnterpriseWebSearch = getValueByPath(fromObject, [
|
|
7463
|
-
'enterpriseWebSearch',
|
|
7464
|
-
]);
|
|
7465
|
-
if (fromEnterpriseWebSearch != null) {
|
|
7466
|
-
setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
|
|
7467
|
-
}
|
|
7468
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7469
|
-
if (fromGoogleMaps != null) {
|
|
7470
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
|
|
7471
|
-
}
|
|
7472
|
-
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7473
|
-
if (fromUrlContext != null) {
|
|
7474
|
-
setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
|
|
7475
|
-
}
|
|
7476
|
-
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7477
|
-
'codeExecution',
|
|
7478
|
-
]);
|
|
7479
|
-
if (fromCodeExecution != null) {
|
|
7480
|
-
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
7481
|
-
}
|
|
7482
|
-
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7483
|
-
if (fromComputerUse != null) {
|
|
7484
|
-
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
7485
|
-
}
|
|
7486
|
-
return toObject;
|
|
7487
|
-
}
|
|
7488
7304
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
7489
7305
|
const toObject = {};
|
|
7490
7306
|
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
@@ -7496,26 +7312,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7496
7312
|
}
|
|
7497
7313
|
return toObject;
|
|
7498
7314
|
}
|
|
7499
|
-
function sessionResumptionConfigToVertex(fromObject) {
|
|
7500
|
-
const toObject = {};
|
|
7501
|
-
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
7502
|
-
if (fromHandle != null) {
|
|
7503
|
-
setValueByPath(toObject, ['handle'], fromHandle);
|
|
7504
|
-
}
|
|
7505
|
-
const fromTransparent = getValueByPath(fromObject, ['transparent']);
|
|
7506
|
-
if (fromTransparent != null) {
|
|
7507
|
-
setValueByPath(toObject, ['transparent'], fromTransparent);
|
|
7508
|
-
}
|
|
7509
|
-
return toObject;
|
|
7510
|
-
}
|
|
7511
7315
|
function audioTranscriptionConfigToMldev$1() {
|
|
7512
7316
|
const toObject = {};
|
|
7513
7317
|
return toObject;
|
|
7514
7318
|
}
|
|
7515
|
-
function audioTranscriptionConfigToVertex() {
|
|
7516
|
-
const toObject = {};
|
|
7517
|
-
return toObject;
|
|
7518
|
-
}
|
|
7519
7319
|
function automaticActivityDetectionToMldev$1(fromObject) {
|
|
7520
7320
|
const toObject = {};
|
|
7521
7321
|
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
@@ -7548,38 +7348,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
|
|
|
7548
7348
|
}
|
|
7549
7349
|
return toObject;
|
|
7550
7350
|
}
|
|
7551
|
-
function automaticActivityDetectionToVertex(fromObject) {
|
|
7552
|
-
const toObject = {};
|
|
7553
|
-
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
7554
|
-
if (fromDisabled != null) {
|
|
7555
|
-
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
7556
|
-
}
|
|
7557
|
-
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7558
|
-
'startOfSpeechSensitivity',
|
|
7559
|
-
]);
|
|
7560
|
-
if (fromStartOfSpeechSensitivity != null) {
|
|
7561
|
-
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
7562
|
-
}
|
|
7563
|
-
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7564
|
-
'endOfSpeechSensitivity',
|
|
7565
|
-
]);
|
|
7566
|
-
if (fromEndOfSpeechSensitivity != null) {
|
|
7567
|
-
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
7568
|
-
}
|
|
7569
|
-
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
7570
|
-
'prefixPaddingMs',
|
|
7571
|
-
]);
|
|
7572
|
-
if (fromPrefixPaddingMs != null) {
|
|
7573
|
-
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
7574
|
-
}
|
|
7575
|
-
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
7576
|
-
'silenceDurationMs',
|
|
7577
|
-
]);
|
|
7578
|
-
if (fromSilenceDurationMs != null) {
|
|
7579
|
-
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
7580
|
-
}
|
|
7581
|
-
return toObject;
|
|
7582
|
-
}
|
|
7583
7351
|
function realtimeInputConfigToMldev$1(fromObject) {
|
|
7584
7352
|
const toObject = {};
|
|
7585
7353
|
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
@@ -7600,26 +7368,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
|
|
|
7600
7368
|
}
|
|
7601
7369
|
return toObject;
|
|
7602
7370
|
}
|
|
7603
|
-
function realtimeInputConfigToVertex(fromObject) {
|
|
7604
|
-
const toObject = {};
|
|
7605
|
-
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
7606
|
-
'automaticActivityDetection',
|
|
7607
|
-
]);
|
|
7608
|
-
if (fromAutomaticActivityDetection != null) {
|
|
7609
|
-
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
|
|
7610
|
-
}
|
|
7611
|
-
const fromActivityHandling = getValueByPath(fromObject, [
|
|
7612
|
-
'activityHandling',
|
|
7613
|
-
]);
|
|
7614
|
-
if (fromActivityHandling != null) {
|
|
7615
|
-
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
7616
|
-
}
|
|
7617
|
-
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
7618
|
-
if (fromTurnCoverage != null) {
|
|
7619
|
-
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
7620
|
-
}
|
|
7621
|
-
return toObject;
|
|
7622
|
-
}
|
|
7623
7371
|
function slidingWindowToMldev$1(fromObject) {
|
|
7624
7372
|
const toObject = {};
|
|
7625
7373
|
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
@@ -7628,14 +7376,6 @@ function slidingWindowToMldev$1(fromObject) {
|
|
|
7628
7376
|
}
|
|
7629
7377
|
return toObject;
|
|
7630
7378
|
}
|
|
7631
|
-
function slidingWindowToVertex(fromObject) {
|
|
7632
|
-
const toObject = {};
|
|
7633
|
-
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
7634
|
-
if (fromTargetTokens != null) {
|
|
7635
|
-
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
7636
|
-
}
|
|
7637
|
-
return toObject;
|
|
7638
|
-
}
|
|
7639
7379
|
function contextWindowCompressionConfigToMldev$1(fromObject) {
|
|
7640
7380
|
const toObject = {};
|
|
7641
7381
|
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
@@ -7652,22 +7392,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
|
|
|
7652
7392
|
}
|
|
7653
7393
|
return toObject;
|
|
7654
7394
|
}
|
|
7655
|
-
function contextWindowCompressionConfigToVertex(fromObject) {
|
|
7656
|
-
const toObject = {};
|
|
7657
|
-
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
7658
|
-
'triggerTokens',
|
|
7659
|
-
]);
|
|
7660
|
-
if (fromTriggerTokens != null) {
|
|
7661
|
-
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
7662
|
-
}
|
|
7663
|
-
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
7664
|
-
'slidingWindow',
|
|
7665
|
-
]);
|
|
7666
|
-
if (fromSlidingWindow != null) {
|
|
7667
|
-
setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
|
|
7668
|
-
}
|
|
7669
|
-
return toObject;
|
|
7670
|
-
}
|
|
7671
7395
|
function proactivityConfigToMldev$1(fromObject) {
|
|
7672
7396
|
const toObject = {};
|
|
7673
7397
|
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
@@ -7678,16 +7402,6 @@ function proactivityConfigToMldev$1(fromObject) {
|
|
|
7678
7402
|
}
|
|
7679
7403
|
return toObject;
|
|
7680
7404
|
}
|
|
7681
|
-
function proactivityConfigToVertex(fromObject) {
|
|
7682
|
-
const toObject = {};
|
|
7683
|
-
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
7684
|
-
'proactiveAudio',
|
|
7685
|
-
]);
|
|
7686
|
-
if (fromProactiveAudio != null) {
|
|
7687
|
-
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
7688
|
-
}
|
|
7689
|
-
return toObject;
|
|
7690
|
-
}
|
|
7691
7405
|
function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
7692
7406
|
const toObject = {};
|
|
7693
7407
|
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
@@ -7792,110 +7506,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
7792
7506
|
}
|
|
7793
7507
|
return toObject;
|
|
7794
7508
|
}
|
|
7795
|
-
function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
7796
|
-
const toObject = {};
|
|
7797
|
-
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
7798
|
-
'generationConfig',
|
|
7799
|
-
]);
|
|
7800
|
-
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
7801
|
-
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
7802
|
-
}
|
|
7803
|
-
const fromResponseModalities = getValueByPath(fromObject, [
|
|
7804
|
-
'responseModalities',
|
|
7805
|
-
]);
|
|
7806
|
-
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
7807
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
7808
|
-
}
|
|
7809
|
-
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
7810
|
-
if (parentObject !== undefined && fromTemperature != null) {
|
|
7811
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
7812
|
-
}
|
|
7813
|
-
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
7814
|
-
if (parentObject !== undefined && fromTopP != null) {
|
|
7815
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
7816
|
-
}
|
|
7817
|
-
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
7818
|
-
if (parentObject !== undefined && fromTopK != null) {
|
|
7819
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
7820
|
-
}
|
|
7821
|
-
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
7822
|
-
'maxOutputTokens',
|
|
7823
|
-
]);
|
|
7824
|
-
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
7825
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
7826
|
-
}
|
|
7827
|
-
const fromMediaResolution = getValueByPath(fromObject, [
|
|
7828
|
-
'mediaResolution',
|
|
7829
|
-
]);
|
|
7830
|
-
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
7831
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
7832
|
-
}
|
|
7833
|
-
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
7834
|
-
if (parentObject !== undefined && fromSeed != null) {
|
|
7835
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
7836
|
-
}
|
|
7837
|
-
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7838
|
-
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
7839
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
7840
|
-
}
|
|
7841
|
-
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
7842
|
-
'enableAffectiveDialog',
|
|
7843
|
-
]);
|
|
7844
|
-
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
7845
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
7846
|
-
}
|
|
7847
|
-
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
7848
|
-
'systemInstruction',
|
|
7849
|
-
]);
|
|
7850
|
-
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
7851
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
7852
|
-
}
|
|
7853
|
-
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
7854
|
-
if (parentObject !== undefined && fromTools != null) {
|
|
7855
|
-
let transformedList = tTools(fromTools);
|
|
7856
|
-
if (Array.isArray(transformedList)) {
|
|
7857
|
-
transformedList = transformedList.map((item) => {
|
|
7858
|
-
return toolToVertex$1(tTool(item));
|
|
7859
|
-
});
|
|
7860
|
-
}
|
|
7861
|
-
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
7862
|
-
}
|
|
7863
|
-
const fromSessionResumption = getValueByPath(fromObject, [
|
|
7864
|
-
'sessionResumption',
|
|
7865
|
-
]);
|
|
7866
|
-
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
7867
|
-
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
|
|
7868
|
-
}
|
|
7869
|
-
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
7870
|
-
'inputAudioTranscription',
|
|
7871
|
-
]);
|
|
7872
|
-
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
7873
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
7874
|
-
}
|
|
7875
|
-
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
7876
|
-
'outputAudioTranscription',
|
|
7877
|
-
]);
|
|
7878
|
-
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
7879
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
7880
|
-
}
|
|
7881
|
-
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
7882
|
-
'realtimeInputConfig',
|
|
7883
|
-
]);
|
|
7884
|
-
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
7885
|
-
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
|
|
7886
|
-
}
|
|
7887
|
-
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
7888
|
-
'contextWindowCompression',
|
|
7889
|
-
]);
|
|
7890
|
-
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
7891
|
-
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
|
|
7892
|
-
}
|
|
7893
|
-
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
7894
|
-
if (parentObject !== undefined && fromProactivity != null) {
|
|
7895
|
-
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
|
|
7896
|
-
}
|
|
7897
|
-
return toObject;
|
|
7898
|
-
}
|
|
7899
7509
|
function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
7900
7510
|
const toObject = {};
|
|
7901
7511
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -7908,34 +7518,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
|
7908
7518
|
}
|
|
7909
7519
|
return toObject;
|
|
7910
7520
|
}
|
|
7911
|
-
function liveConnectParametersToVertex(apiClient, fromObject) {
|
|
7912
|
-
const toObject = {};
|
|
7913
|
-
const fromModel = getValueByPath(fromObject, ['model']);
|
|
7914
|
-
if (fromModel != null) {
|
|
7915
|
-
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
7916
|
-
}
|
|
7917
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
7918
|
-
if (fromConfig != null) {
|
|
7919
|
-
setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
|
|
7920
|
-
}
|
|
7921
|
-
return toObject;
|
|
7922
|
-
}
|
|
7923
7521
|
function activityStartToMldev() {
|
|
7924
7522
|
const toObject = {};
|
|
7925
7523
|
return toObject;
|
|
7926
7524
|
}
|
|
7927
|
-
function activityStartToVertex() {
|
|
7928
|
-
const toObject = {};
|
|
7929
|
-
return toObject;
|
|
7930
|
-
}
|
|
7931
7525
|
function activityEndToMldev() {
|
|
7932
7526
|
const toObject = {};
|
|
7933
7527
|
return toObject;
|
|
7934
7528
|
}
|
|
7935
|
-
function activityEndToVertex() {
|
|
7936
|
-
const toObject = {};
|
|
7937
|
-
return toObject;
|
|
7938
|
-
}
|
|
7939
7529
|
function liveSendRealtimeInputParametersToMldev(fromObject) {
|
|
7940
7530
|
const toObject = {};
|
|
7941
7531
|
const fromMedia = getValueByPath(fromObject, ['media']);
|
|
@@ -7972,43 +7562,1165 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
|
|
|
7972
7562
|
}
|
|
7973
7563
|
return toObject;
|
|
7974
7564
|
}
|
|
7975
|
-
function
|
|
7565
|
+
function weightedPromptToMldev(fromObject) {
|
|
7976
7566
|
const toObject = {};
|
|
7977
|
-
const
|
|
7978
|
-
if (
|
|
7979
|
-
setValueByPath(toObject, ['
|
|
7567
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
7568
|
+
if (fromText != null) {
|
|
7569
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
7980
7570
|
}
|
|
7981
|
-
const
|
|
7982
|
-
if (
|
|
7983
|
-
setValueByPath(toObject, ['
|
|
7571
|
+
const fromWeight = getValueByPath(fromObject, ['weight']);
|
|
7572
|
+
if (fromWeight != null) {
|
|
7573
|
+
setValueByPath(toObject, ['weight'], fromWeight);
|
|
7574
|
+
}
|
|
7575
|
+
return toObject;
|
|
7576
|
+
}
|
|
7577
|
+
function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
|
|
7578
|
+
const toObject = {};
|
|
7579
|
+
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
7580
|
+
'weightedPrompts',
|
|
7581
|
+
]);
|
|
7582
|
+
if (fromWeightedPrompts != null) {
|
|
7583
|
+
let transformedList = fromWeightedPrompts;
|
|
7584
|
+
if (Array.isArray(transformedList)) {
|
|
7585
|
+
transformedList = transformedList.map((item) => {
|
|
7586
|
+
return weightedPromptToMldev(item);
|
|
7587
|
+
});
|
|
7588
|
+
}
|
|
7589
|
+
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
7590
|
+
}
|
|
7591
|
+
return toObject;
|
|
7592
|
+
}
|
|
7593
|
+
function liveMusicGenerationConfigToMldev(fromObject) {
|
|
7594
|
+
const toObject = {};
|
|
7595
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
7596
|
+
if (fromTemperature != null) {
|
|
7597
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
7598
|
+
}
|
|
7599
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
7600
|
+
if (fromTopK != null) {
|
|
7601
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
7602
|
+
}
|
|
7603
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
7604
|
+
if (fromSeed != null) {
|
|
7605
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
7606
|
+
}
|
|
7607
|
+
const fromGuidance = getValueByPath(fromObject, ['guidance']);
|
|
7608
|
+
if (fromGuidance != null) {
|
|
7609
|
+
setValueByPath(toObject, ['guidance'], fromGuidance);
|
|
7610
|
+
}
|
|
7611
|
+
const fromBpm = getValueByPath(fromObject, ['bpm']);
|
|
7612
|
+
if (fromBpm != null) {
|
|
7613
|
+
setValueByPath(toObject, ['bpm'], fromBpm);
|
|
7614
|
+
}
|
|
7615
|
+
const fromDensity = getValueByPath(fromObject, ['density']);
|
|
7616
|
+
if (fromDensity != null) {
|
|
7617
|
+
setValueByPath(toObject, ['density'], fromDensity);
|
|
7618
|
+
}
|
|
7619
|
+
const fromBrightness = getValueByPath(fromObject, ['brightness']);
|
|
7620
|
+
if (fromBrightness != null) {
|
|
7621
|
+
setValueByPath(toObject, ['brightness'], fromBrightness);
|
|
7622
|
+
}
|
|
7623
|
+
const fromScale = getValueByPath(fromObject, ['scale']);
|
|
7624
|
+
if (fromScale != null) {
|
|
7625
|
+
setValueByPath(toObject, ['scale'], fromScale);
|
|
7626
|
+
}
|
|
7627
|
+
const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
|
|
7628
|
+
if (fromMuteBass != null) {
|
|
7629
|
+
setValueByPath(toObject, ['muteBass'], fromMuteBass);
|
|
7630
|
+
}
|
|
7631
|
+
const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
|
|
7632
|
+
if (fromMuteDrums != null) {
|
|
7633
|
+
setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
|
|
7634
|
+
}
|
|
7635
|
+
const fromOnlyBassAndDrums = getValueByPath(fromObject, [
|
|
7636
|
+
'onlyBassAndDrums',
|
|
7637
|
+
]);
|
|
7638
|
+
if (fromOnlyBassAndDrums != null) {
|
|
7639
|
+
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7640
|
+
}
|
|
7641
|
+
return toObject;
|
|
7642
|
+
}
|
|
7643
|
+
function liveMusicSetConfigParametersToMldev(fromObject) {
|
|
7644
|
+
const toObject = {};
|
|
7645
|
+
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
7646
|
+
'musicGenerationConfig',
|
|
7647
|
+
]);
|
|
7648
|
+
if (fromMusicGenerationConfig != null) {
|
|
7649
|
+
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
|
|
7650
|
+
}
|
|
7651
|
+
return toObject;
|
|
7652
|
+
}
|
|
7653
|
+
function liveMusicClientSetupToMldev(fromObject) {
|
|
7654
|
+
const toObject = {};
|
|
7655
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
7656
|
+
if (fromModel != null) {
|
|
7657
|
+
setValueByPath(toObject, ['model'], fromModel);
|
|
7658
|
+
}
|
|
7659
|
+
return toObject;
|
|
7660
|
+
}
|
|
7661
|
+
function liveMusicClientContentToMldev(fromObject) {
|
|
7662
|
+
const toObject = {};
|
|
7663
|
+
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
7664
|
+
'weightedPrompts',
|
|
7665
|
+
]);
|
|
7666
|
+
if (fromWeightedPrompts != null) {
|
|
7667
|
+
let transformedList = fromWeightedPrompts;
|
|
7668
|
+
if (Array.isArray(transformedList)) {
|
|
7669
|
+
transformedList = transformedList.map((item) => {
|
|
7670
|
+
return weightedPromptToMldev(item);
|
|
7671
|
+
});
|
|
7672
|
+
}
|
|
7673
|
+
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
7674
|
+
}
|
|
7675
|
+
return toObject;
|
|
7676
|
+
}
|
|
7677
|
+
function liveMusicClientMessageToMldev(fromObject) {
|
|
7678
|
+
const toObject = {};
|
|
7679
|
+
const fromSetup = getValueByPath(fromObject, ['setup']);
|
|
7680
|
+
if (fromSetup != null) {
|
|
7681
|
+
setValueByPath(toObject, ['setup'], liveMusicClientSetupToMldev(fromSetup));
|
|
7682
|
+
}
|
|
7683
|
+
const fromClientContent = getValueByPath(fromObject, [
|
|
7684
|
+
'clientContent',
|
|
7685
|
+
]);
|
|
7686
|
+
if (fromClientContent != null) {
|
|
7687
|
+
setValueByPath(toObject, ['clientContent'], liveMusicClientContentToMldev(fromClientContent));
|
|
7688
|
+
}
|
|
7689
|
+
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
7690
|
+
'musicGenerationConfig',
|
|
7691
|
+
]);
|
|
7692
|
+
if (fromMusicGenerationConfig != null) {
|
|
7693
|
+
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigToMldev(fromMusicGenerationConfig));
|
|
7694
|
+
}
|
|
7695
|
+
const fromPlaybackControl = getValueByPath(fromObject, [
|
|
7696
|
+
'playbackControl',
|
|
7697
|
+
]);
|
|
7698
|
+
if (fromPlaybackControl != null) {
|
|
7699
|
+
setValueByPath(toObject, ['playbackControl'], fromPlaybackControl);
|
|
7700
|
+
}
|
|
7701
|
+
return toObject;
|
|
7702
|
+
}
|
|
7703
|
+
function prebuiltVoiceConfigToVertex$1(fromObject) {
|
|
7704
|
+
const toObject = {};
|
|
7705
|
+
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
7706
|
+
if (fromVoiceName != null) {
|
|
7707
|
+
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
7708
|
+
}
|
|
7709
|
+
return toObject;
|
|
7710
|
+
}
|
|
7711
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
7712
|
+
const toObject = {};
|
|
7713
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
7714
|
+
'prebuiltVoiceConfig',
|
|
7715
|
+
]);
|
|
7716
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
7717
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
|
|
7718
|
+
}
|
|
7719
|
+
return toObject;
|
|
7720
|
+
}
|
|
7721
|
+
function speechConfigToVertex$1(fromObject) {
|
|
7722
|
+
const toObject = {};
|
|
7723
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7724
|
+
if (fromVoiceConfig != null) {
|
|
7725
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
7726
|
+
}
|
|
7727
|
+
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
7728
|
+
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
7729
|
+
}
|
|
7730
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
7731
|
+
if (fromLanguageCode != null) {
|
|
7732
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
7733
|
+
}
|
|
7734
|
+
return toObject;
|
|
7735
|
+
}
|
|
7736
|
+
function videoMetadataToVertex$1(fromObject) {
|
|
7737
|
+
const toObject = {};
|
|
7738
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
7739
|
+
if (fromFps != null) {
|
|
7740
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
7741
|
+
}
|
|
7742
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
7743
|
+
if (fromEndOffset != null) {
|
|
7744
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
7745
|
+
}
|
|
7746
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
7747
|
+
if (fromStartOffset != null) {
|
|
7748
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
7749
|
+
}
|
|
7750
|
+
return toObject;
|
|
7751
|
+
}
|
|
7752
|
+
function blobToVertex$1(fromObject) {
|
|
7753
|
+
const toObject = {};
|
|
7754
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
7755
|
+
if (fromDisplayName != null) {
|
|
7756
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
7757
|
+
}
|
|
7758
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
7759
|
+
if (fromData != null) {
|
|
7760
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
7761
|
+
}
|
|
7762
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7763
|
+
if (fromMimeType != null) {
|
|
7764
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7765
|
+
}
|
|
7766
|
+
return toObject;
|
|
7767
|
+
}
|
|
7768
|
+
function fileDataToVertex$1(fromObject) {
|
|
7769
|
+
const toObject = {};
|
|
7770
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
7771
|
+
if (fromDisplayName != null) {
|
|
7772
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
7773
|
+
}
|
|
7774
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
7775
|
+
if (fromFileUri != null) {
|
|
7776
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
7777
|
+
}
|
|
7778
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7779
|
+
if (fromMimeType != null) {
|
|
7780
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7781
|
+
}
|
|
7782
|
+
return toObject;
|
|
7783
|
+
}
|
|
7784
|
+
function partToVertex$1(fromObject) {
|
|
7785
|
+
const toObject = {};
|
|
7786
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
7787
|
+
'videoMetadata',
|
|
7788
|
+
]);
|
|
7789
|
+
if (fromVideoMetadata != null) {
|
|
7790
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
|
|
7791
|
+
}
|
|
7792
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
7793
|
+
if (fromThought != null) {
|
|
7794
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
7795
|
+
}
|
|
7796
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
7797
|
+
if (fromInlineData != null) {
|
|
7798
|
+
setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
|
|
7799
|
+
}
|
|
7800
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7801
|
+
if (fromFileData != null) {
|
|
7802
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
|
|
7803
|
+
}
|
|
7804
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
7805
|
+
'thoughtSignature',
|
|
7806
|
+
]);
|
|
7807
|
+
if (fromThoughtSignature != null) {
|
|
7808
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
7809
|
+
}
|
|
7810
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7811
|
+
'codeExecutionResult',
|
|
7812
|
+
]);
|
|
7813
|
+
if (fromCodeExecutionResult != null) {
|
|
7814
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
7815
|
+
}
|
|
7816
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
7817
|
+
'executableCode',
|
|
7818
|
+
]);
|
|
7819
|
+
if (fromExecutableCode != null) {
|
|
7820
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
7821
|
+
}
|
|
7822
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
7823
|
+
if (fromFunctionCall != null) {
|
|
7824
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
7825
|
+
}
|
|
7826
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
7827
|
+
'functionResponse',
|
|
7828
|
+
]);
|
|
7829
|
+
if (fromFunctionResponse != null) {
|
|
7830
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
7831
|
+
}
|
|
7832
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
7833
|
+
if (fromText != null) {
|
|
7834
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
7835
|
+
}
|
|
7836
|
+
return toObject;
|
|
7837
|
+
}
|
|
7838
|
+
function contentToVertex$1(fromObject) {
|
|
7839
|
+
const toObject = {};
|
|
7840
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7841
|
+
if (fromParts != null) {
|
|
7842
|
+
let transformedList = fromParts;
|
|
7843
|
+
if (Array.isArray(transformedList)) {
|
|
7844
|
+
transformedList = transformedList.map((item) => {
|
|
7845
|
+
return partToVertex$1(item);
|
|
7846
|
+
});
|
|
7847
|
+
}
|
|
7848
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
7849
|
+
}
|
|
7850
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
7851
|
+
if (fromRole != null) {
|
|
7852
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
7853
|
+
}
|
|
7854
|
+
return toObject;
|
|
7855
|
+
}
|
|
7856
|
+
function functionDeclarationToVertex$1(fromObject) {
|
|
7857
|
+
const toObject = {};
|
|
7858
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7859
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7860
|
+
}
|
|
7861
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7862
|
+
if (fromDescription != null) {
|
|
7863
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
7864
|
+
}
|
|
7865
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
7866
|
+
if (fromName != null) {
|
|
7867
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
7868
|
+
}
|
|
7869
|
+
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
7870
|
+
if (fromParameters != null) {
|
|
7871
|
+
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
7872
|
+
}
|
|
7873
|
+
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
7874
|
+
'parametersJsonSchema',
|
|
7875
|
+
]);
|
|
7876
|
+
if (fromParametersJsonSchema != null) {
|
|
7877
|
+
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
7878
|
+
}
|
|
7879
|
+
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
7880
|
+
if (fromResponse != null) {
|
|
7881
|
+
setValueByPath(toObject, ['response'], fromResponse);
|
|
7882
|
+
}
|
|
7883
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
7884
|
+
'responseJsonSchema',
|
|
7885
|
+
]);
|
|
7886
|
+
if (fromResponseJsonSchema != null) {
|
|
7887
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7888
|
+
}
|
|
7889
|
+
return toObject;
|
|
7890
|
+
}
|
|
7891
|
+
function intervalToVertex$1(fromObject) {
|
|
7892
|
+
const toObject = {};
|
|
7893
|
+
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7894
|
+
if (fromStartTime != null) {
|
|
7895
|
+
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7896
|
+
}
|
|
7897
|
+
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7898
|
+
if (fromEndTime != null) {
|
|
7899
|
+
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7900
|
+
}
|
|
7901
|
+
return toObject;
|
|
7902
|
+
}
|
|
7903
|
+
function googleSearchToVertex$1(fromObject) {
|
|
7904
|
+
const toObject = {};
|
|
7905
|
+
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7906
|
+
'timeRangeFilter',
|
|
7907
|
+
]);
|
|
7908
|
+
if (fromTimeRangeFilter != null) {
|
|
7909
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
|
|
7910
|
+
}
|
|
7911
|
+
return toObject;
|
|
7912
|
+
}
|
|
7913
|
+
function dynamicRetrievalConfigToVertex$1(fromObject) {
|
|
7914
|
+
const toObject = {};
|
|
7915
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7916
|
+
if (fromMode != null) {
|
|
7917
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
7918
|
+
}
|
|
7919
|
+
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
7920
|
+
'dynamicThreshold',
|
|
7921
|
+
]);
|
|
7922
|
+
if (fromDynamicThreshold != null) {
|
|
7923
|
+
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
7924
|
+
}
|
|
7925
|
+
return toObject;
|
|
7926
|
+
}
|
|
7927
|
+
function googleSearchRetrievalToVertex$1(fromObject) {
|
|
7928
|
+
const toObject = {};
|
|
7929
|
+
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7930
|
+
'dynamicRetrievalConfig',
|
|
7931
|
+
]);
|
|
7932
|
+
if (fromDynamicRetrievalConfig != null) {
|
|
7933
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
|
|
7934
|
+
}
|
|
7935
|
+
return toObject;
|
|
7936
|
+
}
|
|
7937
|
+
function enterpriseWebSearchToVertex$1() {
|
|
7938
|
+
const toObject = {};
|
|
7939
|
+
return toObject;
|
|
7940
|
+
}
|
|
7941
|
+
function apiKeyConfigToVertex$1(fromObject) {
|
|
7942
|
+
const toObject = {};
|
|
7943
|
+
const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
|
|
7944
|
+
if (fromApiKeyString != null) {
|
|
7945
|
+
setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
|
|
7946
|
+
}
|
|
7947
|
+
return toObject;
|
|
7948
|
+
}
|
|
7949
|
+
function authConfigToVertex$1(fromObject) {
|
|
7950
|
+
const toObject = {};
|
|
7951
|
+
const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
|
|
7952
|
+
if (fromApiKeyConfig != null) {
|
|
7953
|
+
setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
|
|
7954
|
+
}
|
|
7955
|
+
const fromAuthType = getValueByPath(fromObject, ['authType']);
|
|
7956
|
+
if (fromAuthType != null) {
|
|
7957
|
+
setValueByPath(toObject, ['authType'], fromAuthType);
|
|
7958
|
+
}
|
|
7959
|
+
const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
|
|
7960
|
+
'googleServiceAccountConfig',
|
|
7961
|
+
]);
|
|
7962
|
+
if (fromGoogleServiceAccountConfig != null) {
|
|
7963
|
+
setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
|
|
7964
|
+
}
|
|
7965
|
+
const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
|
|
7966
|
+
'httpBasicAuthConfig',
|
|
7967
|
+
]);
|
|
7968
|
+
if (fromHttpBasicAuthConfig != null) {
|
|
7969
|
+
setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
|
|
7970
|
+
}
|
|
7971
|
+
const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
|
|
7972
|
+
if (fromOauthConfig != null) {
|
|
7973
|
+
setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
|
|
7974
|
+
}
|
|
7975
|
+
const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
|
|
7976
|
+
if (fromOidcConfig != null) {
|
|
7977
|
+
setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
|
|
7978
|
+
}
|
|
7979
|
+
return toObject;
|
|
7980
|
+
}
|
|
7981
|
+
function googleMapsToVertex$1(fromObject) {
|
|
7982
|
+
const toObject = {};
|
|
7983
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7984
|
+
if (fromAuthConfig != null) {
|
|
7985
|
+
setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
|
|
7986
|
+
}
|
|
7987
|
+
return toObject;
|
|
7988
|
+
}
|
|
7989
|
+
function urlContextToVertex$1() {
|
|
7990
|
+
const toObject = {};
|
|
7991
|
+
return toObject;
|
|
7992
|
+
}
|
|
7993
|
+
function toolToVertex$1(fromObject) {
|
|
7994
|
+
const toObject = {};
|
|
7995
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7996
|
+
'functionDeclarations',
|
|
7997
|
+
]);
|
|
7998
|
+
if (fromFunctionDeclarations != null) {
|
|
7999
|
+
let transformedList = fromFunctionDeclarations;
|
|
8000
|
+
if (Array.isArray(transformedList)) {
|
|
8001
|
+
transformedList = transformedList.map((item) => {
|
|
8002
|
+
return functionDeclarationToVertex$1(item);
|
|
8003
|
+
});
|
|
8004
|
+
}
|
|
8005
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
8006
|
+
}
|
|
8007
|
+
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
8008
|
+
if (fromRetrieval != null) {
|
|
8009
|
+
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
8010
|
+
}
|
|
8011
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8012
|
+
if (fromGoogleSearch != null) {
|
|
8013
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
|
|
8014
|
+
}
|
|
8015
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8016
|
+
'googleSearchRetrieval',
|
|
8017
|
+
]);
|
|
8018
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
8019
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
|
|
8020
|
+
}
|
|
8021
|
+
const fromEnterpriseWebSearch = getValueByPath(fromObject, [
|
|
8022
|
+
'enterpriseWebSearch',
|
|
8023
|
+
]);
|
|
8024
|
+
if (fromEnterpriseWebSearch != null) {
|
|
8025
|
+
setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
|
|
8026
|
+
}
|
|
8027
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
8028
|
+
if (fromGoogleMaps != null) {
|
|
8029
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
|
|
8030
|
+
}
|
|
8031
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8032
|
+
if (fromUrlContext != null) {
|
|
8033
|
+
setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
|
|
8034
|
+
}
|
|
8035
|
+
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8036
|
+
'codeExecution',
|
|
8037
|
+
]);
|
|
8038
|
+
if (fromCodeExecution != null) {
|
|
8039
|
+
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
8040
|
+
}
|
|
8041
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
8042
|
+
if (fromComputerUse != null) {
|
|
8043
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
8044
|
+
}
|
|
8045
|
+
return toObject;
|
|
8046
|
+
}
|
|
8047
|
+
function sessionResumptionConfigToVertex(fromObject) {
|
|
8048
|
+
const toObject = {};
|
|
8049
|
+
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
8050
|
+
if (fromHandle != null) {
|
|
8051
|
+
setValueByPath(toObject, ['handle'], fromHandle);
|
|
8052
|
+
}
|
|
8053
|
+
const fromTransparent = getValueByPath(fromObject, ['transparent']);
|
|
8054
|
+
if (fromTransparent != null) {
|
|
8055
|
+
setValueByPath(toObject, ['transparent'], fromTransparent);
|
|
8056
|
+
}
|
|
8057
|
+
return toObject;
|
|
8058
|
+
}
|
|
8059
|
+
function audioTranscriptionConfigToVertex() {
|
|
8060
|
+
const toObject = {};
|
|
8061
|
+
return toObject;
|
|
8062
|
+
}
|
|
8063
|
+
function automaticActivityDetectionToVertex(fromObject) {
|
|
8064
|
+
const toObject = {};
|
|
8065
|
+
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
8066
|
+
if (fromDisabled != null) {
|
|
8067
|
+
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
8068
|
+
}
|
|
8069
|
+
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
8070
|
+
'startOfSpeechSensitivity',
|
|
8071
|
+
]);
|
|
8072
|
+
if (fromStartOfSpeechSensitivity != null) {
|
|
8073
|
+
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
8074
|
+
}
|
|
8075
|
+
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
8076
|
+
'endOfSpeechSensitivity',
|
|
8077
|
+
]);
|
|
8078
|
+
if (fromEndOfSpeechSensitivity != null) {
|
|
8079
|
+
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
8080
|
+
}
|
|
8081
|
+
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
8082
|
+
'prefixPaddingMs',
|
|
8083
|
+
]);
|
|
8084
|
+
if (fromPrefixPaddingMs != null) {
|
|
8085
|
+
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
8086
|
+
}
|
|
8087
|
+
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
8088
|
+
'silenceDurationMs',
|
|
8089
|
+
]);
|
|
8090
|
+
if (fromSilenceDurationMs != null) {
|
|
8091
|
+
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
8092
|
+
}
|
|
8093
|
+
return toObject;
|
|
8094
|
+
}
|
|
8095
|
+
function realtimeInputConfigToVertex(fromObject) {
|
|
8096
|
+
const toObject = {};
|
|
8097
|
+
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
8098
|
+
'automaticActivityDetection',
|
|
8099
|
+
]);
|
|
8100
|
+
if (fromAutomaticActivityDetection != null) {
|
|
8101
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
|
|
8102
|
+
}
|
|
8103
|
+
const fromActivityHandling = getValueByPath(fromObject, [
|
|
8104
|
+
'activityHandling',
|
|
8105
|
+
]);
|
|
8106
|
+
if (fromActivityHandling != null) {
|
|
8107
|
+
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
8108
|
+
}
|
|
8109
|
+
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
8110
|
+
if (fromTurnCoverage != null) {
|
|
8111
|
+
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
8112
|
+
}
|
|
8113
|
+
return toObject;
|
|
8114
|
+
}
|
|
8115
|
+
function slidingWindowToVertex(fromObject) {
|
|
8116
|
+
const toObject = {};
|
|
8117
|
+
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
8118
|
+
if (fromTargetTokens != null) {
|
|
8119
|
+
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
8120
|
+
}
|
|
8121
|
+
return toObject;
|
|
8122
|
+
}
|
|
8123
|
+
function contextWindowCompressionConfigToVertex(fromObject) {
|
|
8124
|
+
const toObject = {};
|
|
8125
|
+
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
8126
|
+
'triggerTokens',
|
|
8127
|
+
]);
|
|
8128
|
+
if (fromTriggerTokens != null) {
|
|
8129
|
+
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
8130
|
+
}
|
|
8131
|
+
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
8132
|
+
'slidingWindow',
|
|
8133
|
+
]);
|
|
8134
|
+
if (fromSlidingWindow != null) {
|
|
8135
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
|
|
8136
|
+
}
|
|
8137
|
+
return toObject;
|
|
8138
|
+
}
|
|
8139
|
+
function proactivityConfigToVertex(fromObject) {
|
|
8140
|
+
const toObject = {};
|
|
8141
|
+
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
8142
|
+
'proactiveAudio',
|
|
8143
|
+
]);
|
|
8144
|
+
if (fromProactiveAudio != null) {
|
|
8145
|
+
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
8146
|
+
}
|
|
8147
|
+
return toObject;
|
|
8148
|
+
}
|
|
8149
|
+
function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
8150
|
+
const toObject = {};
|
|
8151
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
8152
|
+
'generationConfig',
|
|
8153
|
+
]);
|
|
8154
|
+
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
8155
|
+
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
8156
|
+
}
|
|
8157
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
8158
|
+
'responseModalities',
|
|
8159
|
+
]);
|
|
8160
|
+
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
8161
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
8162
|
+
}
|
|
8163
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
8164
|
+
if (parentObject !== undefined && fromTemperature != null) {
|
|
8165
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
8166
|
+
}
|
|
8167
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
8168
|
+
if (parentObject !== undefined && fromTopP != null) {
|
|
8169
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
8170
|
+
}
|
|
8171
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
8172
|
+
if (parentObject !== undefined && fromTopK != null) {
|
|
8173
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
8174
|
+
}
|
|
8175
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
8176
|
+
'maxOutputTokens',
|
|
8177
|
+
]);
|
|
8178
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
8179
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
8180
|
+
}
|
|
8181
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8182
|
+
'mediaResolution',
|
|
8183
|
+
]);
|
|
8184
|
+
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
8185
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
8186
|
+
}
|
|
8187
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
8188
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
8189
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
8190
|
+
}
|
|
8191
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
8192
|
+
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
8193
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
8194
|
+
}
|
|
8195
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
8196
|
+
'enableAffectiveDialog',
|
|
8197
|
+
]);
|
|
8198
|
+
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
8199
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
8200
|
+
}
|
|
8201
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
8202
|
+
'systemInstruction',
|
|
8203
|
+
]);
|
|
8204
|
+
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8205
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
8206
|
+
}
|
|
8207
|
+
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8208
|
+
if (parentObject !== undefined && fromTools != null) {
|
|
8209
|
+
let transformedList = tTools(fromTools);
|
|
8210
|
+
if (Array.isArray(transformedList)) {
|
|
8211
|
+
transformedList = transformedList.map((item) => {
|
|
8212
|
+
return toolToVertex$1(tTool(item));
|
|
8213
|
+
});
|
|
8214
|
+
}
|
|
8215
|
+
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
8216
|
+
}
|
|
8217
|
+
const fromSessionResumption = getValueByPath(fromObject, [
|
|
8218
|
+
'sessionResumption',
|
|
8219
|
+
]);
|
|
8220
|
+
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
8221
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
|
|
8222
|
+
}
|
|
8223
|
+
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
8224
|
+
'inputAudioTranscription',
|
|
8225
|
+
]);
|
|
8226
|
+
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
8227
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
8228
|
+
}
|
|
8229
|
+
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
8230
|
+
'outputAudioTranscription',
|
|
8231
|
+
]);
|
|
8232
|
+
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
8233
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
8234
|
+
}
|
|
8235
|
+
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
8236
|
+
'realtimeInputConfig',
|
|
8237
|
+
]);
|
|
8238
|
+
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
8239
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
|
|
8240
|
+
}
|
|
8241
|
+
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
8242
|
+
'contextWindowCompression',
|
|
8243
|
+
]);
|
|
8244
|
+
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
8245
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
|
|
8246
|
+
}
|
|
8247
|
+
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
8248
|
+
if (parentObject !== undefined && fromProactivity != null) {
|
|
8249
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
|
|
8250
|
+
}
|
|
8251
|
+
return toObject;
|
|
8252
|
+
}
|
|
8253
|
+
function liveConnectParametersToVertex(apiClient, fromObject) {
|
|
8254
|
+
const toObject = {};
|
|
8255
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
8256
|
+
if (fromModel != null) {
|
|
8257
|
+
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
8258
|
+
}
|
|
8259
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
8260
|
+
if (fromConfig != null) {
|
|
8261
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
|
|
8262
|
+
}
|
|
8263
|
+
return toObject;
|
|
8264
|
+
}
|
|
8265
|
+
function activityStartToVertex() {
|
|
8266
|
+
const toObject = {};
|
|
8267
|
+
return toObject;
|
|
8268
|
+
}
|
|
8269
|
+
function activityEndToVertex() {
|
|
8270
|
+
const toObject = {};
|
|
8271
|
+
return toObject;
|
|
8272
|
+
}
|
|
8273
|
+
function liveSendRealtimeInputParametersToVertex(fromObject) {
|
|
8274
|
+
const toObject = {};
|
|
8275
|
+
const fromMedia = getValueByPath(fromObject, ['media']);
|
|
8276
|
+
if (fromMedia != null) {
|
|
8277
|
+
setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
|
|
8278
|
+
}
|
|
8279
|
+
const fromAudio = getValueByPath(fromObject, ['audio']);
|
|
8280
|
+
if (fromAudio != null) {
|
|
8281
|
+
setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
|
|
8282
|
+
}
|
|
8283
|
+
const fromAudioStreamEnd = getValueByPath(fromObject, [
|
|
8284
|
+
'audioStreamEnd',
|
|
8285
|
+
]);
|
|
8286
|
+
if (fromAudioStreamEnd != null) {
|
|
8287
|
+
setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
|
|
8288
|
+
}
|
|
8289
|
+
const fromVideo = getValueByPath(fromObject, ['video']);
|
|
8290
|
+
if (fromVideo != null) {
|
|
8291
|
+
setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
|
|
8292
|
+
}
|
|
8293
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8294
|
+
if (fromText != null) {
|
|
8295
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8296
|
+
}
|
|
8297
|
+
const fromActivityStart = getValueByPath(fromObject, [
|
|
8298
|
+
'activityStart',
|
|
8299
|
+
]);
|
|
8300
|
+
if (fromActivityStart != null) {
|
|
8301
|
+
setValueByPath(toObject, ['activityStart'], activityStartToVertex());
|
|
8302
|
+
}
|
|
8303
|
+
const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
|
|
8304
|
+
if (fromActivityEnd != null) {
|
|
8305
|
+
setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
|
|
8306
|
+
}
|
|
8307
|
+
return toObject;
|
|
8308
|
+
}
|
|
8309
|
+
function liveServerSetupCompleteFromMldev() {
|
|
8310
|
+
const toObject = {};
|
|
8311
|
+
return toObject;
|
|
8312
|
+
}
|
|
8313
|
+
function videoMetadataFromMldev$1(fromObject) {
|
|
8314
|
+
const toObject = {};
|
|
8315
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
8316
|
+
if (fromFps != null) {
|
|
8317
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
8318
|
+
}
|
|
8319
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
8320
|
+
if (fromEndOffset != null) {
|
|
8321
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
8322
|
+
}
|
|
8323
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
8324
|
+
if (fromStartOffset != null) {
|
|
8325
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
8326
|
+
}
|
|
8327
|
+
return toObject;
|
|
8328
|
+
}
|
|
8329
|
+
function blobFromMldev$1(fromObject) {
|
|
8330
|
+
const toObject = {};
|
|
8331
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
8332
|
+
if (fromData != null) {
|
|
8333
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
8334
|
+
}
|
|
8335
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8336
|
+
if (fromMimeType != null) {
|
|
8337
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8338
|
+
}
|
|
8339
|
+
return toObject;
|
|
8340
|
+
}
|
|
8341
|
+
function fileDataFromMldev$1(fromObject) {
|
|
8342
|
+
const toObject = {};
|
|
8343
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8344
|
+
if (fromFileUri != null) {
|
|
8345
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8346
|
+
}
|
|
8347
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8348
|
+
if (fromMimeType != null) {
|
|
8349
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8350
|
+
}
|
|
8351
|
+
return toObject;
|
|
8352
|
+
}
|
|
8353
|
+
function partFromMldev$1(fromObject) {
|
|
8354
|
+
const toObject = {};
|
|
8355
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8356
|
+
'videoMetadata',
|
|
8357
|
+
]);
|
|
8358
|
+
if (fromVideoMetadata != null) {
|
|
8359
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
|
|
8360
|
+
}
|
|
8361
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8362
|
+
if (fromThought != null) {
|
|
8363
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
8364
|
+
}
|
|
8365
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8366
|
+
if (fromInlineData != null) {
|
|
8367
|
+
setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
|
|
8368
|
+
}
|
|
8369
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8370
|
+
if (fromFileData != null) {
|
|
8371
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
|
|
8372
|
+
}
|
|
8373
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8374
|
+
'thoughtSignature',
|
|
8375
|
+
]);
|
|
8376
|
+
if (fromThoughtSignature != null) {
|
|
8377
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8378
|
+
}
|
|
8379
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8380
|
+
'codeExecutionResult',
|
|
8381
|
+
]);
|
|
8382
|
+
if (fromCodeExecutionResult != null) {
|
|
8383
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8384
|
+
}
|
|
8385
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8386
|
+
'executableCode',
|
|
8387
|
+
]);
|
|
8388
|
+
if (fromExecutableCode != null) {
|
|
8389
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8390
|
+
}
|
|
8391
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8392
|
+
if (fromFunctionCall != null) {
|
|
8393
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
8394
|
+
}
|
|
8395
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
8396
|
+
'functionResponse',
|
|
8397
|
+
]);
|
|
8398
|
+
if (fromFunctionResponse != null) {
|
|
8399
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
8400
|
+
}
|
|
8401
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8402
|
+
if (fromText != null) {
|
|
8403
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8404
|
+
}
|
|
8405
|
+
return toObject;
|
|
8406
|
+
}
|
|
8407
|
+
function contentFromMldev$1(fromObject) {
|
|
8408
|
+
const toObject = {};
|
|
8409
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8410
|
+
if (fromParts != null) {
|
|
8411
|
+
let transformedList = fromParts;
|
|
8412
|
+
if (Array.isArray(transformedList)) {
|
|
8413
|
+
transformedList = transformedList.map((item) => {
|
|
8414
|
+
return partFromMldev$1(item);
|
|
8415
|
+
});
|
|
8416
|
+
}
|
|
8417
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
8418
|
+
}
|
|
8419
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
8420
|
+
if (fromRole != null) {
|
|
8421
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
8422
|
+
}
|
|
8423
|
+
return toObject;
|
|
8424
|
+
}
|
|
8425
|
+
function transcriptionFromMldev(fromObject) {
|
|
8426
|
+
const toObject = {};
|
|
8427
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8428
|
+
if (fromText != null) {
|
|
8429
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8430
|
+
}
|
|
8431
|
+
const fromFinished = getValueByPath(fromObject, ['finished']);
|
|
8432
|
+
if (fromFinished != null) {
|
|
8433
|
+
setValueByPath(toObject, ['finished'], fromFinished);
|
|
8434
|
+
}
|
|
8435
|
+
return toObject;
|
|
8436
|
+
}
|
|
8437
|
+
function urlMetadataFromMldev$1(fromObject) {
|
|
8438
|
+
const toObject = {};
|
|
8439
|
+
const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
|
|
8440
|
+
if (fromRetrievedUrl != null) {
|
|
8441
|
+
setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
|
|
8442
|
+
}
|
|
8443
|
+
const fromUrlRetrievalStatus = getValueByPath(fromObject, [
|
|
8444
|
+
'urlRetrievalStatus',
|
|
8445
|
+
]);
|
|
8446
|
+
if (fromUrlRetrievalStatus != null) {
|
|
8447
|
+
setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
|
|
8448
|
+
}
|
|
8449
|
+
return toObject;
|
|
8450
|
+
}
|
|
8451
|
+
function urlContextMetadataFromMldev$1(fromObject) {
|
|
8452
|
+
const toObject = {};
|
|
8453
|
+
const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
|
|
8454
|
+
if (fromUrlMetadata != null) {
|
|
8455
|
+
let transformedList = fromUrlMetadata;
|
|
8456
|
+
if (Array.isArray(transformedList)) {
|
|
8457
|
+
transformedList = transformedList.map((item) => {
|
|
8458
|
+
return urlMetadataFromMldev$1(item);
|
|
8459
|
+
});
|
|
8460
|
+
}
|
|
8461
|
+
setValueByPath(toObject, ['urlMetadata'], transformedList);
|
|
8462
|
+
}
|
|
8463
|
+
return toObject;
|
|
8464
|
+
}
|
|
8465
|
+
function liveServerContentFromMldev(fromObject) {
|
|
8466
|
+
const toObject = {};
|
|
8467
|
+
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
8468
|
+
if (fromModelTurn != null) {
|
|
8469
|
+
setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
|
|
8470
|
+
}
|
|
8471
|
+
const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
|
|
8472
|
+
if (fromTurnComplete != null) {
|
|
8473
|
+
setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
|
|
8474
|
+
}
|
|
8475
|
+
const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
|
|
8476
|
+
if (fromInterrupted != null) {
|
|
8477
|
+
setValueByPath(toObject, ['interrupted'], fromInterrupted);
|
|
8478
|
+
}
|
|
8479
|
+
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8480
|
+
'groundingMetadata',
|
|
8481
|
+
]);
|
|
8482
|
+
if (fromGroundingMetadata != null) {
|
|
8483
|
+
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8484
|
+
}
|
|
8485
|
+
const fromGenerationComplete = getValueByPath(fromObject, [
|
|
8486
|
+
'generationComplete',
|
|
8487
|
+
]);
|
|
8488
|
+
if (fromGenerationComplete != null) {
|
|
8489
|
+
setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
|
|
8490
|
+
}
|
|
8491
|
+
const fromInputTranscription = getValueByPath(fromObject, [
|
|
8492
|
+
'inputTranscription',
|
|
8493
|
+
]);
|
|
8494
|
+
if (fromInputTranscription != null) {
|
|
8495
|
+
setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
|
|
8496
|
+
}
|
|
8497
|
+
const fromOutputTranscription = getValueByPath(fromObject, [
|
|
8498
|
+
'outputTranscription',
|
|
8499
|
+
]);
|
|
8500
|
+
if (fromOutputTranscription != null) {
|
|
8501
|
+
setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
|
|
8502
|
+
}
|
|
8503
|
+
const fromUrlContextMetadata = getValueByPath(fromObject, [
|
|
8504
|
+
'urlContextMetadata',
|
|
8505
|
+
]);
|
|
8506
|
+
if (fromUrlContextMetadata != null) {
|
|
8507
|
+
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
8508
|
+
}
|
|
8509
|
+
return toObject;
|
|
8510
|
+
}
|
|
8511
|
+
function functionCallFromMldev(fromObject) {
|
|
8512
|
+
const toObject = {};
|
|
8513
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
8514
|
+
if (fromId != null) {
|
|
8515
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
8516
|
+
}
|
|
8517
|
+
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
8518
|
+
if (fromArgs != null) {
|
|
8519
|
+
setValueByPath(toObject, ['args'], fromArgs);
|
|
8520
|
+
}
|
|
8521
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
8522
|
+
if (fromName != null) {
|
|
8523
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
8524
|
+
}
|
|
8525
|
+
return toObject;
|
|
8526
|
+
}
|
|
8527
|
+
function liveServerToolCallFromMldev(fromObject) {
|
|
8528
|
+
const toObject = {};
|
|
8529
|
+
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
8530
|
+
'functionCalls',
|
|
8531
|
+
]);
|
|
8532
|
+
if (fromFunctionCalls != null) {
|
|
8533
|
+
let transformedList = fromFunctionCalls;
|
|
8534
|
+
if (Array.isArray(transformedList)) {
|
|
8535
|
+
transformedList = transformedList.map((item) => {
|
|
8536
|
+
return functionCallFromMldev(item);
|
|
8537
|
+
});
|
|
8538
|
+
}
|
|
8539
|
+
setValueByPath(toObject, ['functionCalls'], transformedList);
|
|
8540
|
+
}
|
|
8541
|
+
return toObject;
|
|
8542
|
+
}
|
|
8543
|
+
function liveServerToolCallCancellationFromMldev(fromObject) {
|
|
8544
|
+
const toObject = {};
|
|
8545
|
+
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
8546
|
+
if (fromIds != null) {
|
|
8547
|
+
setValueByPath(toObject, ['ids'], fromIds);
|
|
8548
|
+
}
|
|
8549
|
+
return toObject;
|
|
8550
|
+
}
|
|
8551
|
+
function modalityTokenCountFromMldev(fromObject) {
|
|
8552
|
+
const toObject = {};
|
|
8553
|
+
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
8554
|
+
if (fromModality != null) {
|
|
8555
|
+
setValueByPath(toObject, ['modality'], fromModality);
|
|
8556
|
+
}
|
|
8557
|
+
const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
|
|
8558
|
+
if (fromTokenCount != null) {
|
|
8559
|
+
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
8560
|
+
}
|
|
8561
|
+
return toObject;
|
|
8562
|
+
}
|
|
8563
|
+
function usageMetadataFromMldev(fromObject) {
|
|
8564
|
+
const toObject = {};
|
|
8565
|
+
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
8566
|
+
'promptTokenCount',
|
|
8567
|
+
]);
|
|
8568
|
+
if (fromPromptTokenCount != null) {
|
|
8569
|
+
setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
|
|
8570
|
+
}
|
|
8571
|
+
const fromCachedContentTokenCount = getValueByPath(fromObject, [
|
|
8572
|
+
'cachedContentTokenCount',
|
|
8573
|
+
]);
|
|
8574
|
+
if (fromCachedContentTokenCount != null) {
|
|
8575
|
+
setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
|
|
8576
|
+
}
|
|
8577
|
+
const fromResponseTokenCount = getValueByPath(fromObject, [
|
|
8578
|
+
'responseTokenCount',
|
|
8579
|
+
]);
|
|
8580
|
+
if (fromResponseTokenCount != null) {
|
|
8581
|
+
setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
|
|
8582
|
+
}
|
|
8583
|
+
const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
|
|
8584
|
+
'toolUsePromptTokenCount',
|
|
8585
|
+
]);
|
|
8586
|
+
if (fromToolUsePromptTokenCount != null) {
|
|
8587
|
+
setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
|
|
8588
|
+
}
|
|
8589
|
+
const fromThoughtsTokenCount = getValueByPath(fromObject, [
|
|
8590
|
+
'thoughtsTokenCount',
|
|
8591
|
+
]);
|
|
8592
|
+
if (fromThoughtsTokenCount != null) {
|
|
8593
|
+
setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
|
|
8594
|
+
}
|
|
8595
|
+
const fromTotalTokenCount = getValueByPath(fromObject, [
|
|
8596
|
+
'totalTokenCount',
|
|
8597
|
+
]);
|
|
8598
|
+
if (fromTotalTokenCount != null) {
|
|
8599
|
+
setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
|
|
8600
|
+
}
|
|
8601
|
+
const fromPromptTokensDetails = getValueByPath(fromObject, [
|
|
8602
|
+
'promptTokensDetails',
|
|
8603
|
+
]);
|
|
8604
|
+
if (fromPromptTokensDetails != null) {
|
|
8605
|
+
let transformedList = fromPromptTokensDetails;
|
|
8606
|
+
if (Array.isArray(transformedList)) {
|
|
8607
|
+
transformedList = transformedList.map((item) => {
|
|
8608
|
+
return modalityTokenCountFromMldev(item);
|
|
8609
|
+
});
|
|
8610
|
+
}
|
|
8611
|
+
setValueByPath(toObject, ['promptTokensDetails'], transformedList);
|
|
8612
|
+
}
|
|
8613
|
+
const fromCacheTokensDetails = getValueByPath(fromObject, [
|
|
8614
|
+
'cacheTokensDetails',
|
|
8615
|
+
]);
|
|
8616
|
+
if (fromCacheTokensDetails != null) {
|
|
8617
|
+
let transformedList = fromCacheTokensDetails;
|
|
8618
|
+
if (Array.isArray(transformedList)) {
|
|
8619
|
+
transformedList = transformedList.map((item) => {
|
|
8620
|
+
return modalityTokenCountFromMldev(item);
|
|
8621
|
+
});
|
|
8622
|
+
}
|
|
8623
|
+
setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
|
|
8624
|
+
}
|
|
8625
|
+
const fromResponseTokensDetails = getValueByPath(fromObject, [
|
|
8626
|
+
'responseTokensDetails',
|
|
8627
|
+
]);
|
|
8628
|
+
if (fromResponseTokensDetails != null) {
|
|
8629
|
+
let transformedList = fromResponseTokensDetails;
|
|
8630
|
+
if (Array.isArray(transformedList)) {
|
|
8631
|
+
transformedList = transformedList.map((item) => {
|
|
8632
|
+
return modalityTokenCountFromMldev(item);
|
|
8633
|
+
});
|
|
8634
|
+
}
|
|
8635
|
+
setValueByPath(toObject, ['responseTokensDetails'], transformedList);
|
|
8636
|
+
}
|
|
8637
|
+
const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
|
|
8638
|
+
'toolUsePromptTokensDetails',
|
|
8639
|
+
]);
|
|
8640
|
+
if (fromToolUsePromptTokensDetails != null) {
|
|
8641
|
+
let transformedList = fromToolUsePromptTokensDetails;
|
|
8642
|
+
if (Array.isArray(transformedList)) {
|
|
8643
|
+
transformedList = transformedList.map((item) => {
|
|
8644
|
+
return modalityTokenCountFromMldev(item);
|
|
8645
|
+
});
|
|
8646
|
+
}
|
|
8647
|
+
setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
|
|
8648
|
+
}
|
|
8649
|
+
return toObject;
|
|
8650
|
+
}
|
|
8651
|
+
function liveServerGoAwayFromMldev(fromObject) {
|
|
8652
|
+
const toObject = {};
|
|
8653
|
+
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
8654
|
+
if (fromTimeLeft != null) {
|
|
8655
|
+
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
8656
|
+
}
|
|
8657
|
+
return toObject;
|
|
8658
|
+
}
|
|
8659
|
+
function liveServerSessionResumptionUpdateFromMldev(fromObject) {
|
|
8660
|
+
const toObject = {};
|
|
8661
|
+
const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
|
|
8662
|
+
if (fromNewHandle != null) {
|
|
8663
|
+
setValueByPath(toObject, ['newHandle'], fromNewHandle);
|
|
8664
|
+
}
|
|
8665
|
+
const fromResumable = getValueByPath(fromObject, ['resumable']);
|
|
8666
|
+
if (fromResumable != null) {
|
|
8667
|
+
setValueByPath(toObject, ['resumable'], fromResumable);
|
|
8668
|
+
}
|
|
8669
|
+
const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
|
|
8670
|
+
'lastConsumedClientMessageIndex',
|
|
8671
|
+
]);
|
|
8672
|
+
if (fromLastConsumedClientMessageIndex != null) {
|
|
8673
|
+
setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
|
|
8674
|
+
}
|
|
8675
|
+
return toObject;
|
|
8676
|
+
}
|
|
8677
|
+
function liveServerMessageFromMldev(fromObject) {
|
|
8678
|
+
const toObject = {};
|
|
8679
|
+
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8680
|
+
'setupComplete',
|
|
8681
|
+
]);
|
|
8682
|
+
if (fromSetupComplete != null) {
|
|
8683
|
+
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
|
|
7984
8684
|
}
|
|
7985
|
-
const
|
|
7986
|
-
'
|
|
8685
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
8686
|
+
'serverContent',
|
|
7987
8687
|
]);
|
|
7988
|
-
if (
|
|
7989
|
-
setValueByPath(toObject, ['
|
|
8688
|
+
if (fromServerContent != null) {
|
|
8689
|
+
setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
|
|
7990
8690
|
}
|
|
7991
|
-
const
|
|
7992
|
-
if (
|
|
7993
|
-
setValueByPath(toObject, ['
|
|
8691
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8692
|
+
if (fromToolCall != null) {
|
|
8693
|
+
setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
|
|
7994
8694
|
}
|
|
7995
|
-
const
|
|
7996
|
-
|
|
7997
|
-
|
|
8695
|
+
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
8696
|
+
'toolCallCancellation',
|
|
8697
|
+
]);
|
|
8698
|
+
if (fromToolCallCancellation != null) {
|
|
8699
|
+
setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
|
|
7998
8700
|
}
|
|
7999
|
-
const
|
|
8000
|
-
'
|
|
8701
|
+
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8702
|
+
'usageMetadata',
|
|
8001
8703
|
]);
|
|
8002
|
-
if (
|
|
8003
|
-
setValueByPath(toObject, ['
|
|
8704
|
+
if (fromUsageMetadata != null) {
|
|
8705
|
+
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
|
|
8004
8706
|
}
|
|
8005
|
-
const
|
|
8006
|
-
if (
|
|
8007
|
-
setValueByPath(toObject, ['
|
|
8707
|
+
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
8708
|
+
if (fromGoAway != null) {
|
|
8709
|
+
setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
|
|
8710
|
+
}
|
|
8711
|
+
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
8712
|
+
'sessionResumptionUpdate',
|
|
8713
|
+
]);
|
|
8714
|
+
if (fromSessionResumptionUpdate != null) {
|
|
8715
|
+
setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
|
|
8008
8716
|
}
|
|
8009
8717
|
return toObject;
|
|
8010
8718
|
}
|
|
8011
|
-
function
|
|
8719
|
+
function liveMusicServerSetupCompleteFromMldev() {
|
|
8720
|
+
const toObject = {};
|
|
8721
|
+
return toObject;
|
|
8722
|
+
}
|
|
8723
|
+
function weightedPromptFromMldev(fromObject) {
|
|
8012
8724
|
const toObject = {};
|
|
8013
8725
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
8014
8726
|
if (fromText != null) {
|
|
@@ -8020,7 +8732,7 @@ function weightedPromptToMldev(fromObject) {
|
|
|
8020
8732
|
}
|
|
8021
8733
|
return toObject;
|
|
8022
8734
|
}
|
|
8023
|
-
function
|
|
8735
|
+
function liveMusicClientContentFromMldev(fromObject) {
|
|
8024
8736
|
const toObject = {};
|
|
8025
8737
|
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
8026
8738
|
'weightedPrompts',
|
|
@@ -8029,14 +8741,14 @@ function liveMusicSetWeightedPromptsParametersToMldev(fromObject) {
|
|
|
8029
8741
|
let transformedList = fromWeightedPrompts;
|
|
8030
8742
|
if (Array.isArray(transformedList)) {
|
|
8031
8743
|
transformedList = transformedList.map((item) => {
|
|
8032
|
-
return
|
|
8744
|
+
return weightedPromptFromMldev(item);
|
|
8033
8745
|
});
|
|
8034
8746
|
}
|
|
8035
8747
|
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
8036
8748
|
}
|
|
8037
8749
|
return toObject;
|
|
8038
8750
|
}
|
|
8039
|
-
function
|
|
8751
|
+
function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
8040
8752
|
const toObject = {};
|
|
8041
8753
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
8042
8754
|
if (fromTemperature != null) {
|
|
@@ -8086,68 +8798,88 @@ function liveMusicGenerationConfigToMldev(fromObject) {
|
|
|
8086
8798
|
}
|
|
8087
8799
|
return toObject;
|
|
8088
8800
|
}
|
|
8089
|
-
function
|
|
8801
|
+
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
8090
8802
|
const toObject = {};
|
|
8803
|
+
const fromClientContent = getValueByPath(fromObject, [
|
|
8804
|
+
'clientContent',
|
|
8805
|
+
]);
|
|
8806
|
+
if (fromClientContent != null) {
|
|
8807
|
+
setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
|
|
8808
|
+
}
|
|
8091
8809
|
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
8092
8810
|
'musicGenerationConfig',
|
|
8093
8811
|
]);
|
|
8094
8812
|
if (fromMusicGenerationConfig != null) {
|
|
8095
|
-
setValueByPath(toObject, ['musicGenerationConfig'],
|
|
8813
|
+
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
|
|
8096
8814
|
}
|
|
8097
8815
|
return toObject;
|
|
8098
8816
|
}
|
|
8099
|
-
function
|
|
8817
|
+
function audioChunkFromMldev(fromObject) {
|
|
8100
8818
|
const toObject = {};
|
|
8101
|
-
const
|
|
8102
|
-
if (
|
|
8103
|
-
setValueByPath(toObject, ['
|
|
8819
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
8820
|
+
if (fromData != null) {
|
|
8821
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
8822
|
+
}
|
|
8823
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8824
|
+
if (fromMimeType != null) {
|
|
8825
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8826
|
+
}
|
|
8827
|
+
const fromSourceMetadata = getValueByPath(fromObject, [
|
|
8828
|
+
'sourceMetadata',
|
|
8829
|
+
]);
|
|
8830
|
+
if (fromSourceMetadata != null) {
|
|
8831
|
+
setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
|
|
8104
8832
|
}
|
|
8105
8833
|
return toObject;
|
|
8106
8834
|
}
|
|
8107
|
-
function
|
|
8835
|
+
function liveMusicServerContentFromMldev(fromObject) {
|
|
8108
8836
|
const toObject = {};
|
|
8109
|
-
const
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
if (fromWeightedPrompts != null) {
|
|
8113
|
-
let transformedList = fromWeightedPrompts;
|
|
8837
|
+
const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
|
|
8838
|
+
if (fromAudioChunks != null) {
|
|
8839
|
+
let transformedList = fromAudioChunks;
|
|
8114
8840
|
if (Array.isArray(transformedList)) {
|
|
8115
8841
|
transformedList = transformedList.map((item) => {
|
|
8116
|
-
return
|
|
8842
|
+
return audioChunkFromMldev(item);
|
|
8117
8843
|
});
|
|
8118
8844
|
}
|
|
8119
|
-
setValueByPath(toObject, ['
|
|
8845
|
+
setValueByPath(toObject, ['audioChunks'], transformedList);
|
|
8120
8846
|
}
|
|
8121
8847
|
return toObject;
|
|
8122
8848
|
}
|
|
8123
|
-
function
|
|
8849
|
+
function liveMusicFilteredPromptFromMldev(fromObject) {
|
|
8124
8850
|
const toObject = {};
|
|
8125
|
-
const
|
|
8126
|
-
if (
|
|
8127
|
-
setValueByPath(toObject, ['
|
|
8851
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8852
|
+
if (fromText != null) {
|
|
8853
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8128
8854
|
}
|
|
8129
|
-
const
|
|
8130
|
-
'
|
|
8855
|
+
const fromFilteredReason = getValueByPath(fromObject, [
|
|
8856
|
+
'filteredReason',
|
|
8131
8857
|
]);
|
|
8132
|
-
if (
|
|
8133
|
-
setValueByPath(toObject, ['
|
|
8858
|
+
if (fromFilteredReason != null) {
|
|
8859
|
+
setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
|
|
8134
8860
|
}
|
|
8135
|
-
|
|
8136
|
-
|
|
8861
|
+
return toObject;
|
|
8862
|
+
}
|
|
8863
|
+
function liveMusicServerMessageFromMldev(fromObject) {
|
|
8864
|
+
const toObject = {};
|
|
8865
|
+
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8866
|
+
'setupComplete',
|
|
8137
8867
|
]);
|
|
8138
|
-
if (
|
|
8139
|
-
setValueByPath(toObject, ['
|
|
8868
|
+
if (fromSetupComplete != null) {
|
|
8869
|
+
setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
|
|
8140
8870
|
}
|
|
8141
|
-
const
|
|
8142
|
-
'
|
|
8871
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
8872
|
+
'serverContent',
|
|
8143
8873
|
]);
|
|
8144
|
-
if (
|
|
8145
|
-
setValueByPath(toObject, ['
|
|
8874
|
+
if (fromServerContent != null) {
|
|
8875
|
+
setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
|
|
8876
|
+
}
|
|
8877
|
+
const fromFilteredPrompt = getValueByPath(fromObject, [
|
|
8878
|
+
'filteredPrompt',
|
|
8879
|
+
]);
|
|
8880
|
+
if (fromFilteredPrompt != null) {
|
|
8881
|
+
setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
|
|
8146
8882
|
}
|
|
8147
|
-
return toObject;
|
|
8148
|
-
}
|
|
8149
|
-
function liveServerSetupCompleteFromMldev() {
|
|
8150
|
-
const toObject = {};
|
|
8151
8883
|
return toObject;
|
|
8152
8884
|
}
|
|
8153
8885
|
function liveServerSetupCompleteFromVertex(fromObject) {
|
|
@@ -8158,22 +8890,6 @@ function liveServerSetupCompleteFromVertex(fromObject) {
|
|
|
8158
8890
|
}
|
|
8159
8891
|
return toObject;
|
|
8160
8892
|
}
|
|
8161
|
-
function videoMetadataFromMldev$1(fromObject) {
|
|
8162
|
-
const toObject = {};
|
|
8163
|
-
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
8164
|
-
if (fromFps != null) {
|
|
8165
|
-
setValueByPath(toObject, ['fps'], fromFps);
|
|
8166
|
-
}
|
|
8167
|
-
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
8168
|
-
if (fromEndOffset != null) {
|
|
8169
|
-
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
8170
|
-
}
|
|
8171
|
-
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
8172
|
-
if (fromStartOffset != null) {
|
|
8173
|
-
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
8174
|
-
}
|
|
8175
|
-
return toObject;
|
|
8176
|
-
}
|
|
8177
8893
|
function videoMetadataFromVertex$1(fromObject) {
|
|
8178
8894
|
const toObject = {};
|
|
8179
8895
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
@@ -8190,18 +8906,6 @@ function videoMetadataFromVertex$1(fromObject) {
|
|
|
8190
8906
|
}
|
|
8191
8907
|
return toObject;
|
|
8192
8908
|
}
|
|
8193
|
-
function blobFromMldev$1(fromObject) {
|
|
8194
|
-
const toObject = {};
|
|
8195
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
8196
|
-
if (fromData != null) {
|
|
8197
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
8198
|
-
}
|
|
8199
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8200
|
-
if (fromMimeType != null) {
|
|
8201
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8202
|
-
}
|
|
8203
|
-
return toObject;
|
|
8204
|
-
}
|
|
8205
8909
|
function blobFromVertex$1(fromObject) {
|
|
8206
8910
|
const toObject = {};
|
|
8207
8911
|
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
@@ -8218,18 +8922,6 @@ function blobFromVertex$1(fromObject) {
|
|
|
8218
8922
|
}
|
|
8219
8923
|
return toObject;
|
|
8220
8924
|
}
|
|
8221
|
-
function fileDataFromMldev$1(fromObject) {
|
|
8222
|
-
const toObject = {};
|
|
8223
|
-
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8224
|
-
if (fromFileUri != null) {
|
|
8225
|
-
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8226
|
-
}
|
|
8227
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8228
|
-
if (fromMimeType != null) {
|
|
8229
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8230
|
-
}
|
|
8231
|
-
return toObject;
|
|
8232
|
-
}
|
|
8233
8925
|
function fileDataFromVertex$1(fromObject) {
|
|
8234
8926
|
const toObject = {};
|
|
8235
8927
|
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
@@ -8246,60 +8938,6 @@ function fileDataFromVertex$1(fromObject) {
|
|
|
8246
8938
|
}
|
|
8247
8939
|
return toObject;
|
|
8248
8940
|
}
|
|
8249
|
-
function partFromMldev$1(fromObject) {
|
|
8250
|
-
const toObject = {};
|
|
8251
|
-
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8252
|
-
'videoMetadata',
|
|
8253
|
-
]);
|
|
8254
|
-
if (fromVideoMetadata != null) {
|
|
8255
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
|
|
8256
|
-
}
|
|
8257
|
-
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8258
|
-
if (fromThought != null) {
|
|
8259
|
-
setValueByPath(toObject, ['thought'], fromThought);
|
|
8260
|
-
}
|
|
8261
|
-
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8262
|
-
if (fromInlineData != null) {
|
|
8263
|
-
setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
|
|
8264
|
-
}
|
|
8265
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8266
|
-
if (fromFileData != null) {
|
|
8267
|
-
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
|
|
8268
|
-
}
|
|
8269
|
-
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8270
|
-
'thoughtSignature',
|
|
8271
|
-
]);
|
|
8272
|
-
if (fromThoughtSignature != null) {
|
|
8273
|
-
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8274
|
-
}
|
|
8275
|
-
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8276
|
-
'codeExecutionResult',
|
|
8277
|
-
]);
|
|
8278
|
-
if (fromCodeExecutionResult != null) {
|
|
8279
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8280
|
-
}
|
|
8281
|
-
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8282
|
-
'executableCode',
|
|
8283
|
-
]);
|
|
8284
|
-
if (fromExecutableCode != null) {
|
|
8285
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8286
|
-
}
|
|
8287
|
-
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8288
|
-
if (fromFunctionCall != null) {
|
|
8289
|
-
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
8290
|
-
}
|
|
8291
|
-
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
8292
|
-
'functionResponse',
|
|
8293
|
-
]);
|
|
8294
|
-
if (fromFunctionResponse != null) {
|
|
8295
|
-
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
8296
|
-
}
|
|
8297
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
8298
|
-
if (fromText != null) {
|
|
8299
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8300
|
-
}
|
|
8301
|
-
return toObject;
|
|
8302
|
-
}
|
|
8303
8941
|
function partFromVertex$1(fromObject) {
|
|
8304
8942
|
const toObject = {};
|
|
8305
8943
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -8349,26 +8987,8 @@ function partFromVertex$1(fromObject) {
|
|
|
8349
8987
|
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
8350
8988
|
}
|
|
8351
8989
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
8352
|
-
if (fromText != null) {
|
|
8353
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8354
|
-
}
|
|
8355
|
-
return toObject;
|
|
8356
|
-
}
|
|
8357
|
-
function contentFromMldev$1(fromObject) {
|
|
8358
|
-
const toObject = {};
|
|
8359
|
-
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8360
|
-
if (fromParts != null) {
|
|
8361
|
-
let transformedList = fromParts;
|
|
8362
|
-
if (Array.isArray(transformedList)) {
|
|
8363
|
-
transformedList = transformedList.map((item) => {
|
|
8364
|
-
return partFromMldev$1(item);
|
|
8365
|
-
});
|
|
8366
|
-
}
|
|
8367
|
-
setValueByPath(toObject, ['parts'], transformedList);
|
|
8368
|
-
}
|
|
8369
|
-
const fromRole = getValueByPath(fromObject, ['role']);
|
|
8370
|
-
if (fromRole != null) {
|
|
8371
|
-
setValueByPath(toObject, ['role'], fromRole);
|
|
8990
|
+
if (fromText != null) {
|
|
8991
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8372
8992
|
}
|
|
8373
8993
|
return toObject;
|
|
8374
8994
|
}
|
|
@@ -8390,18 +9010,6 @@ function contentFromVertex$1(fromObject) {
|
|
|
8390
9010
|
}
|
|
8391
9011
|
return toObject;
|
|
8392
9012
|
}
|
|
8393
|
-
function transcriptionFromMldev(fromObject) {
|
|
8394
|
-
const toObject = {};
|
|
8395
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
8396
|
-
if (fromText != null) {
|
|
8397
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8398
|
-
}
|
|
8399
|
-
const fromFinished = getValueByPath(fromObject, ['finished']);
|
|
8400
|
-
if (fromFinished != null) {
|
|
8401
|
-
setValueByPath(toObject, ['finished'], fromFinished);
|
|
8402
|
-
}
|
|
8403
|
-
return toObject;
|
|
8404
|
-
}
|
|
8405
9013
|
function transcriptionFromVertex(fromObject) {
|
|
8406
9014
|
const toObject = {};
|
|
8407
9015
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
@@ -8414,80 +9022,6 @@ function transcriptionFromVertex(fromObject) {
|
|
|
8414
9022
|
}
|
|
8415
9023
|
return toObject;
|
|
8416
9024
|
}
|
|
8417
|
-
function urlMetadataFromMldev$1(fromObject) {
|
|
8418
|
-
const toObject = {};
|
|
8419
|
-
const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
|
|
8420
|
-
if (fromRetrievedUrl != null) {
|
|
8421
|
-
setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
|
|
8422
|
-
}
|
|
8423
|
-
const fromUrlRetrievalStatus = getValueByPath(fromObject, [
|
|
8424
|
-
'urlRetrievalStatus',
|
|
8425
|
-
]);
|
|
8426
|
-
if (fromUrlRetrievalStatus != null) {
|
|
8427
|
-
setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
|
|
8428
|
-
}
|
|
8429
|
-
return toObject;
|
|
8430
|
-
}
|
|
8431
|
-
function urlContextMetadataFromMldev$1(fromObject) {
|
|
8432
|
-
const toObject = {};
|
|
8433
|
-
const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
|
|
8434
|
-
if (fromUrlMetadata != null) {
|
|
8435
|
-
let transformedList = fromUrlMetadata;
|
|
8436
|
-
if (Array.isArray(transformedList)) {
|
|
8437
|
-
transformedList = transformedList.map((item) => {
|
|
8438
|
-
return urlMetadataFromMldev$1(item);
|
|
8439
|
-
});
|
|
8440
|
-
}
|
|
8441
|
-
setValueByPath(toObject, ['urlMetadata'], transformedList);
|
|
8442
|
-
}
|
|
8443
|
-
return toObject;
|
|
8444
|
-
}
|
|
8445
|
-
function liveServerContentFromMldev(fromObject) {
|
|
8446
|
-
const toObject = {};
|
|
8447
|
-
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
8448
|
-
if (fromModelTurn != null) {
|
|
8449
|
-
setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
|
|
8450
|
-
}
|
|
8451
|
-
const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
|
|
8452
|
-
if (fromTurnComplete != null) {
|
|
8453
|
-
setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
|
|
8454
|
-
}
|
|
8455
|
-
const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
|
|
8456
|
-
if (fromInterrupted != null) {
|
|
8457
|
-
setValueByPath(toObject, ['interrupted'], fromInterrupted);
|
|
8458
|
-
}
|
|
8459
|
-
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8460
|
-
'groundingMetadata',
|
|
8461
|
-
]);
|
|
8462
|
-
if (fromGroundingMetadata != null) {
|
|
8463
|
-
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8464
|
-
}
|
|
8465
|
-
const fromGenerationComplete = getValueByPath(fromObject, [
|
|
8466
|
-
'generationComplete',
|
|
8467
|
-
]);
|
|
8468
|
-
if (fromGenerationComplete != null) {
|
|
8469
|
-
setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
|
|
8470
|
-
}
|
|
8471
|
-
const fromInputTranscription = getValueByPath(fromObject, [
|
|
8472
|
-
'inputTranscription',
|
|
8473
|
-
]);
|
|
8474
|
-
if (fromInputTranscription != null) {
|
|
8475
|
-
setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
|
|
8476
|
-
}
|
|
8477
|
-
const fromOutputTranscription = getValueByPath(fromObject, [
|
|
8478
|
-
'outputTranscription',
|
|
8479
|
-
]);
|
|
8480
|
-
if (fromOutputTranscription != null) {
|
|
8481
|
-
setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
|
|
8482
|
-
}
|
|
8483
|
-
const fromUrlContextMetadata = getValueByPath(fromObject, [
|
|
8484
|
-
'urlContextMetadata',
|
|
8485
|
-
]);
|
|
8486
|
-
if (fromUrlContextMetadata != null) {
|
|
8487
|
-
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
8488
|
-
}
|
|
8489
|
-
return toObject;
|
|
8490
|
-
}
|
|
8491
9025
|
function liveServerContentFromVertex(fromObject) {
|
|
8492
9026
|
const toObject = {};
|
|
8493
9027
|
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
@@ -8528,22 +9062,6 @@ function liveServerContentFromVertex(fromObject) {
|
|
|
8528
9062
|
}
|
|
8529
9063
|
return toObject;
|
|
8530
9064
|
}
|
|
8531
|
-
function functionCallFromMldev(fromObject) {
|
|
8532
|
-
const toObject = {};
|
|
8533
|
-
const fromId = getValueByPath(fromObject, ['id']);
|
|
8534
|
-
if (fromId != null) {
|
|
8535
|
-
setValueByPath(toObject, ['id'], fromId);
|
|
8536
|
-
}
|
|
8537
|
-
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
8538
|
-
if (fromArgs != null) {
|
|
8539
|
-
setValueByPath(toObject, ['args'], fromArgs);
|
|
8540
|
-
}
|
|
8541
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
8542
|
-
if (fromName != null) {
|
|
8543
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
8544
|
-
}
|
|
8545
|
-
return toObject;
|
|
8546
|
-
}
|
|
8547
9065
|
function functionCallFromVertex(fromObject) {
|
|
8548
9066
|
const toObject = {};
|
|
8549
9067
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
@@ -8556,22 +9074,6 @@ function functionCallFromVertex(fromObject) {
|
|
|
8556
9074
|
}
|
|
8557
9075
|
return toObject;
|
|
8558
9076
|
}
|
|
8559
|
-
function liveServerToolCallFromMldev(fromObject) {
|
|
8560
|
-
const toObject = {};
|
|
8561
|
-
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
8562
|
-
'functionCalls',
|
|
8563
|
-
]);
|
|
8564
|
-
if (fromFunctionCalls != null) {
|
|
8565
|
-
let transformedList = fromFunctionCalls;
|
|
8566
|
-
if (Array.isArray(transformedList)) {
|
|
8567
|
-
transformedList = transformedList.map((item) => {
|
|
8568
|
-
return functionCallFromMldev(item);
|
|
8569
|
-
});
|
|
8570
|
-
}
|
|
8571
|
-
setValueByPath(toObject, ['functionCalls'], transformedList);
|
|
8572
|
-
}
|
|
8573
|
-
return toObject;
|
|
8574
|
-
}
|
|
8575
9077
|
function liveServerToolCallFromVertex(fromObject) {
|
|
8576
9078
|
const toObject = {};
|
|
8577
9079
|
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
@@ -8588,14 +9090,6 @@ function liveServerToolCallFromVertex(fromObject) {
|
|
|
8588
9090
|
}
|
|
8589
9091
|
return toObject;
|
|
8590
9092
|
}
|
|
8591
|
-
function liveServerToolCallCancellationFromMldev(fromObject) {
|
|
8592
|
-
const toObject = {};
|
|
8593
|
-
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
8594
|
-
if (fromIds != null) {
|
|
8595
|
-
setValueByPath(toObject, ['ids'], fromIds);
|
|
8596
|
-
}
|
|
8597
|
-
return toObject;
|
|
8598
|
-
}
|
|
8599
9093
|
function liveServerToolCallCancellationFromVertex(fromObject) {
|
|
8600
9094
|
const toObject = {};
|
|
8601
9095
|
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
@@ -8604,18 +9098,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
|
|
|
8604
9098
|
}
|
|
8605
9099
|
return toObject;
|
|
8606
9100
|
}
|
|
8607
|
-
function modalityTokenCountFromMldev(fromObject) {
|
|
8608
|
-
const toObject = {};
|
|
8609
|
-
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
8610
|
-
if (fromModality != null) {
|
|
8611
|
-
setValueByPath(toObject, ['modality'], fromModality);
|
|
8612
|
-
}
|
|
8613
|
-
const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
|
|
8614
|
-
if (fromTokenCount != null) {
|
|
8615
|
-
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
8616
|
-
}
|
|
8617
|
-
return toObject;
|
|
8618
|
-
}
|
|
8619
9101
|
function modalityTokenCountFromVertex(fromObject) {
|
|
8620
9102
|
const toObject = {};
|
|
8621
9103
|
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
@@ -8628,94 +9110,6 @@ function modalityTokenCountFromVertex(fromObject) {
|
|
|
8628
9110
|
}
|
|
8629
9111
|
return toObject;
|
|
8630
9112
|
}
|
|
8631
|
-
function usageMetadataFromMldev(fromObject) {
|
|
8632
|
-
const toObject = {};
|
|
8633
|
-
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
8634
|
-
'promptTokenCount',
|
|
8635
|
-
]);
|
|
8636
|
-
if (fromPromptTokenCount != null) {
|
|
8637
|
-
setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
|
|
8638
|
-
}
|
|
8639
|
-
const fromCachedContentTokenCount = getValueByPath(fromObject, [
|
|
8640
|
-
'cachedContentTokenCount',
|
|
8641
|
-
]);
|
|
8642
|
-
if (fromCachedContentTokenCount != null) {
|
|
8643
|
-
setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
|
|
8644
|
-
}
|
|
8645
|
-
const fromResponseTokenCount = getValueByPath(fromObject, [
|
|
8646
|
-
'responseTokenCount',
|
|
8647
|
-
]);
|
|
8648
|
-
if (fromResponseTokenCount != null) {
|
|
8649
|
-
setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
|
|
8650
|
-
}
|
|
8651
|
-
const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
|
|
8652
|
-
'toolUsePromptTokenCount',
|
|
8653
|
-
]);
|
|
8654
|
-
if (fromToolUsePromptTokenCount != null) {
|
|
8655
|
-
setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
|
|
8656
|
-
}
|
|
8657
|
-
const fromThoughtsTokenCount = getValueByPath(fromObject, [
|
|
8658
|
-
'thoughtsTokenCount',
|
|
8659
|
-
]);
|
|
8660
|
-
if (fromThoughtsTokenCount != null) {
|
|
8661
|
-
setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
|
|
8662
|
-
}
|
|
8663
|
-
const fromTotalTokenCount = getValueByPath(fromObject, [
|
|
8664
|
-
'totalTokenCount',
|
|
8665
|
-
]);
|
|
8666
|
-
if (fromTotalTokenCount != null) {
|
|
8667
|
-
setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
|
|
8668
|
-
}
|
|
8669
|
-
const fromPromptTokensDetails = getValueByPath(fromObject, [
|
|
8670
|
-
'promptTokensDetails',
|
|
8671
|
-
]);
|
|
8672
|
-
if (fromPromptTokensDetails != null) {
|
|
8673
|
-
let transformedList = fromPromptTokensDetails;
|
|
8674
|
-
if (Array.isArray(transformedList)) {
|
|
8675
|
-
transformedList = transformedList.map((item) => {
|
|
8676
|
-
return modalityTokenCountFromMldev(item);
|
|
8677
|
-
});
|
|
8678
|
-
}
|
|
8679
|
-
setValueByPath(toObject, ['promptTokensDetails'], transformedList);
|
|
8680
|
-
}
|
|
8681
|
-
const fromCacheTokensDetails = getValueByPath(fromObject, [
|
|
8682
|
-
'cacheTokensDetails',
|
|
8683
|
-
]);
|
|
8684
|
-
if (fromCacheTokensDetails != null) {
|
|
8685
|
-
let transformedList = fromCacheTokensDetails;
|
|
8686
|
-
if (Array.isArray(transformedList)) {
|
|
8687
|
-
transformedList = transformedList.map((item) => {
|
|
8688
|
-
return modalityTokenCountFromMldev(item);
|
|
8689
|
-
});
|
|
8690
|
-
}
|
|
8691
|
-
setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
|
|
8692
|
-
}
|
|
8693
|
-
const fromResponseTokensDetails = getValueByPath(fromObject, [
|
|
8694
|
-
'responseTokensDetails',
|
|
8695
|
-
]);
|
|
8696
|
-
if (fromResponseTokensDetails != null) {
|
|
8697
|
-
let transformedList = fromResponseTokensDetails;
|
|
8698
|
-
if (Array.isArray(transformedList)) {
|
|
8699
|
-
transformedList = transformedList.map((item) => {
|
|
8700
|
-
return modalityTokenCountFromMldev(item);
|
|
8701
|
-
});
|
|
8702
|
-
}
|
|
8703
|
-
setValueByPath(toObject, ['responseTokensDetails'], transformedList);
|
|
8704
|
-
}
|
|
8705
|
-
const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
|
|
8706
|
-
'toolUsePromptTokensDetails',
|
|
8707
|
-
]);
|
|
8708
|
-
if (fromToolUsePromptTokensDetails != null) {
|
|
8709
|
-
let transformedList = fromToolUsePromptTokensDetails;
|
|
8710
|
-
if (Array.isArray(transformedList)) {
|
|
8711
|
-
transformedList = transformedList.map((item) => {
|
|
8712
|
-
return modalityTokenCountFromMldev(item);
|
|
8713
|
-
});
|
|
8714
|
-
}
|
|
8715
|
-
setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
|
|
8716
|
-
}
|
|
8717
|
-
return toObject;
|
|
8718
|
-
}
|
|
8719
9113
|
function usageMetadataFromVertex(fromObject) {
|
|
8720
9114
|
const toObject = {};
|
|
8721
9115
|
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
@@ -8806,39 +9200,13 @@ function usageMetadataFromVertex(fromObject) {
|
|
|
8806
9200
|
if (fromTrafficType != null) {
|
|
8807
9201
|
setValueByPath(toObject, ['trafficType'], fromTrafficType);
|
|
8808
9202
|
}
|
|
8809
|
-
return toObject;
|
|
8810
|
-
}
|
|
8811
|
-
function
|
|
8812
|
-
const toObject = {};
|
|
8813
|
-
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
8814
|
-
if (fromTimeLeft != null) {
|
|
8815
|
-
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
8816
|
-
}
|
|
8817
|
-
return toObject;
|
|
8818
|
-
}
|
|
8819
|
-
function liveServerGoAwayFromVertex(fromObject) {
|
|
8820
|
-
const toObject = {};
|
|
8821
|
-
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
8822
|
-
if (fromTimeLeft != null) {
|
|
8823
|
-
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
8824
|
-
}
|
|
8825
|
-
return toObject;
|
|
8826
|
-
}
|
|
8827
|
-
function liveServerSessionResumptionUpdateFromMldev(fromObject) {
|
|
8828
|
-
const toObject = {};
|
|
8829
|
-
const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
|
|
8830
|
-
if (fromNewHandle != null) {
|
|
8831
|
-
setValueByPath(toObject, ['newHandle'], fromNewHandle);
|
|
8832
|
-
}
|
|
8833
|
-
const fromResumable = getValueByPath(fromObject, ['resumable']);
|
|
8834
|
-
if (fromResumable != null) {
|
|
8835
|
-
setValueByPath(toObject, ['resumable'], fromResumable);
|
|
8836
|
-
}
|
|
8837
|
-
const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
|
|
8838
|
-
'lastConsumedClientMessageIndex',
|
|
8839
|
-
]);
|
|
8840
|
-
if (fromLastConsumedClientMessageIndex != null) {
|
|
8841
|
-
setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
|
|
9203
|
+
return toObject;
|
|
9204
|
+
}
|
|
9205
|
+
function liveServerGoAwayFromVertex(fromObject) {
|
|
9206
|
+
const toObject = {};
|
|
9207
|
+
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
9208
|
+
if (fromTimeLeft != null) {
|
|
9209
|
+
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
8842
9210
|
}
|
|
8843
9211
|
return toObject;
|
|
8844
9212
|
}
|
|
@@ -8860,48 +9228,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
|
|
|
8860
9228
|
}
|
|
8861
9229
|
return toObject;
|
|
8862
9230
|
}
|
|
8863
|
-
function liveServerMessageFromMldev(fromObject) {
|
|
8864
|
-
const toObject = {};
|
|
8865
|
-
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8866
|
-
'setupComplete',
|
|
8867
|
-
]);
|
|
8868
|
-
if (fromSetupComplete != null) {
|
|
8869
|
-
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
|
|
8870
|
-
}
|
|
8871
|
-
const fromServerContent = getValueByPath(fromObject, [
|
|
8872
|
-
'serverContent',
|
|
8873
|
-
]);
|
|
8874
|
-
if (fromServerContent != null) {
|
|
8875
|
-
setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
|
|
8876
|
-
}
|
|
8877
|
-
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8878
|
-
if (fromToolCall != null) {
|
|
8879
|
-
setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
|
|
8880
|
-
}
|
|
8881
|
-
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
8882
|
-
'toolCallCancellation',
|
|
8883
|
-
]);
|
|
8884
|
-
if (fromToolCallCancellation != null) {
|
|
8885
|
-
setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
|
|
8886
|
-
}
|
|
8887
|
-
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8888
|
-
'usageMetadata',
|
|
8889
|
-
]);
|
|
8890
|
-
if (fromUsageMetadata != null) {
|
|
8891
|
-
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
|
|
8892
|
-
}
|
|
8893
|
-
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
8894
|
-
if (fromGoAway != null) {
|
|
8895
|
-
setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
|
|
8896
|
-
}
|
|
8897
|
-
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
8898
|
-
'sessionResumptionUpdate',
|
|
8899
|
-
]);
|
|
8900
|
-
if (fromSessionResumptionUpdate != null) {
|
|
8901
|
-
setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
|
|
8902
|
-
}
|
|
8903
|
-
return toObject;
|
|
8904
|
-
}
|
|
8905
9231
|
function liveServerMessageFromVertex(fromObject) {
|
|
8906
9232
|
const toObject = {};
|
|
8907
9233
|
const fromSetupComplete = getValueByPath(fromObject, [
|
|
@@ -8944,172 +9270,6 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8944
9270
|
}
|
|
8945
9271
|
return toObject;
|
|
8946
9272
|
}
|
|
8947
|
-
function liveMusicServerSetupCompleteFromMldev() {
|
|
8948
|
-
const toObject = {};
|
|
8949
|
-
return toObject;
|
|
8950
|
-
}
|
|
8951
|
-
function weightedPromptFromMldev(fromObject) {
|
|
8952
|
-
const toObject = {};
|
|
8953
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
8954
|
-
if (fromText != null) {
|
|
8955
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8956
|
-
}
|
|
8957
|
-
const fromWeight = getValueByPath(fromObject, ['weight']);
|
|
8958
|
-
if (fromWeight != null) {
|
|
8959
|
-
setValueByPath(toObject, ['weight'], fromWeight);
|
|
8960
|
-
}
|
|
8961
|
-
return toObject;
|
|
8962
|
-
}
|
|
8963
|
-
function liveMusicClientContentFromMldev(fromObject) {
|
|
8964
|
-
const toObject = {};
|
|
8965
|
-
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
8966
|
-
'weightedPrompts',
|
|
8967
|
-
]);
|
|
8968
|
-
if (fromWeightedPrompts != null) {
|
|
8969
|
-
let transformedList = fromWeightedPrompts;
|
|
8970
|
-
if (Array.isArray(transformedList)) {
|
|
8971
|
-
transformedList = transformedList.map((item) => {
|
|
8972
|
-
return weightedPromptFromMldev(item);
|
|
8973
|
-
});
|
|
8974
|
-
}
|
|
8975
|
-
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
8976
|
-
}
|
|
8977
|
-
return toObject;
|
|
8978
|
-
}
|
|
8979
|
-
function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
8980
|
-
const toObject = {};
|
|
8981
|
-
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
8982
|
-
if (fromTemperature != null) {
|
|
8983
|
-
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
8984
|
-
}
|
|
8985
|
-
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
8986
|
-
if (fromTopK != null) {
|
|
8987
|
-
setValueByPath(toObject, ['topK'], fromTopK);
|
|
8988
|
-
}
|
|
8989
|
-
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
8990
|
-
if (fromSeed != null) {
|
|
8991
|
-
setValueByPath(toObject, ['seed'], fromSeed);
|
|
8992
|
-
}
|
|
8993
|
-
const fromGuidance = getValueByPath(fromObject, ['guidance']);
|
|
8994
|
-
if (fromGuidance != null) {
|
|
8995
|
-
setValueByPath(toObject, ['guidance'], fromGuidance);
|
|
8996
|
-
}
|
|
8997
|
-
const fromBpm = getValueByPath(fromObject, ['bpm']);
|
|
8998
|
-
if (fromBpm != null) {
|
|
8999
|
-
setValueByPath(toObject, ['bpm'], fromBpm);
|
|
9000
|
-
}
|
|
9001
|
-
const fromDensity = getValueByPath(fromObject, ['density']);
|
|
9002
|
-
if (fromDensity != null) {
|
|
9003
|
-
setValueByPath(toObject, ['density'], fromDensity);
|
|
9004
|
-
}
|
|
9005
|
-
const fromBrightness = getValueByPath(fromObject, ['brightness']);
|
|
9006
|
-
if (fromBrightness != null) {
|
|
9007
|
-
setValueByPath(toObject, ['brightness'], fromBrightness);
|
|
9008
|
-
}
|
|
9009
|
-
const fromScale = getValueByPath(fromObject, ['scale']);
|
|
9010
|
-
if (fromScale != null) {
|
|
9011
|
-
setValueByPath(toObject, ['scale'], fromScale);
|
|
9012
|
-
}
|
|
9013
|
-
const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
|
|
9014
|
-
if (fromMuteBass != null) {
|
|
9015
|
-
setValueByPath(toObject, ['muteBass'], fromMuteBass);
|
|
9016
|
-
}
|
|
9017
|
-
const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
|
|
9018
|
-
if (fromMuteDrums != null) {
|
|
9019
|
-
setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
|
|
9020
|
-
}
|
|
9021
|
-
const fromOnlyBassAndDrums = getValueByPath(fromObject, [
|
|
9022
|
-
'onlyBassAndDrums',
|
|
9023
|
-
]);
|
|
9024
|
-
if (fromOnlyBassAndDrums != null) {
|
|
9025
|
-
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
9026
|
-
}
|
|
9027
|
-
return toObject;
|
|
9028
|
-
}
|
|
9029
|
-
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
9030
|
-
const toObject = {};
|
|
9031
|
-
const fromClientContent = getValueByPath(fromObject, [
|
|
9032
|
-
'clientContent',
|
|
9033
|
-
]);
|
|
9034
|
-
if (fromClientContent != null) {
|
|
9035
|
-
setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
|
|
9036
|
-
}
|
|
9037
|
-
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
9038
|
-
'musicGenerationConfig',
|
|
9039
|
-
]);
|
|
9040
|
-
if (fromMusicGenerationConfig != null) {
|
|
9041
|
-
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
|
|
9042
|
-
}
|
|
9043
|
-
return toObject;
|
|
9044
|
-
}
|
|
9045
|
-
function audioChunkFromMldev(fromObject) {
|
|
9046
|
-
const toObject = {};
|
|
9047
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
9048
|
-
if (fromData != null) {
|
|
9049
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
9050
|
-
}
|
|
9051
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
9052
|
-
if (fromMimeType != null) {
|
|
9053
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
9054
|
-
}
|
|
9055
|
-
const fromSourceMetadata = getValueByPath(fromObject, [
|
|
9056
|
-
'sourceMetadata',
|
|
9057
|
-
]);
|
|
9058
|
-
if (fromSourceMetadata != null) {
|
|
9059
|
-
setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
|
|
9060
|
-
}
|
|
9061
|
-
return toObject;
|
|
9062
|
-
}
|
|
9063
|
-
function liveMusicServerContentFromMldev(fromObject) {
|
|
9064
|
-
const toObject = {};
|
|
9065
|
-
const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
|
|
9066
|
-
if (fromAudioChunks != null) {
|
|
9067
|
-
let transformedList = fromAudioChunks;
|
|
9068
|
-
if (Array.isArray(transformedList)) {
|
|
9069
|
-
transformedList = transformedList.map((item) => {
|
|
9070
|
-
return audioChunkFromMldev(item);
|
|
9071
|
-
});
|
|
9072
|
-
}
|
|
9073
|
-
setValueByPath(toObject, ['audioChunks'], transformedList);
|
|
9074
|
-
}
|
|
9075
|
-
return toObject;
|
|
9076
|
-
}
|
|
9077
|
-
function liveMusicFilteredPromptFromMldev(fromObject) {
|
|
9078
|
-
const toObject = {};
|
|
9079
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
9080
|
-
if (fromText != null) {
|
|
9081
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
9082
|
-
}
|
|
9083
|
-
const fromFilteredReason = getValueByPath(fromObject, [
|
|
9084
|
-
'filteredReason',
|
|
9085
|
-
]);
|
|
9086
|
-
if (fromFilteredReason != null) {
|
|
9087
|
-
setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
|
|
9088
|
-
}
|
|
9089
|
-
return toObject;
|
|
9090
|
-
}
|
|
9091
|
-
function liveMusicServerMessageFromMldev(fromObject) {
|
|
9092
|
-
const toObject = {};
|
|
9093
|
-
const fromSetupComplete = getValueByPath(fromObject, [
|
|
9094
|
-
'setupComplete',
|
|
9095
|
-
]);
|
|
9096
|
-
if (fromSetupComplete != null) {
|
|
9097
|
-
setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
|
|
9098
|
-
}
|
|
9099
|
-
const fromServerContent = getValueByPath(fromObject, [
|
|
9100
|
-
'serverContent',
|
|
9101
|
-
]);
|
|
9102
|
-
if (fromServerContent != null) {
|
|
9103
|
-
setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
|
|
9104
|
-
}
|
|
9105
|
-
const fromFilteredPrompt = getValueByPath(fromObject, [
|
|
9106
|
-
'filteredPrompt',
|
|
9107
|
-
]);
|
|
9108
|
-
if (fromFilteredPrompt != null) {
|
|
9109
|
-
setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
|
|
9110
|
-
}
|
|
9111
|
-
return toObject;
|
|
9112
|
-
}
|
|
9113
9273
|
|
|
9114
9274
|
/**
|
|
9115
9275
|
* @license
|
|
@@ -9902,6 +10062,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
|
|
|
9902
10062
|
if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
|
|
9903
10063
|
throw new Error('addWatermark parameter is not supported in Gemini API.');
|
|
9904
10064
|
}
|
|
10065
|
+
if (getValueByPath(fromObject, ['imageSize']) !== undefined) {
|
|
10066
|
+
throw new Error('imageSize parameter is not supported in Gemini API.');
|
|
10067
|
+
}
|
|
9905
10068
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
9906
10069
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
9907
10070
|
}
|
|
@@ -10978,6 +11141,10 @@ function generateImagesConfigToVertex(fromObject, parentObject) {
|
|
|
10978
11141
|
if (parentObject !== undefined && fromAddWatermark != null) {
|
|
10979
11142
|
setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
|
|
10980
11143
|
}
|
|
11144
|
+
const fromImageSize = getValueByPath(fromObject, ['imageSize']);
|
|
11145
|
+
if (parentObject !== undefined && fromImageSize != null) {
|
|
11146
|
+
setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
|
|
11147
|
+
}
|
|
10981
11148
|
const fromEnhancePrompt = getValueByPath(fromObject, [
|
|
10982
11149
|
'enhancePrompt',
|
|
10983
11150
|
]);
|
|
@@ -11190,6 +11357,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
|
|
|
11190
11357
|
if (parentObject !== undefined && fromOutputCompressionQuality != null) {
|
|
11191
11358
|
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
11192
11359
|
}
|
|
11360
|
+
const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
|
|
11361
|
+
if (parentObject !== undefined && fromAddWatermark != null) {
|
|
11362
|
+
setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
|
|
11363
|
+
}
|
|
11193
11364
|
const fromEditMode = getValueByPath(fromObject, ['editMode']);
|
|
11194
11365
|
if (parentObject !== undefined && fromEditMode != null) {
|
|
11195
11366
|
setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
|
|
@@ -11764,6 +11935,12 @@ function candidateFromMldev(fromObject) {
|
|
|
11764
11935
|
}
|
|
11765
11936
|
function generateContentResponseFromMldev(fromObject) {
|
|
11766
11937
|
const toObject = {};
|
|
11938
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
11939
|
+
'sdkHttpResponse',
|
|
11940
|
+
]);
|
|
11941
|
+
if (fromSdkHttpResponse != null) {
|
|
11942
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
11943
|
+
}
|
|
11767
11944
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
11768
11945
|
if (fromCandidates != null) {
|
|
11769
11946
|
let transformedList = fromCandidates;
|
|
@@ -11958,6 +12135,12 @@ function modelFromMldev(fromObject) {
|
|
|
11958
12135
|
}
|
|
11959
12136
|
function listModelsResponseFromMldev(fromObject) {
|
|
11960
12137
|
const toObject = {};
|
|
12138
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12139
|
+
'sdkHttpResponse',
|
|
12140
|
+
]);
|
|
12141
|
+
if (fromSdkHttpResponse != null) {
|
|
12142
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12143
|
+
}
|
|
11961
12144
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
11962
12145
|
'nextPageToken',
|
|
11963
12146
|
]);
|
|
@@ -11994,7 +12177,7 @@ function countTokensResponseFromMldev(fromObject) {
|
|
|
11994
12177
|
}
|
|
11995
12178
|
return toObject;
|
|
11996
12179
|
}
|
|
11997
|
-
function videoFromMldev
|
|
12180
|
+
function videoFromMldev(fromObject) {
|
|
11998
12181
|
const toObject = {};
|
|
11999
12182
|
const fromUri = getValueByPath(fromObject, ['video', 'uri']);
|
|
12000
12183
|
if (fromUri != null) {
|
|
@@ -12013,15 +12196,15 @@ function videoFromMldev$1(fromObject) {
|
|
|
12013
12196
|
}
|
|
12014
12197
|
return toObject;
|
|
12015
12198
|
}
|
|
12016
|
-
function generatedVideoFromMldev
|
|
12199
|
+
function generatedVideoFromMldev(fromObject) {
|
|
12017
12200
|
const toObject = {};
|
|
12018
12201
|
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
12019
12202
|
if (fromVideo != null) {
|
|
12020
|
-
setValueByPath(toObject, ['video'], videoFromMldev
|
|
12203
|
+
setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
|
|
12021
12204
|
}
|
|
12022
12205
|
return toObject;
|
|
12023
12206
|
}
|
|
12024
|
-
function generateVideosResponseFromMldev
|
|
12207
|
+
function generateVideosResponseFromMldev(fromObject) {
|
|
12025
12208
|
const toObject = {};
|
|
12026
12209
|
const fromGeneratedVideos = getValueByPath(fromObject, [
|
|
12027
12210
|
'generatedSamples',
|
|
@@ -12030,7 +12213,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
|
|
|
12030
12213
|
let transformedList = fromGeneratedVideos;
|
|
12031
12214
|
if (Array.isArray(transformedList)) {
|
|
12032
12215
|
transformedList = transformedList.map((item) => {
|
|
12033
|
-
return generatedVideoFromMldev
|
|
12216
|
+
return generatedVideoFromMldev(item);
|
|
12034
12217
|
});
|
|
12035
12218
|
}
|
|
12036
12219
|
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
@@ -12049,7 +12232,7 @@ function generateVideosResponseFromMldev$1(fromObject) {
|
|
|
12049
12232
|
}
|
|
12050
12233
|
return toObject;
|
|
12051
12234
|
}
|
|
12052
|
-
function generateVideosOperationFromMldev
|
|
12235
|
+
function generateVideosOperationFromMldev(fromObject) {
|
|
12053
12236
|
const toObject = {};
|
|
12054
12237
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
12055
12238
|
if (fromName != null) {
|
|
@@ -12072,7 +12255,7 @@ function generateVideosOperationFromMldev$1(fromObject) {
|
|
|
12072
12255
|
'generateVideoResponse',
|
|
12073
12256
|
]);
|
|
12074
12257
|
if (fromResponse != null) {
|
|
12075
|
-
setValueByPath(toObject, ['response'], generateVideosResponseFromMldev
|
|
12258
|
+
setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
|
|
12076
12259
|
}
|
|
12077
12260
|
return toObject;
|
|
12078
12261
|
}
|
|
@@ -12290,6 +12473,12 @@ function candidateFromVertex(fromObject) {
|
|
|
12290
12473
|
}
|
|
12291
12474
|
function generateContentResponseFromVertex(fromObject) {
|
|
12292
12475
|
const toObject = {};
|
|
12476
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12477
|
+
'sdkHttpResponse',
|
|
12478
|
+
]);
|
|
12479
|
+
if (fromSdkHttpResponse != null) {
|
|
12480
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12481
|
+
}
|
|
12293
12482
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
12294
12483
|
if (fromCandidates != null) {
|
|
12295
12484
|
let transformedList = fromCandidates;
|
|
@@ -12602,6 +12791,12 @@ function modelFromVertex(fromObject) {
|
|
|
12602
12791
|
}
|
|
12603
12792
|
function listModelsResponseFromVertex(fromObject) {
|
|
12604
12793
|
const toObject = {};
|
|
12794
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12795
|
+
'sdkHttpResponse',
|
|
12796
|
+
]);
|
|
12797
|
+
if (fromSdkHttpResponse != null) {
|
|
12798
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12799
|
+
}
|
|
12605
12800
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
12606
12801
|
'nextPageToken',
|
|
12607
12802
|
]);
|
|
@@ -12640,7 +12835,7 @@ function computeTokensResponseFromVertex(fromObject) {
|
|
|
12640
12835
|
}
|
|
12641
12836
|
return toObject;
|
|
12642
12837
|
}
|
|
12643
|
-
function videoFromVertex
|
|
12838
|
+
function videoFromVertex(fromObject) {
|
|
12644
12839
|
const toObject = {};
|
|
12645
12840
|
const fromUri = getValueByPath(fromObject, ['gcsUri']);
|
|
12646
12841
|
if (fromUri != null) {
|
|
@@ -12658,22 +12853,22 @@ function videoFromVertex$1(fromObject) {
|
|
|
12658
12853
|
}
|
|
12659
12854
|
return toObject;
|
|
12660
12855
|
}
|
|
12661
|
-
function generatedVideoFromVertex
|
|
12856
|
+
function generatedVideoFromVertex(fromObject) {
|
|
12662
12857
|
const toObject = {};
|
|
12663
12858
|
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
12664
12859
|
if (fromVideo != null) {
|
|
12665
|
-
setValueByPath(toObject, ['video'], videoFromVertex
|
|
12860
|
+
setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
|
|
12666
12861
|
}
|
|
12667
12862
|
return toObject;
|
|
12668
12863
|
}
|
|
12669
|
-
function generateVideosResponseFromVertex
|
|
12864
|
+
function generateVideosResponseFromVertex(fromObject) {
|
|
12670
12865
|
const toObject = {};
|
|
12671
12866
|
const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
|
|
12672
12867
|
if (fromGeneratedVideos != null) {
|
|
12673
12868
|
let transformedList = fromGeneratedVideos;
|
|
12674
12869
|
if (Array.isArray(transformedList)) {
|
|
12675
12870
|
transformedList = transformedList.map((item) => {
|
|
12676
|
-
return generatedVideoFromVertex
|
|
12871
|
+
return generatedVideoFromVertex(item);
|
|
12677
12872
|
});
|
|
12678
12873
|
}
|
|
12679
12874
|
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
@@ -12692,7 +12887,7 @@ function generateVideosResponseFromVertex$1(fromObject) {
|
|
|
12692
12887
|
}
|
|
12693
12888
|
return toObject;
|
|
12694
12889
|
}
|
|
12695
|
-
function generateVideosOperationFromVertex
|
|
12890
|
+
function generateVideosOperationFromVertex(fromObject) {
|
|
12696
12891
|
const toObject = {};
|
|
12697
12892
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
12698
12893
|
if (fromName != null) {
|
|
@@ -12712,7 +12907,7 @@ function generateVideosOperationFromVertex$1(fromObject) {
|
|
|
12712
12907
|
}
|
|
12713
12908
|
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
12714
12909
|
if (fromResponse != null) {
|
|
12715
|
-
setValueByPath(toObject, ['response'], generateVideosResponseFromVertex
|
|
12910
|
+
setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
|
|
12716
12911
|
}
|
|
12717
12912
|
return toObject;
|
|
12718
12913
|
}
|
|
@@ -12726,7 +12921,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12726
12921
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12727
12922
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12728
12923
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12729
|
-
const SDK_VERSION = '1.
|
|
12924
|
+
const SDK_VERSION = '1.11.0'; // x-release-please-version
|
|
12730
12925
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12731
12926
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12732
12927
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13298,6 +13493,9 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
|
|
|
13298
13493
|
*/
|
|
13299
13494
|
// TODO: b/416041229 - Determine how to retrieve the MCP package version.
|
|
13300
13495
|
const MCP_LABEL = 'mcp_used/unknown';
|
|
13496
|
+
// Whether MCP tool usage is detected from mcpToTool. This is used for
|
|
13497
|
+
// telemetry.
|
|
13498
|
+
let hasMcpToolUsageFromMcpToTool = false;
|
|
13301
13499
|
// Checks whether the list of tools contains any MCP tools.
|
|
13302
13500
|
function hasMcpToolUsage(tools) {
|
|
13303
13501
|
for (const tool of tools) {
|
|
@@ -13308,25 +13506,13 @@ function hasMcpToolUsage(tools) {
|
|
|
13308
13506
|
return true;
|
|
13309
13507
|
}
|
|
13310
13508
|
}
|
|
13311
|
-
return
|
|
13509
|
+
return hasMcpToolUsageFromMcpToTool;
|
|
13312
13510
|
}
|
|
13313
13511
|
// Sets the MCP version label in the Google API client header.
|
|
13314
13512
|
function setMcpUsageHeader(headers) {
|
|
13315
|
-
var _a;
|
|
13316
|
-
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
13317
|
-
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
13318
|
-
}
|
|
13319
|
-
// Checks whether the list of tools contains any MCP clients. Will return true
|
|
13320
|
-
// if there is at least one MCP client.
|
|
13321
|
-
function hasMcpClientTools(params) {
|
|
13322
|
-
var _a, _b, _c;
|
|
13323
|
-
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;
|
|
13324
|
-
}
|
|
13325
|
-
// Checks whether the list of tools contains any non-MCP tools. Will return true
|
|
13326
|
-
// if there is at least one non-MCP tool.
|
|
13327
|
-
function hasNonMcpTools(params) {
|
|
13328
|
-
var _a, _b, _c;
|
|
13329
|
-
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);
|
|
13513
|
+
var _a;
|
|
13514
|
+
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
13515
|
+
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
13330
13516
|
}
|
|
13331
13517
|
// Returns true if the object is a MCP CallableTool, otherwise false.
|
|
13332
13518
|
function isMcpCallableTool(object) {
|
|
@@ -13465,6 +13651,8 @@ function isMcpClient(client) {
|
|
|
13465
13651
|
* versions.
|
|
13466
13652
|
*/
|
|
13467
13653
|
function mcpToTool(...args) {
|
|
13654
|
+
// Set MCP usage for telemetry.
|
|
13655
|
+
hasMcpToolUsageFromMcpToTool = true;
|
|
13468
13656
|
if (args.length === 0) {
|
|
13469
13657
|
throw new Error('No MCP clients provided');
|
|
13470
13658
|
}
|
|
@@ -13810,6 +13998,12 @@ class Live {
|
|
|
13810
13998
|
*/
|
|
13811
13999
|
async connect(params) {
|
|
13812
14000
|
var _a, _b, _c, _d, _e, _f;
|
|
14001
|
+
// TODO: b/404946746 - Support per request HTTP options.
|
|
14002
|
+
if (params.config && params.config.httpOptions) {
|
|
14003
|
+
throw new Error('The Live module does not support httpOptions at request-level in' +
|
|
14004
|
+
' LiveConnectConfig yet. Please use the client-level httpOptions' +
|
|
14005
|
+
' configuration instead.');
|
|
14006
|
+
}
|
|
13813
14007
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
13814
14008
|
const apiVersion = this.apiClient.getApiVersion();
|
|
13815
14009
|
let url;
|
|
@@ -14178,6 +14372,18 @@ function shouldDisableAfc(config) {
|
|
|
14178
14372
|
function isCallableTool(tool) {
|
|
14179
14373
|
return 'callTool' in tool && typeof tool.callTool === 'function';
|
|
14180
14374
|
}
|
|
14375
|
+
// Checks whether the list of tools contains any CallableTools. Will return true
|
|
14376
|
+
// if there is at least one CallableTool.
|
|
14377
|
+
function hasCallableTools(params) {
|
|
14378
|
+
var _a, _b, _c;
|
|
14379
|
+
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;
|
|
14380
|
+
}
|
|
14381
|
+
// Checks whether the list of tools contains any non-callable tools. Will return
|
|
14382
|
+
// true if there is at least one non-Callable tool.
|
|
14383
|
+
function hasNonCallableTools(params) {
|
|
14384
|
+
var _a, _b, _c;
|
|
14385
|
+
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;
|
|
14386
|
+
}
|
|
14181
14387
|
/**
|
|
14182
14388
|
* Returns whether to append automatic function calling history to the
|
|
14183
14389
|
* response.
|
|
@@ -14236,12 +14442,12 @@ class Models extends BaseModule {
|
|
|
14236
14442
|
*/
|
|
14237
14443
|
this.generateContent = async (params) => {
|
|
14238
14444
|
var _a, _b, _c, _d, _e;
|
|
14239
|
-
const transformedParams = await this.
|
|
14445
|
+
const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
|
|
14240
14446
|
this.maybeMoveToResponseJsonSchem(params);
|
|
14241
|
-
if (!
|
|
14447
|
+
if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
|
|
14242
14448
|
return await this.generateContentInternal(transformedParams);
|
|
14243
14449
|
}
|
|
14244
|
-
if (
|
|
14450
|
+
if (hasNonCallableTools(params)) {
|
|
14245
14451
|
throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
|
|
14246
14452
|
}
|
|
14247
14453
|
let response;
|
|
@@ -14326,7 +14532,7 @@ class Models extends BaseModule {
|
|
|
14326
14532
|
this.generateContentStream = async (params) => {
|
|
14327
14533
|
this.maybeMoveToResponseJsonSchem(params);
|
|
14328
14534
|
if (shouldDisableAfc(params.config)) {
|
|
14329
|
-
const transformedParams = await this.
|
|
14535
|
+
const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
|
|
14330
14536
|
return await this.generateContentStreamInternal(transformedParams);
|
|
14331
14537
|
}
|
|
14332
14538
|
else {
|
|
@@ -14475,6 +14681,32 @@ class Models extends BaseModule {
|
|
|
14475
14681
|
};
|
|
14476
14682
|
return await this.upscaleImageInternal(apiParams);
|
|
14477
14683
|
};
|
|
14684
|
+
/**
|
|
14685
|
+
* Generates videos based on a text description and configuration.
|
|
14686
|
+
*
|
|
14687
|
+
* @param params - The parameters for generating videos.
|
|
14688
|
+
* @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
|
|
14689
|
+
*
|
|
14690
|
+
* @example
|
|
14691
|
+
* ```ts
|
|
14692
|
+
* const operation = await ai.models.generateVideos({
|
|
14693
|
+
* model: 'veo-2.0-generate-001',
|
|
14694
|
+
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
14695
|
+
* config: {
|
|
14696
|
+
* numberOfVideos: 1
|
|
14697
|
+
* });
|
|
14698
|
+
*
|
|
14699
|
+
* while (!operation.done) {
|
|
14700
|
+
* await new Promise(resolve => setTimeout(resolve, 10000));
|
|
14701
|
+
* operation = await ai.operations.getVideosOperation({operation: operation});
|
|
14702
|
+
* }
|
|
14703
|
+
*
|
|
14704
|
+
* console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
|
|
14705
|
+
* ```
|
|
14706
|
+
*/
|
|
14707
|
+
this.generateVideos = async (params) => {
|
|
14708
|
+
return await this.generateVideosInternal(params);
|
|
14709
|
+
};
|
|
14478
14710
|
}
|
|
14479
14711
|
/**
|
|
14480
14712
|
* This logic is needed for GenerateContentConfig only.
|
|
@@ -14500,7 +14732,7 @@ class Models extends BaseModule {
|
|
|
14500
14732
|
* modify the original params. Also sets the MCP usage header if there are
|
|
14501
14733
|
* MCP tools in the parameters.
|
|
14502
14734
|
*/
|
|
14503
|
-
async
|
|
14735
|
+
async processParamsMaybeAddMcpUsage(params) {
|
|
14504
14736
|
var _a, _b, _c;
|
|
14505
14737
|
const tools = (_a = params.config) === null || _a === void 0 ? void 0 : _a.tools;
|
|
14506
14738
|
if (!tools) {
|
|
@@ -14567,7 +14799,7 @@ class Models extends BaseModule {
|
|
|
14567
14799
|
remoteCallCount++;
|
|
14568
14800
|
wereFunctionsCalled = false;
|
|
14569
14801
|
}
|
|
14570
|
-
const transformedParams = yield __await(models.
|
|
14802
|
+
const transformedParams = yield __await(models.processParamsMaybeAddMcpUsage(params));
|
|
14571
14803
|
const response = yield __await(models.generateContentStreamInternal(transformedParams));
|
|
14572
14804
|
const functionResponses = [];
|
|
14573
14805
|
const responseContents = [];
|
|
@@ -14655,7 +14887,13 @@ class Models extends BaseModule {
|
|
|
14655
14887
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
14656
14888
|
})
|
|
14657
14889
|
.then((httpResponse) => {
|
|
14658
|
-
return httpResponse.json()
|
|
14890
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
14891
|
+
const response = jsonResponse;
|
|
14892
|
+
response.sdkHttpResponse = {
|
|
14893
|
+
headers: httpResponse.headers,
|
|
14894
|
+
};
|
|
14895
|
+
return response;
|
|
14896
|
+
});
|
|
14659
14897
|
});
|
|
14660
14898
|
return response.then((apiResponse) => {
|
|
14661
14899
|
const resp = generateContentResponseFromVertex(apiResponse);
|
|
@@ -14681,7 +14919,13 @@ class Models extends BaseModule {
|
|
|
14681
14919
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
14682
14920
|
})
|
|
14683
14921
|
.then((httpResponse) => {
|
|
14684
|
-
return httpResponse.json()
|
|
14922
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
14923
|
+
const response = jsonResponse;
|
|
14924
|
+
response.sdkHttpResponse = {
|
|
14925
|
+
headers: httpResponse.headers,
|
|
14926
|
+
};
|
|
14927
|
+
return response;
|
|
14928
|
+
});
|
|
14685
14929
|
});
|
|
14686
14930
|
return response.then((apiResponse) => {
|
|
14687
14931
|
const resp = generateContentResponseFromMldev(apiResponse);
|
|
@@ -14721,6 +14965,9 @@ class Models extends BaseModule {
|
|
|
14721
14965
|
_d = false;
|
|
14722
14966
|
const chunk = _c;
|
|
14723
14967
|
const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
|
|
14968
|
+
resp['sdkHttpResponse'] = {
|
|
14969
|
+
headers: chunk.headers,
|
|
14970
|
+
};
|
|
14724
14971
|
const typedResp = new GenerateContentResponse();
|
|
14725
14972
|
Object.assign(typedResp, resp);
|
|
14726
14973
|
yield yield __await(typedResp);
|
|
@@ -14761,6 +15008,9 @@ class Models extends BaseModule {
|
|
|
14761
15008
|
_d = false;
|
|
14762
15009
|
const chunk = _c;
|
|
14763
15010
|
const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
|
|
15011
|
+
resp['sdkHttpResponse'] = {
|
|
15012
|
+
headers: chunk.headers,
|
|
15013
|
+
};
|
|
14764
15014
|
const typedResp = new GenerateContentResponse();
|
|
14765
15015
|
Object.assign(typedResp, resp);
|
|
14766
15016
|
yield yield __await(typedResp);
|
|
@@ -15087,7 +15337,13 @@ class Models extends BaseModule {
|
|
|
15087
15337
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15088
15338
|
})
|
|
15089
15339
|
.then((httpResponse) => {
|
|
15090
|
-
return httpResponse.json()
|
|
15340
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15341
|
+
const response = jsonResponse;
|
|
15342
|
+
response.sdkHttpResponse = {
|
|
15343
|
+
headers: httpResponse.headers,
|
|
15344
|
+
};
|
|
15345
|
+
return response;
|
|
15346
|
+
});
|
|
15091
15347
|
});
|
|
15092
15348
|
return response.then((apiResponse) => {
|
|
15093
15349
|
const resp = listModelsResponseFromVertex(apiResponse);
|
|
@@ -15113,7 +15369,13 @@ class Models extends BaseModule {
|
|
|
15113
15369
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15114
15370
|
})
|
|
15115
15371
|
.then((httpResponse) => {
|
|
15116
|
-
return httpResponse.json()
|
|
15372
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15373
|
+
const response = jsonResponse;
|
|
15374
|
+
response.sdkHttpResponse = {
|
|
15375
|
+
headers: httpResponse.headers,
|
|
15376
|
+
};
|
|
15377
|
+
return response;
|
|
15378
|
+
});
|
|
15117
15379
|
});
|
|
15118
15380
|
return response.then((apiResponse) => {
|
|
15119
15381
|
const resp = listModelsResponseFromMldev(apiResponse);
|
|
@@ -15413,7 +15675,7 @@ class Models extends BaseModule {
|
|
|
15413
15675
|
* console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
|
|
15414
15676
|
* ```
|
|
15415
15677
|
*/
|
|
15416
|
-
async
|
|
15678
|
+
async generateVideosInternal(params) {
|
|
15417
15679
|
var _a, _b, _c, _d;
|
|
15418
15680
|
let response;
|
|
15419
15681
|
let path = '';
|
|
@@ -15438,8 +15700,10 @@ class Models extends BaseModule {
|
|
|
15438
15700
|
return httpResponse.json();
|
|
15439
15701
|
});
|
|
15440
15702
|
return response.then((apiResponse) => {
|
|
15441
|
-
const resp = generateVideosOperationFromVertex
|
|
15442
|
-
|
|
15703
|
+
const resp = generateVideosOperationFromVertex(apiResponse);
|
|
15704
|
+
const typedResp = new GenerateVideosOperation();
|
|
15705
|
+
Object.assign(typedResp, resp);
|
|
15706
|
+
return typedResp;
|
|
15443
15707
|
});
|
|
15444
15708
|
}
|
|
15445
15709
|
else {
|
|
@@ -15462,8 +15726,10 @@ class Models extends BaseModule {
|
|
|
15462
15726
|
return httpResponse.json();
|
|
15463
15727
|
});
|
|
15464
15728
|
return response.then((apiResponse) => {
|
|
15465
|
-
const resp = generateVideosOperationFromMldev
|
|
15466
|
-
|
|
15729
|
+
const resp = generateVideosOperationFromMldev(apiResponse);
|
|
15730
|
+
const typedResp = new GenerateVideosOperation();
|
|
15731
|
+
Object.assign(typedResp, resp);
|
|
15732
|
+
return typedResp;
|
|
15467
15733
|
});
|
|
15468
15734
|
}
|
|
15469
15735
|
}
|
|
@@ -15521,164 +15787,6 @@ function fetchPredictOperationParametersToVertex(fromObject) {
|
|
|
15521
15787
|
}
|
|
15522
15788
|
return toObject;
|
|
15523
15789
|
}
|
|
15524
|
-
function videoFromMldev(fromObject) {
|
|
15525
|
-
const toObject = {};
|
|
15526
|
-
const fromUri = getValueByPath(fromObject, ['video', 'uri']);
|
|
15527
|
-
if (fromUri != null) {
|
|
15528
|
-
setValueByPath(toObject, ['uri'], fromUri);
|
|
15529
|
-
}
|
|
15530
|
-
const fromVideoBytes = getValueByPath(fromObject, [
|
|
15531
|
-
'video',
|
|
15532
|
-
'encodedVideo',
|
|
15533
|
-
]);
|
|
15534
|
-
if (fromVideoBytes != null) {
|
|
15535
|
-
setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
|
|
15536
|
-
}
|
|
15537
|
-
const fromMimeType = getValueByPath(fromObject, ['encoding']);
|
|
15538
|
-
if (fromMimeType != null) {
|
|
15539
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15540
|
-
}
|
|
15541
|
-
return toObject;
|
|
15542
|
-
}
|
|
15543
|
-
function generatedVideoFromMldev(fromObject) {
|
|
15544
|
-
const toObject = {};
|
|
15545
|
-
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
15546
|
-
if (fromVideo != null) {
|
|
15547
|
-
setValueByPath(toObject, ['video'], videoFromMldev(fromVideo));
|
|
15548
|
-
}
|
|
15549
|
-
return toObject;
|
|
15550
|
-
}
|
|
15551
|
-
function generateVideosResponseFromMldev(fromObject) {
|
|
15552
|
-
const toObject = {};
|
|
15553
|
-
const fromGeneratedVideos = getValueByPath(fromObject, [
|
|
15554
|
-
'generatedSamples',
|
|
15555
|
-
]);
|
|
15556
|
-
if (fromGeneratedVideos != null) {
|
|
15557
|
-
let transformedList = fromGeneratedVideos;
|
|
15558
|
-
if (Array.isArray(transformedList)) {
|
|
15559
|
-
transformedList = transformedList.map((item) => {
|
|
15560
|
-
return generatedVideoFromMldev(item);
|
|
15561
|
-
});
|
|
15562
|
-
}
|
|
15563
|
-
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
15564
|
-
}
|
|
15565
|
-
const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
|
|
15566
|
-
'raiMediaFilteredCount',
|
|
15567
|
-
]);
|
|
15568
|
-
if (fromRaiMediaFilteredCount != null) {
|
|
15569
|
-
setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
|
|
15570
|
-
}
|
|
15571
|
-
const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
|
|
15572
|
-
'raiMediaFilteredReasons',
|
|
15573
|
-
]);
|
|
15574
|
-
if (fromRaiMediaFilteredReasons != null) {
|
|
15575
|
-
setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
|
|
15576
|
-
}
|
|
15577
|
-
return toObject;
|
|
15578
|
-
}
|
|
15579
|
-
function generateVideosOperationFromMldev(fromObject) {
|
|
15580
|
-
const toObject = {};
|
|
15581
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
15582
|
-
if (fromName != null) {
|
|
15583
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
15584
|
-
}
|
|
15585
|
-
const fromMetadata = getValueByPath(fromObject, ['metadata']);
|
|
15586
|
-
if (fromMetadata != null) {
|
|
15587
|
-
setValueByPath(toObject, ['metadata'], fromMetadata);
|
|
15588
|
-
}
|
|
15589
|
-
const fromDone = getValueByPath(fromObject, ['done']);
|
|
15590
|
-
if (fromDone != null) {
|
|
15591
|
-
setValueByPath(toObject, ['done'], fromDone);
|
|
15592
|
-
}
|
|
15593
|
-
const fromError = getValueByPath(fromObject, ['error']);
|
|
15594
|
-
if (fromError != null) {
|
|
15595
|
-
setValueByPath(toObject, ['error'], fromError);
|
|
15596
|
-
}
|
|
15597
|
-
const fromResponse = getValueByPath(fromObject, [
|
|
15598
|
-
'response',
|
|
15599
|
-
'generateVideoResponse',
|
|
15600
|
-
]);
|
|
15601
|
-
if (fromResponse != null) {
|
|
15602
|
-
setValueByPath(toObject, ['response'], generateVideosResponseFromMldev(fromResponse));
|
|
15603
|
-
}
|
|
15604
|
-
return toObject;
|
|
15605
|
-
}
|
|
15606
|
-
function videoFromVertex(fromObject) {
|
|
15607
|
-
const toObject = {};
|
|
15608
|
-
const fromUri = getValueByPath(fromObject, ['gcsUri']);
|
|
15609
|
-
if (fromUri != null) {
|
|
15610
|
-
setValueByPath(toObject, ['uri'], fromUri);
|
|
15611
|
-
}
|
|
15612
|
-
const fromVideoBytes = getValueByPath(fromObject, [
|
|
15613
|
-
'bytesBase64Encoded',
|
|
15614
|
-
]);
|
|
15615
|
-
if (fromVideoBytes != null) {
|
|
15616
|
-
setValueByPath(toObject, ['videoBytes'], tBytes(fromVideoBytes));
|
|
15617
|
-
}
|
|
15618
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
15619
|
-
if (fromMimeType != null) {
|
|
15620
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15621
|
-
}
|
|
15622
|
-
return toObject;
|
|
15623
|
-
}
|
|
15624
|
-
function generatedVideoFromVertex(fromObject) {
|
|
15625
|
-
const toObject = {};
|
|
15626
|
-
const fromVideo = getValueByPath(fromObject, ['_self']);
|
|
15627
|
-
if (fromVideo != null) {
|
|
15628
|
-
setValueByPath(toObject, ['video'], videoFromVertex(fromVideo));
|
|
15629
|
-
}
|
|
15630
|
-
return toObject;
|
|
15631
|
-
}
|
|
15632
|
-
function generateVideosResponseFromVertex(fromObject) {
|
|
15633
|
-
const toObject = {};
|
|
15634
|
-
const fromGeneratedVideos = getValueByPath(fromObject, ['videos']);
|
|
15635
|
-
if (fromGeneratedVideos != null) {
|
|
15636
|
-
let transformedList = fromGeneratedVideos;
|
|
15637
|
-
if (Array.isArray(transformedList)) {
|
|
15638
|
-
transformedList = transformedList.map((item) => {
|
|
15639
|
-
return generatedVideoFromVertex(item);
|
|
15640
|
-
});
|
|
15641
|
-
}
|
|
15642
|
-
setValueByPath(toObject, ['generatedVideos'], transformedList);
|
|
15643
|
-
}
|
|
15644
|
-
const fromRaiMediaFilteredCount = getValueByPath(fromObject, [
|
|
15645
|
-
'raiMediaFilteredCount',
|
|
15646
|
-
]);
|
|
15647
|
-
if (fromRaiMediaFilteredCount != null) {
|
|
15648
|
-
setValueByPath(toObject, ['raiMediaFilteredCount'], fromRaiMediaFilteredCount);
|
|
15649
|
-
}
|
|
15650
|
-
const fromRaiMediaFilteredReasons = getValueByPath(fromObject, [
|
|
15651
|
-
'raiMediaFilteredReasons',
|
|
15652
|
-
]);
|
|
15653
|
-
if (fromRaiMediaFilteredReasons != null) {
|
|
15654
|
-
setValueByPath(toObject, ['raiMediaFilteredReasons'], fromRaiMediaFilteredReasons);
|
|
15655
|
-
}
|
|
15656
|
-
return toObject;
|
|
15657
|
-
}
|
|
15658
|
-
function generateVideosOperationFromVertex(fromObject) {
|
|
15659
|
-
const toObject = {};
|
|
15660
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
15661
|
-
if (fromName != null) {
|
|
15662
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
15663
|
-
}
|
|
15664
|
-
const fromMetadata = getValueByPath(fromObject, ['metadata']);
|
|
15665
|
-
if (fromMetadata != null) {
|
|
15666
|
-
setValueByPath(toObject, ['metadata'], fromMetadata);
|
|
15667
|
-
}
|
|
15668
|
-
const fromDone = getValueByPath(fromObject, ['done']);
|
|
15669
|
-
if (fromDone != null) {
|
|
15670
|
-
setValueByPath(toObject, ['done'], fromDone);
|
|
15671
|
-
}
|
|
15672
|
-
const fromError = getValueByPath(fromObject, ['error']);
|
|
15673
|
-
if (fromError != null) {
|
|
15674
|
-
setValueByPath(toObject, ['error'], fromError);
|
|
15675
|
-
}
|
|
15676
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
15677
|
-
if (fromResponse != null) {
|
|
15678
|
-
setValueByPath(toObject, ['response'], generateVideosResponseFromVertex(fromResponse));
|
|
15679
|
-
}
|
|
15680
|
-
return toObject;
|
|
15681
|
-
}
|
|
15682
15790
|
|
|
15683
15791
|
/**
|
|
15684
15792
|
* @license
|
|
@@ -15708,17 +15816,64 @@ class Operations extends BaseModule {
|
|
|
15708
15816
|
if (config && 'httpOptions' in config) {
|
|
15709
15817
|
httpOptions = config.httpOptions;
|
|
15710
15818
|
}
|
|
15711
|
-
|
|
15819
|
+
const rawOperation = await this.fetchPredictVideosOperationInternal({
|
|
15820
|
+
operationName: operation.name,
|
|
15821
|
+
resourceName: resourceName,
|
|
15822
|
+
config: { httpOptions: httpOptions },
|
|
15823
|
+
});
|
|
15824
|
+
return operation._fromAPIResponse({
|
|
15825
|
+
apiResponse: rawOperation,
|
|
15826
|
+
isVertexAI: true,
|
|
15827
|
+
});
|
|
15828
|
+
}
|
|
15829
|
+
else {
|
|
15830
|
+
const rawOperation = await this.getVideosOperationInternal({
|
|
15831
|
+
operationName: operation.name,
|
|
15832
|
+
config: config,
|
|
15833
|
+
});
|
|
15834
|
+
return operation._fromAPIResponse({
|
|
15835
|
+
apiResponse: rawOperation,
|
|
15836
|
+
isVertexAI: false,
|
|
15837
|
+
});
|
|
15838
|
+
}
|
|
15839
|
+
}
|
|
15840
|
+
/**
|
|
15841
|
+
* Gets the status of a long-running operation.
|
|
15842
|
+
*
|
|
15843
|
+
* @param parameters The parameters for the get operation request.
|
|
15844
|
+
* @return The updated Operation object, with the latest status or result.
|
|
15845
|
+
*/
|
|
15846
|
+
async get(parameters) {
|
|
15847
|
+
const operation = parameters.operation;
|
|
15848
|
+
const config = parameters.config;
|
|
15849
|
+
if (operation.name === undefined || operation.name === '') {
|
|
15850
|
+
throw new Error('Operation name is required.');
|
|
15851
|
+
}
|
|
15852
|
+
if (this.apiClient.isVertexAI()) {
|
|
15853
|
+
const resourceName = operation.name.split('/operations/')[0];
|
|
15854
|
+
let httpOptions = undefined;
|
|
15855
|
+
if (config && 'httpOptions' in config) {
|
|
15856
|
+
httpOptions = config.httpOptions;
|
|
15857
|
+
}
|
|
15858
|
+
const rawOperation = await this.fetchPredictVideosOperationInternal({
|
|
15712
15859
|
operationName: operation.name,
|
|
15713
15860
|
resourceName: resourceName,
|
|
15714
15861
|
config: { httpOptions: httpOptions },
|
|
15715
15862
|
});
|
|
15863
|
+
return operation._fromAPIResponse({
|
|
15864
|
+
apiResponse: rawOperation,
|
|
15865
|
+
isVertexAI: true,
|
|
15866
|
+
});
|
|
15716
15867
|
}
|
|
15717
15868
|
else {
|
|
15718
|
-
|
|
15869
|
+
const rawOperation = await this.getVideosOperationInternal({
|
|
15719
15870
|
operationName: operation.name,
|
|
15720
15871
|
config: config,
|
|
15721
15872
|
});
|
|
15873
|
+
return operation._fromAPIResponse({
|
|
15874
|
+
apiResponse: rawOperation,
|
|
15875
|
+
isVertexAI: false,
|
|
15876
|
+
});
|
|
15722
15877
|
}
|
|
15723
15878
|
}
|
|
15724
15879
|
async getVideosOperationInternal(params) {
|
|
@@ -15745,10 +15900,7 @@ class Operations extends BaseModule {
|
|
|
15745
15900
|
.then((httpResponse) => {
|
|
15746
15901
|
return httpResponse.json();
|
|
15747
15902
|
});
|
|
15748
|
-
return response
|
|
15749
|
-
const resp = generateVideosOperationFromVertex(apiResponse);
|
|
15750
|
-
return resp;
|
|
15751
|
-
});
|
|
15903
|
+
return response;
|
|
15752
15904
|
}
|
|
15753
15905
|
else {
|
|
15754
15906
|
const body = getOperationParametersToMldev(params);
|
|
@@ -15769,10 +15921,7 @@ class Operations extends BaseModule {
|
|
|
15769
15921
|
.then((httpResponse) => {
|
|
15770
15922
|
return httpResponse.json();
|
|
15771
15923
|
});
|
|
15772
|
-
return response
|
|
15773
|
-
const resp = generateVideosOperationFromMldev(apiResponse);
|
|
15774
|
-
return resp;
|
|
15775
|
-
});
|
|
15924
|
+
return response;
|
|
15776
15925
|
}
|
|
15777
15926
|
}
|
|
15778
15927
|
async fetchPredictVideosOperationInternal(params) {
|
|
@@ -15799,10 +15948,7 @@ class Operations extends BaseModule {
|
|
|
15799
15948
|
.then((httpResponse) => {
|
|
15800
15949
|
return httpResponse.json();
|
|
15801
15950
|
});
|
|
15802
|
-
return response
|
|
15803
|
-
const resp = generateVideosOperationFromVertex(apiResponse);
|
|
15804
|
-
return resp;
|
|
15805
|
-
});
|
|
15951
|
+
return response;
|
|
15806
15952
|
}
|
|
15807
15953
|
else {
|
|
15808
15954
|
throw new Error('This method is only supported by the Vertex AI.');
|
|
@@ -17203,6 +17349,12 @@ function tuningJobFromMldev(fromObject) {
|
|
|
17203
17349
|
}
|
|
17204
17350
|
function listTuningJobsResponseFromMldev(fromObject) {
|
|
17205
17351
|
const toObject = {};
|
|
17352
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17353
|
+
'sdkHttpResponse',
|
|
17354
|
+
]);
|
|
17355
|
+
if (fromSdkHttpResponse != null) {
|
|
17356
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17357
|
+
}
|
|
17206
17358
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
17207
17359
|
'nextPageToken',
|
|
17208
17360
|
]);
|
|
@@ -17221,7 +17373,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17221
17373
|
}
|
|
17222
17374
|
return toObject;
|
|
17223
17375
|
}
|
|
17224
|
-
function
|
|
17376
|
+
function tuningOperationFromMldev(fromObject) {
|
|
17225
17377
|
const toObject = {};
|
|
17226
17378
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17227
17379
|
if (fromName != null) {
|
|
@@ -17391,6 +17543,12 @@ function tuningJobFromVertex(fromObject) {
|
|
|
17391
17543
|
}
|
|
17392
17544
|
function listTuningJobsResponseFromVertex(fromObject) {
|
|
17393
17545
|
const toObject = {};
|
|
17546
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17547
|
+
'sdkHttpResponse',
|
|
17548
|
+
]);
|
|
17549
|
+
if (fromSdkHttpResponse != null) {
|
|
17550
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17551
|
+
}
|
|
17394
17552
|
const fromNextPageToken = getValueByPath(fromObject, [
|
|
17395
17553
|
'nextPageToken',
|
|
17396
17554
|
]);
|
|
@@ -17551,7 +17709,13 @@ class Tunings extends BaseModule {
|
|
|
17551
17709
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17552
17710
|
})
|
|
17553
17711
|
.then((httpResponse) => {
|
|
17554
|
-
return httpResponse.json()
|
|
17712
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17713
|
+
const response = jsonResponse;
|
|
17714
|
+
response.sdkHttpResponse = {
|
|
17715
|
+
headers: httpResponse.headers,
|
|
17716
|
+
};
|
|
17717
|
+
return response;
|
|
17718
|
+
});
|
|
17555
17719
|
});
|
|
17556
17720
|
return response.then((apiResponse) => {
|
|
17557
17721
|
const resp = listTuningJobsResponseFromVertex(apiResponse);
|
|
@@ -17577,7 +17741,13 @@ class Tunings extends BaseModule {
|
|
|
17577
17741
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17578
17742
|
})
|
|
17579
17743
|
.then((httpResponse) => {
|
|
17580
|
-
return httpResponse.json()
|
|
17744
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17745
|
+
const response = jsonResponse;
|
|
17746
|
+
response.sdkHttpResponse = {
|
|
17747
|
+
headers: httpResponse.headers,
|
|
17748
|
+
};
|
|
17749
|
+
return response;
|
|
17750
|
+
});
|
|
17581
17751
|
});
|
|
17582
17752
|
return response.then((apiResponse) => {
|
|
17583
17753
|
const resp = listTuningJobsResponseFromMldev(apiResponse);
|
|
@@ -17648,7 +17818,7 @@ class Tunings extends BaseModule {
|
|
|
17648
17818
|
return httpResponse.json();
|
|
17649
17819
|
});
|
|
17650
17820
|
return response.then((apiResponse) => {
|
|
17651
|
-
const resp =
|
|
17821
|
+
const resp = tuningOperationFromMldev(apiResponse);
|
|
17652
17822
|
return resp;
|
|
17653
17823
|
});
|
|
17654
17824
|
}
|
|
@@ -18002,7 +18172,7 @@ class GoogleGenAI {
|
|
|
18002
18172
|
this.apiKey = undefined;
|
|
18003
18173
|
}
|
|
18004
18174
|
}
|
|
18005
|
-
const baseUrl = getBaseUrl(options, getEnv('GOOGLE_VERTEX_BASE_URL'), getEnv('GOOGLE_GEMINI_BASE_URL'));
|
|
18175
|
+
const baseUrl = getBaseUrl(options.httpOptions, options.vertexai, getEnv('GOOGLE_VERTEX_BASE_URL'), getEnv('GOOGLE_GEMINI_BASE_URL'));
|
|
18006
18176
|
if (baseUrl) {
|
|
18007
18177
|
if (options.httpOptions) {
|
|
18008
18178
|
options.httpOptions.baseUrl = baseUrl;
|
|
@@ -18081,6 +18251,7 @@ exports.GenerateContentResponse = GenerateContentResponse;
|
|
|
18081
18251
|
exports.GenerateContentResponsePromptFeedback = GenerateContentResponsePromptFeedback;
|
|
18082
18252
|
exports.GenerateContentResponseUsageMetadata = GenerateContentResponseUsageMetadata;
|
|
18083
18253
|
exports.GenerateImagesResponse = GenerateImagesResponse;
|
|
18254
|
+
exports.GenerateVideosOperation = GenerateVideosOperation;
|
|
18084
18255
|
exports.GenerateVideosResponse = GenerateVideosResponse;
|
|
18085
18256
|
exports.GoogleGenAI = GoogleGenAI;
|
|
18086
18257
|
exports.HttpResponse = HttpResponse;
|