@google/genai 1.0.0 → 1.1.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 +5 -5
- package/dist/genai.d.ts +79 -21
- package/dist/{index.js → index.cjs} +458 -78
- package/dist/index.mjs +457 -77
- package/dist/index.mjs.map +1 -1
- package/dist/node/{index.js → index.cjs} +458 -78
- package/dist/node/index.mjs +457 -77
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +79 -21
- package/dist/web/index.mjs +457 -77
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +79 -21
- package/package.json +10 -15
- package/dist/index.js.map +0 -1
- package/dist/node/index.js.map +0 -1
|
@@ -197,6 +197,42 @@ exports.Language = void 0;
|
|
|
197
197
|
*/
|
|
198
198
|
Language["PYTHON"] = "PYTHON";
|
|
199
199
|
})(exports.Language || (exports.Language = {}));
|
|
200
|
+
/** Optional. The type of the data. */
|
|
201
|
+
exports.Type = void 0;
|
|
202
|
+
(function (Type) {
|
|
203
|
+
/**
|
|
204
|
+
* Not specified, should not be used.
|
|
205
|
+
*/
|
|
206
|
+
Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
207
|
+
/**
|
|
208
|
+
* OpenAPI string type
|
|
209
|
+
*/
|
|
210
|
+
Type["STRING"] = "STRING";
|
|
211
|
+
/**
|
|
212
|
+
* OpenAPI number type
|
|
213
|
+
*/
|
|
214
|
+
Type["NUMBER"] = "NUMBER";
|
|
215
|
+
/**
|
|
216
|
+
* OpenAPI integer type
|
|
217
|
+
*/
|
|
218
|
+
Type["INTEGER"] = "INTEGER";
|
|
219
|
+
/**
|
|
220
|
+
* OpenAPI boolean type
|
|
221
|
+
*/
|
|
222
|
+
Type["BOOLEAN"] = "BOOLEAN";
|
|
223
|
+
/**
|
|
224
|
+
* OpenAPI array type
|
|
225
|
+
*/
|
|
226
|
+
Type["ARRAY"] = "ARRAY";
|
|
227
|
+
/**
|
|
228
|
+
* OpenAPI object type
|
|
229
|
+
*/
|
|
230
|
+
Type["OBJECT"] = "OBJECT";
|
|
231
|
+
/**
|
|
232
|
+
* Null type
|
|
233
|
+
*/
|
|
234
|
+
Type["NULL"] = "NULL";
|
|
235
|
+
})(exports.Type || (exports.Type = {}));
|
|
200
236
|
/** Required. Harm category. */
|
|
201
237
|
exports.HarmCategory = void 0;
|
|
202
238
|
(function (HarmCategory) {
|
|
@@ -221,7 +257,7 @@ exports.HarmCategory = void 0;
|
|
|
221
257
|
*/
|
|
222
258
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
223
259
|
/**
|
|
224
|
-
* The harm category is civic integrity.
|
|
260
|
+
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
225
261
|
*/
|
|
226
262
|
HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
227
263
|
})(exports.HarmCategory || (exports.HarmCategory = {}));
|
|
@@ -269,38 +305,6 @@ exports.HarmBlockThreshold = void 0;
|
|
|
269
305
|
*/
|
|
270
306
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
271
307
|
})(exports.HarmBlockThreshold || (exports.HarmBlockThreshold = {}));
|
|
272
|
-
/** Optional. The type of the data. */
|
|
273
|
-
exports.Type = void 0;
|
|
274
|
-
(function (Type) {
|
|
275
|
-
/**
|
|
276
|
-
* Not specified, should not be used.
|
|
277
|
-
*/
|
|
278
|
-
Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
279
|
-
/**
|
|
280
|
-
* OpenAPI string type
|
|
281
|
-
*/
|
|
282
|
-
Type["STRING"] = "STRING";
|
|
283
|
-
/**
|
|
284
|
-
* OpenAPI number type
|
|
285
|
-
*/
|
|
286
|
-
Type["NUMBER"] = "NUMBER";
|
|
287
|
-
/**
|
|
288
|
-
* OpenAPI integer type
|
|
289
|
-
*/
|
|
290
|
-
Type["INTEGER"] = "INTEGER";
|
|
291
|
-
/**
|
|
292
|
-
* OpenAPI boolean type
|
|
293
|
-
*/
|
|
294
|
-
Type["BOOLEAN"] = "BOOLEAN";
|
|
295
|
-
/**
|
|
296
|
-
* OpenAPI array type
|
|
297
|
-
*/
|
|
298
|
-
Type["ARRAY"] = "ARRAY";
|
|
299
|
-
/**
|
|
300
|
-
* OpenAPI object type
|
|
301
|
-
*/
|
|
302
|
-
Type["OBJECT"] = "OBJECT";
|
|
303
|
-
})(exports.Type || (exports.Type = {}));
|
|
304
308
|
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
305
309
|
exports.Mode = void 0;
|
|
306
310
|
(function (Mode) {
|
|
@@ -2440,6 +2444,21 @@ function blobToMldev$2(apiClient, fromObject) {
|
|
|
2440
2444
|
}
|
|
2441
2445
|
return toObject;
|
|
2442
2446
|
}
|
|
2447
|
+
function fileDataToMldev$2(apiClient, fromObject) {
|
|
2448
|
+
const toObject = {};
|
|
2449
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2450
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
2451
|
+
}
|
|
2452
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
2453
|
+
if (fromFileUri != null) {
|
|
2454
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
2455
|
+
}
|
|
2456
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
2457
|
+
if (fromMimeType != null) {
|
|
2458
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
2459
|
+
}
|
|
2460
|
+
return toObject;
|
|
2461
|
+
}
|
|
2443
2462
|
function partToMldev$2(apiClient, fromObject) {
|
|
2444
2463
|
const toObject = {};
|
|
2445
2464
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -2456,6 +2475,10 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2456
2475
|
if (fromInlineData != null) {
|
|
2457
2476
|
setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
|
|
2458
2477
|
}
|
|
2478
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2479
|
+
if (fromFileData != null) {
|
|
2480
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
|
|
2481
|
+
}
|
|
2459
2482
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2460
2483
|
'codeExecutionResult',
|
|
2461
2484
|
]);
|
|
@@ -2468,10 +2491,6 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2468
2491
|
if (fromExecutableCode != null) {
|
|
2469
2492
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
2470
2493
|
}
|
|
2471
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2472
|
-
if (fromFileData != null) {
|
|
2473
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
2474
|
-
}
|
|
2475
2494
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
2476
2495
|
if (fromFunctionCall != null) {
|
|
2477
2496
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -2657,6 +2676,10 @@ function retrievalConfigToMldev$1(apiClient, fromObject) {
|
|
|
2657
2676
|
if (fromLatLng != null) {
|
|
2658
2677
|
setValueByPath(toObject, ['latLng'], latLngToMldev$1(apiClient, fromLatLng));
|
|
2659
2678
|
}
|
|
2679
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
2680
|
+
if (fromLanguageCode != null) {
|
|
2681
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
2682
|
+
}
|
|
2660
2683
|
return toObject;
|
|
2661
2684
|
}
|
|
2662
2685
|
function toolConfigToMldev$1(apiClient, fromObject) {
|
|
@@ -2836,6 +2859,22 @@ function blobToVertex$2(apiClient, fromObject) {
|
|
|
2836
2859
|
}
|
|
2837
2860
|
return toObject;
|
|
2838
2861
|
}
|
|
2862
|
+
function fileDataToVertex$2(apiClient, fromObject) {
|
|
2863
|
+
const toObject = {};
|
|
2864
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
2865
|
+
if (fromDisplayName != null) {
|
|
2866
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
2867
|
+
}
|
|
2868
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
2869
|
+
if (fromFileUri != null) {
|
|
2870
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
2871
|
+
}
|
|
2872
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
2873
|
+
if (fromMimeType != null) {
|
|
2874
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
2875
|
+
}
|
|
2876
|
+
return toObject;
|
|
2877
|
+
}
|
|
2839
2878
|
function partToVertex$2(apiClient, fromObject) {
|
|
2840
2879
|
const toObject = {};
|
|
2841
2880
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -2852,6 +2891,10 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2852
2891
|
if (fromInlineData != null) {
|
|
2853
2892
|
setValueByPath(toObject, ['inlineData'], blobToVertex$2(apiClient, fromInlineData));
|
|
2854
2893
|
}
|
|
2894
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2895
|
+
if (fromFileData != null) {
|
|
2896
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
|
|
2897
|
+
}
|
|
2855
2898
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2856
2899
|
'codeExecutionResult',
|
|
2857
2900
|
]);
|
|
@@ -2864,10 +2907,6 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2864
2907
|
if (fromExecutableCode != null) {
|
|
2865
2908
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
2866
2909
|
}
|
|
2867
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2868
|
-
if (fromFileData != null) {
|
|
2869
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
2870
|
-
}
|
|
2871
2910
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
2872
2911
|
if (fromFunctionCall != null) {
|
|
2873
2912
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -3104,6 +3143,10 @@ function retrievalConfigToVertex$1(apiClient, fromObject) {
|
|
|
3104
3143
|
if (fromLatLng != null) {
|
|
3105
3144
|
setValueByPath(toObject, ['latLng'], latLngToVertex$1(apiClient, fromLatLng));
|
|
3106
3145
|
}
|
|
3146
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
3147
|
+
if (fromLanguageCode != null) {
|
|
3148
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
3149
|
+
}
|
|
3107
3150
|
return toObject;
|
|
3108
3151
|
}
|
|
3109
3152
|
function toolConfigToVertex$1(apiClient, fromObject) {
|
|
@@ -4172,7 +4215,10 @@ class Chat {
|
|
|
4172
4215
|
this.recordHistory(inputContent, modelOutput, automaticFunctionCallingHistory);
|
|
4173
4216
|
return;
|
|
4174
4217
|
})();
|
|
4175
|
-
await this.sendPromise
|
|
4218
|
+
await this.sendPromise.catch(() => {
|
|
4219
|
+
// Resets sendPromise to avoid subsequent calls failing
|
|
4220
|
+
this.sendPromise = Promise.resolve();
|
|
4221
|
+
});
|
|
4176
4222
|
return responsePromise;
|
|
4177
4223
|
}
|
|
4178
4224
|
/**
|
|
@@ -4310,7 +4356,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
4310
4356
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
4311
4357
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
4312
4358
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
4313
|
-
const SDK_VERSION = '1.
|
|
4359
|
+
const SDK_VERSION = '1.1.0'; // x-release-please-version
|
|
4314
4360
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
4315
4361
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
4316
4362
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -5634,6 +5680,37 @@ function blobToVertex$1(apiClient, fromObject) {
|
|
|
5634
5680
|
}
|
|
5635
5681
|
return toObject;
|
|
5636
5682
|
}
|
|
5683
|
+
function fileDataToMldev$1(apiClient, fromObject) {
|
|
5684
|
+
const toObject = {};
|
|
5685
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5686
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
5687
|
+
}
|
|
5688
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
5689
|
+
if (fromFileUri != null) {
|
|
5690
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
5691
|
+
}
|
|
5692
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
5693
|
+
if (fromMimeType != null) {
|
|
5694
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
5695
|
+
}
|
|
5696
|
+
return toObject;
|
|
5697
|
+
}
|
|
5698
|
+
function fileDataToVertex$1(apiClient, fromObject) {
|
|
5699
|
+
const toObject = {};
|
|
5700
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
5701
|
+
if (fromDisplayName != null) {
|
|
5702
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
5703
|
+
}
|
|
5704
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
5705
|
+
if (fromFileUri != null) {
|
|
5706
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
5707
|
+
}
|
|
5708
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
5709
|
+
if (fromMimeType != null) {
|
|
5710
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
5711
|
+
}
|
|
5712
|
+
return toObject;
|
|
5713
|
+
}
|
|
5637
5714
|
function partToMldev$1(apiClient, fromObject) {
|
|
5638
5715
|
const toObject = {};
|
|
5639
5716
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -5650,6 +5727,10 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5650
5727
|
if (fromInlineData != null) {
|
|
5651
5728
|
setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
|
|
5652
5729
|
}
|
|
5730
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5731
|
+
if (fromFileData != null) {
|
|
5732
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
|
|
5733
|
+
}
|
|
5653
5734
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5654
5735
|
'codeExecutionResult',
|
|
5655
5736
|
]);
|
|
@@ -5662,10 +5743,6 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5662
5743
|
if (fromExecutableCode != null) {
|
|
5663
5744
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
5664
5745
|
}
|
|
5665
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5666
|
-
if (fromFileData != null) {
|
|
5667
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
5668
|
-
}
|
|
5669
5746
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
5670
5747
|
if (fromFunctionCall != null) {
|
|
5671
5748
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -5698,6 +5775,10 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5698
5775
|
if (fromInlineData != null) {
|
|
5699
5776
|
setValueByPath(toObject, ['inlineData'], blobToVertex$1(apiClient, fromInlineData));
|
|
5700
5777
|
}
|
|
5778
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5779
|
+
if (fromFileData != null) {
|
|
5780
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
|
|
5781
|
+
}
|
|
5701
5782
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5702
5783
|
'codeExecutionResult',
|
|
5703
5784
|
]);
|
|
@@ -5710,10 +5791,6 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5710
5791
|
if (fromExecutableCode != null) {
|
|
5711
5792
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
5712
5793
|
}
|
|
5713
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5714
|
-
if (fromFileData != null) {
|
|
5715
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
5716
|
-
}
|
|
5717
5794
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
5718
5795
|
if (fromFunctionCall != null) {
|
|
5719
5796
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -6787,6 +6864,34 @@ function blobFromVertex$1(apiClient, fromObject) {
|
|
|
6787
6864
|
}
|
|
6788
6865
|
return toObject;
|
|
6789
6866
|
}
|
|
6867
|
+
function fileDataFromMldev$1(apiClient, fromObject) {
|
|
6868
|
+
const toObject = {};
|
|
6869
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
6870
|
+
if (fromFileUri != null) {
|
|
6871
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
6872
|
+
}
|
|
6873
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
6874
|
+
if (fromMimeType != null) {
|
|
6875
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
6876
|
+
}
|
|
6877
|
+
return toObject;
|
|
6878
|
+
}
|
|
6879
|
+
function fileDataFromVertex$1(apiClient, fromObject) {
|
|
6880
|
+
const toObject = {};
|
|
6881
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
6882
|
+
if (fromDisplayName != null) {
|
|
6883
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
6884
|
+
}
|
|
6885
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
6886
|
+
if (fromFileUri != null) {
|
|
6887
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
6888
|
+
}
|
|
6889
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
6890
|
+
if (fromMimeType != null) {
|
|
6891
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
6892
|
+
}
|
|
6893
|
+
return toObject;
|
|
6894
|
+
}
|
|
6790
6895
|
function partFromMldev$1(apiClient, fromObject) {
|
|
6791
6896
|
const toObject = {};
|
|
6792
6897
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -6803,6 +6908,10 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6803
6908
|
if (fromInlineData != null) {
|
|
6804
6909
|
setValueByPath(toObject, ['inlineData'], blobFromMldev$1(apiClient, fromInlineData));
|
|
6805
6910
|
}
|
|
6911
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6912
|
+
if (fromFileData != null) {
|
|
6913
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
|
|
6914
|
+
}
|
|
6806
6915
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6807
6916
|
'codeExecutionResult',
|
|
6808
6917
|
]);
|
|
@@ -6815,10 +6924,6 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6815
6924
|
if (fromExecutableCode != null) {
|
|
6816
6925
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6817
6926
|
}
|
|
6818
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6819
|
-
if (fromFileData != null) {
|
|
6820
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6821
|
-
}
|
|
6822
6927
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6823
6928
|
if (fromFunctionCall != null) {
|
|
6824
6929
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -6851,6 +6956,10 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6851
6956
|
if (fromInlineData != null) {
|
|
6852
6957
|
setValueByPath(toObject, ['inlineData'], blobFromVertex$1(apiClient, fromInlineData));
|
|
6853
6958
|
}
|
|
6959
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6960
|
+
if (fromFileData != null) {
|
|
6961
|
+
setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
|
|
6962
|
+
}
|
|
6854
6963
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6855
6964
|
'codeExecutionResult',
|
|
6856
6965
|
]);
|
|
@@ -6863,10 +6972,6 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6863
6972
|
if (fromExecutableCode != null) {
|
|
6864
6973
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6865
6974
|
}
|
|
6866
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6867
|
-
if (fromFileData != null) {
|
|
6868
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6869
|
-
}
|
|
6870
6975
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6871
6976
|
if (fromFunctionCall != null) {
|
|
6872
6977
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -7682,6 +7787,21 @@ function blobToMldev(apiClient, fromObject) {
|
|
|
7682
7787
|
}
|
|
7683
7788
|
return toObject;
|
|
7684
7789
|
}
|
|
7790
|
+
function fileDataToMldev(apiClient, fromObject) {
|
|
7791
|
+
const toObject = {};
|
|
7792
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7793
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
7794
|
+
}
|
|
7795
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
7796
|
+
if (fromFileUri != null) {
|
|
7797
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
7798
|
+
}
|
|
7799
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7800
|
+
if (fromMimeType != null) {
|
|
7801
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7802
|
+
}
|
|
7803
|
+
return toObject;
|
|
7804
|
+
}
|
|
7685
7805
|
function partToMldev(apiClient, fromObject) {
|
|
7686
7806
|
const toObject = {};
|
|
7687
7807
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -7698,6 +7818,10 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7698
7818
|
if (fromInlineData != null) {
|
|
7699
7819
|
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
7700
7820
|
}
|
|
7821
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7822
|
+
if (fromFileData != null) {
|
|
7823
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
7824
|
+
}
|
|
7701
7825
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7702
7826
|
'codeExecutionResult',
|
|
7703
7827
|
]);
|
|
@@ -7710,10 +7834,6 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7710
7834
|
if (fromExecutableCode != null) {
|
|
7711
7835
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
7712
7836
|
}
|
|
7713
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7714
|
-
if (fromFileData != null) {
|
|
7715
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
7716
|
-
}
|
|
7717
7837
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
7718
7838
|
if (fromFunctionCall != null) {
|
|
7719
7839
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -7748,6 +7868,104 @@ function contentToMldev(apiClient, fromObject) {
|
|
|
7748
7868
|
}
|
|
7749
7869
|
return toObject;
|
|
7750
7870
|
}
|
|
7871
|
+
function schemaToMldev(apiClient, fromObject) {
|
|
7872
|
+
const toObject = {};
|
|
7873
|
+
const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
|
|
7874
|
+
if (fromAnyOf != null) {
|
|
7875
|
+
setValueByPath(toObject, ['anyOf'], fromAnyOf);
|
|
7876
|
+
}
|
|
7877
|
+
const fromDefault = getValueByPath(fromObject, ['default']);
|
|
7878
|
+
if (fromDefault != null) {
|
|
7879
|
+
setValueByPath(toObject, ['default'], fromDefault);
|
|
7880
|
+
}
|
|
7881
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7882
|
+
if (fromDescription != null) {
|
|
7883
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
7884
|
+
}
|
|
7885
|
+
const fromEnum = getValueByPath(fromObject, ['enum']);
|
|
7886
|
+
if (fromEnum != null) {
|
|
7887
|
+
setValueByPath(toObject, ['enum'], fromEnum);
|
|
7888
|
+
}
|
|
7889
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
7890
|
+
if (fromExample != null) {
|
|
7891
|
+
setValueByPath(toObject, ['example'], fromExample);
|
|
7892
|
+
}
|
|
7893
|
+
const fromFormat = getValueByPath(fromObject, ['format']);
|
|
7894
|
+
if (fromFormat != null) {
|
|
7895
|
+
setValueByPath(toObject, ['format'], fromFormat);
|
|
7896
|
+
}
|
|
7897
|
+
const fromItems = getValueByPath(fromObject, ['items']);
|
|
7898
|
+
if (fromItems != null) {
|
|
7899
|
+
setValueByPath(toObject, ['items'], fromItems);
|
|
7900
|
+
}
|
|
7901
|
+
const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
|
|
7902
|
+
if (fromMaxItems != null) {
|
|
7903
|
+
setValueByPath(toObject, ['maxItems'], fromMaxItems);
|
|
7904
|
+
}
|
|
7905
|
+
const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
|
|
7906
|
+
if (fromMaxLength != null) {
|
|
7907
|
+
setValueByPath(toObject, ['maxLength'], fromMaxLength);
|
|
7908
|
+
}
|
|
7909
|
+
const fromMaxProperties = getValueByPath(fromObject, [
|
|
7910
|
+
'maxProperties',
|
|
7911
|
+
]);
|
|
7912
|
+
if (fromMaxProperties != null) {
|
|
7913
|
+
setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
|
|
7914
|
+
}
|
|
7915
|
+
const fromMaximum = getValueByPath(fromObject, ['maximum']);
|
|
7916
|
+
if (fromMaximum != null) {
|
|
7917
|
+
setValueByPath(toObject, ['maximum'], fromMaximum);
|
|
7918
|
+
}
|
|
7919
|
+
const fromMinItems = getValueByPath(fromObject, ['minItems']);
|
|
7920
|
+
if (fromMinItems != null) {
|
|
7921
|
+
setValueByPath(toObject, ['minItems'], fromMinItems);
|
|
7922
|
+
}
|
|
7923
|
+
const fromMinLength = getValueByPath(fromObject, ['minLength']);
|
|
7924
|
+
if (fromMinLength != null) {
|
|
7925
|
+
setValueByPath(toObject, ['minLength'], fromMinLength);
|
|
7926
|
+
}
|
|
7927
|
+
const fromMinProperties = getValueByPath(fromObject, [
|
|
7928
|
+
'minProperties',
|
|
7929
|
+
]);
|
|
7930
|
+
if (fromMinProperties != null) {
|
|
7931
|
+
setValueByPath(toObject, ['minProperties'], fromMinProperties);
|
|
7932
|
+
}
|
|
7933
|
+
const fromMinimum = getValueByPath(fromObject, ['minimum']);
|
|
7934
|
+
if (fromMinimum != null) {
|
|
7935
|
+
setValueByPath(toObject, ['minimum'], fromMinimum);
|
|
7936
|
+
}
|
|
7937
|
+
const fromNullable = getValueByPath(fromObject, ['nullable']);
|
|
7938
|
+
if (fromNullable != null) {
|
|
7939
|
+
setValueByPath(toObject, ['nullable'], fromNullable);
|
|
7940
|
+
}
|
|
7941
|
+
const fromPattern = getValueByPath(fromObject, ['pattern']);
|
|
7942
|
+
if (fromPattern != null) {
|
|
7943
|
+
setValueByPath(toObject, ['pattern'], fromPattern);
|
|
7944
|
+
}
|
|
7945
|
+
const fromProperties = getValueByPath(fromObject, ['properties']);
|
|
7946
|
+
if (fromProperties != null) {
|
|
7947
|
+
setValueByPath(toObject, ['properties'], fromProperties);
|
|
7948
|
+
}
|
|
7949
|
+
const fromPropertyOrdering = getValueByPath(fromObject, [
|
|
7950
|
+
'propertyOrdering',
|
|
7951
|
+
]);
|
|
7952
|
+
if (fromPropertyOrdering != null) {
|
|
7953
|
+
setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
|
|
7954
|
+
}
|
|
7955
|
+
const fromRequired = getValueByPath(fromObject, ['required']);
|
|
7956
|
+
if (fromRequired != null) {
|
|
7957
|
+
setValueByPath(toObject, ['required'], fromRequired);
|
|
7958
|
+
}
|
|
7959
|
+
const fromTitle = getValueByPath(fromObject, ['title']);
|
|
7960
|
+
if (fromTitle != null) {
|
|
7961
|
+
setValueByPath(toObject, ['title'], fromTitle);
|
|
7962
|
+
}
|
|
7963
|
+
const fromType = getValueByPath(fromObject, ['type']);
|
|
7964
|
+
if (fromType != null) {
|
|
7965
|
+
setValueByPath(toObject, ['type'], fromType);
|
|
7966
|
+
}
|
|
7967
|
+
return toObject;
|
|
7968
|
+
}
|
|
7751
7969
|
function safetySettingToMldev(apiClient, fromObject) {
|
|
7752
7970
|
const toObject = {};
|
|
7753
7971
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
@@ -7914,6 +8132,10 @@ function retrievalConfigToMldev(apiClient, fromObject) {
|
|
|
7914
8132
|
if (fromLatLng != null) {
|
|
7915
8133
|
setValueByPath(toObject, ['latLng'], latLngToMldev(apiClient, fromLatLng));
|
|
7916
8134
|
}
|
|
8135
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
8136
|
+
if (fromLanguageCode != null) {
|
|
8137
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
8138
|
+
}
|
|
7917
8139
|
return toObject;
|
|
7918
8140
|
}
|
|
7919
8141
|
function toolConfigToMldev(apiClient, fromObject) {
|
|
@@ -8086,7 +8308,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8086
8308
|
'responseSchema',
|
|
8087
8309
|
]);
|
|
8088
8310
|
if (fromResponseSchema != null) {
|
|
8089
|
-
setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
|
|
8311
|
+
setValueByPath(toObject, ['responseSchema'], schemaToMldev(apiClient, tSchema(apiClient, fromResponseSchema)));
|
|
8090
8312
|
}
|
|
8091
8313
|
if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
|
|
8092
8314
|
throw new Error('routingConfig parameter is not supported in Gemini API.');
|
|
@@ -8547,6 +8769,22 @@ function blobToVertex(apiClient, fromObject) {
|
|
|
8547
8769
|
}
|
|
8548
8770
|
return toObject;
|
|
8549
8771
|
}
|
|
8772
|
+
function fileDataToVertex(apiClient, fromObject) {
|
|
8773
|
+
const toObject = {};
|
|
8774
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8775
|
+
if (fromDisplayName != null) {
|
|
8776
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
8777
|
+
}
|
|
8778
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8779
|
+
if (fromFileUri != null) {
|
|
8780
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8781
|
+
}
|
|
8782
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8783
|
+
if (fromMimeType != null) {
|
|
8784
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8785
|
+
}
|
|
8786
|
+
return toObject;
|
|
8787
|
+
}
|
|
8550
8788
|
function partToVertex(apiClient, fromObject) {
|
|
8551
8789
|
const toObject = {};
|
|
8552
8790
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -8563,6 +8801,10 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8563
8801
|
if (fromInlineData != null) {
|
|
8564
8802
|
setValueByPath(toObject, ['inlineData'], blobToVertex(apiClient, fromInlineData));
|
|
8565
8803
|
}
|
|
8804
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8805
|
+
if (fromFileData != null) {
|
|
8806
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
|
|
8807
|
+
}
|
|
8566
8808
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8567
8809
|
'codeExecutionResult',
|
|
8568
8810
|
]);
|
|
@@ -8575,10 +8817,6 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8575
8817
|
if (fromExecutableCode != null) {
|
|
8576
8818
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8577
8819
|
}
|
|
8578
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8579
|
-
if (fromFileData != null) {
|
|
8580
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
8581
|
-
}
|
|
8582
8820
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8583
8821
|
if (fromFunctionCall != null) {
|
|
8584
8822
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -8613,6 +8851,104 @@ function contentToVertex(apiClient, fromObject) {
|
|
|
8613
8851
|
}
|
|
8614
8852
|
return toObject;
|
|
8615
8853
|
}
|
|
8854
|
+
function schemaToVertex(apiClient, fromObject) {
|
|
8855
|
+
const toObject = {};
|
|
8856
|
+
const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
|
|
8857
|
+
if (fromAnyOf != null) {
|
|
8858
|
+
setValueByPath(toObject, ['anyOf'], fromAnyOf);
|
|
8859
|
+
}
|
|
8860
|
+
const fromDefault = getValueByPath(fromObject, ['default']);
|
|
8861
|
+
if (fromDefault != null) {
|
|
8862
|
+
setValueByPath(toObject, ['default'], fromDefault);
|
|
8863
|
+
}
|
|
8864
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8865
|
+
if (fromDescription != null) {
|
|
8866
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
8867
|
+
}
|
|
8868
|
+
const fromEnum = getValueByPath(fromObject, ['enum']);
|
|
8869
|
+
if (fromEnum != null) {
|
|
8870
|
+
setValueByPath(toObject, ['enum'], fromEnum);
|
|
8871
|
+
}
|
|
8872
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
8873
|
+
if (fromExample != null) {
|
|
8874
|
+
setValueByPath(toObject, ['example'], fromExample);
|
|
8875
|
+
}
|
|
8876
|
+
const fromFormat = getValueByPath(fromObject, ['format']);
|
|
8877
|
+
if (fromFormat != null) {
|
|
8878
|
+
setValueByPath(toObject, ['format'], fromFormat);
|
|
8879
|
+
}
|
|
8880
|
+
const fromItems = getValueByPath(fromObject, ['items']);
|
|
8881
|
+
if (fromItems != null) {
|
|
8882
|
+
setValueByPath(toObject, ['items'], fromItems);
|
|
8883
|
+
}
|
|
8884
|
+
const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
|
|
8885
|
+
if (fromMaxItems != null) {
|
|
8886
|
+
setValueByPath(toObject, ['maxItems'], fromMaxItems);
|
|
8887
|
+
}
|
|
8888
|
+
const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
|
|
8889
|
+
if (fromMaxLength != null) {
|
|
8890
|
+
setValueByPath(toObject, ['maxLength'], fromMaxLength);
|
|
8891
|
+
}
|
|
8892
|
+
const fromMaxProperties = getValueByPath(fromObject, [
|
|
8893
|
+
'maxProperties',
|
|
8894
|
+
]);
|
|
8895
|
+
if (fromMaxProperties != null) {
|
|
8896
|
+
setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
|
|
8897
|
+
}
|
|
8898
|
+
const fromMaximum = getValueByPath(fromObject, ['maximum']);
|
|
8899
|
+
if (fromMaximum != null) {
|
|
8900
|
+
setValueByPath(toObject, ['maximum'], fromMaximum);
|
|
8901
|
+
}
|
|
8902
|
+
const fromMinItems = getValueByPath(fromObject, ['minItems']);
|
|
8903
|
+
if (fromMinItems != null) {
|
|
8904
|
+
setValueByPath(toObject, ['minItems'], fromMinItems);
|
|
8905
|
+
}
|
|
8906
|
+
const fromMinLength = getValueByPath(fromObject, ['minLength']);
|
|
8907
|
+
if (fromMinLength != null) {
|
|
8908
|
+
setValueByPath(toObject, ['minLength'], fromMinLength);
|
|
8909
|
+
}
|
|
8910
|
+
const fromMinProperties = getValueByPath(fromObject, [
|
|
8911
|
+
'minProperties',
|
|
8912
|
+
]);
|
|
8913
|
+
if (fromMinProperties != null) {
|
|
8914
|
+
setValueByPath(toObject, ['minProperties'], fromMinProperties);
|
|
8915
|
+
}
|
|
8916
|
+
const fromMinimum = getValueByPath(fromObject, ['minimum']);
|
|
8917
|
+
if (fromMinimum != null) {
|
|
8918
|
+
setValueByPath(toObject, ['minimum'], fromMinimum);
|
|
8919
|
+
}
|
|
8920
|
+
const fromNullable = getValueByPath(fromObject, ['nullable']);
|
|
8921
|
+
if (fromNullable != null) {
|
|
8922
|
+
setValueByPath(toObject, ['nullable'], fromNullable);
|
|
8923
|
+
}
|
|
8924
|
+
const fromPattern = getValueByPath(fromObject, ['pattern']);
|
|
8925
|
+
if (fromPattern != null) {
|
|
8926
|
+
setValueByPath(toObject, ['pattern'], fromPattern);
|
|
8927
|
+
}
|
|
8928
|
+
const fromProperties = getValueByPath(fromObject, ['properties']);
|
|
8929
|
+
if (fromProperties != null) {
|
|
8930
|
+
setValueByPath(toObject, ['properties'], fromProperties);
|
|
8931
|
+
}
|
|
8932
|
+
const fromPropertyOrdering = getValueByPath(fromObject, [
|
|
8933
|
+
'propertyOrdering',
|
|
8934
|
+
]);
|
|
8935
|
+
if (fromPropertyOrdering != null) {
|
|
8936
|
+
setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
|
|
8937
|
+
}
|
|
8938
|
+
const fromRequired = getValueByPath(fromObject, ['required']);
|
|
8939
|
+
if (fromRequired != null) {
|
|
8940
|
+
setValueByPath(toObject, ['required'], fromRequired);
|
|
8941
|
+
}
|
|
8942
|
+
const fromTitle = getValueByPath(fromObject, ['title']);
|
|
8943
|
+
if (fromTitle != null) {
|
|
8944
|
+
setValueByPath(toObject, ['title'], fromTitle);
|
|
8945
|
+
}
|
|
8946
|
+
const fromType = getValueByPath(fromObject, ['type']);
|
|
8947
|
+
if (fromType != null) {
|
|
8948
|
+
setValueByPath(toObject, ['type'], fromType);
|
|
8949
|
+
}
|
|
8950
|
+
return toObject;
|
|
8951
|
+
}
|
|
8616
8952
|
function modelSelectionConfigToVertex(apiClient, fromObject) {
|
|
8617
8953
|
const toObject = {};
|
|
8618
8954
|
const fromFeatureSelectionPreference = getValueByPath(fromObject, [
|
|
@@ -8841,6 +9177,10 @@ function retrievalConfigToVertex(apiClient, fromObject) {
|
|
|
8841
9177
|
if (fromLatLng != null) {
|
|
8842
9178
|
setValueByPath(toObject, ['latLng'], latLngToVertex(apiClient, fromLatLng));
|
|
8843
9179
|
}
|
|
9180
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
9181
|
+
if (fromLanguageCode != null) {
|
|
9182
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
9183
|
+
}
|
|
8844
9184
|
return toObject;
|
|
8845
9185
|
}
|
|
8846
9186
|
function toolConfigToVertex(apiClient, fromObject) {
|
|
@@ -8982,7 +9322,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
8982
9322
|
'responseSchema',
|
|
8983
9323
|
]);
|
|
8984
9324
|
if (fromResponseSchema != null) {
|
|
8985
|
-
setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
|
|
9325
|
+
setValueByPath(toObject, ['responseSchema'], schemaToVertex(apiClient, tSchema(apiClient, fromResponseSchema)));
|
|
8986
9326
|
}
|
|
8987
9327
|
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
8988
9328
|
'routingConfig',
|
|
@@ -9764,6 +10104,18 @@ function blobFromMldev(apiClient, fromObject) {
|
|
|
9764
10104
|
}
|
|
9765
10105
|
return toObject;
|
|
9766
10106
|
}
|
|
10107
|
+
function fileDataFromMldev(apiClient, fromObject) {
|
|
10108
|
+
const toObject = {};
|
|
10109
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
10110
|
+
if (fromFileUri != null) {
|
|
10111
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
10112
|
+
}
|
|
10113
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
10114
|
+
if (fromMimeType != null) {
|
|
10115
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
10116
|
+
}
|
|
10117
|
+
return toObject;
|
|
10118
|
+
}
|
|
9767
10119
|
function partFromMldev(apiClient, fromObject) {
|
|
9768
10120
|
const toObject = {};
|
|
9769
10121
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -9780,6 +10132,10 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9780
10132
|
if (fromInlineData != null) {
|
|
9781
10133
|
setValueByPath(toObject, ['inlineData'], blobFromMldev(apiClient, fromInlineData));
|
|
9782
10134
|
}
|
|
10135
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10136
|
+
if (fromFileData != null) {
|
|
10137
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
|
|
10138
|
+
}
|
|
9783
10139
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
9784
10140
|
'codeExecutionResult',
|
|
9785
10141
|
]);
|
|
@@ -9792,10 +10148,6 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9792
10148
|
if (fromExecutableCode != null) {
|
|
9793
10149
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
9794
10150
|
}
|
|
9795
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
9796
|
-
if (fromFileData != null) {
|
|
9797
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
9798
|
-
}
|
|
9799
10151
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
9800
10152
|
if (fromFunctionCall != null) {
|
|
9801
10153
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -10266,6 +10618,22 @@ function blobFromVertex(apiClient, fromObject) {
|
|
|
10266
10618
|
}
|
|
10267
10619
|
return toObject;
|
|
10268
10620
|
}
|
|
10621
|
+
function fileDataFromVertex(apiClient, fromObject) {
|
|
10622
|
+
const toObject = {};
|
|
10623
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
10624
|
+
if (fromDisplayName != null) {
|
|
10625
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
10626
|
+
}
|
|
10627
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
10628
|
+
if (fromFileUri != null) {
|
|
10629
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
10630
|
+
}
|
|
10631
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
10632
|
+
if (fromMimeType != null) {
|
|
10633
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
10634
|
+
}
|
|
10635
|
+
return toObject;
|
|
10636
|
+
}
|
|
10269
10637
|
function partFromVertex(apiClient, fromObject) {
|
|
10270
10638
|
const toObject = {};
|
|
10271
10639
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -10282,6 +10650,10 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10282
10650
|
if (fromInlineData != null) {
|
|
10283
10651
|
setValueByPath(toObject, ['inlineData'], blobFromVertex(apiClient, fromInlineData));
|
|
10284
10652
|
}
|
|
10653
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10654
|
+
if (fromFileData != null) {
|
|
10655
|
+
setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
|
|
10656
|
+
}
|
|
10285
10657
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
10286
10658
|
'codeExecutionResult',
|
|
10287
10659
|
]);
|
|
@@ -10294,10 +10666,6 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10294
10666
|
if (fromExecutableCode != null) {
|
|
10295
10667
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
10296
10668
|
}
|
|
10297
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10298
|
-
if (fromFileData != null) {
|
|
10299
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
10300
|
-
}
|
|
10301
10669
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
10302
10670
|
if (fromFunctionCall != null) {
|
|
10303
10671
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -13621,6 +13989,12 @@ function tuningJobFromMldev(apiClient, fromObject) {
|
|
|
13621
13989
|
if (fromPipelineJob != null) {
|
|
13622
13990
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
13623
13991
|
}
|
|
13992
|
+
const fromServiceAccount = getValueByPath(fromObject, [
|
|
13993
|
+
'serviceAccount',
|
|
13994
|
+
]);
|
|
13995
|
+
if (fromServiceAccount != null) {
|
|
13996
|
+
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
13997
|
+
}
|
|
13624
13998
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
13625
13999
|
'tunedModelDisplayName',
|
|
13626
14000
|
]);
|
|
@@ -13795,6 +14169,12 @@ function tuningJobFromVertex(apiClient, fromObject) {
|
|
|
13795
14169
|
if (fromPipelineJob != null) {
|
|
13796
14170
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
13797
14171
|
}
|
|
14172
|
+
const fromServiceAccount = getValueByPath(fromObject, [
|
|
14173
|
+
'serviceAccount',
|
|
14174
|
+
]);
|
|
14175
|
+
if (fromServiceAccount != null) {
|
|
14176
|
+
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
14177
|
+
}
|
|
13798
14178
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
13799
14179
|
'tunedModelDisplayName',
|
|
13800
14180
|
]);
|
|
@@ -14206,4 +14586,4 @@ exports.createPartFromUri = createPartFromUri;
|
|
|
14206
14586
|
exports.createUserContent = createUserContent;
|
|
14207
14587
|
exports.mcpToTool = mcpToTool;
|
|
14208
14588
|
exports.setDefaultBaseUrls = setDefaultBaseUrls;
|
|
14209
|
-
//# sourceMappingURL=index.
|
|
14589
|
+
//# sourceMappingURL=index.cjs.map
|