@google/genai 1.1.0 → 1.3.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 +1 -1
- package/dist/genai.d.ts +144 -46
- package/dist/index.cjs +1066 -184
- package/dist/index.mjs +1066 -185
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1050 -172
- package/dist/node/index.mjs +1050 -173
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +144 -46
- package/dist/web/index.mjs +1066 -185
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +144 -46
- package/package.json +1 -1
package/dist/web/index.mjs
CHANGED
|
@@ -192,7 +192,6 @@ function getValueByPath(data, keys) {
|
|
|
192
192
|
* Copyright 2025 Google LLC
|
|
193
193
|
* SPDX-License-Identifier: Apache-2.0
|
|
194
194
|
*/
|
|
195
|
-
// Code generated by the Google Gen AI SDK generator DO NOT EDIT.
|
|
196
195
|
/** Required. Outcome of the code execution. */
|
|
197
196
|
var Outcome;
|
|
198
197
|
(function (Outcome) {
|
|
@@ -428,6 +427,10 @@ var FinishReason;
|
|
|
428
427
|
* Token generation stopped because generated images have safety violations.
|
|
429
428
|
*/
|
|
430
429
|
FinishReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
|
|
430
|
+
/**
|
|
431
|
+
* The tool call generated by the model is invalid.
|
|
432
|
+
*/
|
|
433
|
+
FinishReason["UNEXPECTED_TOOL_CALL"] = "UNEXPECTED_TOOL_CALL";
|
|
431
434
|
})(FinishReason || (FinishReason = {}));
|
|
432
435
|
/** Output only. Harm probability levels in the content. */
|
|
433
436
|
var HarmProbability;
|
|
@@ -533,7 +536,7 @@ var Modality;
|
|
|
533
536
|
*/
|
|
534
537
|
Modality["IMAGE"] = "IMAGE";
|
|
535
538
|
/**
|
|
536
|
-
* Indicates the model should return
|
|
539
|
+
* Indicates the model should return audio.
|
|
537
540
|
*/
|
|
538
541
|
Modality["AUDIO"] = "AUDIO";
|
|
539
542
|
})(Modality || (Modality = {}));
|
|
@@ -957,24 +960,6 @@ var Scale;
|
|
|
957
960
|
*/
|
|
958
961
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
959
962
|
})(Scale || (Scale = {}));
|
|
960
|
-
/** The mode of music generation. */
|
|
961
|
-
var MusicGenerationMode;
|
|
962
|
-
(function (MusicGenerationMode) {
|
|
963
|
-
/**
|
|
964
|
-
* This value is unused.
|
|
965
|
-
*/
|
|
966
|
-
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
967
|
-
/**
|
|
968
|
-
* Steer text prompts to regions of latent space with higher quality
|
|
969
|
-
music.
|
|
970
|
-
*/
|
|
971
|
-
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
972
|
-
/**
|
|
973
|
-
* Steer text prompts to regions of latent space with a larger diversity
|
|
974
|
-
of music.
|
|
975
|
-
*/
|
|
976
|
-
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
977
|
-
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
978
963
|
/** The playback control signal to apply to the music generation. */
|
|
979
964
|
var LiveMusicPlaybackControl;
|
|
980
965
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -1439,7 +1424,6 @@ class ReplayResponse {
|
|
|
1439
1424
|
*/
|
|
1440
1425
|
class RawReferenceImage {
|
|
1441
1426
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1442
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1443
1427
|
toReferenceImageAPI() {
|
|
1444
1428
|
const referenceImageAPI = {
|
|
1445
1429
|
referenceType: 'REFERENCE_TYPE_RAW',
|
|
@@ -1461,7 +1445,6 @@ class RawReferenceImage {
|
|
|
1461
1445
|
*/
|
|
1462
1446
|
class MaskReferenceImage {
|
|
1463
1447
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1464
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1465
1448
|
toReferenceImageAPI() {
|
|
1466
1449
|
const referenceImageAPI = {
|
|
1467
1450
|
referenceType: 'REFERENCE_TYPE_MASK',
|
|
@@ -1484,7 +1467,6 @@ class MaskReferenceImage {
|
|
|
1484
1467
|
*/
|
|
1485
1468
|
class ControlReferenceImage {
|
|
1486
1469
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1487
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1488
1470
|
toReferenceImageAPI() {
|
|
1489
1471
|
const referenceImageAPI = {
|
|
1490
1472
|
referenceType: 'REFERENCE_TYPE_CONTROL',
|
|
@@ -1505,7 +1487,6 @@ class ControlReferenceImage {
|
|
|
1505
1487
|
*/
|
|
1506
1488
|
class StyleReferenceImage {
|
|
1507
1489
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1508
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1509
1490
|
toReferenceImageAPI() {
|
|
1510
1491
|
const referenceImageAPI = {
|
|
1511
1492
|
referenceType: 'REFERENCE_TYPE_STYLE',
|
|
@@ -1526,7 +1507,6 @@ class StyleReferenceImage {
|
|
|
1526
1507
|
*/
|
|
1527
1508
|
class SubjectReferenceImage {
|
|
1528
1509
|
/* Internal method to convert to ReferenceImageAPIInternal. */
|
|
1529
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1530
1510
|
toReferenceImageAPI() {
|
|
1531
1511
|
const referenceImageAPI = {
|
|
1532
1512
|
referenceType: 'REFERENCE_TYPE_SUBJECT',
|
|
@@ -2441,7 +2421,7 @@ function filterToJsonSchema(schema) {
|
|
|
2441
2421
|
* Copyright 2025 Google LLC
|
|
2442
2422
|
* SPDX-License-Identifier: Apache-2.0
|
|
2443
2423
|
*/
|
|
2444
|
-
function videoMetadataToMldev$
|
|
2424
|
+
function videoMetadataToMldev$3(apiClient, fromObject) {
|
|
2445
2425
|
const toObject = {};
|
|
2446
2426
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
2447
2427
|
if (fromFps != null) {
|
|
@@ -2457,7 +2437,7 @@ function videoMetadataToMldev$2(apiClient, fromObject) {
|
|
|
2457
2437
|
}
|
|
2458
2438
|
return toObject;
|
|
2459
2439
|
}
|
|
2460
|
-
function blobToMldev$
|
|
2440
|
+
function blobToMldev$3(apiClient, fromObject) {
|
|
2461
2441
|
const toObject = {};
|
|
2462
2442
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2463
2443
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -2472,7 +2452,7 @@ function blobToMldev$2(apiClient, fromObject) {
|
|
|
2472
2452
|
}
|
|
2473
2453
|
return toObject;
|
|
2474
2454
|
}
|
|
2475
|
-
function fileDataToMldev$
|
|
2455
|
+
function fileDataToMldev$3(apiClient, fromObject) {
|
|
2476
2456
|
const toObject = {};
|
|
2477
2457
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2478
2458
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -2487,13 +2467,13 @@ function fileDataToMldev$2(apiClient, fromObject) {
|
|
|
2487
2467
|
}
|
|
2488
2468
|
return toObject;
|
|
2489
2469
|
}
|
|
2490
|
-
function partToMldev$
|
|
2470
|
+
function partToMldev$3(apiClient, fromObject) {
|
|
2491
2471
|
const toObject = {};
|
|
2492
2472
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
2493
2473
|
'videoMetadata',
|
|
2494
2474
|
]);
|
|
2495
2475
|
if (fromVideoMetadata != null) {
|
|
2496
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$
|
|
2476
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$3(apiClient, fromVideoMetadata));
|
|
2497
2477
|
}
|
|
2498
2478
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
2499
2479
|
if (fromThought != null) {
|
|
@@ -2501,11 +2481,17 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2501
2481
|
}
|
|
2502
2482
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
2503
2483
|
if (fromInlineData != null) {
|
|
2504
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev$
|
|
2484
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$3(apiClient, fromInlineData));
|
|
2505
2485
|
}
|
|
2506
2486
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2507
2487
|
if (fromFileData != null) {
|
|
2508
|
-
setValueByPath(toObject, ['fileData'], fileDataToMldev$
|
|
2488
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$3(apiClient, fromFileData));
|
|
2489
|
+
}
|
|
2490
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
2491
|
+
'thoughtSignature',
|
|
2492
|
+
]);
|
|
2493
|
+
if (fromThoughtSignature != null) {
|
|
2494
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
2509
2495
|
}
|
|
2510
2496
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2511
2497
|
'codeExecutionResult',
|
|
@@ -2535,14 +2521,14 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2535
2521
|
}
|
|
2536
2522
|
return toObject;
|
|
2537
2523
|
}
|
|
2538
|
-
function contentToMldev$
|
|
2524
|
+
function contentToMldev$3(apiClient, fromObject) {
|
|
2539
2525
|
const toObject = {};
|
|
2540
2526
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
2541
2527
|
if (fromParts != null) {
|
|
2542
2528
|
let transformedList = fromParts;
|
|
2543
2529
|
if (Array.isArray(transformedList)) {
|
|
2544
2530
|
transformedList = transformedList.map((item) => {
|
|
2545
|
-
return partToMldev$
|
|
2531
|
+
return partToMldev$3(apiClient, item);
|
|
2546
2532
|
});
|
|
2547
2533
|
}
|
|
2548
2534
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -2553,7 +2539,7 @@ function contentToMldev$2(apiClient, fromObject) {
|
|
|
2553
2539
|
}
|
|
2554
2540
|
return toObject;
|
|
2555
2541
|
}
|
|
2556
|
-
function functionDeclarationToMldev$
|
|
2542
|
+
function functionDeclarationToMldev$3(apiClient, fromObject) {
|
|
2557
2543
|
const toObject = {};
|
|
2558
2544
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
2559
2545
|
if (fromBehavior != null) {
|
|
@@ -2577,7 +2563,7 @@ function functionDeclarationToMldev$2(apiClient, fromObject) {
|
|
|
2577
2563
|
}
|
|
2578
2564
|
return toObject;
|
|
2579
2565
|
}
|
|
2580
|
-
function intervalToMldev$
|
|
2566
|
+
function intervalToMldev$3(apiClient, fromObject) {
|
|
2581
2567
|
const toObject = {};
|
|
2582
2568
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
2583
2569
|
if (fromStartTime != null) {
|
|
@@ -2589,17 +2575,17 @@ function intervalToMldev$2(apiClient, fromObject) {
|
|
|
2589
2575
|
}
|
|
2590
2576
|
return toObject;
|
|
2591
2577
|
}
|
|
2592
|
-
function googleSearchToMldev$
|
|
2578
|
+
function googleSearchToMldev$3(apiClient, fromObject) {
|
|
2593
2579
|
const toObject = {};
|
|
2594
2580
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
2595
2581
|
'timeRangeFilter',
|
|
2596
2582
|
]);
|
|
2597
2583
|
if (fromTimeRangeFilter != null) {
|
|
2598
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$
|
|
2584
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(apiClient, fromTimeRangeFilter));
|
|
2599
2585
|
}
|
|
2600
2586
|
return toObject;
|
|
2601
2587
|
}
|
|
2602
|
-
function dynamicRetrievalConfigToMldev$
|
|
2588
|
+
function dynamicRetrievalConfigToMldev$3(apiClient, fromObject) {
|
|
2603
2589
|
const toObject = {};
|
|
2604
2590
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
2605
2591
|
if (fromMode != null) {
|
|
@@ -2613,21 +2599,21 @@ function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
|
|
|
2613
2599
|
}
|
|
2614
2600
|
return toObject;
|
|
2615
2601
|
}
|
|
2616
|
-
function googleSearchRetrievalToMldev$
|
|
2602
|
+
function googleSearchRetrievalToMldev$3(apiClient, fromObject) {
|
|
2617
2603
|
const toObject = {};
|
|
2618
2604
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
2619
2605
|
'dynamicRetrievalConfig',
|
|
2620
2606
|
]);
|
|
2621
2607
|
if (fromDynamicRetrievalConfig != null) {
|
|
2622
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$
|
|
2608
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$3(apiClient, fromDynamicRetrievalConfig));
|
|
2623
2609
|
}
|
|
2624
2610
|
return toObject;
|
|
2625
2611
|
}
|
|
2626
|
-
function urlContextToMldev$
|
|
2612
|
+
function urlContextToMldev$3() {
|
|
2627
2613
|
const toObject = {};
|
|
2628
2614
|
return toObject;
|
|
2629
2615
|
}
|
|
2630
|
-
function toolToMldev$
|
|
2616
|
+
function toolToMldev$3(apiClient, fromObject) {
|
|
2631
2617
|
const toObject = {};
|
|
2632
2618
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
2633
2619
|
'functionDeclarations',
|
|
@@ -2636,7 +2622,7 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2636
2622
|
let transformedList = fromFunctionDeclarations;
|
|
2637
2623
|
if (Array.isArray(transformedList)) {
|
|
2638
2624
|
transformedList = transformedList.map((item) => {
|
|
2639
|
-
return functionDeclarationToMldev$
|
|
2625
|
+
return functionDeclarationToMldev$3(apiClient, item);
|
|
2640
2626
|
});
|
|
2641
2627
|
}
|
|
2642
2628
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -2646,13 +2632,13 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2646
2632
|
}
|
|
2647
2633
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
2648
2634
|
if (fromGoogleSearch != null) {
|
|
2649
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$
|
|
2635
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(apiClient, fromGoogleSearch));
|
|
2650
2636
|
}
|
|
2651
2637
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
2652
2638
|
'googleSearchRetrieval',
|
|
2653
2639
|
]);
|
|
2654
2640
|
if (fromGoogleSearchRetrieval != null) {
|
|
2655
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$
|
|
2641
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$3(apiClient, fromGoogleSearchRetrieval));
|
|
2656
2642
|
}
|
|
2657
2643
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
2658
2644
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -2662,7 +2648,7 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2662
2648
|
}
|
|
2663
2649
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
2664
2650
|
if (fromUrlContext != null) {
|
|
2665
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev$
|
|
2651
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
|
|
2666
2652
|
}
|
|
2667
2653
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
2668
2654
|
'codeExecution',
|
|
@@ -2745,7 +2731,7 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
2745
2731
|
let transformedList = tContents(apiClient, fromContents);
|
|
2746
2732
|
if (Array.isArray(transformedList)) {
|
|
2747
2733
|
transformedList = transformedList.map((item) => {
|
|
2748
|
-
return contentToMldev$
|
|
2734
|
+
return contentToMldev$3(apiClient, item);
|
|
2749
2735
|
});
|
|
2750
2736
|
}
|
|
2751
2737
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -2754,14 +2740,14 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
2754
2740
|
'systemInstruction',
|
|
2755
2741
|
]);
|
|
2756
2742
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
2757
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$
|
|
2743
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$3(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
2758
2744
|
}
|
|
2759
2745
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
2760
2746
|
if (parentObject !== undefined && fromTools != null) {
|
|
2761
2747
|
let transformedList = fromTools;
|
|
2762
2748
|
if (Array.isArray(transformedList)) {
|
|
2763
2749
|
transformedList = transformedList.map((item) => {
|
|
2764
|
-
return toolToMldev$
|
|
2750
|
+
return toolToMldev$3(apiClient, item);
|
|
2765
2751
|
});
|
|
2766
2752
|
}
|
|
2767
2753
|
setValueByPath(parentObject, ['tools'], transformedList);
|
|
@@ -2923,6 +2909,12 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2923
2909
|
if (fromFileData != null) {
|
|
2924
2910
|
setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
|
|
2925
2911
|
}
|
|
2912
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
2913
|
+
'thoughtSignature',
|
|
2914
|
+
]);
|
|
2915
|
+
if (fromThoughtSignature != null) {
|
|
2916
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
2917
|
+
}
|
|
2926
2918
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2927
2919
|
'codeExecutionResult',
|
|
2928
2920
|
]);
|
|
@@ -4901,7 +4893,7 @@ class Files extends BaseModule {
|
|
|
4901
4893
|
* Copyright 2025 Google LLC
|
|
4902
4894
|
* SPDX-License-Identifier: Apache-2.0
|
|
4903
4895
|
*/
|
|
4904
|
-
function prebuiltVoiceConfigToMldev$
|
|
4896
|
+
function prebuiltVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4905
4897
|
const toObject = {};
|
|
4906
4898
|
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
4907
4899
|
if (fromVoiceName != null) {
|
|
@@ -4917,13 +4909,13 @@ function prebuiltVoiceConfigToVertex$1(apiClient, fromObject) {
|
|
|
4917
4909
|
}
|
|
4918
4910
|
return toObject;
|
|
4919
4911
|
}
|
|
4920
|
-
function voiceConfigToMldev$
|
|
4912
|
+
function voiceConfigToMldev$2(apiClient, fromObject) {
|
|
4921
4913
|
const toObject = {};
|
|
4922
4914
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
4923
4915
|
'prebuiltVoiceConfig',
|
|
4924
4916
|
]);
|
|
4925
4917
|
if (fromPrebuiltVoiceConfig != null) {
|
|
4926
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$
|
|
4918
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$2(apiClient, fromPrebuiltVoiceConfig));
|
|
4927
4919
|
}
|
|
4928
4920
|
return toObject;
|
|
4929
4921
|
}
|
|
@@ -4937,7 +4929,7 @@ function voiceConfigToVertex$1(apiClient, fromObject) {
|
|
|
4937
4929
|
}
|
|
4938
4930
|
return toObject;
|
|
4939
4931
|
}
|
|
4940
|
-
function speakerVoiceConfigToMldev$
|
|
4932
|
+
function speakerVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4941
4933
|
const toObject = {};
|
|
4942
4934
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
4943
4935
|
if (fromSpeaker != null) {
|
|
@@ -4945,11 +4937,11 @@ function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
|
4945
4937
|
}
|
|
4946
4938
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
4947
4939
|
if (fromVoiceConfig != null) {
|
|
4948
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$
|
|
4940
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
|
|
4949
4941
|
}
|
|
4950
4942
|
return toObject;
|
|
4951
4943
|
}
|
|
4952
|
-
function multiSpeakerVoiceConfigToMldev$
|
|
4944
|
+
function multiSpeakerVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4953
4945
|
const toObject = {};
|
|
4954
4946
|
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
4955
4947
|
'speakerVoiceConfigs',
|
|
@@ -4958,24 +4950,24 @@ function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
|
4958
4950
|
let transformedList = fromSpeakerVoiceConfigs;
|
|
4959
4951
|
if (Array.isArray(transformedList)) {
|
|
4960
4952
|
transformedList = transformedList.map((item) => {
|
|
4961
|
-
return speakerVoiceConfigToMldev$
|
|
4953
|
+
return speakerVoiceConfigToMldev$2(apiClient, item);
|
|
4962
4954
|
});
|
|
4963
4955
|
}
|
|
4964
4956
|
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
4965
4957
|
}
|
|
4966
4958
|
return toObject;
|
|
4967
4959
|
}
|
|
4968
|
-
function speechConfigToMldev$
|
|
4960
|
+
function speechConfigToMldev$2(apiClient, fromObject) {
|
|
4969
4961
|
const toObject = {};
|
|
4970
4962
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
4971
4963
|
if (fromVoiceConfig != null) {
|
|
4972
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$
|
|
4964
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
|
|
4973
4965
|
}
|
|
4974
4966
|
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
4975
4967
|
'multiSpeakerVoiceConfig',
|
|
4976
4968
|
]);
|
|
4977
4969
|
if (fromMultiSpeakerVoiceConfig != null) {
|
|
4978
|
-
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$
|
|
4970
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$2(apiClient, fromMultiSpeakerVoiceConfig));
|
|
4979
4971
|
}
|
|
4980
4972
|
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
4981
4973
|
if (fromLanguageCode != null) {
|
|
@@ -4998,7 +4990,7 @@ function speechConfigToVertex$1(apiClient, fromObject) {
|
|
|
4998
4990
|
}
|
|
4999
4991
|
return toObject;
|
|
5000
4992
|
}
|
|
5001
|
-
function videoMetadataToMldev$
|
|
4993
|
+
function videoMetadataToMldev$2(apiClient, fromObject) {
|
|
5002
4994
|
const toObject = {};
|
|
5003
4995
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
5004
4996
|
if (fromFps != null) {
|
|
@@ -5030,7 +5022,7 @@ function videoMetadataToVertex$1(apiClient, fromObject) {
|
|
|
5030
5022
|
}
|
|
5031
5023
|
return toObject;
|
|
5032
5024
|
}
|
|
5033
|
-
function blobToMldev$
|
|
5025
|
+
function blobToMldev$2(apiClient, fromObject) {
|
|
5034
5026
|
const toObject = {};
|
|
5035
5027
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5036
5028
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -5061,7 +5053,7 @@ function blobToVertex$1(apiClient, fromObject) {
|
|
|
5061
5053
|
}
|
|
5062
5054
|
return toObject;
|
|
5063
5055
|
}
|
|
5064
|
-
function fileDataToMldev$
|
|
5056
|
+
function fileDataToMldev$2(apiClient, fromObject) {
|
|
5065
5057
|
const toObject = {};
|
|
5066
5058
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5067
5059
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -5092,13 +5084,13 @@ function fileDataToVertex$1(apiClient, fromObject) {
|
|
|
5092
5084
|
}
|
|
5093
5085
|
return toObject;
|
|
5094
5086
|
}
|
|
5095
|
-
function partToMldev$
|
|
5087
|
+
function partToMldev$2(apiClient, fromObject) {
|
|
5096
5088
|
const toObject = {};
|
|
5097
5089
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
5098
5090
|
'videoMetadata',
|
|
5099
5091
|
]);
|
|
5100
5092
|
if (fromVideoMetadata != null) {
|
|
5101
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$
|
|
5093
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$2(apiClient, fromVideoMetadata));
|
|
5102
5094
|
}
|
|
5103
5095
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
5104
5096
|
if (fromThought != null) {
|
|
@@ -5106,11 +5098,17 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5106
5098
|
}
|
|
5107
5099
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
5108
5100
|
if (fromInlineData != null) {
|
|
5109
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev$
|
|
5101
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
|
|
5110
5102
|
}
|
|
5111
5103
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5112
5104
|
if (fromFileData != null) {
|
|
5113
|
-
setValueByPath(toObject, ['fileData'], fileDataToMldev$
|
|
5105
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
|
|
5106
|
+
}
|
|
5107
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
5108
|
+
'thoughtSignature',
|
|
5109
|
+
]);
|
|
5110
|
+
if (fromThoughtSignature != null) {
|
|
5111
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
5114
5112
|
}
|
|
5115
5113
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5116
5114
|
'codeExecutionResult',
|
|
@@ -5160,6 +5158,12 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5160
5158
|
if (fromFileData != null) {
|
|
5161
5159
|
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
|
|
5162
5160
|
}
|
|
5161
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
5162
|
+
'thoughtSignature',
|
|
5163
|
+
]);
|
|
5164
|
+
if (fromThoughtSignature != null) {
|
|
5165
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
5166
|
+
}
|
|
5163
5167
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5164
5168
|
'codeExecutionResult',
|
|
5165
5169
|
]);
|
|
@@ -5188,14 +5192,14 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5188
5192
|
}
|
|
5189
5193
|
return toObject;
|
|
5190
5194
|
}
|
|
5191
|
-
function contentToMldev$
|
|
5195
|
+
function contentToMldev$2(apiClient, fromObject) {
|
|
5192
5196
|
const toObject = {};
|
|
5193
5197
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5194
5198
|
if (fromParts != null) {
|
|
5195
5199
|
let transformedList = fromParts;
|
|
5196
5200
|
if (Array.isArray(transformedList)) {
|
|
5197
5201
|
transformedList = transformedList.map((item) => {
|
|
5198
|
-
return partToMldev$
|
|
5202
|
+
return partToMldev$2(apiClient, item);
|
|
5199
5203
|
});
|
|
5200
5204
|
}
|
|
5201
5205
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -5224,7 +5228,7 @@ function contentToVertex$1(apiClient, fromObject) {
|
|
|
5224
5228
|
}
|
|
5225
5229
|
return toObject;
|
|
5226
5230
|
}
|
|
5227
|
-
function functionDeclarationToMldev$
|
|
5231
|
+
function functionDeclarationToMldev$2(apiClient, fromObject) {
|
|
5228
5232
|
const toObject = {};
|
|
5229
5233
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
5230
5234
|
if (fromBehavior != null) {
|
|
@@ -5271,7 +5275,7 @@ function functionDeclarationToVertex$1(apiClient, fromObject) {
|
|
|
5271
5275
|
}
|
|
5272
5276
|
return toObject;
|
|
5273
5277
|
}
|
|
5274
|
-
function intervalToMldev$
|
|
5278
|
+
function intervalToMldev$2(apiClient, fromObject) {
|
|
5275
5279
|
const toObject = {};
|
|
5276
5280
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
5277
5281
|
if (fromStartTime != null) {
|
|
@@ -5295,13 +5299,13 @@ function intervalToVertex$1(apiClient, fromObject) {
|
|
|
5295
5299
|
}
|
|
5296
5300
|
return toObject;
|
|
5297
5301
|
}
|
|
5298
|
-
function googleSearchToMldev$
|
|
5302
|
+
function googleSearchToMldev$2(apiClient, fromObject) {
|
|
5299
5303
|
const toObject = {};
|
|
5300
5304
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
5301
5305
|
'timeRangeFilter',
|
|
5302
5306
|
]);
|
|
5303
5307
|
if (fromTimeRangeFilter != null) {
|
|
5304
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$
|
|
5308
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(apiClient, fromTimeRangeFilter));
|
|
5305
5309
|
}
|
|
5306
5310
|
return toObject;
|
|
5307
5311
|
}
|
|
@@ -5315,7 +5319,7 @@ function googleSearchToVertex$1(apiClient, fromObject) {
|
|
|
5315
5319
|
}
|
|
5316
5320
|
return toObject;
|
|
5317
5321
|
}
|
|
5318
|
-
function dynamicRetrievalConfigToMldev$
|
|
5322
|
+
function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
|
|
5319
5323
|
const toObject = {};
|
|
5320
5324
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5321
5325
|
if (fromMode != null) {
|
|
@@ -5343,13 +5347,13 @@ function dynamicRetrievalConfigToVertex$1(apiClient, fromObject) {
|
|
|
5343
5347
|
}
|
|
5344
5348
|
return toObject;
|
|
5345
5349
|
}
|
|
5346
|
-
function googleSearchRetrievalToMldev$
|
|
5350
|
+
function googleSearchRetrievalToMldev$2(apiClient, fromObject) {
|
|
5347
5351
|
const toObject = {};
|
|
5348
5352
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
5349
5353
|
'dynamicRetrievalConfig',
|
|
5350
5354
|
]);
|
|
5351
5355
|
if (fromDynamicRetrievalConfig != null) {
|
|
5352
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$
|
|
5356
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$2(apiClient, fromDynamicRetrievalConfig));
|
|
5353
5357
|
}
|
|
5354
5358
|
return toObject;
|
|
5355
5359
|
}
|
|
@@ -5415,11 +5419,11 @@ function googleMapsToVertex$1(apiClient, fromObject) {
|
|
|
5415
5419
|
}
|
|
5416
5420
|
return toObject;
|
|
5417
5421
|
}
|
|
5418
|
-
function urlContextToMldev$
|
|
5422
|
+
function urlContextToMldev$2() {
|
|
5419
5423
|
const toObject = {};
|
|
5420
5424
|
return toObject;
|
|
5421
5425
|
}
|
|
5422
|
-
function toolToMldev$
|
|
5426
|
+
function toolToMldev$2(apiClient, fromObject) {
|
|
5423
5427
|
const toObject = {};
|
|
5424
5428
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5425
5429
|
'functionDeclarations',
|
|
@@ -5428,7 +5432,7 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5428
5432
|
let transformedList = fromFunctionDeclarations;
|
|
5429
5433
|
if (Array.isArray(transformedList)) {
|
|
5430
5434
|
transformedList = transformedList.map((item) => {
|
|
5431
|
-
return functionDeclarationToMldev$
|
|
5435
|
+
return functionDeclarationToMldev$2(apiClient, item);
|
|
5432
5436
|
});
|
|
5433
5437
|
}
|
|
5434
5438
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -5438,13 +5442,13 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5438
5442
|
}
|
|
5439
5443
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5440
5444
|
if (fromGoogleSearch != null) {
|
|
5441
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$
|
|
5445
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(apiClient, fromGoogleSearch));
|
|
5442
5446
|
}
|
|
5443
5447
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5444
5448
|
'googleSearchRetrieval',
|
|
5445
5449
|
]);
|
|
5446
5450
|
if (fromGoogleSearchRetrieval != null) {
|
|
5447
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$
|
|
5451
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$2(apiClient, fromGoogleSearchRetrieval));
|
|
5448
5452
|
}
|
|
5449
5453
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5450
5454
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -5454,7 +5458,7 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5454
5458
|
}
|
|
5455
5459
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5456
5460
|
if (fromUrlContext != null) {
|
|
5457
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev$
|
|
5461
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
|
|
5458
5462
|
}
|
|
5459
5463
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5460
5464
|
'codeExecution',
|
|
@@ -5513,7 +5517,7 @@ function toolToVertex$1(apiClient, fromObject) {
|
|
|
5513
5517
|
}
|
|
5514
5518
|
return toObject;
|
|
5515
5519
|
}
|
|
5516
|
-
function sessionResumptionConfigToMldev(apiClient, fromObject) {
|
|
5520
|
+
function sessionResumptionConfigToMldev$1(apiClient, fromObject) {
|
|
5517
5521
|
const toObject = {};
|
|
5518
5522
|
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
5519
5523
|
if (fromHandle != null) {
|
|
@@ -5536,7 +5540,7 @@ function sessionResumptionConfigToVertex(apiClient, fromObject) {
|
|
|
5536
5540
|
}
|
|
5537
5541
|
return toObject;
|
|
5538
5542
|
}
|
|
5539
|
-
function audioTranscriptionConfigToMldev() {
|
|
5543
|
+
function audioTranscriptionConfigToMldev$1() {
|
|
5540
5544
|
const toObject = {};
|
|
5541
5545
|
return toObject;
|
|
5542
5546
|
}
|
|
@@ -5544,7 +5548,7 @@ function audioTranscriptionConfigToVertex() {
|
|
|
5544
5548
|
const toObject = {};
|
|
5545
5549
|
return toObject;
|
|
5546
5550
|
}
|
|
5547
|
-
function automaticActivityDetectionToMldev(apiClient, fromObject) {
|
|
5551
|
+
function automaticActivityDetectionToMldev$1(apiClient, fromObject) {
|
|
5548
5552
|
const toObject = {};
|
|
5549
5553
|
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
5550
5554
|
if (fromDisabled != null) {
|
|
@@ -5608,13 +5612,13 @@ function automaticActivityDetectionToVertex(apiClient, fromObject) {
|
|
|
5608
5612
|
}
|
|
5609
5613
|
return toObject;
|
|
5610
5614
|
}
|
|
5611
|
-
function realtimeInputConfigToMldev(apiClient, fromObject) {
|
|
5615
|
+
function realtimeInputConfigToMldev$1(apiClient, fromObject) {
|
|
5612
5616
|
const toObject = {};
|
|
5613
5617
|
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
5614
5618
|
'automaticActivityDetection',
|
|
5615
5619
|
]);
|
|
5616
5620
|
if (fromAutomaticActivityDetection != null) {
|
|
5617
|
-
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
|
|
5621
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev$1(apiClient, fromAutomaticActivityDetection));
|
|
5618
5622
|
}
|
|
5619
5623
|
const fromActivityHandling = getValueByPath(fromObject, [
|
|
5620
5624
|
'activityHandling',
|
|
@@ -5648,7 +5652,7 @@ function realtimeInputConfigToVertex(apiClient, fromObject) {
|
|
|
5648
5652
|
}
|
|
5649
5653
|
return toObject;
|
|
5650
5654
|
}
|
|
5651
|
-
function slidingWindowToMldev(apiClient, fromObject) {
|
|
5655
|
+
function slidingWindowToMldev$1(apiClient, fromObject) {
|
|
5652
5656
|
const toObject = {};
|
|
5653
5657
|
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
5654
5658
|
if (fromTargetTokens != null) {
|
|
@@ -5664,7 +5668,7 @@ function slidingWindowToVertex(apiClient, fromObject) {
|
|
|
5664
5668
|
}
|
|
5665
5669
|
return toObject;
|
|
5666
5670
|
}
|
|
5667
|
-
function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
5671
|
+
function contextWindowCompressionConfigToMldev$1(apiClient, fromObject) {
|
|
5668
5672
|
const toObject = {};
|
|
5669
5673
|
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
5670
5674
|
'triggerTokens',
|
|
@@ -5676,7 +5680,7 @@ function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
|
5676
5680
|
'slidingWindow',
|
|
5677
5681
|
]);
|
|
5678
5682
|
if (fromSlidingWindow != null) {
|
|
5679
|
-
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
|
|
5683
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev$1(apiClient, fromSlidingWindow));
|
|
5680
5684
|
}
|
|
5681
5685
|
return toObject;
|
|
5682
5686
|
}
|
|
@@ -5696,7 +5700,7 @@ function contextWindowCompressionConfigToVertex(apiClient, fromObject) {
|
|
|
5696
5700
|
}
|
|
5697
5701
|
return toObject;
|
|
5698
5702
|
}
|
|
5699
|
-
function proactivityConfigToMldev(apiClient, fromObject) {
|
|
5703
|
+
function proactivityConfigToMldev$1(apiClient, fromObject) {
|
|
5700
5704
|
const toObject = {};
|
|
5701
5705
|
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
5702
5706
|
'proactiveAudio',
|
|
@@ -5716,7 +5720,7 @@ function proactivityConfigToVertex(apiClient, fromObject) {
|
|
|
5716
5720
|
}
|
|
5717
5721
|
return toObject;
|
|
5718
5722
|
}
|
|
5719
|
-
function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
5723
|
+
function liveConnectConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
5720
5724
|
const toObject = {};
|
|
5721
5725
|
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
5722
5726
|
'generationConfig',
|
|
@@ -5760,7 +5764,7 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5760
5764
|
}
|
|
5761
5765
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
5762
5766
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
5763
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$
|
|
5767
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$2(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
|
|
5764
5768
|
}
|
|
5765
5769
|
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
5766
5770
|
'enableAffectiveDialog',
|
|
@@ -5772,14 +5776,14 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5772
5776
|
'systemInstruction',
|
|
5773
5777
|
]);
|
|
5774
5778
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
5775
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$
|
|
5779
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$2(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
5776
5780
|
}
|
|
5777
5781
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
5778
5782
|
if (parentObject !== undefined && fromTools != null) {
|
|
5779
5783
|
let transformedList = tTools(apiClient, fromTools);
|
|
5780
5784
|
if (Array.isArray(transformedList)) {
|
|
5781
5785
|
transformedList = transformedList.map((item) => {
|
|
5782
|
-
return toolToMldev$
|
|
5786
|
+
return toolToMldev$2(apiClient, tTool(apiClient, item));
|
|
5783
5787
|
});
|
|
5784
5788
|
}
|
|
5785
5789
|
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
@@ -5788,35 +5792,35 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5788
5792
|
'sessionResumption',
|
|
5789
5793
|
]);
|
|
5790
5794
|
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
5791
|
-
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
|
|
5795
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev$1(apiClient, fromSessionResumption));
|
|
5792
5796
|
}
|
|
5793
5797
|
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
5794
5798
|
'inputAudioTranscription',
|
|
5795
5799
|
]);
|
|
5796
5800
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
5797
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
5801
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1());
|
|
5798
5802
|
}
|
|
5799
5803
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
5800
5804
|
'outputAudioTranscription',
|
|
5801
5805
|
]);
|
|
5802
5806
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
5803
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
5807
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1());
|
|
5804
5808
|
}
|
|
5805
5809
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
5806
5810
|
'realtimeInputConfig',
|
|
5807
5811
|
]);
|
|
5808
5812
|
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
5809
|
-
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
|
|
5813
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev$1(apiClient, fromRealtimeInputConfig));
|
|
5810
5814
|
}
|
|
5811
5815
|
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
5812
5816
|
'contextWindowCompression',
|
|
5813
5817
|
]);
|
|
5814
5818
|
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
5815
|
-
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
|
|
5819
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev$1(apiClient, fromContextWindowCompression));
|
|
5816
5820
|
}
|
|
5817
5821
|
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
5818
5822
|
if (parentObject !== undefined && fromProactivity != null) {
|
|
5819
|
-
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
|
|
5823
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev$1(apiClient, fromProactivity));
|
|
5820
5824
|
}
|
|
5821
5825
|
return toObject;
|
|
5822
5826
|
}
|
|
@@ -5932,7 +5936,7 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
|
5932
5936
|
}
|
|
5933
5937
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
5934
5938
|
if (fromConfig != null) {
|
|
5935
|
-
setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
|
|
5939
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToMldev$1(apiClient, fromConfig, toObject));
|
|
5936
5940
|
}
|
|
5937
5941
|
return toObject;
|
|
5938
5942
|
}
|
|
@@ -6109,12 +6113,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
|
|
|
6109
6113
|
if (fromOnlyBassAndDrums != null) {
|
|
6110
6114
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
6111
6115
|
}
|
|
6112
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
6113
|
-
'musicGenerationMode',
|
|
6114
|
-
]);
|
|
6115
|
-
if (fromMusicGenerationMode != null) {
|
|
6116
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
6117
|
-
}
|
|
6118
6116
|
return toObject;
|
|
6119
6117
|
}
|
|
6120
6118
|
function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
|
|
@@ -6293,6 +6291,12 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6293
6291
|
if (fromFileData != null) {
|
|
6294
6292
|
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
|
|
6295
6293
|
}
|
|
6294
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6295
|
+
'thoughtSignature',
|
|
6296
|
+
]);
|
|
6297
|
+
if (fromThoughtSignature != null) {
|
|
6298
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6299
|
+
}
|
|
6296
6300
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6297
6301
|
'codeExecutionResult',
|
|
6298
6302
|
]);
|
|
@@ -6341,6 +6345,12 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6341
6345
|
if (fromFileData != null) {
|
|
6342
6346
|
setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
|
|
6343
6347
|
}
|
|
6348
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6349
|
+
'thoughtSignature',
|
|
6350
|
+
]);
|
|
6351
|
+
if (fromThoughtSignature != null) {
|
|
6352
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6353
|
+
}
|
|
6344
6354
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6345
6355
|
'codeExecutionResult',
|
|
6346
6356
|
]);
|
|
@@ -7039,12 +7049,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
|
|
|
7039
7049
|
if (fromOnlyBassAndDrums != null) {
|
|
7040
7050
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7041
7051
|
}
|
|
7042
|
-
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7043
|
-
'musicGenerationMode',
|
|
7044
|
-
]);
|
|
7045
|
-
if (fromMusicGenerationMode != null) {
|
|
7046
|
-
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7047
|
-
}
|
|
7048
7052
|
return toObject;
|
|
7049
7053
|
}
|
|
7050
7054
|
function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
|
|
@@ -7137,7 +7141,7 @@ function liveMusicServerMessageFromMldev(apiClient, fromObject) {
|
|
|
7137
7141
|
* Copyright 2025 Google LLC
|
|
7138
7142
|
* SPDX-License-Identifier: Apache-2.0
|
|
7139
7143
|
*/
|
|
7140
|
-
function videoMetadataToMldev(apiClient, fromObject) {
|
|
7144
|
+
function videoMetadataToMldev$1(apiClient, fromObject) {
|
|
7141
7145
|
const toObject = {};
|
|
7142
7146
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
7143
7147
|
if (fromFps != null) {
|
|
@@ -7153,7 +7157,7 @@ function videoMetadataToMldev(apiClient, fromObject) {
|
|
|
7153
7157
|
}
|
|
7154
7158
|
return toObject;
|
|
7155
7159
|
}
|
|
7156
|
-
function blobToMldev(apiClient, fromObject) {
|
|
7160
|
+
function blobToMldev$1(apiClient, fromObject) {
|
|
7157
7161
|
const toObject = {};
|
|
7158
7162
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7159
7163
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -7168,7 +7172,7 @@ function blobToMldev(apiClient, fromObject) {
|
|
|
7168
7172
|
}
|
|
7169
7173
|
return toObject;
|
|
7170
7174
|
}
|
|
7171
|
-
function fileDataToMldev(apiClient, fromObject) {
|
|
7175
|
+
function fileDataToMldev$1(apiClient, fromObject) {
|
|
7172
7176
|
const toObject = {};
|
|
7173
7177
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7174
7178
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -7183,13 +7187,13 @@ function fileDataToMldev(apiClient, fromObject) {
|
|
|
7183
7187
|
}
|
|
7184
7188
|
return toObject;
|
|
7185
7189
|
}
|
|
7186
|
-
function partToMldev(apiClient, fromObject) {
|
|
7190
|
+
function partToMldev$1(apiClient, fromObject) {
|
|
7187
7191
|
const toObject = {};
|
|
7188
7192
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
7189
7193
|
'videoMetadata',
|
|
7190
7194
|
]);
|
|
7191
7195
|
if (fromVideoMetadata != null) {
|
|
7192
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
|
|
7196
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$1(apiClient, fromVideoMetadata));
|
|
7193
7197
|
}
|
|
7194
7198
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
7195
7199
|
if (fromThought != null) {
|
|
@@ -7197,11 +7201,17 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7197
7201
|
}
|
|
7198
7202
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
7199
7203
|
if (fromInlineData != null) {
|
|
7200
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
7204
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
|
|
7201
7205
|
}
|
|
7202
7206
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7203
7207
|
if (fromFileData != null) {
|
|
7204
|
-
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
7208
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
|
|
7209
|
+
}
|
|
7210
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
7211
|
+
'thoughtSignature',
|
|
7212
|
+
]);
|
|
7213
|
+
if (fromThoughtSignature != null) {
|
|
7214
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
7205
7215
|
}
|
|
7206
7216
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7207
7217
|
'codeExecutionResult',
|
|
@@ -7231,14 +7241,14 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7231
7241
|
}
|
|
7232
7242
|
return toObject;
|
|
7233
7243
|
}
|
|
7234
|
-
function contentToMldev(apiClient, fromObject) {
|
|
7244
|
+
function contentToMldev$1(apiClient, fromObject) {
|
|
7235
7245
|
const toObject = {};
|
|
7236
7246
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7237
7247
|
if (fromParts != null) {
|
|
7238
7248
|
let transformedList = fromParts;
|
|
7239
7249
|
if (Array.isArray(transformedList)) {
|
|
7240
7250
|
transformedList = transformedList.map((item) => {
|
|
7241
|
-
return partToMldev(apiClient, item);
|
|
7251
|
+
return partToMldev$1(apiClient, item);
|
|
7242
7252
|
});
|
|
7243
7253
|
}
|
|
7244
7254
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -7362,7 +7372,7 @@ function safetySettingToMldev(apiClient, fromObject) {
|
|
|
7362
7372
|
}
|
|
7363
7373
|
return toObject;
|
|
7364
7374
|
}
|
|
7365
|
-
function functionDeclarationToMldev(apiClient, fromObject) {
|
|
7375
|
+
function functionDeclarationToMldev$1(apiClient, fromObject) {
|
|
7366
7376
|
const toObject = {};
|
|
7367
7377
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
7368
7378
|
if (fromBehavior != null) {
|
|
@@ -7386,7 +7396,7 @@ function functionDeclarationToMldev(apiClient, fromObject) {
|
|
|
7386
7396
|
}
|
|
7387
7397
|
return toObject;
|
|
7388
7398
|
}
|
|
7389
|
-
function intervalToMldev(apiClient, fromObject) {
|
|
7399
|
+
function intervalToMldev$1(apiClient, fromObject) {
|
|
7390
7400
|
const toObject = {};
|
|
7391
7401
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7392
7402
|
if (fromStartTime != null) {
|
|
@@ -7398,17 +7408,17 @@ function intervalToMldev(apiClient, fromObject) {
|
|
|
7398
7408
|
}
|
|
7399
7409
|
return toObject;
|
|
7400
7410
|
}
|
|
7401
|
-
function googleSearchToMldev(apiClient, fromObject) {
|
|
7411
|
+
function googleSearchToMldev$1(apiClient, fromObject) {
|
|
7402
7412
|
const toObject = {};
|
|
7403
7413
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7404
7414
|
'timeRangeFilter',
|
|
7405
7415
|
]);
|
|
7406
7416
|
if (fromTimeRangeFilter != null) {
|
|
7407
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
|
|
7417
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(apiClient, fromTimeRangeFilter));
|
|
7408
7418
|
}
|
|
7409
7419
|
return toObject;
|
|
7410
7420
|
}
|
|
7411
|
-
function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
7421
|
+
function dynamicRetrievalConfigToMldev$1(apiClient, fromObject) {
|
|
7412
7422
|
const toObject = {};
|
|
7413
7423
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7414
7424
|
if (fromMode != null) {
|
|
@@ -7422,21 +7432,21 @@ function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
|
7422
7432
|
}
|
|
7423
7433
|
return toObject;
|
|
7424
7434
|
}
|
|
7425
|
-
function googleSearchRetrievalToMldev(apiClient, fromObject) {
|
|
7435
|
+
function googleSearchRetrievalToMldev$1(apiClient, fromObject) {
|
|
7426
7436
|
const toObject = {};
|
|
7427
7437
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7428
7438
|
'dynamicRetrievalConfig',
|
|
7429
7439
|
]);
|
|
7430
7440
|
if (fromDynamicRetrievalConfig != null) {
|
|
7431
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
|
|
7441
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$1(apiClient, fromDynamicRetrievalConfig));
|
|
7432
7442
|
}
|
|
7433
7443
|
return toObject;
|
|
7434
7444
|
}
|
|
7435
|
-
function urlContextToMldev() {
|
|
7445
|
+
function urlContextToMldev$1() {
|
|
7436
7446
|
const toObject = {};
|
|
7437
7447
|
return toObject;
|
|
7438
7448
|
}
|
|
7439
|
-
function toolToMldev(apiClient, fromObject) {
|
|
7449
|
+
function toolToMldev$1(apiClient, fromObject) {
|
|
7440
7450
|
const toObject = {};
|
|
7441
7451
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7442
7452
|
'functionDeclarations',
|
|
@@ -7445,7 +7455,7 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7445
7455
|
let transformedList = fromFunctionDeclarations;
|
|
7446
7456
|
if (Array.isArray(transformedList)) {
|
|
7447
7457
|
transformedList = transformedList.map((item) => {
|
|
7448
|
-
return functionDeclarationToMldev(apiClient, item);
|
|
7458
|
+
return functionDeclarationToMldev$1(apiClient, item);
|
|
7449
7459
|
});
|
|
7450
7460
|
}
|
|
7451
7461
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -7455,13 +7465,13 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7455
7465
|
}
|
|
7456
7466
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7457
7467
|
if (fromGoogleSearch != null) {
|
|
7458
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
|
|
7468
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(apiClient, fromGoogleSearch));
|
|
7459
7469
|
}
|
|
7460
7470
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7461
7471
|
'googleSearchRetrieval',
|
|
7462
7472
|
]);
|
|
7463
7473
|
if (fromGoogleSearchRetrieval != null) {
|
|
7464
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
|
|
7474
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$1(apiClient, fromGoogleSearchRetrieval));
|
|
7465
7475
|
}
|
|
7466
7476
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7467
7477
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -7471,7 +7481,7 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7471
7481
|
}
|
|
7472
7482
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7473
7483
|
if (fromUrlContext != null) {
|
|
7474
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev());
|
|
7484
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
|
|
7475
7485
|
}
|
|
7476
7486
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7477
7487
|
'codeExecution',
|
|
@@ -7535,7 +7545,7 @@ function toolConfigToMldev(apiClient, fromObject) {
|
|
|
7535
7545
|
}
|
|
7536
7546
|
return toObject;
|
|
7537
7547
|
}
|
|
7538
|
-
function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
7548
|
+
function prebuiltVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7539
7549
|
const toObject = {};
|
|
7540
7550
|
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
7541
7551
|
if (fromVoiceName != null) {
|
|
@@ -7543,17 +7553,17 @@ function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7543
7553
|
}
|
|
7544
7554
|
return toObject;
|
|
7545
7555
|
}
|
|
7546
|
-
function voiceConfigToMldev(apiClient, fromObject) {
|
|
7556
|
+
function voiceConfigToMldev$1(apiClient, fromObject) {
|
|
7547
7557
|
const toObject = {};
|
|
7548
7558
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
7549
7559
|
'prebuiltVoiceConfig',
|
|
7550
7560
|
]);
|
|
7551
7561
|
if (fromPrebuiltVoiceConfig != null) {
|
|
7552
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
|
|
7562
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$1(apiClient, fromPrebuiltVoiceConfig));
|
|
7553
7563
|
}
|
|
7554
7564
|
return toObject;
|
|
7555
7565
|
}
|
|
7556
|
-
function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
7566
|
+
function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7557
7567
|
const toObject = {};
|
|
7558
7568
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
7559
7569
|
if (fromSpeaker != null) {
|
|
@@ -7561,11 +7571,11 @@ function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7561
7571
|
}
|
|
7562
7572
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7563
7573
|
if (fromVoiceConfig != null) {
|
|
7564
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
7574
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
|
|
7565
7575
|
}
|
|
7566
7576
|
return toObject;
|
|
7567
7577
|
}
|
|
7568
|
-
function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
7578
|
+
function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7569
7579
|
const toObject = {};
|
|
7570
7580
|
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
7571
7581
|
'speakerVoiceConfigs',
|
|
@@ -7574,24 +7584,24 @@ function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7574
7584
|
let transformedList = fromSpeakerVoiceConfigs;
|
|
7575
7585
|
if (Array.isArray(transformedList)) {
|
|
7576
7586
|
transformedList = transformedList.map((item) => {
|
|
7577
|
-
return speakerVoiceConfigToMldev(apiClient, item);
|
|
7587
|
+
return speakerVoiceConfigToMldev$1(apiClient, item);
|
|
7578
7588
|
});
|
|
7579
7589
|
}
|
|
7580
7590
|
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
7581
7591
|
}
|
|
7582
7592
|
return toObject;
|
|
7583
7593
|
}
|
|
7584
|
-
function speechConfigToMldev(apiClient, fromObject) {
|
|
7594
|
+
function speechConfigToMldev$1(apiClient, fromObject) {
|
|
7585
7595
|
const toObject = {};
|
|
7586
7596
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7587
7597
|
if (fromVoiceConfig != null) {
|
|
7588
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
7598
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
|
|
7589
7599
|
}
|
|
7590
7600
|
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
7591
7601
|
'multiSpeakerVoiceConfig',
|
|
7592
7602
|
]);
|
|
7593
7603
|
if (fromMultiSpeakerVoiceConfig != null) {
|
|
7594
|
-
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
|
|
7604
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$1(apiClient, fromMultiSpeakerVoiceConfig));
|
|
7595
7605
|
}
|
|
7596
7606
|
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
7597
7607
|
if (fromLanguageCode != null) {
|
|
@@ -7621,7 +7631,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7621
7631
|
'systemInstruction',
|
|
7622
7632
|
]);
|
|
7623
7633
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
7624
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
7634
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$1(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
7625
7635
|
}
|
|
7626
7636
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
7627
7637
|
if (fromTemperature != null) {
|
|
@@ -7714,7 +7724,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7714
7724
|
let transformedList = tTools(apiClient, fromTools);
|
|
7715
7725
|
if (Array.isArray(transformedList)) {
|
|
7716
7726
|
transformedList = transformedList.map((item) => {
|
|
7717
|
-
return toolToMldev(apiClient, tTool(apiClient, item));
|
|
7727
|
+
return toolToMldev$1(apiClient, tTool(apiClient, item));
|
|
7718
7728
|
});
|
|
7719
7729
|
}
|
|
7720
7730
|
setValueByPath(parentObject, ['tools'], transformedList);
|
|
@@ -7746,7 +7756,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7746
7756
|
}
|
|
7747
7757
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7748
7758
|
if (fromSpeechConfig != null) {
|
|
7749
|
-
setValueByPath(toObject, ['speechConfig'], speechConfigToMldev(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
|
|
7759
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToMldev$1(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
|
|
7750
7760
|
}
|
|
7751
7761
|
if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
|
|
7752
7762
|
throw new Error('audioTimestamp parameter is not supported in Gemini API.');
|
|
@@ -7770,7 +7780,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
|
|
|
7770
7780
|
let transformedList = tContents(apiClient, fromContents);
|
|
7771
7781
|
if (Array.isArray(transformedList)) {
|
|
7772
7782
|
transformedList = transformedList.map((item) => {
|
|
7773
|
-
return contentToMldev(apiClient, item);
|
|
7783
|
+
return contentToMldev$1(apiClient, item);
|
|
7774
7784
|
});
|
|
7775
7785
|
}
|
|
7776
7786
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -8022,7 +8032,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
|
|
|
8022
8032
|
let transformedList = tContents(apiClient, fromContents);
|
|
8023
8033
|
if (Array.isArray(transformedList)) {
|
|
8024
8034
|
transformedList = transformedList.map((item) => {
|
|
8025
|
-
return contentToMldev(apiClient, item);
|
|
8035
|
+
return contentToMldev$1(apiClient, item);
|
|
8026
8036
|
});
|
|
8027
8037
|
}
|
|
8028
8038
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -8096,6 +8106,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8096
8106
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
8097
8107
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
8098
8108
|
}
|
|
8109
|
+
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8110
|
+
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
8111
|
+
}
|
|
8099
8112
|
return toObject;
|
|
8100
8113
|
}
|
|
8101
8114
|
function generateVideosParametersToMldev(apiClient, fromObject) {
|
|
@@ -8186,6 +8199,12 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8186
8199
|
if (fromFileData != null) {
|
|
8187
8200
|
setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
|
|
8188
8201
|
}
|
|
8202
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8203
|
+
'thoughtSignature',
|
|
8204
|
+
]);
|
|
8205
|
+
if (fromThoughtSignature != null) {
|
|
8206
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8207
|
+
}
|
|
8189
8208
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8190
8209
|
'codeExecutionResult',
|
|
8191
8210
|
]);
|
|
@@ -9435,6 +9454,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
9435
9454
|
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
9436
9455
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
9437
9456
|
}
|
|
9457
|
+
const fromGenerateAudio = getValueByPath(fromObject, [
|
|
9458
|
+
'generateAudio',
|
|
9459
|
+
]);
|
|
9460
|
+
if (parentObject !== undefined && fromGenerateAudio != null) {
|
|
9461
|
+
setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
|
|
9462
|
+
}
|
|
9438
9463
|
return toObject;
|
|
9439
9464
|
}
|
|
9440
9465
|
function generateVideosParametersToVertex(apiClient, fromObject) {
|
|
@@ -9517,6 +9542,12 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9517
9542
|
if (fromFileData != null) {
|
|
9518
9543
|
setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
|
|
9519
9544
|
}
|
|
9545
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
9546
|
+
'thoughtSignature',
|
|
9547
|
+
]);
|
|
9548
|
+
if (fromThoughtSignature != null) {
|
|
9549
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
9550
|
+
}
|
|
9520
9551
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
9521
9552
|
'codeExecutionResult',
|
|
9522
9553
|
]);
|
|
@@ -10035,6 +10066,12 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10035
10066
|
if (fromFileData != null) {
|
|
10036
10067
|
setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
|
|
10037
10068
|
}
|
|
10069
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
10070
|
+
'thoughtSignature',
|
|
10071
|
+
]);
|
|
10072
|
+
if (fromThoughtSignature != null) {
|
|
10073
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
10074
|
+
}
|
|
10038
10075
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
10039
10076
|
'codeExecutionResult',
|
|
10040
10077
|
]);
|
|
@@ -10577,7 +10614,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10577
10614
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10578
10615
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10579
10616
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10580
|
-
const SDK_VERSION = '1.
|
|
10617
|
+
const SDK_VERSION = '1.3.0'; // x-release-please-version
|
|
10581
10618
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10582
10619
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10583
10620
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11113,9 +11150,6 @@ function hasMcpToolUsage(tools) {
|
|
|
11113
11150
|
function setMcpUsageHeader(headers) {
|
|
11114
11151
|
var _a;
|
|
11115
11152
|
const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
|
|
11116
|
-
if (existingHeader.includes(MCP_LABEL)) {
|
|
11117
|
-
return;
|
|
11118
|
-
}
|
|
11119
11153
|
headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
|
|
11120
11154
|
}
|
|
11121
11155
|
// Checks whether the list of tools contains any MCP clients. Will return true
|
|
@@ -11132,11 +11166,9 @@ function hasNonMcpTools(params) {
|
|
|
11132
11166
|
}
|
|
11133
11167
|
// Returns true if the object is a MCP CallableTool, otherwise false.
|
|
11134
11168
|
function isMcpCallableTool(object) {
|
|
11135
|
-
// TODO: b/418266406 - Add a more robust check for the MCP CallableTool.
|
|
11136
11169
|
return (object !== null &&
|
|
11137
11170
|
typeof object === 'object' &&
|
|
11138
|
-
|
|
11139
|
-
'callTool' in object);
|
|
11171
|
+
object instanceof McpCallableTool);
|
|
11140
11172
|
}
|
|
11141
11173
|
// List all tools from the MCP client.
|
|
11142
11174
|
function listAllTools(mcpClient, maxTools = 100) {
|
|
@@ -11616,7 +11648,14 @@ class Live {
|
|
|
11616
11648
|
}
|
|
11617
11649
|
else {
|
|
11618
11650
|
const apiKey = this.apiClient.getApiKey();
|
|
11619
|
-
|
|
11651
|
+
let method = 'BidiGenerateContent';
|
|
11652
|
+
let keyName = 'key';
|
|
11653
|
+
if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
|
|
11654
|
+
console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
|
|
11655
|
+
method = 'BidiGenerateContentConstrained';
|
|
11656
|
+
keyName = 'access_token';
|
|
11657
|
+
}
|
|
11658
|
+
url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.${method}?${keyName}=${apiKey}`;
|
|
11620
11659
|
}
|
|
11621
11660
|
let onopenResolve = () => { };
|
|
11622
11661
|
const onopenPromise = new Promise((resolve) => {
|
|
@@ -11722,7 +11761,7 @@ class Session {
|
|
|
11722
11761
|
contents = contents.map((item) => contentToVertex(apiClient, item));
|
|
11723
11762
|
}
|
|
11724
11763
|
else {
|
|
11725
|
-
contents = contents.map((item) => contentToMldev(apiClient, item));
|
|
11764
|
+
contents = contents.map((item) => contentToMldev$1(apiClient, item));
|
|
11726
11765
|
}
|
|
11727
11766
|
}
|
|
11728
11767
|
catch (_a) {
|
|
@@ -12020,7 +12059,6 @@ class Models extends BaseModule {
|
|
|
12020
12059
|
if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
|
|
12021
12060
|
return await this.generateContentInternal(transformedParams);
|
|
12022
12061
|
}
|
|
12023
|
-
// TODO: b/418266406 - Improve the check for CallableTools and Tools.
|
|
12024
12062
|
if (hasNonMcpTools(params)) {
|
|
12025
12063
|
throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
|
|
12026
12064
|
}
|
|
@@ -13575,43 +13613,878 @@ class Operations extends BaseModule {
|
|
|
13575
13613
|
* Copyright 2025 Google LLC
|
|
13576
13614
|
* SPDX-License-Identifier: Apache-2.0
|
|
13577
13615
|
*/
|
|
13578
|
-
function
|
|
13616
|
+
function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
13579
13617
|
const toObject = {};
|
|
13580
|
-
const
|
|
13581
|
-
if (
|
|
13582
|
-
setValueByPath(toObject, ['
|
|
13583
|
-
}
|
|
13584
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
13585
|
-
if (fromConfig != null) {
|
|
13586
|
-
setValueByPath(toObject, ['config'], fromConfig);
|
|
13618
|
+
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
13619
|
+
if (fromVoiceName != null) {
|
|
13620
|
+
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
13587
13621
|
}
|
|
13588
13622
|
return toObject;
|
|
13589
13623
|
}
|
|
13590
|
-
function
|
|
13624
|
+
function voiceConfigToMldev(apiClient, fromObject) {
|
|
13591
13625
|
const toObject = {};
|
|
13592
|
-
const
|
|
13593
|
-
|
|
13594
|
-
|
|
13626
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
13627
|
+
'prebuiltVoiceConfig',
|
|
13628
|
+
]);
|
|
13629
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
13630
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
|
|
13595
13631
|
}
|
|
13596
|
-
|
|
13597
|
-
|
|
13598
|
-
|
|
13632
|
+
return toObject;
|
|
13633
|
+
}
|
|
13634
|
+
function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
13635
|
+
const toObject = {};
|
|
13636
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
13637
|
+
if (fromSpeaker != null) {
|
|
13638
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
13599
13639
|
}
|
|
13600
|
-
const
|
|
13601
|
-
if (
|
|
13602
|
-
setValueByPath(
|
|
13640
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
13641
|
+
if (fromVoiceConfig != null) {
|
|
13642
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
13603
13643
|
}
|
|
13604
13644
|
return toObject;
|
|
13605
13645
|
}
|
|
13606
|
-
function
|
|
13646
|
+
function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
13607
13647
|
const toObject = {};
|
|
13608
|
-
const
|
|
13609
|
-
|
|
13610
|
-
|
|
13648
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
13649
|
+
'speakerVoiceConfigs',
|
|
13650
|
+
]);
|
|
13651
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
13652
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
13653
|
+
if (Array.isArray(transformedList)) {
|
|
13654
|
+
transformedList = transformedList.map((item) => {
|
|
13655
|
+
return speakerVoiceConfigToMldev(apiClient, item);
|
|
13656
|
+
});
|
|
13657
|
+
}
|
|
13658
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
13611
13659
|
}
|
|
13612
13660
|
return toObject;
|
|
13613
13661
|
}
|
|
13614
|
-
function
|
|
13662
|
+
function speechConfigToMldev(apiClient, fromObject) {
|
|
13663
|
+
const toObject = {};
|
|
13664
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
13665
|
+
if (fromVoiceConfig != null) {
|
|
13666
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
13667
|
+
}
|
|
13668
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
13669
|
+
'multiSpeakerVoiceConfig',
|
|
13670
|
+
]);
|
|
13671
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
13672
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
|
|
13673
|
+
}
|
|
13674
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
13675
|
+
if (fromLanguageCode != null) {
|
|
13676
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
13677
|
+
}
|
|
13678
|
+
return toObject;
|
|
13679
|
+
}
|
|
13680
|
+
function videoMetadataToMldev(apiClient, fromObject) {
|
|
13681
|
+
const toObject = {};
|
|
13682
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
13683
|
+
if (fromFps != null) {
|
|
13684
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
13685
|
+
}
|
|
13686
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
13687
|
+
if (fromEndOffset != null) {
|
|
13688
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
13689
|
+
}
|
|
13690
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
13691
|
+
if (fromStartOffset != null) {
|
|
13692
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
13693
|
+
}
|
|
13694
|
+
return toObject;
|
|
13695
|
+
}
|
|
13696
|
+
function blobToMldev(apiClient, fromObject) {
|
|
13697
|
+
const toObject = {};
|
|
13698
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
13699
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
13700
|
+
}
|
|
13701
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
13702
|
+
if (fromData != null) {
|
|
13703
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
13704
|
+
}
|
|
13705
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
13706
|
+
if (fromMimeType != null) {
|
|
13707
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
13708
|
+
}
|
|
13709
|
+
return toObject;
|
|
13710
|
+
}
|
|
13711
|
+
function fileDataToMldev(apiClient, fromObject) {
|
|
13712
|
+
const toObject = {};
|
|
13713
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
13714
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
13715
|
+
}
|
|
13716
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
13717
|
+
if (fromFileUri != null) {
|
|
13718
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
13719
|
+
}
|
|
13720
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
13721
|
+
if (fromMimeType != null) {
|
|
13722
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
13723
|
+
}
|
|
13724
|
+
return toObject;
|
|
13725
|
+
}
|
|
13726
|
+
function partToMldev(apiClient, fromObject) {
|
|
13727
|
+
const toObject = {};
|
|
13728
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
13729
|
+
'videoMetadata',
|
|
13730
|
+
]);
|
|
13731
|
+
if (fromVideoMetadata != null) {
|
|
13732
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
|
|
13733
|
+
}
|
|
13734
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
13735
|
+
if (fromThought != null) {
|
|
13736
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
13737
|
+
}
|
|
13738
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
13739
|
+
if (fromInlineData != null) {
|
|
13740
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
13741
|
+
}
|
|
13742
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
13743
|
+
if (fromFileData != null) {
|
|
13744
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
13745
|
+
}
|
|
13746
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
13747
|
+
'thoughtSignature',
|
|
13748
|
+
]);
|
|
13749
|
+
if (fromThoughtSignature != null) {
|
|
13750
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
13751
|
+
}
|
|
13752
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
13753
|
+
'codeExecutionResult',
|
|
13754
|
+
]);
|
|
13755
|
+
if (fromCodeExecutionResult != null) {
|
|
13756
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
13757
|
+
}
|
|
13758
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
13759
|
+
'executableCode',
|
|
13760
|
+
]);
|
|
13761
|
+
if (fromExecutableCode != null) {
|
|
13762
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
13763
|
+
}
|
|
13764
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
13765
|
+
if (fromFunctionCall != null) {
|
|
13766
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
13767
|
+
}
|
|
13768
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
13769
|
+
'functionResponse',
|
|
13770
|
+
]);
|
|
13771
|
+
if (fromFunctionResponse != null) {
|
|
13772
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
13773
|
+
}
|
|
13774
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
13775
|
+
if (fromText != null) {
|
|
13776
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
13777
|
+
}
|
|
13778
|
+
return toObject;
|
|
13779
|
+
}
|
|
13780
|
+
function contentToMldev(apiClient, fromObject) {
|
|
13781
|
+
const toObject = {};
|
|
13782
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
13783
|
+
if (fromParts != null) {
|
|
13784
|
+
let transformedList = fromParts;
|
|
13785
|
+
if (Array.isArray(transformedList)) {
|
|
13786
|
+
transformedList = transformedList.map((item) => {
|
|
13787
|
+
return partToMldev(apiClient, item);
|
|
13788
|
+
});
|
|
13789
|
+
}
|
|
13790
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
13791
|
+
}
|
|
13792
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
13793
|
+
if (fromRole != null) {
|
|
13794
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
13795
|
+
}
|
|
13796
|
+
return toObject;
|
|
13797
|
+
}
|
|
13798
|
+
function functionDeclarationToMldev(apiClient, fromObject) {
|
|
13799
|
+
const toObject = {};
|
|
13800
|
+
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
13801
|
+
if (fromBehavior != null) {
|
|
13802
|
+
setValueByPath(toObject, ['behavior'], fromBehavior);
|
|
13803
|
+
}
|
|
13804
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
13805
|
+
if (fromDescription != null) {
|
|
13806
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
13807
|
+
}
|
|
13808
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
13809
|
+
if (fromName != null) {
|
|
13810
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
13811
|
+
}
|
|
13812
|
+
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
13813
|
+
if (fromParameters != null) {
|
|
13814
|
+
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
13815
|
+
}
|
|
13816
|
+
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
13817
|
+
if (fromResponse != null) {
|
|
13818
|
+
setValueByPath(toObject, ['response'], fromResponse);
|
|
13819
|
+
}
|
|
13820
|
+
return toObject;
|
|
13821
|
+
}
|
|
13822
|
+
function intervalToMldev(apiClient, fromObject) {
|
|
13823
|
+
const toObject = {};
|
|
13824
|
+
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
13825
|
+
if (fromStartTime != null) {
|
|
13826
|
+
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
13827
|
+
}
|
|
13828
|
+
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
13829
|
+
if (fromEndTime != null) {
|
|
13830
|
+
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
13831
|
+
}
|
|
13832
|
+
return toObject;
|
|
13833
|
+
}
|
|
13834
|
+
function googleSearchToMldev(apiClient, fromObject) {
|
|
13835
|
+
const toObject = {};
|
|
13836
|
+
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
13837
|
+
'timeRangeFilter',
|
|
13838
|
+
]);
|
|
13839
|
+
if (fromTimeRangeFilter != null) {
|
|
13840
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
|
|
13841
|
+
}
|
|
13842
|
+
return toObject;
|
|
13843
|
+
}
|
|
13844
|
+
function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
13845
|
+
const toObject = {};
|
|
13846
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
13847
|
+
if (fromMode != null) {
|
|
13848
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
13849
|
+
}
|
|
13850
|
+
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
13851
|
+
'dynamicThreshold',
|
|
13852
|
+
]);
|
|
13853
|
+
if (fromDynamicThreshold != null) {
|
|
13854
|
+
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
13855
|
+
}
|
|
13856
|
+
return toObject;
|
|
13857
|
+
}
|
|
13858
|
+
function googleSearchRetrievalToMldev(apiClient, fromObject) {
|
|
13859
|
+
const toObject = {};
|
|
13860
|
+
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
13861
|
+
'dynamicRetrievalConfig',
|
|
13862
|
+
]);
|
|
13863
|
+
if (fromDynamicRetrievalConfig != null) {
|
|
13864
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
|
|
13865
|
+
}
|
|
13866
|
+
return toObject;
|
|
13867
|
+
}
|
|
13868
|
+
function urlContextToMldev() {
|
|
13869
|
+
const toObject = {};
|
|
13870
|
+
return toObject;
|
|
13871
|
+
}
|
|
13872
|
+
function toolToMldev(apiClient, fromObject) {
|
|
13873
|
+
const toObject = {};
|
|
13874
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
13875
|
+
'functionDeclarations',
|
|
13876
|
+
]);
|
|
13877
|
+
if (fromFunctionDeclarations != null) {
|
|
13878
|
+
let transformedList = fromFunctionDeclarations;
|
|
13879
|
+
if (Array.isArray(transformedList)) {
|
|
13880
|
+
transformedList = transformedList.map((item) => {
|
|
13881
|
+
return functionDeclarationToMldev(apiClient, item);
|
|
13882
|
+
});
|
|
13883
|
+
}
|
|
13884
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
13885
|
+
}
|
|
13886
|
+
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
13887
|
+
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
13888
|
+
}
|
|
13889
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
13890
|
+
if (fromGoogleSearch != null) {
|
|
13891
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
|
|
13892
|
+
}
|
|
13893
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
13894
|
+
'googleSearchRetrieval',
|
|
13895
|
+
]);
|
|
13896
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
13897
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
|
|
13898
|
+
}
|
|
13899
|
+
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
13900
|
+
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
13901
|
+
}
|
|
13902
|
+
if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
|
|
13903
|
+
throw new Error('googleMaps parameter is not supported in Gemini API.');
|
|
13904
|
+
}
|
|
13905
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
13906
|
+
if (fromUrlContext != null) {
|
|
13907
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev());
|
|
13908
|
+
}
|
|
13909
|
+
const fromCodeExecution = getValueByPath(fromObject, [
|
|
13910
|
+
'codeExecution',
|
|
13911
|
+
]);
|
|
13912
|
+
if (fromCodeExecution != null) {
|
|
13913
|
+
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
13914
|
+
}
|
|
13915
|
+
return toObject;
|
|
13916
|
+
}
|
|
13917
|
+
function sessionResumptionConfigToMldev(apiClient, fromObject) {
|
|
13918
|
+
const toObject = {};
|
|
13919
|
+
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
13920
|
+
if (fromHandle != null) {
|
|
13921
|
+
setValueByPath(toObject, ['handle'], fromHandle);
|
|
13922
|
+
}
|
|
13923
|
+
if (getValueByPath(fromObject, ['transparent']) !== undefined) {
|
|
13924
|
+
throw new Error('transparent parameter is not supported in Gemini API.');
|
|
13925
|
+
}
|
|
13926
|
+
return toObject;
|
|
13927
|
+
}
|
|
13928
|
+
function audioTranscriptionConfigToMldev() {
|
|
13929
|
+
const toObject = {};
|
|
13930
|
+
return toObject;
|
|
13931
|
+
}
|
|
13932
|
+
function automaticActivityDetectionToMldev(apiClient, fromObject) {
|
|
13933
|
+
const toObject = {};
|
|
13934
|
+
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
13935
|
+
if (fromDisabled != null) {
|
|
13936
|
+
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
13937
|
+
}
|
|
13938
|
+
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
13939
|
+
'startOfSpeechSensitivity',
|
|
13940
|
+
]);
|
|
13941
|
+
if (fromStartOfSpeechSensitivity != null) {
|
|
13942
|
+
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
13943
|
+
}
|
|
13944
|
+
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
13945
|
+
'endOfSpeechSensitivity',
|
|
13946
|
+
]);
|
|
13947
|
+
if (fromEndOfSpeechSensitivity != null) {
|
|
13948
|
+
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
13949
|
+
}
|
|
13950
|
+
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
13951
|
+
'prefixPaddingMs',
|
|
13952
|
+
]);
|
|
13953
|
+
if (fromPrefixPaddingMs != null) {
|
|
13954
|
+
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
13955
|
+
}
|
|
13956
|
+
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
13957
|
+
'silenceDurationMs',
|
|
13958
|
+
]);
|
|
13959
|
+
if (fromSilenceDurationMs != null) {
|
|
13960
|
+
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
13961
|
+
}
|
|
13962
|
+
return toObject;
|
|
13963
|
+
}
|
|
13964
|
+
function realtimeInputConfigToMldev(apiClient, fromObject) {
|
|
13965
|
+
const toObject = {};
|
|
13966
|
+
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
13967
|
+
'automaticActivityDetection',
|
|
13968
|
+
]);
|
|
13969
|
+
if (fromAutomaticActivityDetection != null) {
|
|
13970
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
|
|
13971
|
+
}
|
|
13972
|
+
const fromActivityHandling = getValueByPath(fromObject, [
|
|
13973
|
+
'activityHandling',
|
|
13974
|
+
]);
|
|
13975
|
+
if (fromActivityHandling != null) {
|
|
13976
|
+
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
13977
|
+
}
|
|
13978
|
+
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
13979
|
+
if (fromTurnCoverage != null) {
|
|
13980
|
+
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
13981
|
+
}
|
|
13982
|
+
return toObject;
|
|
13983
|
+
}
|
|
13984
|
+
function slidingWindowToMldev(apiClient, fromObject) {
|
|
13985
|
+
const toObject = {};
|
|
13986
|
+
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
13987
|
+
if (fromTargetTokens != null) {
|
|
13988
|
+
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
13989
|
+
}
|
|
13990
|
+
return toObject;
|
|
13991
|
+
}
|
|
13992
|
+
function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
13993
|
+
const toObject = {};
|
|
13994
|
+
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
13995
|
+
'triggerTokens',
|
|
13996
|
+
]);
|
|
13997
|
+
if (fromTriggerTokens != null) {
|
|
13998
|
+
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
13999
|
+
}
|
|
14000
|
+
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
14001
|
+
'slidingWindow',
|
|
14002
|
+
]);
|
|
14003
|
+
if (fromSlidingWindow != null) {
|
|
14004
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
|
|
14005
|
+
}
|
|
14006
|
+
return toObject;
|
|
14007
|
+
}
|
|
14008
|
+
function proactivityConfigToMldev(apiClient, fromObject) {
|
|
14009
|
+
const toObject = {};
|
|
14010
|
+
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
14011
|
+
'proactiveAudio',
|
|
14012
|
+
]);
|
|
14013
|
+
if (fromProactiveAudio != null) {
|
|
14014
|
+
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
14015
|
+
}
|
|
14016
|
+
return toObject;
|
|
14017
|
+
}
|
|
14018
|
+
function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14019
|
+
const toObject = {};
|
|
14020
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
14021
|
+
'generationConfig',
|
|
14022
|
+
]);
|
|
14023
|
+
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
14024
|
+
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
14025
|
+
}
|
|
14026
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
14027
|
+
'responseModalities',
|
|
14028
|
+
]);
|
|
14029
|
+
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
14030
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
14031
|
+
}
|
|
14032
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
14033
|
+
if (parentObject !== undefined && fromTemperature != null) {
|
|
14034
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
14035
|
+
}
|
|
14036
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
14037
|
+
if (parentObject !== undefined && fromTopP != null) {
|
|
14038
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
14039
|
+
}
|
|
14040
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
14041
|
+
if (parentObject !== undefined && fromTopK != null) {
|
|
14042
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
14043
|
+
}
|
|
14044
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
14045
|
+
'maxOutputTokens',
|
|
14046
|
+
]);
|
|
14047
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
14048
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
14049
|
+
}
|
|
14050
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
14051
|
+
'mediaResolution',
|
|
14052
|
+
]);
|
|
14053
|
+
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
14054
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
14055
|
+
}
|
|
14056
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
14057
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
14058
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
14059
|
+
}
|
|
14060
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14061
|
+
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
14062
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
|
|
14063
|
+
}
|
|
14064
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
14065
|
+
'enableAffectiveDialog',
|
|
14066
|
+
]);
|
|
14067
|
+
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
14068
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
14069
|
+
}
|
|
14070
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
14071
|
+
'systemInstruction',
|
|
14072
|
+
]);
|
|
14073
|
+
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
14074
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
14075
|
+
}
|
|
14076
|
+
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
14077
|
+
if (parentObject !== undefined && fromTools != null) {
|
|
14078
|
+
let transformedList = tTools(apiClient, fromTools);
|
|
14079
|
+
if (Array.isArray(transformedList)) {
|
|
14080
|
+
transformedList = transformedList.map((item) => {
|
|
14081
|
+
return toolToMldev(apiClient, tTool(apiClient, item));
|
|
14082
|
+
});
|
|
14083
|
+
}
|
|
14084
|
+
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
14085
|
+
}
|
|
14086
|
+
const fromSessionResumption = getValueByPath(fromObject, [
|
|
14087
|
+
'sessionResumption',
|
|
14088
|
+
]);
|
|
14089
|
+
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
14090
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
|
|
14091
|
+
}
|
|
14092
|
+
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
14093
|
+
'inputAudioTranscription',
|
|
14094
|
+
]);
|
|
14095
|
+
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
14096
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
14097
|
+
}
|
|
14098
|
+
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
14099
|
+
'outputAudioTranscription',
|
|
14100
|
+
]);
|
|
14101
|
+
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
14102
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
14103
|
+
}
|
|
14104
|
+
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
14105
|
+
'realtimeInputConfig',
|
|
14106
|
+
]);
|
|
14107
|
+
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
14108
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
|
|
14109
|
+
}
|
|
14110
|
+
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
14111
|
+
'contextWindowCompression',
|
|
14112
|
+
]);
|
|
14113
|
+
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
14114
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
|
|
14115
|
+
}
|
|
14116
|
+
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
14117
|
+
if (parentObject !== undefined && fromProactivity != null) {
|
|
14118
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
|
|
14119
|
+
}
|
|
14120
|
+
return toObject;
|
|
14121
|
+
}
|
|
14122
|
+
function liveConnectConstraintsToMldev(apiClient, fromObject) {
|
|
14123
|
+
const toObject = {};
|
|
14124
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
14125
|
+
if (fromModel != null) {
|
|
14126
|
+
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
14127
|
+
}
|
|
14128
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14129
|
+
if (fromConfig != null) {
|
|
14130
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
|
|
14131
|
+
}
|
|
14132
|
+
return toObject;
|
|
14133
|
+
}
|
|
14134
|
+
function createAuthTokenConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14135
|
+
const toObject = {};
|
|
14136
|
+
const fromExpireTime = getValueByPath(fromObject, ['expireTime']);
|
|
14137
|
+
if (parentObject !== undefined && fromExpireTime != null) {
|
|
14138
|
+
setValueByPath(parentObject, ['expireTime'], fromExpireTime);
|
|
14139
|
+
}
|
|
14140
|
+
const fromNewSessionExpireTime = getValueByPath(fromObject, [
|
|
14141
|
+
'newSessionExpireTime',
|
|
14142
|
+
]);
|
|
14143
|
+
if (parentObject !== undefined && fromNewSessionExpireTime != null) {
|
|
14144
|
+
setValueByPath(parentObject, ['newSessionExpireTime'], fromNewSessionExpireTime);
|
|
14145
|
+
}
|
|
14146
|
+
const fromUses = getValueByPath(fromObject, ['uses']);
|
|
14147
|
+
if (parentObject !== undefined && fromUses != null) {
|
|
14148
|
+
setValueByPath(parentObject, ['uses'], fromUses);
|
|
14149
|
+
}
|
|
14150
|
+
const fromLiveConnectConstraints = getValueByPath(fromObject, [
|
|
14151
|
+
'liveConnectConstraints',
|
|
14152
|
+
]);
|
|
14153
|
+
if (parentObject !== undefined && fromLiveConnectConstraints != null) {
|
|
14154
|
+
setValueByPath(parentObject, ['bidiGenerateContentSetup'], liveConnectConstraintsToMldev(apiClient, fromLiveConnectConstraints));
|
|
14155
|
+
}
|
|
14156
|
+
const fromLockAdditionalFields = getValueByPath(fromObject, [
|
|
14157
|
+
'lockAdditionalFields',
|
|
14158
|
+
]);
|
|
14159
|
+
if (parentObject !== undefined && fromLockAdditionalFields != null) {
|
|
14160
|
+
setValueByPath(parentObject, ['fieldMask'], fromLockAdditionalFields);
|
|
14161
|
+
}
|
|
14162
|
+
return toObject;
|
|
14163
|
+
}
|
|
14164
|
+
function createAuthTokenParametersToMldev(apiClient, fromObject) {
|
|
14165
|
+
const toObject = {};
|
|
14166
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14167
|
+
if (fromConfig != null) {
|
|
14168
|
+
setValueByPath(toObject, ['config'], createAuthTokenConfigToMldev(apiClient, fromConfig, toObject));
|
|
14169
|
+
}
|
|
14170
|
+
return toObject;
|
|
14171
|
+
}
|
|
14172
|
+
function authTokenFromMldev(apiClient, fromObject) {
|
|
14173
|
+
const toObject = {};
|
|
14174
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
14175
|
+
if (fromName != null) {
|
|
14176
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
14177
|
+
}
|
|
14178
|
+
return toObject;
|
|
14179
|
+
}
|
|
14180
|
+
|
|
14181
|
+
/**
|
|
14182
|
+
* @license
|
|
14183
|
+
* Copyright 2025 Google LLC
|
|
14184
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14185
|
+
*/
|
|
14186
|
+
/**
|
|
14187
|
+
* Returns a comma-separated list of field masks from a given object.
|
|
14188
|
+
*
|
|
14189
|
+
* @param setup The object to extract field masks from.
|
|
14190
|
+
* @return A comma-separated list of field masks.
|
|
14191
|
+
*/
|
|
14192
|
+
function getFieldMasks(setup) {
|
|
14193
|
+
const fields = [];
|
|
14194
|
+
for (const key in setup) {
|
|
14195
|
+
if (Object.prototype.hasOwnProperty.call(setup, key)) {
|
|
14196
|
+
const value = setup[key];
|
|
14197
|
+
// 2nd layer, recursively get field masks see TODO(b/418290100)
|
|
14198
|
+
if (typeof value === 'object' &&
|
|
14199
|
+
value != null &&
|
|
14200
|
+
Object.keys(value).length > 0) {
|
|
14201
|
+
const field = Object.keys(value).map((kk) => `${key}.${kk}`);
|
|
14202
|
+
fields.push(...field);
|
|
14203
|
+
}
|
|
14204
|
+
else {
|
|
14205
|
+
fields.push(key); // 1st layer
|
|
14206
|
+
}
|
|
14207
|
+
}
|
|
14208
|
+
}
|
|
14209
|
+
return fields.join(',');
|
|
14210
|
+
}
|
|
14211
|
+
/**
|
|
14212
|
+
* Converts bidiGenerateContentSetup.
|
|
14213
|
+
* @param requestDict - The request dictionary.
|
|
14214
|
+
* @param config - The configuration object.
|
|
14215
|
+
* @return - The modified request dictionary.
|
|
14216
|
+
*/
|
|
14217
|
+
function convertBidiSetupToTokenSetup(requestDict, config) {
|
|
14218
|
+
// Convert bidiGenerateContentSetup from bidiGenerateContentSetup.setup.
|
|
14219
|
+
let setupForMaskGeneration = null;
|
|
14220
|
+
const bidiGenerateContentSetupValue = requestDict['bidiGenerateContentSetup'];
|
|
14221
|
+
if (typeof bidiGenerateContentSetupValue === 'object' &&
|
|
14222
|
+
bidiGenerateContentSetupValue !== null &&
|
|
14223
|
+
'setup' in bidiGenerateContentSetupValue) {
|
|
14224
|
+
// Now we know bidiGenerateContentSetupValue is an object and has a 'setup'
|
|
14225
|
+
// property.
|
|
14226
|
+
const innerSetup = bidiGenerateContentSetupValue
|
|
14227
|
+
.setup;
|
|
14228
|
+
if (typeof innerSetup === 'object' && innerSetup !== null) {
|
|
14229
|
+
// Valid inner setup found.
|
|
14230
|
+
requestDict['bidiGenerateContentSetup'] = innerSetup;
|
|
14231
|
+
setupForMaskGeneration = innerSetup;
|
|
14232
|
+
}
|
|
14233
|
+
else {
|
|
14234
|
+
// `bidiGenerateContentSetupValue.setup` is not a valid object; treat as
|
|
14235
|
+
// if bidiGenerateContentSetup is invalid.
|
|
14236
|
+
delete requestDict['bidiGenerateContentSetup'];
|
|
14237
|
+
}
|
|
14238
|
+
}
|
|
14239
|
+
else if (bidiGenerateContentSetupValue !== undefined) {
|
|
14240
|
+
// `bidiGenerateContentSetup` exists but not in the expected
|
|
14241
|
+
// shape {setup: {...}}; treat as invalid.
|
|
14242
|
+
delete requestDict['bidiGenerateContentSetup'];
|
|
14243
|
+
}
|
|
14244
|
+
const preExistingFieldMask = requestDict['fieldMask'];
|
|
14245
|
+
// Handle mask generation setup.
|
|
14246
|
+
if (setupForMaskGeneration) {
|
|
14247
|
+
const generatedMaskFromBidi = getFieldMasks(setupForMaskGeneration);
|
|
14248
|
+
if (Array.isArray(config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
|
|
14249
|
+
(config === null || config === void 0 ? void 0 : config.lockAdditionalFields.length) === 0) {
|
|
14250
|
+
// Case 1: lockAdditionalFields is an empty array. Lock only fields from
|
|
14251
|
+
// bidi setup.
|
|
14252
|
+
if (generatedMaskFromBidi) {
|
|
14253
|
+
// Only assign if mask is not empty
|
|
14254
|
+
requestDict['fieldMask'] = generatedMaskFromBidi;
|
|
14255
|
+
}
|
|
14256
|
+
else {
|
|
14257
|
+
delete requestDict['fieldMask']; // If mask is empty, effectively no
|
|
14258
|
+
// specific fields locked by bidi
|
|
14259
|
+
}
|
|
14260
|
+
}
|
|
14261
|
+
else if ((config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
|
|
14262
|
+
config.lockAdditionalFields.length > 0 &&
|
|
14263
|
+
preExistingFieldMask !== null &&
|
|
14264
|
+
Array.isArray(preExistingFieldMask) &&
|
|
14265
|
+
preExistingFieldMask.length > 0) {
|
|
14266
|
+
// Case 2: Lock fields from bidi setup + additional fields
|
|
14267
|
+
// (preExistingFieldMask).
|
|
14268
|
+
const generationConfigFields = [
|
|
14269
|
+
'temperature',
|
|
14270
|
+
'topK',
|
|
14271
|
+
'topP',
|
|
14272
|
+
'maxOutputTokens',
|
|
14273
|
+
'responseModalities',
|
|
14274
|
+
'seed',
|
|
14275
|
+
'speechConfig',
|
|
14276
|
+
];
|
|
14277
|
+
let mappedFieldsFromPreExisting = [];
|
|
14278
|
+
if (preExistingFieldMask.length > 0) {
|
|
14279
|
+
mappedFieldsFromPreExisting = preExistingFieldMask.map((field) => {
|
|
14280
|
+
if (generationConfigFields.includes(field)) {
|
|
14281
|
+
return `generationConfig.${field}`;
|
|
14282
|
+
}
|
|
14283
|
+
return field; // Keep original field name if not in
|
|
14284
|
+
// generationConfigFields
|
|
14285
|
+
});
|
|
14286
|
+
}
|
|
14287
|
+
const finalMaskParts = [];
|
|
14288
|
+
if (generatedMaskFromBidi) {
|
|
14289
|
+
finalMaskParts.push(generatedMaskFromBidi);
|
|
14290
|
+
}
|
|
14291
|
+
if (mappedFieldsFromPreExisting.length > 0) {
|
|
14292
|
+
finalMaskParts.push(...mappedFieldsFromPreExisting);
|
|
14293
|
+
}
|
|
14294
|
+
if (finalMaskParts.length > 0) {
|
|
14295
|
+
requestDict['fieldMask'] = finalMaskParts.join(',');
|
|
14296
|
+
}
|
|
14297
|
+
else {
|
|
14298
|
+
// If no fields from bidi and no valid additional fields from
|
|
14299
|
+
// pre-existing mask.
|
|
14300
|
+
delete requestDict['fieldMask'];
|
|
14301
|
+
}
|
|
14302
|
+
}
|
|
14303
|
+
else {
|
|
14304
|
+
// Case 3: "Lock all fields" (meaning, don't send a field_mask, let server
|
|
14305
|
+
// defaults apply or all are mutable). This is hit if:
|
|
14306
|
+
// - `config.lockAdditionalFields` is undefined.
|
|
14307
|
+
// - `config.lockAdditionalFields` is non-empty, BUT
|
|
14308
|
+
// `preExistingFieldMask` is null, not a string, or an empty string.
|
|
14309
|
+
delete requestDict['fieldMask'];
|
|
14310
|
+
}
|
|
14311
|
+
}
|
|
14312
|
+
else {
|
|
14313
|
+
// No valid `bidiGenerateContentSetup` was found or extracted.
|
|
14314
|
+
// "Lock additional null fields if any".
|
|
14315
|
+
if (preExistingFieldMask !== null &&
|
|
14316
|
+
Array.isArray(preExistingFieldMask) &&
|
|
14317
|
+
preExistingFieldMask.length > 0) {
|
|
14318
|
+
// If there's a pre-existing field mask, it's a string, and it's not
|
|
14319
|
+
// empty, then we should lock all fields.
|
|
14320
|
+
requestDict['fieldMask'] = preExistingFieldMask.join(',');
|
|
14321
|
+
}
|
|
14322
|
+
else {
|
|
14323
|
+
delete requestDict['fieldMask'];
|
|
14324
|
+
}
|
|
14325
|
+
}
|
|
14326
|
+
return requestDict;
|
|
14327
|
+
}
|
|
14328
|
+
class Tokens extends BaseModule {
|
|
14329
|
+
constructor(apiClient) {
|
|
14330
|
+
super();
|
|
14331
|
+
this.apiClient = apiClient;
|
|
14332
|
+
}
|
|
14333
|
+
/**
|
|
14334
|
+
* Creates an ephemeral auth token resource.
|
|
14335
|
+
*
|
|
14336
|
+
* @experimental
|
|
14337
|
+
*
|
|
14338
|
+
* @remarks
|
|
14339
|
+
* Ephermeral auth tokens is only supported in the Gemini Developer API.
|
|
14340
|
+
* It can be used for the session connection to the Live constrained API.
|
|
14341
|
+
*
|
|
14342
|
+
* @param params - The parameters for the create request.
|
|
14343
|
+
* @return The created auth token.
|
|
14344
|
+
*
|
|
14345
|
+
* @example
|
|
14346
|
+
* ```ts
|
|
14347
|
+
* // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
|
|
14348
|
+
* // when using the token in Live API sessions. Each session connection can
|
|
14349
|
+
* // use a different configuration.
|
|
14350
|
+
* const config: CreateAuthTokenConfig = {
|
|
14351
|
+
* uses: 3,
|
|
14352
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14353
|
+
* }
|
|
14354
|
+
* const token = await ai.tokens.create(config);
|
|
14355
|
+
*
|
|
14356
|
+
* // Case 2: If LiveEphemeralParameters is set, lock all fields in
|
|
14357
|
+
* // LiveConnectConfig when using the token in Live API sessions. For
|
|
14358
|
+
* // example, changing `outputAudioTranscription` in the Live API
|
|
14359
|
+
* // connection will be ignored by the API.
|
|
14360
|
+
* const config: CreateAuthTokenConfig =
|
|
14361
|
+
* uses: 3,
|
|
14362
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14363
|
+
* LiveEphemeralParameters: {
|
|
14364
|
+
* model: 'gemini-2.0-flash-001',
|
|
14365
|
+
* config: {
|
|
14366
|
+
* 'responseModalities': ['AUDIO'],
|
|
14367
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14368
|
+
* }
|
|
14369
|
+
* }
|
|
14370
|
+
* }
|
|
14371
|
+
* const token = await ai.tokens.create(config);
|
|
14372
|
+
*
|
|
14373
|
+
* // Case 3: If LiveEphemeralParameters is set and lockAdditionalFields is
|
|
14374
|
+
* // set, lock LiveConnectConfig with set and additional fields (e.g.
|
|
14375
|
+
* // responseModalities, systemInstruction, temperature in this example) when
|
|
14376
|
+
* // using the token in Live API sessions.
|
|
14377
|
+
* const config: CreateAuthTokenConfig =
|
|
14378
|
+
* uses: 3,
|
|
14379
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14380
|
+
* LiveEphemeralParameters: {
|
|
14381
|
+
* model: 'gemini-2.0-flash-001',
|
|
14382
|
+
* config: {
|
|
14383
|
+
* 'responseModalities': ['AUDIO'],
|
|
14384
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14385
|
+
* }
|
|
14386
|
+
* },
|
|
14387
|
+
* lockAdditionalFields: ['temperature'],
|
|
14388
|
+
* }
|
|
14389
|
+
* const token = await ai.tokens.create(config);
|
|
14390
|
+
*
|
|
14391
|
+
* // Case 4: If LiveEphemeralParameters is set and lockAdditionalFields is
|
|
14392
|
+
* // empty array, lock LiveConnectConfig with set fields (e.g.
|
|
14393
|
+
* // responseModalities, systemInstruction in this example) when using the
|
|
14394
|
+
* // token in Live API sessions.
|
|
14395
|
+
* const config: CreateAuthTokenConfig =
|
|
14396
|
+
* uses: 3,
|
|
14397
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14398
|
+
* LiveEphemeralParameters: {
|
|
14399
|
+
* model: 'gemini-2.0-flash-001',
|
|
14400
|
+
* config: {
|
|
14401
|
+
* 'responseModalities': ['AUDIO'],
|
|
14402
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14403
|
+
* }
|
|
14404
|
+
* },
|
|
14405
|
+
* lockAdditionalFields: [],
|
|
14406
|
+
* }
|
|
14407
|
+
* const token = await ai.tokens.create(config);
|
|
14408
|
+
* ```
|
|
14409
|
+
*/
|
|
14410
|
+
async create(params) {
|
|
14411
|
+
var _a, _b;
|
|
14412
|
+
let response;
|
|
14413
|
+
let path = '';
|
|
14414
|
+
let queryParams = {};
|
|
14415
|
+
if (this.apiClient.isVertexAI()) {
|
|
14416
|
+
throw new Error('The client.tokens.create method is only supported by the Gemini Developer API.');
|
|
14417
|
+
}
|
|
14418
|
+
else {
|
|
14419
|
+
const body = createAuthTokenParametersToMldev(this.apiClient, params);
|
|
14420
|
+
path = formatMap('auth_tokens', body['_url']);
|
|
14421
|
+
queryParams = body['_query'];
|
|
14422
|
+
delete body['config'];
|
|
14423
|
+
delete body['_url'];
|
|
14424
|
+
delete body['_query'];
|
|
14425
|
+
const transformedBody = convertBidiSetupToTokenSetup(body, params.config);
|
|
14426
|
+
response = this.apiClient
|
|
14427
|
+
.request({
|
|
14428
|
+
path: path,
|
|
14429
|
+
queryParams: queryParams,
|
|
14430
|
+
body: JSON.stringify(transformedBody),
|
|
14431
|
+
httpMethod: 'POST',
|
|
14432
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
14433
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
14434
|
+
})
|
|
14435
|
+
.then((httpResponse) => {
|
|
14436
|
+
return httpResponse.json();
|
|
14437
|
+
});
|
|
14438
|
+
return response.then((apiResponse) => {
|
|
14439
|
+
const resp = authTokenFromMldev(this.apiClient, apiResponse);
|
|
14440
|
+
return resp;
|
|
14441
|
+
});
|
|
14442
|
+
}
|
|
14443
|
+
}
|
|
14444
|
+
}
|
|
14445
|
+
|
|
14446
|
+
/**
|
|
14447
|
+
* @license
|
|
14448
|
+
* Copyright 2025 Google LLC
|
|
14449
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14450
|
+
*/
|
|
14451
|
+
function getTuningJobParametersToMldev(apiClient, fromObject) {
|
|
14452
|
+
const toObject = {};
|
|
14453
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
14454
|
+
if (fromName != null) {
|
|
14455
|
+
setValueByPath(toObject, ['_url', 'name'], fromName);
|
|
14456
|
+
}
|
|
14457
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14458
|
+
if (fromConfig != null) {
|
|
14459
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
14460
|
+
}
|
|
14461
|
+
return toObject;
|
|
14462
|
+
}
|
|
14463
|
+
function listTuningJobsConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14464
|
+
const toObject = {};
|
|
14465
|
+
const fromPageSize = getValueByPath(fromObject, ['pageSize']);
|
|
14466
|
+
if (parentObject !== undefined && fromPageSize != null) {
|
|
14467
|
+
setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
|
|
14468
|
+
}
|
|
14469
|
+
const fromPageToken = getValueByPath(fromObject, ['pageToken']);
|
|
14470
|
+
if (parentObject !== undefined && fromPageToken != null) {
|
|
14471
|
+
setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
|
|
14472
|
+
}
|
|
14473
|
+
const fromFilter = getValueByPath(fromObject, ['filter']);
|
|
14474
|
+
if (parentObject !== undefined && fromFilter != null) {
|
|
14475
|
+
setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
|
|
14476
|
+
}
|
|
14477
|
+
return toObject;
|
|
14478
|
+
}
|
|
14479
|
+
function listTuningJobsParametersToMldev(apiClient, fromObject) {
|
|
14480
|
+
const toObject = {};
|
|
14481
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14482
|
+
if (fromConfig != null) {
|
|
14483
|
+
setValueByPath(toObject, ['config'], listTuningJobsConfigToMldev(apiClient, fromConfig, toObject));
|
|
14484
|
+
}
|
|
14485
|
+
return toObject;
|
|
14486
|
+
}
|
|
14487
|
+
function tuningExampleToMldev(apiClient, fromObject) {
|
|
13615
14488
|
const toObject = {};
|
|
13616
14489
|
const fromTextInput = getValueByPath(fromObject, ['textInput']);
|
|
13617
14490
|
if (fromTextInput != null) {
|
|
@@ -14503,6 +15376,13 @@ class WebAuth {
|
|
|
14503
15376
|
if (headers.get(GOOGLE_API_KEY_HEADER) !== null) {
|
|
14504
15377
|
return;
|
|
14505
15378
|
}
|
|
15379
|
+
if (this.apiKey.startsWith('auth_tokens/')) {
|
|
15380
|
+
throw new Error('Ephemeral tokens are only supported by the live API.');
|
|
15381
|
+
}
|
|
15382
|
+
// Check if API key is empty or null
|
|
15383
|
+
if (!this.apiKey) {
|
|
15384
|
+
throw new Error('API key is missing. Please provide a valid API key.');
|
|
15385
|
+
}
|
|
14506
15386
|
headers.append(GOOGLE_API_KEY_HEADER, this.apiKey);
|
|
14507
15387
|
}
|
|
14508
15388
|
}
|
|
@@ -14590,9 +15470,10 @@ class GoogleGenAI {
|
|
|
14590
15470
|
this.caches = new Caches(this.apiClient);
|
|
14591
15471
|
this.files = new Files(this.apiClient);
|
|
14592
15472
|
this.operations = new Operations(this.apiClient);
|
|
15473
|
+
this.authTokens = new Tokens(this.apiClient);
|
|
14593
15474
|
this.tunings = new Tunings(this.apiClient);
|
|
14594
15475
|
}
|
|
14595
15476
|
}
|
|
14596
15477
|
|
|
14597
|
-
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,
|
|
15478
|
+
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, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
14598
15479
|
//# sourceMappingURL=index.mjs.map
|