@google/genai 1.0.1 → 1.2.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 +6 -6
- package/dist/genai.d.ts +82 -43
- package/dist/index.cjs +14565 -0
- package/dist/index.mjs +464 -111
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +14970 -0
- package/dist/node/index.mjs +464 -111
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +82 -43
- package/dist/web/index.mjs +464 -111
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +82 -43
- package/package.json +5 -1
package/dist/index.mjs
CHANGED
|
@@ -195,6 +195,42 @@ var Language;
|
|
|
195
195
|
*/
|
|
196
196
|
Language["PYTHON"] = "PYTHON";
|
|
197
197
|
})(Language || (Language = {}));
|
|
198
|
+
/** Optional. The type of the data. */
|
|
199
|
+
var Type;
|
|
200
|
+
(function (Type) {
|
|
201
|
+
/**
|
|
202
|
+
* Not specified, should not be used.
|
|
203
|
+
*/
|
|
204
|
+
Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
205
|
+
/**
|
|
206
|
+
* OpenAPI string type
|
|
207
|
+
*/
|
|
208
|
+
Type["STRING"] = "STRING";
|
|
209
|
+
/**
|
|
210
|
+
* OpenAPI number type
|
|
211
|
+
*/
|
|
212
|
+
Type["NUMBER"] = "NUMBER";
|
|
213
|
+
/**
|
|
214
|
+
* OpenAPI integer type
|
|
215
|
+
*/
|
|
216
|
+
Type["INTEGER"] = "INTEGER";
|
|
217
|
+
/**
|
|
218
|
+
* OpenAPI boolean type
|
|
219
|
+
*/
|
|
220
|
+
Type["BOOLEAN"] = "BOOLEAN";
|
|
221
|
+
/**
|
|
222
|
+
* OpenAPI array type
|
|
223
|
+
*/
|
|
224
|
+
Type["ARRAY"] = "ARRAY";
|
|
225
|
+
/**
|
|
226
|
+
* OpenAPI object type
|
|
227
|
+
*/
|
|
228
|
+
Type["OBJECT"] = "OBJECT";
|
|
229
|
+
/**
|
|
230
|
+
* Null type
|
|
231
|
+
*/
|
|
232
|
+
Type["NULL"] = "NULL";
|
|
233
|
+
})(Type || (Type = {}));
|
|
198
234
|
/** Required. Harm category. */
|
|
199
235
|
var HarmCategory;
|
|
200
236
|
(function (HarmCategory) {
|
|
@@ -219,7 +255,7 @@ var HarmCategory;
|
|
|
219
255
|
*/
|
|
220
256
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
221
257
|
/**
|
|
222
|
-
* The harm category is civic integrity.
|
|
258
|
+
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
223
259
|
*/
|
|
224
260
|
HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
225
261
|
})(HarmCategory || (HarmCategory = {}));
|
|
@@ -267,38 +303,6 @@ var HarmBlockThreshold;
|
|
|
267
303
|
*/
|
|
268
304
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
269
305
|
})(HarmBlockThreshold || (HarmBlockThreshold = {}));
|
|
270
|
-
/** Optional. The type of the data. */
|
|
271
|
-
var Type;
|
|
272
|
-
(function (Type) {
|
|
273
|
-
/**
|
|
274
|
-
* Not specified, should not be used.
|
|
275
|
-
*/
|
|
276
|
-
Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
277
|
-
/**
|
|
278
|
-
* OpenAPI string type
|
|
279
|
-
*/
|
|
280
|
-
Type["STRING"] = "STRING";
|
|
281
|
-
/**
|
|
282
|
-
* OpenAPI number type
|
|
283
|
-
*/
|
|
284
|
-
Type["NUMBER"] = "NUMBER";
|
|
285
|
-
/**
|
|
286
|
-
* OpenAPI integer type
|
|
287
|
-
*/
|
|
288
|
-
Type["INTEGER"] = "INTEGER";
|
|
289
|
-
/**
|
|
290
|
-
* OpenAPI boolean type
|
|
291
|
-
*/
|
|
292
|
-
Type["BOOLEAN"] = "BOOLEAN";
|
|
293
|
-
/**
|
|
294
|
-
* OpenAPI array type
|
|
295
|
-
*/
|
|
296
|
-
Type["ARRAY"] = "ARRAY";
|
|
297
|
-
/**
|
|
298
|
-
* OpenAPI object type
|
|
299
|
-
*/
|
|
300
|
-
Type["OBJECT"] = "OBJECT";
|
|
301
|
-
})(Type || (Type = {}));
|
|
302
306
|
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
303
307
|
var Mode;
|
|
304
308
|
(function (Mode) {
|
|
@@ -499,7 +503,7 @@ var Modality;
|
|
|
499
503
|
*/
|
|
500
504
|
Modality["IMAGE"] = "IMAGE";
|
|
501
505
|
/**
|
|
502
|
-
* Indicates the model should return
|
|
506
|
+
* Indicates the model should return audio.
|
|
503
507
|
*/
|
|
504
508
|
Modality["AUDIO"] = "AUDIO";
|
|
505
509
|
})(Modality || (Modality = {}));
|
|
@@ -923,24 +927,6 @@ var Scale;
|
|
|
923
927
|
*/
|
|
924
928
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
925
929
|
})(Scale || (Scale = {}));
|
|
926
|
-
/** The mode of music generation. */
|
|
927
|
-
var MusicGenerationMode;
|
|
928
|
-
(function (MusicGenerationMode) {
|
|
929
|
-
/**
|
|
930
|
-
* This value is unused.
|
|
931
|
-
*/
|
|
932
|
-
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
933
|
-
/**
|
|
934
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
935
|
-
music.
|
|
936
|
-
*/
|
|
937
|
-
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
938
|
-
/**
|
|
939
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
940
|
-
of music.
|
|
941
|
-
*/
|
|
942
|
-
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
943
|
-
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
944
930
|
/** The playback control signal to apply to the music generation. */
|
|
945
931
|
var LiveMusicPlaybackControl;
|
|
946
932
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -2438,6 +2424,21 @@ function blobToMldev$2(apiClient, fromObject) {
|
|
|
2438
2424
|
}
|
|
2439
2425
|
return toObject;
|
|
2440
2426
|
}
|
|
2427
|
+
function fileDataToMldev$2(apiClient, fromObject) {
|
|
2428
|
+
const toObject = {};
|
|
2429
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2430
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
2431
|
+
}
|
|
2432
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
2433
|
+
if (fromFileUri != null) {
|
|
2434
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
2435
|
+
}
|
|
2436
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
2437
|
+
if (fromMimeType != null) {
|
|
2438
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
2439
|
+
}
|
|
2440
|
+
return toObject;
|
|
2441
|
+
}
|
|
2441
2442
|
function partToMldev$2(apiClient, fromObject) {
|
|
2442
2443
|
const toObject = {};
|
|
2443
2444
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -2454,6 +2455,10 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2454
2455
|
if (fromInlineData != null) {
|
|
2455
2456
|
setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
|
|
2456
2457
|
}
|
|
2458
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2459
|
+
if (fromFileData != null) {
|
|
2460
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
|
|
2461
|
+
}
|
|
2457
2462
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2458
2463
|
'codeExecutionResult',
|
|
2459
2464
|
]);
|
|
@@ -2466,10 +2471,6 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2466
2471
|
if (fromExecutableCode != null) {
|
|
2467
2472
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
2468
2473
|
}
|
|
2469
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2470
|
-
if (fromFileData != null) {
|
|
2471
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
2472
|
-
}
|
|
2473
2474
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
2474
2475
|
if (fromFunctionCall != null) {
|
|
2475
2476
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -2655,6 +2656,10 @@ function retrievalConfigToMldev$1(apiClient, fromObject) {
|
|
|
2655
2656
|
if (fromLatLng != null) {
|
|
2656
2657
|
setValueByPath(toObject, ['latLng'], latLngToMldev$1(apiClient, fromLatLng));
|
|
2657
2658
|
}
|
|
2659
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
2660
|
+
if (fromLanguageCode != null) {
|
|
2661
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
2662
|
+
}
|
|
2658
2663
|
return toObject;
|
|
2659
2664
|
}
|
|
2660
2665
|
function toolConfigToMldev$1(apiClient, fromObject) {
|
|
@@ -2834,6 +2839,22 @@ function blobToVertex$2(apiClient, fromObject) {
|
|
|
2834
2839
|
}
|
|
2835
2840
|
return toObject;
|
|
2836
2841
|
}
|
|
2842
|
+
function fileDataToVertex$2(apiClient, fromObject) {
|
|
2843
|
+
const toObject = {};
|
|
2844
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
2845
|
+
if (fromDisplayName != null) {
|
|
2846
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
2847
|
+
}
|
|
2848
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
2849
|
+
if (fromFileUri != null) {
|
|
2850
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
2851
|
+
}
|
|
2852
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
2853
|
+
if (fromMimeType != null) {
|
|
2854
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
2855
|
+
}
|
|
2856
|
+
return toObject;
|
|
2857
|
+
}
|
|
2837
2858
|
function partToVertex$2(apiClient, fromObject) {
|
|
2838
2859
|
const toObject = {};
|
|
2839
2860
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -2850,6 +2871,10 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2850
2871
|
if (fromInlineData != null) {
|
|
2851
2872
|
setValueByPath(toObject, ['inlineData'], blobToVertex$2(apiClient, fromInlineData));
|
|
2852
2873
|
}
|
|
2874
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2875
|
+
if (fromFileData != null) {
|
|
2876
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
|
|
2877
|
+
}
|
|
2853
2878
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2854
2879
|
'codeExecutionResult',
|
|
2855
2880
|
]);
|
|
@@ -2862,10 +2887,6 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2862
2887
|
if (fromExecutableCode != null) {
|
|
2863
2888
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
2864
2889
|
}
|
|
2865
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2866
|
-
if (fromFileData != null) {
|
|
2867
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
2868
|
-
}
|
|
2869
2890
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
2870
2891
|
if (fromFunctionCall != null) {
|
|
2871
2892
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -3102,6 +3123,10 @@ function retrievalConfigToVertex$1(apiClient, fromObject) {
|
|
|
3102
3123
|
if (fromLatLng != null) {
|
|
3103
3124
|
setValueByPath(toObject, ['latLng'], latLngToVertex$1(apiClient, fromLatLng));
|
|
3104
3125
|
}
|
|
3126
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
3127
|
+
if (fromLanguageCode != null) {
|
|
3128
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
3129
|
+
}
|
|
3105
3130
|
return toObject;
|
|
3106
3131
|
}
|
|
3107
3132
|
function toolConfigToVertex$1(apiClient, fromObject) {
|
|
@@ -4311,7 +4336,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
4311
4336
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
4312
4337
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
4313
4338
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
4314
|
-
const SDK_VERSION = '1.0
|
|
4339
|
+
const SDK_VERSION = '1.2.0'; // x-release-please-version
|
|
4315
4340
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
4316
4341
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
4317
4342
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -5635,6 +5660,37 @@ function blobToVertex$1(apiClient, fromObject) {
|
|
|
5635
5660
|
}
|
|
5636
5661
|
return toObject;
|
|
5637
5662
|
}
|
|
5663
|
+
function fileDataToMldev$1(apiClient, fromObject) {
|
|
5664
|
+
const toObject = {};
|
|
5665
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5666
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
5667
|
+
}
|
|
5668
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
5669
|
+
if (fromFileUri != null) {
|
|
5670
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
5671
|
+
}
|
|
5672
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
5673
|
+
if (fromMimeType != null) {
|
|
5674
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
5675
|
+
}
|
|
5676
|
+
return toObject;
|
|
5677
|
+
}
|
|
5678
|
+
function fileDataToVertex$1(apiClient, fromObject) {
|
|
5679
|
+
const toObject = {};
|
|
5680
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
5681
|
+
if (fromDisplayName != null) {
|
|
5682
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
5683
|
+
}
|
|
5684
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
5685
|
+
if (fromFileUri != null) {
|
|
5686
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
5687
|
+
}
|
|
5688
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
5689
|
+
if (fromMimeType != null) {
|
|
5690
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
5691
|
+
}
|
|
5692
|
+
return toObject;
|
|
5693
|
+
}
|
|
5638
5694
|
function partToMldev$1(apiClient, fromObject) {
|
|
5639
5695
|
const toObject = {};
|
|
5640
5696
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -5651,6 +5707,10 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5651
5707
|
if (fromInlineData != null) {
|
|
5652
5708
|
setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
|
|
5653
5709
|
}
|
|
5710
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5711
|
+
if (fromFileData != null) {
|
|
5712
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
|
|
5713
|
+
}
|
|
5654
5714
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5655
5715
|
'codeExecutionResult',
|
|
5656
5716
|
]);
|
|
@@ -5663,10 +5723,6 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5663
5723
|
if (fromExecutableCode != null) {
|
|
5664
5724
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
5665
5725
|
}
|
|
5666
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5667
|
-
if (fromFileData != null) {
|
|
5668
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
5669
|
-
}
|
|
5670
5726
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
5671
5727
|
if (fromFunctionCall != null) {
|
|
5672
5728
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -5699,6 +5755,10 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5699
5755
|
if (fromInlineData != null) {
|
|
5700
5756
|
setValueByPath(toObject, ['inlineData'], blobToVertex$1(apiClient, fromInlineData));
|
|
5701
5757
|
}
|
|
5758
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5759
|
+
if (fromFileData != null) {
|
|
5760
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
|
|
5761
|
+
}
|
|
5702
5762
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5703
5763
|
'codeExecutionResult',
|
|
5704
5764
|
]);
|
|
@@ -5711,10 +5771,6 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5711
5771
|
if (fromExecutableCode != null) {
|
|
5712
5772
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
5713
5773
|
}
|
|
5714
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5715
|
-
if (fromFileData != null) {
|
|
5716
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
5717
|
-
}
|
|
5718
5774
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
5719
5775
|
if (fromFunctionCall != null) {
|
|
5720
5776
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -6652,12 +6708,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
|
|
|
6652
6708
|
if (fromOnlyBassAndDrums != null) {
|
|
6653
6709
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
6654
6710
|
}
|
|
6655
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
6656
|
-
'musicGenerationMode',
|
|
6657
|
-
]);
|
|
6658
|
-
if (fromMusicGenerationMode != null) {
|
|
6659
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
6660
|
-
}
|
|
6661
6711
|
return toObject;
|
|
6662
6712
|
}
|
|
6663
6713
|
function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
|
|
@@ -6788,6 +6838,34 @@ function blobFromVertex$1(apiClient, fromObject) {
|
|
|
6788
6838
|
}
|
|
6789
6839
|
return toObject;
|
|
6790
6840
|
}
|
|
6841
|
+
function fileDataFromMldev$1(apiClient, fromObject) {
|
|
6842
|
+
const toObject = {};
|
|
6843
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
6844
|
+
if (fromFileUri != null) {
|
|
6845
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
6846
|
+
}
|
|
6847
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
6848
|
+
if (fromMimeType != null) {
|
|
6849
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
6850
|
+
}
|
|
6851
|
+
return toObject;
|
|
6852
|
+
}
|
|
6853
|
+
function fileDataFromVertex$1(apiClient, fromObject) {
|
|
6854
|
+
const toObject = {};
|
|
6855
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
6856
|
+
if (fromDisplayName != null) {
|
|
6857
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
6858
|
+
}
|
|
6859
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
6860
|
+
if (fromFileUri != null) {
|
|
6861
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
6862
|
+
}
|
|
6863
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
6864
|
+
if (fromMimeType != null) {
|
|
6865
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
6866
|
+
}
|
|
6867
|
+
return toObject;
|
|
6868
|
+
}
|
|
6791
6869
|
function partFromMldev$1(apiClient, fromObject) {
|
|
6792
6870
|
const toObject = {};
|
|
6793
6871
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -6804,6 +6882,10 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6804
6882
|
if (fromInlineData != null) {
|
|
6805
6883
|
setValueByPath(toObject, ['inlineData'], blobFromMldev$1(apiClient, fromInlineData));
|
|
6806
6884
|
}
|
|
6885
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6886
|
+
if (fromFileData != null) {
|
|
6887
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
|
|
6888
|
+
}
|
|
6807
6889
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6808
6890
|
'codeExecutionResult',
|
|
6809
6891
|
]);
|
|
@@ -6816,10 +6898,6 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6816
6898
|
if (fromExecutableCode != null) {
|
|
6817
6899
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6818
6900
|
}
|
|
6819
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6820
|
-
if (fromFileData != null) {
|
|
6821
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6822
|
-
}
|
|
6823
6901
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6824
6902
|
if (fromFunctionCall != null) {
|
|
6825
6903
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -6852,6 +6930,10 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6852
6930
|
if (fromInlineData != null) {
|
|
6853
6931
|
setValueByPath(toObject, ['inlineData'], blobFromVertex$1(apiClient, fromInlineData));
|
|
6854
6932
|
}
|
|
6933
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6934
|
+
if (fromFileData != null) {
|
|
6935
|
+
setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
|
|
6936
|
+
}
|
|
6855
6937
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6856
6938
|
'codeExecutionResult',
|
|
6857
6939
|
]);
|
|
@@ -6864,10 +6946,6 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6864
6946
|
if (fromExecutableCode != null) {
|
|
6865
6947
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6866
6948
|
}
|
|
6867
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6868
|
-
if (fromFileData != null) {
|
|
6869
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6870
|
-
}
|
|
6871
6949
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6872
6950
|
if (fromFunctionCall != null) {
|
|
6873
6951
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -7554,12 +7632,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
|
|
|
7554
7632
|
if (fromOnlyBassAndDrums != null) {
|
|
7555
7633
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7556
7634
|
}
|
|
7557
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7558
|
-
'musicGenerationMode',
|
|
7559
|
-
]);
|
|
7560
|
-
if (fromMusicGenerationMode != null) {
|
|
7561
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7562
|
-
}
|
|
7563
7635
|
return toObject;
|
|
7564
7636
|
}
|
|
7565
7637
|
function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
|
|
@@ -7683,6 +7755,21 @@ function blobToMldev(apiClient, fromObject) {
|
|
|
7683
7755
|
}
|
|
7684
7756
|
return toObject;
|
|
7685
7757
|
}
|
|
7758
|
+
function fileDataToMldev(apiClient, fromObject) {
|
|
7759
|
+
const toObject = {};
|
|
7760
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7761
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
7762
|
+
}
|
|
7763
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
7764
|
+
if (fromFileUri != null) {
|
|
7765
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
7766
|
+
}
|
|
7767
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7768
|
+
if (fromMimeType != null) {
|
|
7769
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7770
|
+
}
|
|
7771
|
+
return toObject;
|
|
7772
|
+
}
|
|
7686
7773
|
function partToMldev(apiClient, fromObject) {
|
|
7687
7774
|
const toObject = {};
|
|
7688
7775
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -7699,6 +7786,10 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7699
7786
|
if (fromInlineData != null) {
|
|
7700
7787
|
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
7701
7788
|
}
|
|
7789
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7790
|
+
if (fromFileData != null) {
|
|
7791
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
7792
|
+
}
|
|
7702
7793
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7703
7794
|
'codeExecutionResult',
|
|
7704
7795
|
]);
|
|
@@ -7711,10 +7802,6 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7711
7802
|
if (fromExecutableCode != null) {
|
|
7712
7803
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
7713
7804
|
}
|
|
7714
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7715
|
-
if (fromFileData != null) {
|
|
7716
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
7717
|
-
}
|
|
7718
7805
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
7719
7806
|
if (fromFunctionCall != null) {
|
|
7720
7807
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -7749,6 +7836,104 @@ function contentToMldev(apiClient, fromObject) {
|
|
|
7749
7836
|
}
|
|
7750
7837
|
return toObject;
|
|
7751
7838
|
}
|
|
7839
|
+
function schemaToMldev(apiClient, fromObject) {
|
|
7840
|
+
const toObject = {};
|
|
7841
|
+
const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
|
|
7842
|
+
if (fromAnyOf != null) {
|
|
7843
|
+
setValueByPath(toObject, ['anyOf'], fromAnyOf);
|
|
7844
|
+
}
|
|
7845
|
+
const fromDefault = getValueByPath(fromObject, ['default']);
|
|
7846
|
+
if (fromDefault != null) {
|
|
7847
|
+
setValueByPath(toObject, ['default'], fromDefault);
|
|
7848
|
+
}
|
|
7849
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7850
|
+
if (fromDescription != null) {
|
|
7851
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
7852
|
+
}
|
|
7853
|
+
const fromEnum = getValueByPath(fromObject, ['enum']);
|
|
7854
|
+
if (fromEnum != null) {
|
|
7855
|
+
setValueByPath(toObject, ['enum'], fromEnum);
|
|
7856
|
+
}
|
|
7857
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
7858
|
+
if (fromExample != null) {
|
|
7859
|
+
setValueByPath(toObject, ['example'], fromExample);
|
|
7860
|
+
}
|
|
7861
|
+
const fromFormat = getValueByPath(fromObject, ['format']);
|
|
7862
|
+
if (fromFormat != null) {
|
|
7863
|
+
setValueByPath(toObject, ['format'], fromFormat);
|
|
7864
|
+
}
|
|
7865
|
+
const fromItems = getValueByPath(fromObject, ['items']);
|
|
7866
|
+
if (fromItems != null) {
|
|
7867
|
+
setValueByPath(toObject, ['items'], fromItems);
|
|
7868
|
+
}
|
|
7869
|
+
const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
|
|
7870
|
+
if (fromMaxItems != null) {
|
|
7871
|
+
setValueByPath(toObject, ['maxItems'], fromMaxItems);
|
|
7872
|
+
}
|
|
7873
|
+
const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
|
|
7874
|
+
if (fromMaxLength != null) {
|
|
7875
|
+
setValueByPath(toObject, ['maxLength'], fromMaxLength);
|
|
7876
|
+
}
|
|
7877
|
+
const fromMaxProperties = getValueByPath(fromObject, [
|
|
7878
|
+
'maxProperties',
|
|
7879
|
+
]);
|
|
7880
|
+
if (fromMaxProperties != null) {
|
|
7881
|
+
setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
|
|
7882
|
+
}
|
|
7883
|
+
const fromMaximum = getValueByPath(fromObject, ['maximum']);
|
|
7884
|
+
if (fromMaximum != null) {
|
|
7885
|
+
setValueByPath(toObject, ['maximum'], fromMaximum);
|
|
7886
|
+
}
|
|
7887
|
+
const fromMinItems = getValueByPath(fromObject, ['minItems']);
|
|
7888
|
+
if (fromMinItems != null) {
|
|
7889
|
+
setValueByPath(toObject, ['minItems'], fromMinItems);
|
|
7890
|
+
}
|
|
7891
|
+
const fromMinLength = getValueByPath(fromObject, ['minLength']);
|
|
7892
|
+
if (fromMinLength != null) {
|
|
7893
|
+
setValueByPath(toObject, ['minLength'], fromMinLength);
|
|
7894
|
+
}
|
|
7895
|
+
const fromMinProperties = getValueByPath(fromObject, [
|
|
7896
|
+
'minProperties',
|
|
7897
|
+
]);
|
|
7898
|
+
if (fromMinProperties != null) {
|
|
7899
|
+
setValueByPath(toObject, ['minProperties'], fromMinProperties);
|
|
7900
|
+
}
|
|
7901
|
+
const fromMinimum = getValueByPath(fromObject, ['minimum']);
|
|
7902
|
+
if (fromMinimum != null) {
|
|
7903
|
+
setValueByPath(toObject, ['minimum'], fromMinimum);
|
|
7904
|
+
}
|
|
7905
|
+
const fromNullable = getValueByPath(fromObject, ['nullable']);
|
|
7906
|
+
if (fromNullable != null) {
|
|
7907
|
+
setValueByPath(toObject, ['nullable'], fromNullable);
|
|
7908
|
+
}
|
|
7909
|
+
const fromPattern = getValueByPath(fromObject, ['pattern']);
|
|
7910
|
+
if (fromPattern != null) {
|
|
7911
|
+
setValueByPath(toObject, ['pattern'], fromPattern);
|
|
7912
|
+
}
|
|
7913
|
+
const fromProperties = getValueByPath(fromObject, ['properties']);
|
|
7914
|
+
if (fromProperties != null) {
|
|
7915
|
+
setValueByPath(toObject, ['properties'], fromProperties);
|
|
7916
|
+
}
|
|
7917
|
+
const fromPropertyOrdering = getValueByPath(fromObject, [
|
|
7918
|
+
'propertyOrdering',
|
|
7919
|
+
]);
|
|
7920
|
+
if (fromPropertyOrdering != null) {
|
|
7921
|
+
setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
|
|
7922
|
+
}
|
|
7923
|
+
const fromRequired = getValueByPath(fromObject, ['required']);
|
|
7924
|
+
if (fromRequired != null) {
|
|
7925
|
+
setValueByPath(toObject, ['required'], fromRequired);
|
|
7926
|
+
}
|
|
7927
|
+
const fromTitle = getValueByPath(fromObject, ['title']);
|
|
7928
|
+
if (fromTitle != null) {
|
|
7929
|
+
setValueByPath(toObject, ['title'], fromTitle);
|
|
7930
|
+
}
|
|
7931
|
+
const fromType = getValueByPath(fromObject, ['type']);
|
|
7932
|
+
if (fromType != null) {
|
|
7933
|
+
setValueByPath(toObject, ['type'], fromType);
|
|
7934
|
+
}
|
|
7935
|
+
return toObject;
|
|
7936
|
+
}
|
|
7752
7937
|
function safetySettingToMldev(apiClient, fromObject) {
|
|
7753
7938
|
const toObject = {};
|
|
7754
7939
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
@@ -7915,6 +8100,10 @@ function retrievalConfigToMldev(apiClient, fromObject) {
|
|
|
7915
8100
|
if (fromLatLng != null) {
|
|
7916
8101
|
setValueByPath(toObject, ['latLng'], latLngToMldev(apiClient, fromLatLng));
|
|
7917
8102
|
}
|
|
8103
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
8104
|
+
if (fromLanguageCode != null) {
|
|
8105
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
8106
|
+
}
|
|
7918
8107
|
return toObject;
|
|
7919
8108
|
}
|
|
7920
8109
|
function toolConfigToMldev(apiClient, fromObject) {
|
|
@@ -8087,7 +8276,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8087
8276
|
'responseSchema',
|
|
8088
8277
|
]);
|
|
8089
8278
|
if (fromResponseSchema != null) {
|
|
8090
|
-
setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
|
|
8279
|
+
setValueByPath(toObject, ['responseSchema'], schemaToMldev(apiClient, tSchema(apiClient, fromResponseSchema)));
|
|
8091
8280
|
}
|
|
8092
8281
|
if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
|
|
8093
8282
|
throw new Error('routingConfig parameter is not supported in Gemini API.');
|
|
@@ -8494,6 +8683,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8494
8683
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
8495
8684
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
8496
8685
|
}
|
|
8686
|
+
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8687
|
+
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
8688
|
+
}
|
|
8497
8689
|
return toObject;
|
|
8498
8690
|
}
|
|
8499
8691
|
function generateVideosParametersToMldev(apiClient, fromObject) {
|
|
@@ -8548,6 +8740,22 @@ function blobToVertex(apiClient, fromObject) {
|
|
|
8548
8740
|
}
|
|
8549
8741
|
return toObject;
|
|
8550
8742
|
}
|
|
8743
|
+
function fileDataToVertex(apiClient, fromObject) {
|
|
8744
|
+
const toObject = {};
|
|
8745
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8746
|
+
if (fromDisplayName != null) {
|
|
8747
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
8748
|
+
}
|
|
8749
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8750
|
+
if (fromFileUri != null) {
|
|
8751
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8752
|
+
}
|
|
8753
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8754
|
+
if (fromMimeType != null) {
|
|
8755
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8756
|
+
}
|
|
8757
|
+
return toObject;
|
|
8758
|
+
}
|
|
8551
8759
|
function partToVertex(apiClient, fromObject) {
|
|
8552
8760
|
const toObject = {};
|
|
8553
8761
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -8564,6 +8772,10 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8564
8772
|
if (fromInlineData != null) {
|
|
8565
8773
|
setValueByPath(toObject, ['inlineData'], blobToVertex(apiClient, fromInlineData));
|
|
8566
8774
|
}
|
|
8775
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8776
|
+
if (fromFileData != null) {
|
|
8777
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
|
|
8778
|
+
}
|
|
8567
8779
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8568
8780
|
'codeExecutionResult',
|
|
8569
8781
|
]);
|
|
@@ -8576,10 +8788,6 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8576
8788
|
if (fromExecutableCode != null) {
|
|
8577
8789
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8578
8790
|
}
|
|
8579
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8580
|
-
if (fromFileData != null) {
|
|
8581
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
8582
|
-
}
|
|
8583
8791
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8584
8792
|
if (fromFunctionCall != null) {
|
|
8585
8793
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -8614,6 +8822,104 @@ function contentToVertex(apiClient, fromObject) {
|
|
|
8614
8822
|
}
|
|
8615
8823
|
return toObject;
|
|
8616
8824
|
}
|
|
8825
|
+
function schemaToVertex(apiClient, fromObject) {
|
|
8826
|
+
const toObject = {};
|
|
8827
|
+
const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
|
|
8828
|
+
if (fromAnyOf != null) {
|
|
8829
|
+
setValueByPath(toObject, ['anyOf'], fromAnyOf);
|
|
8830
|
+
}
|
|
8831
|
+
const fromDefault = getValueByPath(fromObject, ['default']);
|
|
8832
|
+
if (fromDefault != null) {
|
|
8833
|
+
setValueByPath(toObject, ['default'], fromDefault);
|
|
8834
|
+
}
|
|
8835
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8836
|
+
if (fromDescription != null) {
|
|
8837
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
8838
|
+
}
|
|
8839
|
+
const fromEnum = getValueByPath(fromObject, ['enum']);
|
|
8840
|
+
if (fromEnum != null) {
|
|
8841
|
+
setValueByPath(toObject, ['enum'], fromEnum);
|
|
8842
|
+
}
|
|
8843
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
8844
|
+
if (fromExample != null) {
|
|
8845
|
+
setValueByPath(toObject, ['example'], fromExample);
|
|
8846
|
+
}
|
|
8847
|
+
const fromFormat = getValueByPath(fromObject, ['format']);
|
|
8848
|
+
if (fromFormat != null) {
|
|
8849
|
+
setValueByPath(toObject, ['format'], fromFormat);
|
|
8850
|
+
}
|
|
8851
|
+
const fromItems = getValueByPath(fromObject, ['items']);
|
|
8852
|
+
if (fromItems != null) {
|
|
8853
|
+
setValueByPath(toObject, ['items'], fromItems);
|
|
8854
|
+
}
|
|
8855
|
+
const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
|
|
8856
|
+
if (fromMaxItems != null) {
|
|
8857
|
+
setValueByPath(toObject, ['maxItems'], fromMaxItems);
|
|
8858
|
+
}
|
|
8859
|
+
const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
|
|
8860
|
+
if (fromMaxLength != null) {
|
|
8861
|
+
setValueByPath(toObject, ['maxLength'], fromMaxLength);
|
|
8862
|
+
}
|
|
8863
|
+
const fromMaxProperties = getValueByPath(fromObject, [
|
|
8864
|
+
'maxProperties',
|
|
8865
|
+
]);
|
|
8866
|
+
if (fromMaxProperties != null) {
|
|
8867
|
+
setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
|
|
8868
|
+
}
|
|
8869
|
+
const fromMaximum = getValueByPath(fromObject, ['maximum']);
|
|
8870
|
+
if (fromMaximum != null) {
|
|
8871
|
+
setValueByPath(toObject, ['maximum'], fromMaximum);
|
|
8872
|
+
}
|
|
8873
|
+
const fromMinItems = getValueByPath(fromObject, ['minItems']);
|
|
8874
|
+
if (fromMinItems != null) {
|
|
8875
|
+
setValueByPath(toObject, ['minItems'], fromMinItems);
|
|
8876
|
+
}
|
|
8877
|
+
const fromMinLength = getValueByPath(fromObject, ['minLength']);
|
|
8878
|
+
if (fromMinLength != null) {
|
|
8879
|
+
setValueByPath(toObject, ['minLength'], fromMinLength);
|
|
8880
|
+
}
|
|
8881
|
+
const fromMinProperties = getValueByPath(fromObject, [
|
|
8882
|
+
'minProperties',
|
|
8883
|
+
]);
|
|
8884
|
+
if (fromMinProperties != null) {
|
|
8885
|
+
setValueByPath(toObject, ['minProperties'], fromMinProperties);
|
|
8886
|
+
}
|
|
8887
|
+
const fromMinimum = getValueByPath(fromObject, ['minimum']);
|
|
8888
|
+
if (fromMinimum != null) {
|
|
8889
|
+
setValueByPath(toObject, ['minimum'], fromMinimum);
|
|
8890
|
+
}
|
|
8891
|
+
const fromNullable = getValueByPath(fromObject, ['nullable']);
|
|
8892
|
+
if (fromNullable != null) {
|
|
8893
|
+
setValueByPath(toObject, ['nullable'], fromNullable);
|
|
8894
|
+
}
|
|
8895
|
+
const fromPattern = getValueByPath(fromObject, ['pattern']);
|
|
8896
|
+
if (fromPattern != null) {
|
|
8897
|
+
setValueByPath(toObject, ['pattern'], fromPattern);
|
|
8898
|
+
}
|
|
8899
|
+
const fromProperties = getValueByPath(fromObject, ['properties']);
|
|
8900
|
+
if (fromProperties != null) {
|
|
8901
|
+
setValueByPath(toObject, ['properties'], fromProperties);
|
|
8902
|
+
}
|
|
8903
|
+
const fromPropertyOrdering = getValueByPath(fromObject, [
|
|
8904
|
+
'propertyOrdering',
|
|
8905
|
+
]);
|
|
8906
|
+
if (fromPropertyOrdering != null) {
|
|
8907
|
+
setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
|
|
8908
|
+
}
|
|
8909
|
+
const fromRequired = getValueByPath(fromObject, ['required']);
|
|
8910
|
+
if (fromRequired != null) {
|
|
8911
|
+
setValueByPath(toObject, ['required'], fromRequired);
|
|
8912
|
+
}
|
|
8913
|
+
const fromTitle = getValueByPath(fromObject, ['title']);
|
|
8914
|
+
if (fromTitle != null) {
|
|
8915
|
+
setValueByPath(toObject, ['title'], fromTitle);
|
|
8916
|
+
}
|
|
8917
|
+
const fromType = getValueByPath(fromObject, ['type']);
|
|
8918
|
+
if (fromType != null) {
|
|
8919
|
+
setValueByPath(toObject, ['type'], fromType);
|
|
8920
|
+
}
|
|
8921
|
+
return toObject;
|
|
8922
|
+
}
|
|
8617
8923
|
function modelSelectionConfigToVertex(apiClient, fromObject) {
|
|
8618
8924
|
const toObject = {};
|
|
8619
8925
|
const fromFeatureSelectionPreference = getValueByPath(fromObject, [
|
|
@@ -8842,6 +9148,10 @@ function retrievalConfigToVertex(apiClient, fromObject) {
|
|
|
8842
9148
|
if (fromLatLng != null) {
|
|
8843
9149
|
setValueByPath(toObject, ['latLng'], latLngToVertex(apiClient, fromLatLng));
|
|
8844
9150
|
}
|
|
9151
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
9152
|
+
if (fromLanguageCode != null) {
|
|
9153
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
9154
|
+
}
|
|
8845
9155
|
return toObject;
|
|
8846
9156
|
}
|
|
8847
9157
|
function toolConfigToVertex(apiClient, fromObject) {
|
|
@@ -8983,7 +9293,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
8983
9293
|
'responseSchema',
|
|
8984
9294
|
]);
|
|
8985
9295
|
if (fromResponseSchema != null) {
|
|
8986
|
-
setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
|
|
9296
|
+
setValueByPath(toObject, ['responseSchema'], schemaToVertex(apiClient, tSchema(apiClient, fromResponseSchema)));
|
|
8987
9297
|
}
|
|
8988
9298
|
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
8989
9299
|
'routingConfig',
|
|
@@ -9715,6 +10025,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
9715
10025
|
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
9716
10026
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
9717
10027
|
}
|
|
10028
|
+
const fromGenerateAudio = getValueByPath(fromObject, [
|
|
10029
|
+
'generateAudio',
|
|
10030
|
+
]);
|
|
10031
|
+
if (parentObject !== undefined && fromGenerateAudio != null) {
|
|
10032
|
+
setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
|
|
10033
|
+
}
|
|
9718
10034
|
return toObject;
|
|
9719
10035
|
}
|
|
9720
10036
|
function generateVideosParametersToVertex(apiClient, fromObject) {
|
|
@@ -9765,6 +10081,18 @@ function blobFromMldev(apiClient, fromObject) {
|
|
|
9765
10081
|
}
|
|
9766
10082
|
return toObject;
|
|
9767
10083
|
}
|
|
10084
|
+
function fileDataFromMldev(apiClient, fromObject) {
|
|
10085
|
+
const toObject = {};
|
|
10086
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
10087
|
+
if (fromFileUri != null) {
|
|
10088
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
10089
|
+
}
|
|
10090
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
10091
|
+
if (fromMimeType != null) {
|
|
10092
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
10093
|
+
}
|
|
10094
|
+
return toObject;
|
|
10095
|
+
}
|
|
9768
10096
|
function partFromMldev(apiClient, fromObject) {
|
|
9769
10097
|
const toObject = {};
|
|
9770
10098
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -9781,6 +10109,10 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9781
10109
|
if (fromInlineData != null) {
|
|
9782
10110
|
setValueByPath(toObject, ['inlineData'], blobFromMldev(apiClient, fromInlineData));
|
|
9783
10111
|
}
|
|
10112
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10113
|
+
if (fromFileData != null) {
|
|
10114
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
|
|
10115
|
+
}
|
|
9784
10116
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
9785
10117
|
'codeExecutionResult',
|
|
9786
10118
|
]);
|
|
@@ -9793,10 +10125,6 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9793
10125
|
if (fromExecutableCode != null) {
|
|
9794
10126
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
9795
10127
|
}
|
|
9796
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
9797
|
-
if (fromFileData != null) {
|
|
9798
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
9799
|
-
}
|
|
9800
10128
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
9801
10129
|
if (fromFunctionCall != null) {
|
|
9802
10130
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -10267,6 +10595,22 @@ function blobFromVertex(apiClient, fromObject) {
|
|
|
10267
10595
|
}
|
|
10268
10596
|
return toObject;
|
|
10269
10597
|
}
|
|
10598
|
+
function fileDataFromVertex(apiClient, fromObject) {
|
|
10599
|
+
const toObject = {};
|
|
10600
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
10601
|
+
if (fromDisplayName != null) {
|
|
10602
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
10603
|
+
}
|
|
10604
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
10605
|
+
if (fromFileUri != null) {
|
|
10606
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
10607
|
+
}
|
|
10608
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
10609
|
+
if (fromMimeType != null) {
|
|
10610
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
10611
|
+
}
|
|
10612
|
+
return toObject;
|
|
10613
|
+
}
|
|
10270
10614
|
function partFromVertex(apiClient, fromObject) {
|
|
10271
10615
|
const toObject = {};
|
|
10272
10616
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -10283,6 +10627,10 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10283
10627
|
if (fromInlineData != null) {
|
|
10284
10628
|
setValueByPath(toObject, ['inlineData'], blobFromVertex(apiClient, fromInlineData));
|
|
10285
10629
|
}
|
|
10630
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10631
|
+
if (fromFileData != null) {
|
|
10632
|
+
setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
|
|
10633
|
+
}
|
|
10286
10634
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
10287
10635
|
'codeExecutionResult',
|
|
10288
10636
|
]);
|
|
@@ -10295,10 +10643,6 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10295
10643
|
if (fromExecutableCode != null) {
|
|
10296
10644
|
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
10297
10645
|
}
|
|
10298
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
10299
|
-
if (fromFileData != null) {
|
|
10300
|
-
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
10301
|
-
}
|
|
10302
10646
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
10303
10647
|
if (fromFunctionCall != null) {
|
|
10304
10648
|
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
@@ -10843,9 +11187,6 @@ function hasMcpToolUsage(tools) {
|
|
|
10843
11187
|
function setMcpUsageHeader(headers) {
|
|
10844
11188
|
var _a;
|
|
10845
11189
|
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
10846
|
-
if (existingHeader.includes(MCP_LABEL)) {
|
|
10847
|
-
return;
|
|
10848
|
-
}
|
|
10849
11190
|
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
10850
11191
|
}
|
|
10851
11192
|
// Checks whether the list of tools contains any MCP clients. Will return true
|
|
@@ -13622,6 +13963,12 @@ function tuningJobFromMldev(apiClient, fromObject) {
|
|
|
13622
13963
|
if (fromPipelineJob != null) {
|
|
13623
13964
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
13624
13965
|
}
|
|
13966
|
+
const fromServiceAccount = getValueByPath(fromObject, [
|
|
13967
|
+
'serviceAccount',
|
|
13968
|
+
]);
|
|
13969
|
+
if (fromServiceAccount != null) {
|
|
13970
|
+
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
13971
|
+
}
|
|
13625
13972
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
13626
13973
|
'tunedModelDisplayName',
|
|
13627
13974
|
]);
|
|
@@ -13796,6 +14143,12 @@ function tuningJobFromVertex(apiClient, fromObject) {
|
|
|
13796
14143
|
if (fromPipelineJob != null) {
|
|
13797
14144
|
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
13798
14145
|
}
|
|
14146
|
+
const fromServiceAccount = getValueByPath(fromObject, [
|
|
14147
|
+
'serviceAccount',
|
|
14148
|
+
]);
|
|
14149
|
+
if (fromServiceAccount != null) {
|
|
14150
|
+
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
14151
|
+
}
|
|
13799
14152
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
13800
14153
|
'tunedModelDisplayName',
|
|
13801
14154
|
]);
|
|
@@ -14156,5 +14509,5 @@ class GoogleGenAI {
|
|
|
14156
14509
|
}
|
|
14157
14510
|
}
|
|
14158
14511
|
|
|
14159
|
-
export { ActivityHandling, AdapterSize, AuthType, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, JobState, Language, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models,
|
|
14512
|
+
export { ActivityHandling, AdapterSize, AuthType, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, JobState, Language, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
14160
14513
|
//# sourceMappingURL=index.mjs.map
|