@google/genai 1.2.0 → 1.4.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 +42 -1
- package/dist/genai.d.ts +141 -24
- package/dist/index.cjs +1115 -157
- package/dist/index.mjs +1115 -158
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1120 -158
- package/dist/node/index.mjs +1120 -159
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +141 -24
- package/dist/web/index.mjs +1115 -158
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +141 -24
- 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;
|
|
@@ -1421,7 +1424,6 @@ class ReplayResponse {
|
|
|
1421
1424
|
*/
|
|
1422
1425
|
class RawReferenceImage {
|
|
1423
1426
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1424
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1425
1427
|
toReferenceImageAPI() {
|
|
1426
1428
|
const referenceImageAPI = {
|
|
1427
1429
|
referenceType: 'REFERENCE_TYPE_RAW',
|
|
@@ -1443,7 +1445,6 @@ class RawReferenceImage {
|
|
|
1443
1445
|
*/
|
|
1444
1446
|
class MaskReferenceImage {
|
|
1445
1447
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1446
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1447
1448
|
toReferenceImageAPI() {
|
|
1448
1449
|
const referenceImageAPI = {
|
|
1449
1450
|
referenceType: 'REFERENCE_TYPE_MASK',
|
|
@@ -1466,7 +1467,6 @@ class MaskReferenceImage {
|
|
|
1466
1467
|
*/
|
|
1467
1468
|
class ControlReferenceImage {
|
|
1468
1469
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1469
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1470
1470
|
toReferenceImageAPI() {
|
|
1471
1471
|
const referenceImageAPI = {
|
|
1472
1472
|
referenceType: 'REFERENCE_TYPE_CONTROL',
|
|
@@ -1487,7 +1487,6 @@ class ControlReferenceImage {
|
|
|
1487
1487
|
*/
|
|
1488
1488
|
class StyleReferenceImage {
|
|
1489
1489
|
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1490
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1491
1490
|
toReferenceImageAPI() {
|
|
1492
1491
|
const referenceImageAPI = {
|
|
1493
1492
|
referenceType: 'REFERENCE_TYPE_STYLE',
|
|
@@ -1508,7 +1507,6 @@ class StyleReferenceImage {
|
|
|
1508
1507
|
*/
|
|
1509
1508
|
class SubjectReferenceImage {
|
|
1510
1509
|
/* Internal method to convert to ReferenceImageAPIInternal. */
|
|
1511
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1512
1510
|
toReferenceImageAPI() {
|
|
1513
1511
|
const referenceImageAPI = {
|
|
1514
1512
|
referenceType: 'REFERENCE_TYPE_SUBJECT',
|
|
@@ -1955,16 +1953,16 @@ function flattenTypeArrayToAnyOf(typeList, resultingSchema) {
|
|
|
1955
1953
|
}
|
|
1956
1954
|
const listWithoutNull = typeList.filter((type) => type !== 'null');
|
|
1957
1955
|
if (listWithoutNull.length === 1) {
|
|
1958
|
-
resultingSchema['type'] = Object.
|
|
1959
|
-
?
|
|
1956
|
+
resultingSchema['type'] = Object.values(Type).includes(listWithoutNull[0].toUpperCase())
|
|
1957
|
+
? listWithoutNull[0].toUpperCase()
|
|
1960
1958
|
: Type.TYPE_UNSPECIFIED;
|
|
1961
1959
|
}
|
|
1962
1960
|
else {
|
|
1963
1961
|
resultingSchema['anyOf'] = [];
|
|
1964
1962
|
for (const i of listWithoutNull) {
|
|
1965
1963
|
resultingSchema['anyOf'].push({
|
|
1966
|
-
'type': Object.
|
|
1967
|
-
?
|
|
1964
|
+
'type': Object.values(Type).includes(i.toUpperCase())
|
|
1965
|
+
? i.toUpperCase()
|
|
1968
1966
|
: Type.TYPE_UNSPECIFIED,
|
|
1969
1967
|
});
|
|
1970
1968
|
}
|
|
@@ -2048,7 +2046,7 @@ function processJsonSchema(_jsonSchema) {
|
|
|
2048
2046
|
// beginning of this function.
|
|
2049
2047
|
continue;
|
|
2050
2048
|
}
|
|
2051
|
-
genAISchema['type'] = Object.
|
|
2049
|
+
genAISchema['type'] = Object.values(Type).includes(fieldValue.toUpperCase())
|
|
2052
2050
|
? fieldValue.toUpperCase()
|
|
2053
2051
|
: Type.TYPE_UNSPECIFIED;
|
|
2054
2052
|
}
|
|
@@ -2407,7 +2405,7 @@ function filterToJsonSchema(schema) {
|
|
|
2407
2405
|
}
|
|
2408
2406
|
else if (fieldName === 'type') {
|
|
2409
2407
|
const typeValue = fieldValue.toUpperCase();
|
|
2410
|
-
filteredSchema[fieldName] = Object.
|
|
2408
|
+
filteredSchema[fieldName] = Object.values(Type).includes(typeValue)
|
|
2411
2409
|
? typeValue
|
|
2412
2410
|
: Type.TYPE_UNSPECIFIED;
|
|
2413
2411
|
}
|
|
@@ -2423,7 +2421,7 @@ function filterToJsonSchema(schema) {
|
|
|
2423
2421
|
* Copyright 2025 Google LLC
|
|
2424
2422
|
* SPDX-License-Identifier: Apache-2.0
|
|
2425
2423
|
*/
|
|
2426
|
-
function videoMetadataToMldev$
|
|
2424
|
+
function videoMetadataToMldev$3(apiClient, fromObject) {
|
|
2427
2425
|
const toObject = {};
|
|
2428
2426
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
2429
2427
|
if (fromFps != null) {
|
|
@@ -2439,7 +2437,7 @@ function videoMetadataToMldev$2(apiClient, fromObject) {
|
|
|
2439
2437
|
}
|
|
2440
2438
|
return toObject;
|
|
2441
2439
|
}
|
|
2442
|
-
function blobToMldev$
|
|
2440
|
+
function blobToMldev$3(apiClient, fromObject) {
|
|
2443
2441
|
const toObject = {};
|
|
2444
2442
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2445
2443
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -2454,7 +2452,7 @@ function blobToMldev$2(apiClient, fromObject) {
|
|
|
2454
2452
|
}
|
|
2455
2453
|
return toObject;
|
|
2456
2454
|
}
|
|
2457
|
-
function fileDataToMldev$
|
|
2455
|
+
function fileDataToMldev$3(apiClient, fromObject) {
|
|
2458
2456
|
const toObject = {};
|
|
2459
2457
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
2460
2458
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -2469,13 +2467,13 @@ function fileDataToMldev$2(apiClient, fromObject) {
|
|
|
2469
2467
|
}
|
|
2470
2468
|
return toObject;
|
|
2471
2469
|
}
|
|
2472
|
-
function partToMldev$
|
|
2470
|
+
function partToMldev$3(apiClient, fromObject) {
|
|
2473
2471
|
const toObject = {};
|
|
2474
2472
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
2475
2473
|
'videoMetadata',
|
|
2476
2474
|
]);
|
|
2477
2475
|
if (fromVideoMetadata != null) {
|
|
2478
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$
|
|
2476
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$3(apiClient, fromVideoMetadata));
|
|
2479
2477
|
}
|
|
2480
2478
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
2481
2479
|
if (fromThought != null) {
|
|
@@ -2483,11 +2481,17 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2483
2481
|
}
|
|
2484
2482
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
2485
2483
|
if (fromInlineData != null) {
|
|
2486
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev$
|
|
2484
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$3(apiClient, fromInlineData));
|
|
2487
2485
|
}
|
|
2488
2486
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
2489
2487
|
if (fromFileData != null) {
|
|
2490
|
-
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);
|
|
2491
2495
|
}
|
|
2492
2496
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2493
2497
|
'codeExecutionResult',
|
|
@@ -2517,14 +2521,14 @@ function partToMldev$2(apiClient, fromObject) {
|
|
|
2517
2521
|
}
|
|
2518
2522
|
return toObject;
|
|
2519
2523
|
}
|
|
2520
|
-
function contentToMldev$
|
|
2524
|
+
function contentToMldev$3(apiClient, fromObject) {
|
|
2521
2525
|
const toObject = {};
|
|
2522
2526
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
2523
2527
|
if (fromParts != null) {
|
|
2524
2528
|
let transformedList = fromParts;
|
|
2525
2529
|
if (Array.isArray(transformedList)) {
|
|
2526
2530
|
transformedList = transformedList.map((item) => {
|
|
2527
|
-
return partToMldev$
|
|
2531
|
+
return partToMldev$3(apiClient, item);
|
|
2528
2532
|
});
|
|
2529
2533
|
}
|
|
2530
2534
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -2535,7 +2539,7 @@ function contentToMldev$2(apiClient, fromObject) {
|
|
|
2535
2539
|
}
|
|
2536
2540
|
return toObject;
|
|
2537
2541
|
}
|
|
2538
|
-
function functionDeclarationToMldev$
|
|
2542
|
+
function functionDeclarationToMldev$3(apiClient, fromObject) {
|
|
2539
2543
|
const toObject = {};
|
|
2540
2544
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
2541
2545
|
if (fromBehavior != null) {
|
|
@@ -2559,7 +2563,7 @@ function functionDeclarationToMldev$2(apiClient, fromObject) {
|
|
|
2559
2563
|
}
|
|
2560
2564
|
return toObject;
|
|
2561
2565
|
}
|
|
2562
|
-
function intervalToMldev$
|
|
2566
|
+
function intervalToMldev$3(apiClient, fromObject) {
|
|
2563
2567
|
const toObject = {};
|
|
2564
2568
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
2565
2569
|
if (fromStartTime != null) {
|
|
@@ -2571,17 +2575,17 @@ function intervalToMldev$2(apiClient, fromObject) {
|
|
|
2571
2575
|
}
|
|
2572
2576
|
return toObject;
|
|
2573
2577
|
}
|
|
2574
|
-
function googleSearchToMldev$
|
|
2578
|
+
function googleSearchToMldev$3(apiClient, fromObject) {
|
|
2575
2579
|
const toObject = {};
|
|
2576
2580
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
2577
2581
|
'timeRangeFilter',
|
|
2578
2582
|
]);
|
|
2579
2583
|
if (fromTimeRangeFilter != null) {
|
|
2580
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$
|
|
2584
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(apiClient, fromTimeRangeFilter));
|
|
2581
2585
|
}
|
|
2582
2586
|
return toObject;
|
|
2583
2587
|
}
|
|
2584
|
-
function dynamicRetrievalConfigToMldev$
|
|
2588
|
+
function dynamicRetrievalConfigToMldev$3(apiClient, fromObject) {
|
|
2585
2589
|
const toObject = {};
|
|
2586
2590
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
2587
2591
|
if (fromMode != null) {
|
|
@@ -2595,21 +2599,21 @@ function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
|
|
|
2595
2599
|
}
|
|
2596
2600
|
return toObject;
|
|
2597
2601
|
}
|
|
2598
|
-
function googleSearchRetrievalToMldev$
|
|
2602
|
+
function googleSearchRetrievalToMldev$3(apiClient, fromObject) {
|
|
2599
2603
|
const toObject = {};
|
|
2600
2604
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
2601
2605
|
'dynamicRetrievalConfig',
|
|
2602
2606
|
]);
|
|
2603
2607
|
if (fromDynamicRetrievalConfig != null) {
|
|
2604
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$
|
|
2608
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$3(apiClient, fromDynamicRetrievalConfig));
|
|
2605
2609
|
}
|
|
2606
2610
|
return toObject;
|
|
2607
2611
|
}
|
|
2608
|
-
function urlContextToMldev$
|
|
2612
|
+
function urlContextToMldev$3() {
|
|
2609
2613
|
const toObject = {};
|
|
2610
2614
|
return toObject;
|
|
2611
2615
|
}
|
|
2612
|
-
function toolToMldev$
|
|
2616
|
+
function toolToMldev$3(apiClient, fromObject) {
|
|
2613
2617
|
const toObject = {};
|
|
2614
2618
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
2615
2619
|
'functionDeclarations',
|
|
@@ -2618,7 +2622,7 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2618
2622
|
let transformedList = fromFunctionDeclarations;
|
|
2619
2623
|
if (Array.isArray(transformedList)) {
|
|
2620
2624
|
transformedList = transformedList.map((item) => {
|
|
2621
|
-
return functionDeclarationToMldev$
|
|
2625
|
+
return functionDeclarationToMldev$3(apiClient, item);
|
|
2622
2626
|
});
|
|
2623
2627
|
}
|
|
2624
2628
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -2628,13 +2632,13 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2628
2632
|
}
|
|
2629
2633
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
2630
2634
|
if (fromGoogleSearch != null) {
|
|
2631
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$
|
|
2635
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(apiClient, fromGoogleSearch));
|
|
2632
2636
|
}
|
|
2633
2637
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
2634
2638
|
'googleSearchRetrieval',
|
|
2635
2639
|
]);
|
|
2636
2640
|
if (fromGoogleSearchRetrieval != null) {
|
|
2637
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$
|
|
2641
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$3(apiClient, fromGoogleSearchRetrieval));
|
|
2638
2642
|
}
|
|
2639
2643
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
2640
2644
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -2644,7 +2648,7 @@ function toolToMldev$2(apiClient, fromObject) {
|
|
|
2644
2648
|
}
|
|
2645
2649
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
2646
2650
|
if (fromUrlContext != null) {
|
|
2647
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev$
|
|
2651
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
|
|
2648
2652
|
}
|
|
2649
2653
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
2650
2654
|
'codeExecution',
|
|
@@ -2727,7 +2731,7 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
2727
2731
|
let transformedList = tContents(apiClient, fromContents);
|
|
2728
2732
|
if (Array.isArray(transformedList)) {
|
|
2729
2733
|
transformedList = transformedList.map((item) => {
|
|
2730
|
-
return contentToMldev$
|
|
2734
|
+
return contentToMldev$3(apiClient, item);
|
|
2731
2735
|
});
|
|
2732
2736
|
}
|
|
2733
2737
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -2736,14 +2740,14 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
2736
2740
|
'systemInstruction',
|
|
2737
2741
|
]);
|
|
2738
2742
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
2739
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$
|
|
2743
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$3(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
2740
2744
|
}
|
|
2741
2745
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
2742
2746
|
if (parentObject !== undefined && fromTools != null) {
|
|
2743
2747
|
let transformedList = fromTools;
|
|
2744
2748
|
if (Array.isArray(transformedList)) {
|
|
2745
2749
|
transformedList = transformedList.map((item) => {
|
|
2746
|
-
return toolToMldev$
|
|
2750
|
+
return toolToMldev$3(apiClient, item);
|
|
2747
2751
|
});
|
|
2748
2752
|
}
|
|
2749
2753
|
setValueByPath(parentObject, ['tools'], transformedList);
|
|
@@ -2905,6 +2909,12 @@ function partToVertex$2(apiClient, fromObject) {
|
|
|
2905
2909
|
if (fromFileData != null) {
|
|
2906
2910
|
setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
|
|
2907
2911
|
}
|
|
2912
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
2913
|
+
'thoughtSignature',
|
|
2914
|
+
]);
|
|
2915
|
+
if (fromThoughtSignature != null) {
|
|
2916
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
2917
|
+
}
|
|
2908
2918
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
2909
2919
|
'codeExecutionResult',
|
|
2910
2920
|
]);
|
|
@@ -3072,6 +3082,10 @@ function googleMapsToVertex$2(apiClient, fromObject) {
|
|
|
3072
3082
|
}
|
|
3073
3083
|
return toObject;
|
|
3074
3084
|
}
|
|
3085
|
+
function urlContextToVertex$2() {
|
|
3086
|
+
const toObject = {};
|
|
3087
|
+
return toObject;
|
|
3088
|
+
}
|
|
3075
3089
|
function toolToVertex$2(apiClient, fromObject) {
|
|
3076
3090
|
const toObject = {};
|
|
3077
3091
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
@@ -3110,8 +3124,9 @@ function toolToVertex$2(apiClient, fromObject) {
|
|
|
3110
3124
|
if (fromGoogleMaps != null) {
|
|
3111
3125
|
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$2(apiClient, fromGoogleMaps));
|
|
3112
3126
|
}
|
|
3113
|
-
|
|
3114
|
-
|
|
3127
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
3128
|
+
if (fromUrlContext != null) {
|
|
3129
|
+
setValueByPath(toObject, ['urlContext'], urlContextToVertex$2());
|
|
3115
3130
|
}
|
|
3116
3131
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
3117
3132
|
'codeExecution',
|
|
@@ -4883,7 +4898,7 @@ class Files extends BaseModule {
|
|
|
4883
4898
|
* Copyright 2025 Google LLC
|
|
4884
4899
|
* SPDX-License-Identifier: Apache-2.0
|
|
4885
4900
|
*/
|
|
4886
|
-
function prebuiltVoiceConfigToMldev$
|
|
4901
|
+
function prebuiltVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4887
4902
|
const toObject = {};
|
|
4888
4903
|
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
4889
4904
|
if (fromVoiceName != null) {
|
|
@@ -4899,13 +4914,13 @@ function prebuiltVoiceConfigToVertex$1(apiClient, fromObject) {
|
|
|
4899
4914
|
}
|
|
4900
4915
|
return toObject;
|
|
4901
4916
|
}
|
|
4902
|
-
function voiceConfigToMldev$
|
|
4917
|
+
function voiceConfigToMldev$2(apiClient, fromObject) {
|
|
4903
4918
|
const toObject = {};
|
|
4904
4919
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
4905
4920
|
'prebuiltVoiceConfig',
|
|
4906
4921
|
]);
|
|
4907
4922
|
if (fromPrebuiltVoiceConfig != null) {
|
|
4908
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$
|
|
4923
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$2(apiClient, fromPrebuiltVoiceConfig));
|
|
4909
4924
|
}
|
|
4910
4925
|
return toObject;
|
|
4911
4926
|
}
|
|
@@ -4919,7 +4934,7 @@ function voiceConfigToVertex$1(apiClient, fromObject) {
|
|
|
4919
4934
|
}
|
|
4920
4935
|
return toObject;
|
|
4921
4936
|
}
|
|
4922
|
-
function speakerVoiceConfigToMldev$
|
|
4937
|
+
function speakerVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4923
4938
|
const toObject = {};
|
|
4924
4939
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
4925
4940
|
if (fromSpeaker != null) {
|
|
@@ -4927,11 +4942,11 @@ function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
|
4927
4942
|
}
|
|
4928
4943
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
4929
4944
|
if (fromVoiceConfig != null) {
|
|
4930
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$
|
|
4945
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
|
|
4931
4946
|
}
|
|
4932
4947
|
return toObject;
|
|
4933
4948
|
}
|
|
4934
|
-
function multiSpeakerVoiceConfigToMldev$
|
|
4949
|
+
function multiSpeakerVoiceConfigToMldev$2(apiClient, fromObject) {
|
|
4935
4950
|
const toObject = {};
|
|
4936
4951
|
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
4937
4952
|
'speakerVoiceConfigs',
|
|
@@ -4940,24 +4955,24 @@ function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
|
4940
4955
|
let transformedList = fromSpeakerVoiceConfigs;
|
|
4941
4956
|
if (Array.isArray(transformedList)) {
|
|
4942
4957
|
transformedList = transformedList.map((item) => {
|
|
4943
|
-
return speakerVoiceConfigToMldev$
|
|
4958
|
+
return speakerVoiceConfigToMldev$2(apiClient, item);
|
|
4944
4959
|
});
|
|
4945
4960
|
}
|
|
4946
4961
|
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
4947
4962
|
}
|
|
4948
4963
|
return toObject;
|
|
4949
4964
|
}
|
|
4950
|
-
function speechConfigToMldev$
|
|
4965
|
+
function speechConfigToMldev$2(apiClient, fromObject) {
|
|
4951
4966
|
const toObject = {};
|
|
4952
4967
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
4953
4968
|
if (fromVoiceConfig != null) {
|
|
4954
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$
|
|
4969
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
|
|
4955
4970
|
}
|
|
4956
4971
|
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
4957
4972
|
'multiSpeakerVoiceConfig',
|
|
4958
4973
|
]);
|
|
4959
4974
|
if (fromMultiSpeakerVoiceConfig != null) {
|
|
4960
|
-
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$
|
|
4975
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$2(apiClient, fromMultiSpeakerVoiceConfig));
|
|
4961
4976
|
}
|
|
4962
4977
|
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
4963
4978
|
if (fromLanguageCode != null) {
|
|
@@ -4980,7 +4995,7 @@ function speechConfigToVertex$1(apiClient, fromObject) {
|
|
|
4980
4995
|
}
|
|
4981
4996
|
return toObject;
|
|
4982
4997
|
}
|
|
4983
|
-
function videoMetadataToMldev$
|
|
4998
|
+
function videoMetadataToMldev$2(apiClient, fromObject) {
|
|
4984
4999
|
const toObject = {};
|
|
4985
5000
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
4986
5001
|
if (fromFps != null) {
|
|
@@ -5012,7 +5027,7 @@ function videoMetadataToVertex$1(apiClient, fromObject) {
|
|
|
5012
5027
|
}
|
|
5013
5028
|
return toObject;
|
|
5014
5029
|
}
|
|
5015
|
-
function blobToMldev$
|
|
5030
|
+
function blobToMldev$2(apiClient, fromObject) {
|
|
5016
5031
|
const toObject = {};
|
|
5017
5032
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5018
5033
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -5043,7 +5058,7 @@ function blobToVertex$1(apiClient, fromObject) {
|
|
|
5043
5058
|
}
|
|
5044
5059
|
return toObject;
|
|
5045
5060
|
}
|
|
5046
|
-
function fileDataToMldev$
|
|
5061
|
+
function fileDataToMldev$2(apiClient, fromObject) {
|
|
5047
5062
|
const toObject = {};
|
|
5048
5063
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5049
5064
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -5074,13 +5089,13 @@ function fileDataToVertex$1(apiClient, fromObject) {
|
|
|
5074
5089
|
}
|
|
5075
5090
|
return toObject;
|
|
5076
5091
|
}
|
|
5077
|
-
function partToMldev$
|
|
5092
|
+
function partToMldev$2(apiClient, fromObject) {
|
|
5078
5093
|
const toObject = {};
|
|
5079
5094
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
5080
5095
|
'videoMetadata',
|
|
5081
5096
|
]);
|
|
5082
5097
|
if (fromVideoMetadata != null) {
|
|
5083
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$
|
|
5098
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$2(apiClient, fromVideoMetadata));
|
|
5084
5099
|
}
|
|
5085
5100
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
5086
5101
|
if (fromThought != null) {
|
|
@@ -5088,11 +5103,17 @@ function partToMldev$1(apiClient, fromObject) {
|
|
|
5088
5103
|
}
|
|
5089
5104
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
5090
5105
|
if (fromInlineData != null) {
|
|
5091
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev$
|
|
5106
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
|
|
5092
5107
|
}
|
|
5093
5108
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
5094
5109
|
if (fromFileData != null) {
|
|
5095
|
-
setValueByPath(toObject, ['fileData'], fileDataToMldev$
|
|
5110
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
|
|
5111
|
+
}
|
|
5112
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
5113
|
+
'thoughtSignature',
|
|
5114
|
+
]);
|
|
5115
|
+
if (fromThoughtSignature != null) {
|
|
5116
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
5096
5117
|
}
|
|
5097
5118
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5098
5119
|
'codeExecutionResult',
|
|
@@ -5142,6 +5163,12 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5142
5163
|
if (fromFileData != null) {
|
|
5143
5164
|
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
|
|
5144
5165
|
}
|
|
5166
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
5167
|
+
'thoughtSignature',
|
|
5168
|
+
]);
|
|
5169
|
+
if (fromThoughtSignature != null) {
|
|
5170
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
5171
|
+
}
|
|
5145
5172
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
5146
5173
|
'codeExecutionResult',
|
|
5147
5174
|
]);
|
|
@@ -5170,14 +5197,14 @@ function partToVertex$1(apiClient, fromObject) {
|
|
|
5170
5197
|
}
|
|
5171
5198
|
return toObject;
|
|
5172
5199
|
}
|
|
5173
|
-
function contentToMldev$
|
|
5200
|
+
function contentToMldev$2(apiClient, fromObject) {
|
|
5174
5201
|
const toObject = {};
|
|
5175
5202
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5176
5203
|
if (fromParts != null) {
|
|
5177
5204
|
let transformedList = fromParts;
|
|
5178
5205
|
if (Array.isArray(transformedList)) {
|
|
5179
5206
|
transformedList = transformedList.map((item) => {
|
|
5180
|
-
return partToMldev$
|
|
5207
|
+
return partToMldev$2(apiClient, item);
|
|
5181
5208
|
});
|
|
5182
5209
|
}
|
|
5183
5210
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -5206,7 +5233,7 @@ function contentToVertex$1(apiClient, fromObject) {
|
|
|
5206
5233
|
}
|
|
5207
5234
|
return toObject;
|
|
5208
5235
|
}
|
|
5209
|
-
function functionDeclarationToMldev$
|
|
5236
|
+
function functionDeclarationToMldev$2(apiClient, fromObject) {
|
|
5210
5237
|
const toObject = {};
|
|
5211
5238
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
5212
5239
|
if (fromBehavior != null) {
|
|
@@ -5253,7 +5280,7 @@ function functionDeclarationToVertex$1(apiClient, fromObject) {
|
|
|
5253
5280
|
}
|
|
5254
5281
|
return toObject;
|
|
5255
5282
|
}
|
|
5256
|
-
function intervalToMldev$
|
|
5283
|
+
function intervalToMldev$2(apiClient, fromObject) {
|
|
5257
5284
|
const toObject = {};
|
|
5258
5285
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
5259
5286
|
if (fromStartTime != null) {
|
|
@@ -5277,13 +5304,13 @@ function intervalToVertex$1(apiClient, fromObject) {
|
|
|
5277
5304
|
}
|
|
5278
5305
|
return toObject;
|
|
5279
5306
|
}
|
|
5280
|
-
function googleSearchToMldev$
|
|
5307
|
+
function googleSearchToMldev$2(apiClient, fromObject) {
|
|
5281
5308
|
const toObject = {};
|
|
5282
5309
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
5283
5310
|
'timeRangeFilter',
|
|
5284
5311
|
]);
|
|
5285
5312
|
if (fromTimeRangeFilter != null) {
|
|
5286
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$
|
|
5313
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(apiClient, fromTimeRangeFilter));
|
|
5287
5314
|
}
|
|
5288
5315
|
return toObject;
|
|
5289
5316
|
}
|
|
@@ -5297,7 +5324,7 @@ function googleSearchToVertex$1(apiClient, fromObject) {
|
|
|
5297
5324
|
}
|
|
5298
5325
|
return toObject;
|
|
5299
5326
|
}
|
|
5300
|
-
function dynamicRetrievalConfigToMldev$
|
|
5327
|
+
function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
|
|
5301
5328
|
const toObject = {};
|
|
5302
5329
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5303
5330
|
if (fromMode != null) {
|
|
@@ -5325,13 +5352,13 @@ function dynamicRetrievalConfigToVertex$1(apiClient, fromObject) {
|
|
|
5325
5352
|
}
|
|
5326
5353
|
return toObject;
|
|
5327
5354
|
}
|
|
5328
|
-
function googleSearchRetrievalToMldev$
|
|
5355
|
+
function googleSearchRetrievalToMldev$2(apiClient, fromObject) {
|
|
5329
5356
|
const toObject = {};
|
|
5330
5357
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
5331
5358
|
'dynamicRetrievalConfig',
|
|
5332
5359
|
]);
|
|
5333
5360
|
if (fromDynamicRetrievalConfig != null) {
|
|
5334
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$
|
|
5361
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$2(apiClient, fromDynamicRetrievalConfig));
|
|
5335
5362
|
}
|
|
5336
5363
|
return toObject;
|
|
5337
5364
|
}
|
|
@@ -5397,11 +5424,15 @@ function googleMapsToVertex$1(apiClient, fromObject) {
|
|
|
5397
5424
|
}
|
|
5398
5425
|
return toObject;
|
|
5399
5426
|
}
|
|
5400
|
-
function urlContextToMldev$
|
|
5427
|
+
function urlContextToMldev$2() {
|
|
5401
5428
|
const toObject = {};
|
|
5402
5429
|
return toObject;
|
|
5403
5430
|
}
|
|
5404
|
-
function
|
|
5431
|
+
function urlContextToVertex$1() {
|
|
5432
|
+
const toObject = {};
|
|
5433
|
+
return toObject;
|
|
5434
|
+
}
|
|
5435
|
+
function toolToMldev$2(apiClient, fromObject) {
|
|
5405
5436
|
const toObject = {};
|
|
5406
5437
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5407
5438
|
'functionDeclarations',
|
|
@@ -5410,7 +5441,7 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5410
5441
|
let transformedList = fromFunctionDeclarations;
|
|
5411
5442
|
if (Array.isArray(transformedList)) {
|
|
5412
5443
|
transformedList = transformedList.map((item) => {
|
|
5413
|
-
return functionDeclarationToMldev$
|
|
5444
|
+
return functionDeclarationToMldev$2(apiClient, item);
|
|
5414
5445
|
});
|
|
5415
5446
|
}
|
|
5416
5447
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -5420,13 +5451,13 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5420
5451
|
}
|
|
5421
5452
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5422
5453
|
if (fromGoogleSearch != null) {
|
|
5423
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$
|
|
5454
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(apiClient, fromGoogleSearch));
|
|
5424
5455
|
}
|
|
5425
5456
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5426
5457
|
'googleSearchRetrieval',
|
|
5427
5458
|
]);
|
|
5428
5459
|
if (fromGoogleSearchRetrieval != null) {
|
|
5429
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$
|
|
5460
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$2(apiClient, fromGoogleSearchRetrieval));
|
|
5430
5461
|
}
|
|
5431
5462
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5432
5463
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -5436,7 +5467,7 @@ function toolToMldev$1(apiClient, fromObject) {
|
|
|
5436
5467
|
}
|
|
5437
5468
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5438
5469
|
if (fromUrlContext != null) {
|
|
5439
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev$
|
|
5470
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
|
|
5440
5471
|
}
|
|
5441
5472
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5442
5473
|
'codeExecution',
|
|
@@ -5484,8 +5515,9 @@ function toolToVertex$1(apiClient, fromObject) {
|
|
|
5484
5515
|
if (fromGoogleMaps != null) {
|
|
5485
5516
|
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(apiClient, fromGoogleMaps));
|
|
5486
5517
|
}
|
|
5487
|
-
|
|
5488
|
-
|
|
5518
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5519
|
+
if (fromUrlContext != null) {
|
|
5520
|
+
setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
|
|
5489
5521
|
}
|
|
5490
5522
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5491
5523
|
'codeExecution',
|
|
@@ -5495,7 +5527,7 @@ function toolToVertex$1(apiClient, fromObject) {
|
|
|
5495
5527
|
}
|
|
5496
5528
|
return toObject;
|
|
5497
5529
|
}
|
|
5498
|
-
function sessionResumptionConfigToMldev(apiClient, fromObject) {
|
|
5530
|
+
function sessionResumptionConfigToMldev$1(apiClient, fromObject) {
|
|
5499
5531
|
const toObject = {};
|
|
5500
5532
|
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
5501
5533
|
if (fromHandle != null) {
|
|
@@ -5518,7 +5550,7 @@ function sessionResumptionConfigToVertex(apiClient, fromObject) {
|
|
|
5518
5550
|
}
|
|
5519
5551
|
return toObject;
|
|
5520
5552
|
}
|
|
5521
|
-
function audioTranscriptionConfigToMldev() {
|
|
5553
|
+
function audioTranscriptionConfigToMldev$1() {
|
|
5522
5554
|
const toObject = {};
|
|
5523
5555
|
return toObject;
|
|
5524
5556
|
}
|
|
@@ -5526,7 +5558,7 @@ function audioTranscriptionConfigToVertex() {
|
|
|
5526
5558
|
const toObject = {};
|
|
5527
5559
|
return toObject;
|
|
5528
5560
|
}
|
|
5529
|
-
function automaticActivityDetectionToMldev(apiClient, fromObject) {
|
|
5561
|
+
function automaticActivityDetectionToMldev$1(apiClient, fromObject) {
|
|
5530
5562
|
const toObject = {};
|
|
5531
5563
|
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
5532
5564
|
if (fromDisabled != null) {
|
|
@@ -5590,13 +5622,13 @@ function automaticActivityDetectionToVertex(apiClient, fromObject) {
|
|
|
5590
5622
|
}
|
|
5591
5623
|
return toObject;
|
|
5592
5624
|
}
|
|
5593
|
-
function realtimeInputConfigToMldev(apiClient, fromObject) {
|
|
5625
|
+
function realtimeInputConfigToMldev$1(apiClient, fromObject) {
|
|
5594
5626
|
const toObject = {};
|
|
5595
5627
|
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
5596
5628
|
'automaticActivityDetection',
|
|
5597
5629
|
]);
|
|
5598
5630
|
if (fromAutomaticActivityDetection != null) {
|
|
5599
|
-
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
|
|
5631
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev$1(apiClient, fromAutomaticActivityDetection));
|
|
5600
5632
|
}
|
|
5601
5633
|
const fromActivityHandling = getValueByPath(fromObject, [
|
|
5602
5634
|
'activityHandling',
|
|
@@ -5630,7 +5662,7 @@ function realtimeInputConfigToVertex(apiClient, fromObject) {
|
|
|
5630
5662
|
}
|
|
5631
5663
|
return toObject;
|
|
5632
5664
|
}
|
|
5633
|
-
function slidingWindowToMldev(apiClient, fromObject) {
|
|
5665
|
+
function slidingWindowToMldev$1(apiClient, fromObject) {
|
|
5634
5666
|
const toObject = {};
|
|
5635
5667
|
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
5636
5668
|
if (fromTargetTokens != null) {
|
|
@@ -5646,7 +5678,7 @@ function slidingWindowToVertex(apiClient, fromObject) {
|
|
|
5646
5678
|
}
|
|
5647
5679
|
return toObject;
|
|
5648
5680
|
}
|
|
5649
|
-
function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
5681
|
+
function contextWindowCompressionConfigToMldev$1(apiClient, fromObject) {
|
|
5650
5682
|
const toObject = {};
|
|
5651
5683
|
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
5652
5684
|
'triggerTokens',
|
|
@@ -5658,7 +5690,7 @@ function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
|
5658
5690
|
'slidingWindow',
|
|
5659
5691
|
]);
|
|
5660
5692
|
if (fromSlidingWindow != null) {
|
|
5661
|
-
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
|
|
5693
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev$1(apiClient, fromSlidingWindow));
|
|
5662
5694
|
}
|
|
5663
5695
|
return toObject;
|
|
5664
5696
|
}
|
|
@@ -5678,7 +5710,7 @@ function contextWindowCompressionConfigToVertex(apiClient, fromObject) {
|
|
|
5678
5710
|
}
|
|
5679
5711
|
return toObject;
|
|
5680
5712
|
}
|
|
5681
|
-
function proactivityConfigToMldev(apiClient, fromObject) {
|
|
5713
|
+
function proactivityConfigToMldev$1(apiClient, fromObject) {
|
|
5682
5714
|
const toObject = {};
|
|
5683
5715
|
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
5684
5716
|
'proactiveAudio',
|
|
@@ -5698,7 +5730,7 @@ function proactivityConfigToVertex(apiClient, fromObject) {
|
|
|
5698
5730
|
}
|
|
5699
5731
|
return toObject;
|
|
5700
5732
|
}
|
|
5701
|
-
function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
5733
|
+
function liveConnectConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
5702
5734
|
const toObject = {};
|
|
5703
5735
|
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
5704
5736
|
'generationConfig',
|
|
@@ -5742,7 +5774,7 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5742
5774
|
}
|
|
5743
5775
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
5744
5776
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
5745
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$
|
|
5777
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$2(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
|
|
5746
5778
|
}
|
|
5747
5779
|
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
5748
5780
|
'enableAffectiveDialog',
|
|
@@ -5754,14 +5786,14 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5754
5786
|
'systemInstruction',
|
|
5755
5787
|
]);
|
|
5756
5788
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
5757
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$
|
|
5789
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$2(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
5758
5790
|
}
|
|
5759
5791
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
5760
5792
|
if (parentObject !== undefined && fromTools != null) {
|
|
5761
5793
|
let transformedList = tTools(apiClient, fromTools);
|
|
5762
5794
|
if (Array.isArray(transformedList)) {
|
|
5763
5795
|
transformedList = transformedList.map((item) => {
|
|
5764
|
-
return toolToMldev$
|
|
5796
|
+
return toolToMldev$2(apiClient, tTool(apiClient, item));
|
|
5765
5797
|
});
|
|
5766
5798
|
}
|
|
5767
5799
|
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
@@ -5770,35 +5802,35 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
5770
5802
|
'sessionResumption',
|
|
5771
5803
|
]);
|
|
5772
5804
|
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
5773
|
-
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
|
|
5805
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev$1(apiClient, fromSessionResumption));
|
|
5774
5806
|
}
|
|
5775
5807
|
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
5776
5808
|
'inputAudioTranscription',
|
|
5777
5809
|
]);
|
|
5778
5810
|
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
5779
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
5811
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1());
|
|
5780
5812
|
}
|
|
5781
5813
|
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
5782
5814
|
'outputAudioTranscription',
|
|
5783
5815
|
]);
|
|
5784
5816
|
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
5785
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
5817
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1());
|
|
5786
5818
|
}
|
|
5787
5819
|
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
5788
5820
|
'realtimeInputConfig',
|
|
5789
5821
|
]);
|
|
5790
5822
|
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
5791
|
-
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
|
|
5823
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev$1(apiClient, fromRealtimeInputConfig));
|
|
5792
5824
|
}
|
|
5793
5825
|
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
5794
5826
|
'contextWindowCompression',
|
|
5795
5827
|
]);
|
|
5796
5828
|
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
5797
|
-
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
|
|
5829
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev$1(apiClient, fromContextWindowCompression));
|
|
5798
5830
|
}
|
|
5799
5831
|
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
5800
5832
|
if (parentObject !== undefined && fromProactivity != null) {
|
|
5801
|
-
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
|
|
5833
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev$1(apiClient, fromProactivity));
|
|
5802
5834
|
}
|
|
5803
5835
|
return toObject;
|
|
5804
5836
|
}
|
|
@@ -5914,7 +5946,7 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
|
5914
5946
|
}
|
|
5915
5947
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
5916
5948
|
if (fromConfig != null) {
|
|
5917
|
-
setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
|
|
5949
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToMldev$1(apiClient, fromConfig, toObject));
|
|
5918
5950
|
}
|
|
5919
5951
|
return toObject;
|
|
5920
5952
|
}
|
|
@@ -6269,6 +6301,12 @@ function partFromMldev$1(apiClient, fromObject) {
|
|
|
6269
6301
|
if (fromFileData != null) {
|
|
6270
6302
|
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
|
|
6271
6303
|
}
|
|
6304
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6305
|
+
'thoughtSignature',
|
|
6306
|
+
]);
|
|
6307
|
+
if (fromThoughtSignature != null) {
|
|
6308
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6309
|
+
}
|
|
6272
6310
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6273
6311
|
'codeExecutionResult',
|
|
6274
6312
|
]);
|
|
@@ -6317,6 +6355,12 @@ function partFromVertex$1(apiClient, fromObject) {
|
|
|
6317
6355
|
if (fromFileData != null) {
|
|
6318
6356
|
setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
|
|
6319
6357
|
}
|
|
6358
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6359
|
+
'thoughtSignature',
|
|
6360
|
+
]);
|
|
6361
|
+
if (fromThoughtSignature != null) {
|
|
6362
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6363
|
+
}
|
|
6320
6364
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6321
6365
|
'codeExecutionResult',
|
|
6322
6366
|
]);
|
|
@@ -7107,7 +7151,7 @@ function liveMusicServerMessageFromMldev(apiClient, fromObject) {
|
|
|
7107
7151
|
* Copyright 2025 Google LLC
|
|
7108
7152
|
* SPDX-License-Identifier: Apache-2.0
|
|
7109
7153
|
*/
|
|
7110
|
-
function videoMetadataToMldev(apiClient, fromObject) {
|
|
7154
|
+
function videoMetadataToMldev$1(apiClient, fromObject) {
|
|
7111
7155
|
const toObject = {};
|
|
7112
7156
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
7113
7157
|
if (fromFps != null) {
|
|
@@ -7123,7 +7167,7 @@ function videoMetadataToMldev(apiClient, fromObject) {
|
|
|
7123
7167
|
}
|
|
7124
7168
|
return toObject;
|
|
7125
7169
|
}
|
|
7126
|
-
function blobToMldev(apiClient, fromObject) {
|
|
7170
|
+
function blobToMldev$1(apiClient, fromObject) {
|
|
7127
7171
|
const toObject = {};
|
|
7128
7172
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7129
7173
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -7138,7 +7182,7 @@ function blobToMldev(apiClient, fromObject) {
|
|
|
7138
7182
|
}
|
|
7139
7183
|
return toObject;
|
|
7140
7184
|
}
|
|
7141
|
-
function fileDataToMldev(apiClient, fromObject) {
|
|
7185
|
+
function fileDataToMldev$1(apiClient, fromObject) {
|
|
7142
7186
|
const toObject = {};
|
|
7143
7187
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
7144
7188
|
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
@@ -7153,13 +7197,13 @@ function fileDataToMldev(apiClient, fromObject) {
|
|
|
7153
7197
|
}
|
|
7154
7198
|
return toObject;
|
|
7155
7199
|
}
|
|
7156
|
-
function partToMldev(apiClient, fromObject) {
|
|
7200
|
+
function partToMldev$1(apiClient, fromObject) {
|
|
7157
7201
|
const toObject = {};
|
|
7158
7202
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
7159
7203
|
'videoMetadata',
|
|
7160
7204
|
]);
|
|
7161
7205
|
if (fromVideoMetadata != null) {
|
|
7162
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
|
|
7206
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$1(apiClient, fromVideoMetadata));
|
|
7163
7207
|
}
|
|
7164
7208
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
7165
7209
|
if (fromThought != null) {
|
|
@@ -7167,11 +7211,17 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7167
7211
|
}
|
|
7168
7212
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
7169
7213
|
if (fromInlineData != null) {
|
|
7170
|
-
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
7214
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
|
|
7171
7215
|
}
|
|
7172
7216
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7173
7217
|
if (fromFileData != null) {
|
|
7174
|
-
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
7218
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
|
|
7219
|
+
}
|
|
7220
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
7221
|
+
'thoughtSignature',
|
|
7222
|
+
]);
|
|
7223
|
+
if (fromThoughtSignature != null) {
|
|
7224
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
7175
7225
|
}
|
|
7176
7226
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7177
7227
|
'codeExecutionResult',
|
|
@@ -7201,14 +7251,14 @@ function partToMldev(apiClient, fromObject) {
|
|
|
7201
7251
|
}
|
|
7202
7252
|
return toObject;
|
|
7203
7253
|
}
|
|
7204
|
-
function contentToMldev(apiClient, fromObject) {
|
|
7254
|
+
function contentToMldev$1(apiClient, fromObject) {
|
|
7205
7255
|
const toObject = {};
|
|
7206
7256
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7207
7257
|
if (fromParts != null) {
|
|
7208
7258
|
let transformedList = fromParts;
|
|
7209
7259
|
if (Array.isArray(transformedList)) {
|
|
7210
7260
|
transformedList = transformedList.map((item) => {
|
|
7211
|
-
return partToMldev(apiClient, item);
|
|
7261
|
+
return partToMldev$1(apiClient, item);
|
|
7212
7262
|
});
|
|
7213
7263
|
}
|
|
7214
7264
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -7332,7 +7382,7 @@ function safetySettingToMldev(apiClient, fromObject) {
|
|
|
7332
7382
|
}
|
|
7333
7383
|
return toObject;
|
|
7334
7384
|
}
|
|
7335
|
-
function functionDeclarationToMldev(apiClient, fromObject) {
|
|
7385
|
+
function functionDeclarationToMldev$1(apiClient, fromObject) {
|
|
7336
7386
|
const toObject = {};
|
|
7337
7387
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
7338
7388
|
if (fromBehavior != null) {
|
|
@@ -7356,7 +7406,7 @@ function functionDeclarationToMldev(apiClient, fromObject) {
|
|
|
7356
7406
|
}
|
|
7357
7407
|
return toObject;
|
|
7358
7408
|
}
|
|
7359
|
-
function intervalToMldev(apiClient, fromObject) {
|
|
7409
|
+
function intervalToMldev$1(apiClient, fromObject) {
|
|
7360
7410
|
const toObject = {};
|
|
7361
7411
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7362
7412
|
if (fromStartTime != null) {
|
|
@@ -7368,17 +7418,17 @@ function intervalToMldev(apiClient, fromObject) {
|
|
|
7368
7418
|
}
|
|
7369
7419
|
return toObject;
|
|
7370
7420
|
}
|
|
7371
|
-
function googleSearchToMldev(apiClient, fromObject) {
|
|
7421
|
+
function googleSearchToMldev$1(apiClient, fromObject) {
|
|
7372
7422
|
const toObject = {};
|
|
7373
7423
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7374
7424
|
'timeRangeFilter',
|
|
7375
7425
|
]);
|
|
7376
7426
|
if (fromTimeRangeFilter != null) {
|
|
7377
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
|
|
7427
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(apiClient, fromTimeRangeFilter));
|
|
7378
7428
|
}
|
|
7379
7429
|
return toObject;
|
|
7380
7430
|
}
|
|
7381
|
-
function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
7431
|
+
function dynamicRetrievalConfigToMldev$1(apiClient, fromObject) {
|
|
7382
7432
|
const toObject = {};
|
|
7383
7433
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7384
7434
|
if (fromMode != null) {
|
|
@@ -7392,21 +7442,21 @@ function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
|
7392
7442
|
}
|
|
7393
7443
|
return toObject;
|
|
7394
7444
|
}
|
|
7395
|
-
function googleSearchRetrievalToMldev(apiClient, fromObject) {
|
|
7445
|
+
function googleSearchRetrievalToMldev$1(apiClient, fromObject) {
|
|
7396
7446
|
const toObject = {};
|
|
7397
7447
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7398
7448
|
'dynamicRetrievalConfig',
|
|
7399
7449
|
]);
|
|
7400
7450
|
if (fromDynamicRetrievalConfig != null) {
|
|
7401
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
|
|
7451
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$1(apiClient, fromDynamicRetrievalConfig));
|
|
7402
7452
|
}
|
|
7403
7453
|
return toObject;
|
|
7404
7454
|
}
|
|
7405
|
-
function urlContextToMldev() {
|
|
7455
|
+
function urlContextToMldev$1() {
|
|
7406
7456
|
const toObject = {};
|
|
7407
7457
|
return toObject;
|
|
7408
7458
|
}
|
|
7409
|
-
function toolToMldev(apiClient, fromObject) {
|
|
7459
|
+
function toolToMldev$1(apiClient, fromObject) {
|
|
7410
7460
|
const toObject = {};
|
|
7411
7461
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7412
7462
|
'functionDeclarations',
|
|
@@ -7415,7 +7465,7 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7415
7465
|
let transformedList = fromFunctionDeclarations;
|
|
7416
7466
|
if (Array.isArray(transformedList)) {
|
|
7417
7467
|
transformedList = transformedList.map((item) => {
|
|
7418
|
-
return functionDeclarationToMldev(apiClient, item);
|
|
7468
|
+
return functionDeclarationToMldev$1(apiClient, item);
|
|
7419
7469
|
});
|
|
7420
7470
|
}
|
|
7421
7471
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -7425,13 +7475,13 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7425
7475
|
}
|
|
7426
7476
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7427
7477
|
if (fromGoogleSearch != null) {
|
|
7428
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
|
|
7478
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(apiClient, fromGoogleSearch));
|
|
7429
7479
|
}
|
|
7430
7480
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7431
7481
|
'googleSearchRetrieval',
|
|
7432
7482
|
]);
|
|
7433
7483
|
if (fromGoogleSearchRetrieval != null) {
|
|
7434
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
|
|
7484
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$1(apiClient, fromGoogleSearchRetrieval));
|
|
7435
7485
|
}
|
|
7436
7486
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7437
7487
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
@@ -7441,7 +7491,7 @@ function toolToMldev(apiClient, fromObject) {
|
|
|
7441
7491
|
}
|
|
7442
7492
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7443
7493
|
if (fromUrlContext != null) {
|
|
7444
|
-
setValueByPath(toObject, ['urlContext'], urlContextToMldev());
|
|
7494
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
|
|
7445
7495
|
}
|
|
7446
7496
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7447
7497
|
'codeExecution',
|
|
@@ -7505,7 +7555,7 @@ function toolConfigToMldev(apiClient, fromObject) {
|
|
|
7505
7555
|
}
|
|
7506
7556
|
return toObject;
|
|
7507
7557
|
}
|
|
7508
|
-
function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
7558
|
+
function prebuiltVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7509
7559
|
const toObject = {};
|
|
7510
7560
|
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
7511
7561
|
if (fromVoiceName != null) {
|
|
@@ -7513,17 +7563,17 @@ function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7513
7563
|
}
|
|
7514
7564
|
return toObject;
|
|
7515
7565
|
}
|
|
7516
|
-
function voiceConfigToMldev(apiClient, fromObject) {
|
|
7566
|
+
function voiceConfigToMldev$1(apiClient, fromObject) {
|
|
7517
7567
|
const toObject = {};
|
|
7518
7568
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
7519
7569
|
'prebuiltVoiceConfig',
|
|
7520
7570
|
]);
|
|
7521
7571
|
if (fromPrebuiltVoiceConfig != null) {
|
|
7522
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
|
|
7572
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$1(apiClient, fromPrebuiltVoiceConfig));
|
|
7523
7573
|
}
|
|
7524
7574
|
return toObject;
|
|
7525
7575
|
}
|
|
7526
|
-
function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
7576
|
+
function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7527
7577
|
const toObject = {};
|
|
7528
7578
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
7529
7579
|
if (fromSpeaker != null) {
|
|
@@ -7531,11 +7581,11 @@ function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7531
7581
|
}
|
|
7532
7582
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7533
7583
|
if (fromVoiceConfig != null) {
|
|
7534
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
7584
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
|
|
7535
7585
|
}
|
|
7536
7586
|
return toObject;
|
|
7537
7587
|
}
|
|
7538
|
-
function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
7588
|
+
function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
|
|
7539
7589
|
const toObject = {};
|
|
7540
7590
|
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
7541
7591
|
'speakerVoiceConfigs',
|
|
@@ -7544,24 +7594,24 @@ function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
|
7544
7594
|
let transformedList = fromSpeakerVoiceConfigs;
|
|
7545
7595
|
if (Array.isArray(transformedList)) {
|
|
7546
7596
|
transformedList = transformedList.map((item) => {
|
|
7547
|
-
return speakerVoiceConfigToMldev(apiClient, item);
|
|
7597
|
+
return speakerVoiceConfigToMldev$1(apiClient, item);
|
|
7548
7598
|
});
|
|
7549
7599
|
}
|
|
7550
7600
|
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
7551
7601
|
}
|
|
7552
7602
|
return toObject;
|
|
7553
7603
|
}
|
|
7554
|
-
function speechConfigToMldev(apiClient, fromObject) {
|
|
7604
|
+
function speechConfigToMldev$1(apiClient, fromObject) {
|
|
7555
7605
|
const toObject = {};
|
|
7556
7606
|
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7557
7607
|
if (fromVoiceConfig != null) {
|
|
7558
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
7608
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
|
|
7559
7609
|
}
|
|
7560
7610
|
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
7561
7611
|
'multiSpeakerVoiceConfig',
|
|
7562
7612
|
]);
|
|
7563
7613
|
if (fromMultiSpeakerVoiceConfig != null) {
|
|
7564
|
-
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
|
|
7614
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$1(apiClient, fromMultiSpeakerVoiceConfig));
|
|
7565
7615
|
}
|
|
7566
7616
|
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
7567
7617
|
if (fromLanguageCode != null) {
|
|
@@ -7591,7 +7641,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7591
7641
|
'systemInstruction',
|
|
7592
7642
|
]);
|
|
7593
7643
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
7594
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
7644
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToMldev$1(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
7595
7645
|
}
|
|
7596
7646
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
7597
7647
|
if (fromTemperature != null) {
|
|
@@ -7684,7 +7734,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7684
7734
|
let transformedList = tTools(apiClient, fromTools);
|
|
7685
7735
|
if (Array.isArray(transformedList)) {
|
|
7686
7736
|
transformedList = transformedList.map((item) => {
|
|
7687
|
-
return toolToMldev(apiClient, tTool(apiClient, item));
|
|
7737
|
+
return toolToMldev$1(apiClient, tTool(apiClient, item));
|
|
7688
7738
|
});
|
|
7689
7739
|
}
|
|
7690
7740
|
setValueByPath(parentObject, ['tools'], transformedList);
|
|
@@ -7716,7 +7766,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
7716
7766
|
}
|
|
7717
7767
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7718
7768
|
if (fromSpeechConfig != null) {
|
|
7719
|
-
setValueByPath(toObject, ['speechConfig'], speechConfigToMldev(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
|
|
7769
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToMldev$1(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
|
|
7720
7770
|
}
|
|
7721
7771
|
if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
|
|
7722
7772
|
throw new Error('audioTimestamp parameter is not supported in Gemini API.');
|
|
@@ -7740,7 +7790,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
|
|
|
7740
7790
|
let transformedList = tContents(apiClient, fromContents);
|
|
7741
7791
|
if (Array.isArray(transformedList)) {
|
|
7742
7792
|
transformedList = transformedList.map((item) => {
|
|
7743
|
-
return contentToMldev(apiClient, item);
|
|
7793
|
+
return contentToMldev$1(apiClient, item);
|
|
7744
7794
|
});
|
|
7745
7795
|
}
|
|
7746
7796
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -7992,7 +8042,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
|
|
|
7992
8042
|
let transformedList = tContents(apiClient, fromContents);
|
|
7993
8043
|
if (Array.isArray(transformedList)) {
|
|
7994
8044
|
transformedList = transformedList.map((item) => {
|
|
7995
|
-
return contentToMldev(apiClient, item);
|
|
8045
|
+
return contentToMldev$1(apiClient, item);
|
|
7996
8046
|
});
|
|
7997
8047
|
}
|
|
7998
8048
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -8063,8 +8113,11 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
|
|
|
8063
8113
|
if (parentObject !== undefined && fromNegativePrompt != null) {
|
|
8064
8114
|
setValueByPath(parentObject, ['parameters', 'negativePrompt'], fromNegativePrompt);
|
|
8065
8115
|
}
|
|
8066
|
-
|
|
8067
|
-
|
|
8116
|
+
const fromEnhancePrompt = getValueByPath(fromObject, [
|
|
8117
|
+
'enhancePrompt',
|
|
8118
|
+
]);
|
|
8119
|
+
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
8120
|
+
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
8068
8121
|
}
|
|
8069
8122
|
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
8070
8123
|
throw new Error('generateAudio parameter is not supported in Gemini API.');
|
|
@@ -8159,6 +8212,12 @@ function partToVertex(apiClient, fromObject) {
|
|
|
8159
8212
|
if (fromFileData != null) {
|
|
8160
8213
|
setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
|
|
8161
8214
|
}
|
|
8215
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8216
|
+
'thoughtSignature',
|
|
8217
|
+
]);
|
|
8218
|
+
if (fromThoughtSignature != null) {
|
|
8219
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8220
|
+
}
|
|
8162
8221
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8163
8222
|
'codeExecutionResult',
|
|
8164
8223
|
]);
|
|
@@ -8450,6 +8509,10 @@ function googleMapsToVertex(apiClient, fromObject) {
|
|
|
8450
8509
|
}
|
|
8451
8510
|
return toObject;
|
|
8452
8511
|
}
|
|
8512
|
+
function urlContextToVertex() {
|
|
8513
|
+
const toObject = {};
|
|
8514
|
+
return toObject;
|
|
8515
|
+
}
|
|
8453
8516
|
function toolToVertex(apiClient, fromObject) {
|
|
8454
8517
|
const toObject = {};
|
|
8455
8518
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
@@ -8488,8 +8551,9 @@ function toolToVertex(apiClient, fromObject) {
|
|
|
8488
8551
|
if (fromGoogleMaps != null) {
|
|
8489
8552
|
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex(apiClient, fromGoogleMaps));
|
|
8490
8553
|
}
|
|
8491
|
-
|
|
8492
|
-
|
|
8554
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
8555
|
+
if (fromUrlContext != null) {
|
|
8556
|
+
setValueByPath(toObject, ['urlContext'], urlContextToVertex());
|
|
8493
8557
|
}
|
|
8494
8558
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8495
8559
|
'codeExecution',
|
|
@@ -9496,6 +9560,12 @@ function partFromMldev(apiClient, fromObject) {
|
|
|
9496
9560
|
if (fromFileData != null) {
|
|
9497
9561
|
setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
|
|
9498
9562
|
}
|
|
9563
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
9564
|
+
'thoughtSignature',
|
|
9565
|
+
]);
|
|
9566
|
+
if (fromThoughtSignature != null) {
|
|
9567
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
9568
|
+
}
|
|
9499
9569
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
9500
9570
|
'codeExecutionResult',
|
|
9501
9571
|
]);
|
|
@@ -10014,6 +10084,12 @@ function partFromVertex(apiClient, fromObject) {
|
|
|
10014
10084
|
if (fromFileData != null) {
|
|
10015
10085
|
setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
|
|
10016
10086
|
}
|
|
10087
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
10088
|
+
'thoughtSignature',
|
|
10089
|
+
]);
|
|
10090
|
+
if (fromThoughtSignature != null) {
|
|
10091
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
10092
|
+
}
|
|
10017
10093
|
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
10018
10094
|
'codeExecutionResult',
|
|
10019
10095
|
]);
|
|
@@ -10068,6 +10144,34 @@ function citationMetadataFromVertex(apiClient, fromObject) {
|
|
|
10068
10144
|
}
|
|
10069
10145
|
return toObject;
|
|
10070
10146
|
}
|
|
10147
|
+
function urlMetadataFromVertex(apiClient, fromObject) {
|
|
10148
|
+
const toObject = {};
|
|
10149
|
+
const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
|
|
10150
|
+
if (fromRetrievedUrl != null) {
|
|
10151
|
+
setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
|
|
10152
|
+
}
|
|
10153
|
+
const fromUrlRetrievalStatus = getValueByPath(fromObject, [
|
|
10154
|
+
'urlRetrievalStatus',
|
|
10155
|
+
]);
|
|
10156
|
+
if (fromUrlRetrievalStatus != null) {
|
|
10157
|
+
setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
|
|
10158
|
+
}
|
|
10159
|
+
return toObject;
|
|
10160
|
+
}
|
|
10161
|
+
function urlContextMetadataFromVertex(apiClient, fromObject) {
|
|
10162
|
+
const toObject = {};
|
|
10163
|
+
const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
|
|
10164
|
+
if (fromUrlMetadata != null) {
|
|
10165
|
+
let transformedList = fromUrlMetadata;
|
|
10166
|
+
if (Array.isArray(transformedList)) {
|
|
10167
|
+
transformedList = transformedList.map((item) => {
|
|
10168
|
+
return urlMetadataFromVertex(apiClient, item);
|
|
10169
|
+
});
|
|
10170
|
+
}
|
|
10171
|
+
setValueByPath(toObject, ['urlMetadata'], transformedList);
|
|
10172
|
+
}
|
|
10173
|
+
return toObject;
|
|
10174
|
+
}
|
|
10071
10175
|
function candidateFromVertex(apiClient, fromObject) {
|
|
10072
10176
|
const toObject = {};
|
|
10073
10177
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
@@ -10090,6 +10194,12 @@ function candidateFromVertex(apiClient, fromObject) {
|
|
|
10090
10194
|
if (fromFinishReason != null) {
|
|
10091
10195
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
10092
10196
|
}
|
|
10197
|
+
const fromUrlContextMetadata = getValueByPath(fromObject, [
|
|
10198
|
+
'urlContextMetadata',
|
|
10199
|
+
]);
|
|
10200
|
+
if (fromUrlContextMetadata != null) {
|
|
10201
|
+
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromVertex(apiClient, fromUrlContextMetadata));
|
|
10202
|
+
}
|
|
10093
10203
|
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
10094
10204
|
if (fromAvgLogprobs != null) {
|
|
10095
10205
|
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
@@ -10556,7 +10666,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10556
10666
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10557
10667
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10558
10668
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10559
|
-
const SDK_VERSION = '1.
|
|
10669
|
+
const SDK_VERSION = '1.4.0'; // x-release-please-version
|
|
10560
10670
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10561
10671
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10562
10672
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11108,11 +11218,9 @@ function hasNonMcpTools(params) {
|
|
|
11108
11218
|
}
|
|
11109
11219
|
// Returns true if the object is a MCP CallableTool, otherwise false.
|
|
11110
11220
|
function isMcpCallableTool(object) {
|
|
11111
|
-
// TODO: b/418266406 - Add a more robust check for the MCP CallableTool.
|
|
11112
11221
|
return (object !== null &&
|
|
11113
11222
|
typeof object === 'object' &&
|
|
11114
|
-
|
|
11115
|
-
'callTool' in object);
|
|
11223
|
+
object instanceof McpCallableTool);
|
|
11116
11224
|
}
|
|
11117
11225
|
// List all tools from the MCP client.
|
|
11118
11226
|
function listAllTools(mcpClient, maxTools = 100) {
|
|
@@ -11592,7 +11700,14 @@ class Live {
|
|
|
11592
11700
|
}
|
|
11593
11701
|
else {
|
|
11594
11702
|
const apiKey = this.apiClient.getApiKey();
|
|
11595
|
-
|
|
11703
|
+
let method = 'BidiGenerateContent';
|
|
11704
|
+
let keyName = 'key';
|
|
11705
|
+
if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
|
|
11706
|
+
console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
|
|
11707
|
+
method = 'BidiGenerateContentConstrained';
|
|
11708
|
+
keyName = 'access_token';
|
|
11709
|
+
}
|
|
11710
|
+
url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.${method}?${keyName}=${apiKey}`;
|
|
11596
11711
|
}
|
|
11597
11712
|
let onopenResolve = () => { };
|
|
11598
11713
|
const onopenPromise = new Promise((resolve) => {
|
|
@@ -11698,7 +11813,7 @@ class Session {
|
|
|
11698
11813
|
contents = contents.map((item) => contentToVertex(apiClient, item));
|
|
11699
11814
|
}
|
|
11700
11815
|
else {
|
|
11701
|
-
contents = contents.map((item) => contentToMldev(apiClient, item));
|
|
11816
|
+
contents = contents.map((item) => contentToMldev$1(apiClient, item));
|
|
11702
11817
|
}
|
|
11703
11818
|
}
|
|
11704
11819
|
catch (_a) {
|
|
@@ -11996,7 +12111,6 @@ class Models extends BaseModule {
|
|
|
11996
12111
|
if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
|
|
11997
12112
|
return await this.generateContentInternal(transformedParams);
|
|
11998
12113
|
}
|
|
11999
|
-
// TODO: b/418266406 - Improve the check for CallableTools and Tools.
|
|
12000
12114
|
if (hasNonMcpTools(params)) {
|
|
12001
12115
|
throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
|
|
12002
12116
|
}
|
|
@@ -13551,27 +13665,862 @@ class Operations extends BaseModule {
|
|
|
13551
13665
|
* Copyright 2025 Google LLC
|
|
13552
13666
|
* SPDX-License-Identifier: Apache-2.0
|
|
13553
13667
|
*/
|
|
13554
|
-
function
|
|
13668
|
+
function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
|
|
13555
13669
|
const toObject = {};
|
|
13556
|
-
const
|
|
13557
|
-
if (
|
|
13558
|
-
setValueByPath(toObject, ['
|
|
13559
|
-
}
|
|
13560
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
13561
|
-
if (fromConfig != null) {
|
|
13562
|
-
setValueByPath(toObject, ['config'], fromConfig);
|
|
13670
|
+
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
13671
|
+
if (fromVoiceName != null) {
|
|
13672
|
+
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
13563
13673
|
}
|
|
13564
13674
|
return toObject;
|
|
13565
13675
|
}
|
|
13566
|
-
function
|
|
13676
|
+
function voiceConfigToMldev(apiClient, fromObject) {
|
|
13567
13677
|
const toObject = {};
|
|
13568
|
-
const
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13678
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
13679
|
+
'prebuiltVoiceConfig',
|
|
13680
|
+
]);
|
|
13681
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
13682
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
|
|
13683
|
+
}
|
|
13684
|
+
return toObject;
|
|
13685
|
+
}
|
|
13686
|
+
function speakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
13687
|
+
const toObject = {};
|
|
13688
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
13689
|
+
if (fromSpeaker != null) {
|
|
13690
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
13691
|
+
}
|
|
13692
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
13693
|
+
if (fromVoiceConfig != null) {
|
|
13694
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
13695
|
+
}
|
|
13696
|
+
return toObject;
|
|
13697
|
+
}
|
|
13698
|
+
function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
|
|
13699
|
+
const toObject = {};
|
|
13700
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
13701
|
+
'speakerVoiceConfigs',
|
|
13702
|
+
]);
|
|
13703
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
13704
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
13705
|
+
if (Array.isArray(transformedList)) {
|
|
13706
|
+
transformedList = transformedList.map((item) => {
|
|
13707
|
+
return speakerVoiceConfigToMldev(apiClient, item);
|
|
13708
|
+
});
|
|
13709
|
+
}
|
|
13710
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
13711
|
+
}
|
|
13712
|
+
return toObject;
|
|
13713
|
+
}
|
|
13714
|
+
function speechConfigToMldev(apiClient, fromObject) {
|
|
13715
|
+
const toObject = {};
|
|
13716
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
13717
|
+
if (fromVoiceConfig != null) {
|
|
13718
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
|
|
13719
|
+
}
|
|
13720
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
13721
|
+
'multiSpeakerVoiceConfig',
|
|
13722
|
+
]);
|
|
13723
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
13724
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
|
|
13725
|
+
}
|
|
13726
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
13727
|
+
if (fromLanguageCode != null) {
|
|
13728
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
13729
|
+
}
|
|
13730
|
+
return toObject;
|
|
13731
|
+
}
|
|
13732
|
+
function videoMetadataToMldev(apiClient, fromObject) {
|
|
13733
|
+
const toObject = {};
|
|
13734
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
13735
|
+
if (fromFps != null) {
|
|
13736
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
13737
|
+
}
|
|
13738
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
13739
|
+
if (fromEndOffset != null) {
|
|
13740
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
13741
|
+
}
|
|
13742
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
13743
|
+
if (fromStartOffset != null) {
|
|
13744
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
13745
|
+
}
|
|
13746
|
+
return toObject;
|
|
13747
|
+
}
|
|
13748
|
+
function blobToMldev(apiClient, fromObject) {
|
|
13749
|
+
const toObject = {};
|
|
13750
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
13751
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
13752
|
+
}
|
|
13753
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
13754
|
+
if (fromData != null) {
|
|
13755
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
13756
|
+
}
|
|
13757
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
13758
|
+
if (fromMimeType != null) {
|
|
13759
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
13760
|
+
}
|
|
13761
|
+
return toObject;
|
|
13762
|
+
}
|
|
13763
|
+
function fileDataToMldev(apiClient, fromObject) {
|
|
13764
|
+
const toObject = {};
|
|
13765
|
+
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
13766
|
+
throw new Error('displayName parameter is not supported in Gemini API.');
|
|
13767
|
+
}
|
|
13768
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
13769
|
+
if (fromFileUri != null) {
|
|
13770
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
13771
|
+
}
|
|
13772
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
13773
|
+
if (fromMimeType != null) {
|
|
13774
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
13775
|
+
}
|
|
13776
|
+
return toObject;
|
|
13777
|
+
}
|
|
13778
|
+
function partToMldev(apiClient, fromObject) {
|
|
13779
|
+
const toObject = {};
|
|
13780
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
13781
|
+
'videoMetadata',
|
|
13782
|
+
]);
|
|
13783
|
+
if (fromVideoMetadata != null) {
|
|
13784
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
|
|
13785
|
+
}
|
|
13786
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
13787
|
+
if (fromThought != null) {
|
|
13788
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
13789
|
+
}
|
|
13790
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
13791
|
+
if (fromInlineData != null) {
|
|
13792
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
|
|
13793
|
+
}
|
|
13794
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
13795
|
+
if (fromFileData != null) {
|
|
13796
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
|
|
13797
|
+
}
|
|
13798
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
13799
|
+
'thoughtSignature',
|
|
13800
|
+
]);
|
|
13801
|
+
if (fromThoughtSignature != null) {
|
|
13802
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
13803
|
+
}
|
|
13804
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
13805
|
+
'codeExecutionResult',
|
|
13806
|
+
]);
|
|
13807
|
+
if (fromCodeExecutionResult != null) {
|
|
13808
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
13809
|
+
}
|
|
13810
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
13811
|
+
'executableCode',
|
|
13812
|
+
]);
|
|
13813
|
+
if (fromExecutableCode != null) {
|
|
13814
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
13815
|
+
}
|
|
13816
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
13817
|
+
if (fromFunctionCall != null) {
|
|
13818
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
13819
|
+
}
|
|
13820
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
13821
|
+
'functionResponse',
|
|
13822
|
+
]);
|
|
13823
|
+
if (fromFunctionResponse != null) {
|
|
13824
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
13825
|
+
}
|
|
13826
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
13827
|
+
if (fromText != null) {
|
|
13828
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
13829
|
+
}
|
|
13830
|
+
return toObject;
|
|
13831
|
+
}
|
|
13832
|
+
function contentToMldev(apiClient, fromObject) {
|
|
13833
|
+
const toObject = {};
|
|
13834
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
13835
|
+
if (fromParts != null) {
|
|
13836
|
+
let transformedList = fromParts;
|
|
13837
|
+
if (Array.isArray(transformedList)) {
|
|
13838
|
+
transformedList = transformedList.map((item) => {
|
|
13839
|
+
return partToMldev(apiClient, item);
|
|
13840
|
+
});
|
|
13841
|
+
}
|
|
13842
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
13843
|
+
}
|
|
13844
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
13845
|
+
if (fromRole != null) {
|
|
13846
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
13847
|
+
}
|
|
13848
|
+
return toObject;
|
|
13849
|
+
}
|
|
13850
|
+
function functionDeclarationToMldev(apiClient, fromObject) {
|
|
13851
|
+
const toObject = {};
|
|
13852
|
+
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
13853
|
+
if (fromBehavior != null) {
|
|
13854
|
+
setValueByPath(toObject, ['behavior'], fromBehavior);
|
|
13855
|
+
}
|
|
13856
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
13857
|
+
if (fromDescription != null) {
|
|
13858
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
13859
|
+
}
|
|
13860
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
13861
|
+
if (fromName != null) {
|
|
13862
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
13863
|
+
}
|
|
13864
|
+
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
13865
|
+
if (fromParameters != null) {
|
|
13866
|
+
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
13867
|
+
}
|
|
13868
|
+
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
13869
|
+
if (fromResponse != null) {
|
|
13870
|
+
setValueByPath(toObject, ['response'], fromResponse);
|
|
13871
|
+
}
|
|
13872
|
+
return toObject;
|
|
13873
|
+
}
|
|
13874
|
+
function intervalToMldev(apiClient, fromObject) {
|
|
13875
|
+
const toObject = {};
|
|
13876
|
+
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
13877
|
+
if (fromStartTime != null) {
|
|
13878
|
+
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
13879
|
+
}
|
|
13880
|
+
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
13881
|
+
if (fromEndTime != null) {
|
|
13882
|
+
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
13883
|
+
}
|
|
13884
|
+
return toObject;
|
|
13885
|
+
}
|
|
13886
|
+
function googleSearchToMldev(apiClient, fromObject) {
|
|
13887
|
+
const toObject = {};
|
|
13888
|
+
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
13889
|
+
'timeRangeFilter',
|
|
13890
|
+
]);
|
|
13891
|
+
if (fromTimeRangeFilter != null) {
|
|
13892
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
|
|
13893
|
+
}
|
|
13894
|
+
return toObject;
|
|
13895
|
+
}
|
|
13896
|
+
function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
|
|
13897
|
+
const toObject = {};
|
|
13898
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
13899
|
+
if (fromMode != null) {
|
|
13900
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
13901
|
+
}
|
|
13902
|
+
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
13903
|
+
'dynamicThreshold',
|
|
13904
|
+
]);
|
|
13905
|
+
if (fromDynamicThreshold != null) {
|
|
13906
|
+
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
13907
|
+
}
|
|
13908
|
+
return toObject;
|
|
13909
|
+
}
|
|
13910
|
+
function googleSearchRetrievalToMldev(apiClient, fromObject) {
|
|
13911
|
+
const toObject = {};
|
|
13912
|
+
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
13913
|
+
'dynamicRetrievalConfig',
|
|
13914
|
+
]);
|
|
13915
|
+
if (fromDynamicRetrievalConfig != null) {
|
|
13916
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
|
|
13917
|
+
}
|
|
13918
|
+
return toObject;
|
|
13919
|
+
}
|
|
13920
|
+
function urlContextToMldev() {
|
|
13921
|
+
const toObject = {};
|
|
13922
|
+
return toObject;
|
|
13923
|
+
}
|
|
13924
|
+
function toolToMldev(apiClient, fromObject) {
|
|
13925
|
+
const toObject = {};
|
|
13926
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
13927
|
+
'functionDeclarations',
|
|
13928
|
+
]);
|
|
13929
|
+
if (fromFunctionDeclarations != null) {
|
|
13930
|
+
let transformedList = fromFunctionDeclarations;
|
|
13931
|
+
if (Array.isArray(transformedList)) {
|
|
13932
|
+
transformedList = transformedList.map((item) => {
|
|
13933
|
+
return functionDeclarationToMldev(apiClient, item);
|
|
13934
|
+
});
|
|
13935
|
+
}
|
|
13936
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
13937
|
+
}
|
|
13938
|
+
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
13939
|
+
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
13940
|
+
}
|
|
13941
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
13942
|
+
if (fromGoogleSearch != null) {
|
|
13943
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
|
|
13944
|
+
}
|
|
13945
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
13946
|
+
'googleSearchRetrieval',
|
|
13947
|
+
]);
|
|
13948
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
13949
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
|
|
13950
|
+
}
|
|
13951
|
+
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
13952
|
+
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
13953
|
+
}
|
|
13954
|
+
if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
|
|
13955
|
+
throw new Error('googleMaps parameter is not supported in Gemini API.');
|
|
13956
|
+
}
|
|
13957
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
13958
|
+
if (fromUrlContext != null) {
|
|
13959
|
+
setValueByPath(toObject, ['urlContext'], urlContextToMldev());
|
|
13960
|
+
}
|
|
13961
|
+
const fromCodeExecution = getValueByPath(fromObject, [
|
|
13962
|
+
'codeExecution',
|
|
13963
|
+
]);
|
|
13964
|
+
if (fromCodeExecution != null) {
|
|
13965
|
+
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
13966
|
+
}
|
|
13967
|
+
return toObject;
|
|
13968
|
+
}
|
|
13969
|
+
function sessionResumptionConfigToMldev(apiClient, fromObject) {
|
|
13970
|
+
const toObject = {};
|
|
13971
|
+
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
13972
|
+
if (fromHandle != null) {
|
|
13973
|
+
setValueByPath(toObject, ['handle'], fromHandle);
|
|
13974
|
+
}
|
|
13975
|
+
if (getValueByPath(fromObject, ['transparent']) !== undefined) {
|
|
13976
|
+
throw new Error('transparent parameter is not supported in Gemini API.');
|
|
13977
|
+
}
|
|
13978
|
+
return toObject;
|
|
13979
|
+
}
|
|
13980
|
+
function audioTranscriptionConfigToMldev() {
|
|
13981
|
+
const toObject = {};
|
|
13982
|
+
return toObject;
|
|
13983
|
+
}
|
|
13984
|
+
function automaticActivityDetectionToMldev(apiClient, fromObject) {
|
|
13985
|
+
const toObject = {};
|
|
13986
|
+
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
13987
|
+
if (fromDisabled != null) {
|
|
13988
|
+
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
13989
|
+
}
|
|
13990
|
+
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
13991
|
+
'startOfSpeechSensitivity',
|
|
13992
|
+
]);
|
|
13993
|
+
if (fromStartOfSpeechSensitivity != null) {
|
|
13994
|
+
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
13995
|
+
}
|
|
13996
|
+
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
13997
|
+
'endOfSpeechSensitivity',
|
|
13998
|
+
]);
|
|
13999
|
+
if (fromEndOfSpeechSensitivity != null) {
|
|
14000
|
+
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
14001
|
+
}
|
|
14002
|
+
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
14003
|
+
'prefixPaddingMs',
|
|
14004
|
+
]);
|
|
14005
|
+
if (fromPrefixPaddingMs != null) {
|
|
14006
|
+
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
14007
|
+
}
|
|
14008
|
+
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
14009
|
+
'silenceDurationMs',
|
|
14010
|
+
]);
|
|
14011
|
+
if (fromSilenceDurationMs != null) {
|
|
14012
|
+
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
14013
|
+
}
|
|
14014
|
+
return toObject;
|
|
14015
|
+
}
|
|
14016
|
+
function realtimeInputConfigToMldev(apiClient, fromObject) {
|
|
14017
|
+
const toObject = {};
|
|
14018
|
+
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
14019
|
+
'automaticActivityDetection',
|
|
14020
|
+
]);
|
|
14021
|
+
if (fromAutomaticActivityDetection != null) {
|
|
14022
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
|
|
14023
|
+
}
|
|
14024
|
+
const fromActivityHandling = getValueByPath(fromObject, [
|
|
14025
|
+
'activityHandling',
|
|
14026
|
+
]);
|
|
14027
|
+
if (fromActivityHandling != null) {
|
|
14028
|
+
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
14029
|
+
}
|
|
14030
|
+
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
14031
|
+
if (fromTurnCoverage != null) {
|
|
14032
|
+
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
14033
|
+
}
|
|
14034
|
+
return toObject;
|
|
14035
|
+
}
|
|
14036
|
+
function slidingWindowToMldev(apiClient, fromObject) {
|
|
14037
|
+
const toObject = {};
|
|
14038
|
+
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
14039
|
+
if (fromTargetTokens != null) {
|
|
14040
|
+
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
14041
|
+
}
|
|
14042
|
+
return toObject;
|
|
14043
|
+
}
|
|
14044
|
+
function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
|
|
14045
|
+
const toObject = {};
|
|
14046
|
+
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
14047
|
+
'triggerTokens',
|
|
14048
|
+
]);
|
|
14049
|
+
if (fromTriggerTokens != null) {
|
|
14050
|
+
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
14051
|
+
}
|
|
14052
|
+
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
14053
|
+
'slidingWindow',
|
|
14054
|
+
]);
|
|
14055
|
+
if (fromSlidingWindow != null) {
|
|
14056
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
|
|
14057
|
+
}
|
|
14058
|
+
return toObject;
|
|
14059
|
+
}
|
|
14060
|
+
function proactivityConfigToMldev(apiClient, fromObject) {
|
|
14061
|
+
const toObject = {};
|
|
14062
|
+
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
14063
|
+
'proactiveAudio',
|
|
14064
|
+
]);
|
|
14065
|
+
if (fromProactiveAudio != null) {
|
|
14066
|
+
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
14067
|
+
}
|
|
14068
|
+
return toObject;
|
|
14069
|
+
}
|
|
14070
|
+
function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14071
|
+
const toObject = {};
|
|
14072
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
14073
|
+
'generationConfig',
|
|
14074
|
+
]);
|
|
14075
|
+
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
14076
|
+
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
14077
|
+
}
|
|
14078
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
14079
|
+
'responseModalities',
|
|
14080
|
+
]);
|
|
14081
|
+
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
14082
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
14083
|
+
}
|
|
14084
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
14085
|
+
if (parentObject !== undefined && fromTemperature != null) {
|
|
14086
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
14087
|
+
}
|
|
14088
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
14089
|
+
if (parentObject !== undefined && fromTopP != null) {
|
|
14090
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
14091
|
+
}
|
|
14092
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
14093
|
+
if (parentObject !== undefined && fromTopK != null) {
|
|
14094
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
14095
|
+
}
|
|
14096
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
14097
|
+
'maxOutputTokens',
|
|
14098
|
+
]);
|
|
14099
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
14100
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
14101
|
+
}
|
|
14102
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
14103
|
+
'mediaResolution',
|
|
14104
|
+
]);
|
|
14105
|
+
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
14106
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
14107
|
+
}
|
|
14108
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
14109
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
14110
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
14111
|
+
}
|
|
14112
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14113
|
+
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
14114
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
|
|
14115
|
+
}
|
|
14116
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
14117
|
+
'enableAffectiveDialog',
|
|
14118
|
+
]);
|
|
14119
|
+
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
14120
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
14121
|
+
}
|
|
14122
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
14123
|
+
'systemInstruction',
|
|
14124
|
+
]);
|
|
14125
|
+
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
14126
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
|
|
14127
|
+
}
|
|
14128
|
+
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
14129
|
+
if (parentObject !== undefined && fromTools != null) {
|
|
14130
|
+
let transformedList = tTools(apiClient, fromTools);
|
|
14131
|
+
if (Array.isArray(transformedList)) {
|
|
14132
|
+
transformedList = transformedList.map((item) => {
|
|
14133
|
+
return toolToMldev(apiClient, tTool(apiClient, item));
|
|
14134
|
+
});
|
|
14135
|
+
}
|
|
14136
|
+
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
14137
|
+
}
|
|
14138
|
+
const fromSessionResumption = getValueByPath(fromObject, [
|
|
14139
|
+
'sessionResumption',
|
|
14140
|
+
]);
|
|
14141
|
+
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
14142
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
|
|
14143
|
+
}
|
|
14144
|
+
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
14145
|
+
'inputAudioTranscription',
|
|
14146
|
+
]);
|
|
14147
|
+
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
14148
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
14149
|
+
}
|
|
14150
|
+
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
14151
|
+
'outputAudioTranscription',
|
|
14152
|
+
]);
|
|
14153
|
+
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
14154
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
|
|
14155
|
+
}
|
|
14156
|
+
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
14157
|
+
'realtimeInputConfig',
|
|
14158
|
+
]);
|
|
14159
|
+
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
14160
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
|
|
14161
|
+
}
|
|
14162
|
+
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
14163
|
+
'contextWindowCompression',
|
|
14164
|
+
]);
|
|
14165
|
+
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
14166
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
|
|
14167
|
+
}
|
|
14168
|
+
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
14169
|
+
if (parentObject !== undefined && fromProactivity != null) {
|
|
14170
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
|
|
14171
|
+
}
|
|
14172
|
+
return toObject;
|
|
14173
|
+
}
|
|
14174
|
+
function liveConnectConstraintsToMldev(apiClient, fromObject) {
|
|
14175
|
+
const toObject = {};
|
|
14176
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
14177
|
+
if (fromModel != null) {
|
|
14178
|
+
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
14179
|
+
}
|
|
14180
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14181
|
+
if (fromConfig != null) {
|
|
14182
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
|
|
14183
|
+
}
|
|
14184
|
+
return toObject;
|
|
14185
|
+
}
|
|
14186
|
+
function createAuthTokenConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14187
|
+
const toObject = {};
|
|
14188
|
+
const fromExpireTime = getValueByPath(fromObject, ['expireTime']);
|
|
14189
|
+
if (parentObject !== undefined && fromExpireTime != null) {
|
|
14190
|
+
setValueByPath(parentObject, ['expireTime'], fromExpireTime);
|
|
14191
|
+
}
|
|
14192
|
+
const fromNewSessionExpireTime = getValueByPath(fromObject, [
|
|
14193
|
+
'newSessionExpireTime',
|
|
14194
|
+
]);
|
|
14195
|
+
if (parentObject !== undefined && fromNewSessionExpireTime != null) {
|
|
14196
|
+
setValueByPath(parentObject, ['newSessionExpireTime'], fromNewSessionExpireTime);
|
|
14197
|
+
}
|
|
14198
|
+
const fromUses = getValueByPath(fromObject, ['uses']);
|
|
14199
|
+
if (parentObject !== undefined && fromUses != null) {
|
|
14200
|
+
setValueByPath(parentObject, ['uses'], fromUses);
|
|
14201
|
+
}
|
|
14202
|
+
const fromLiveConnectConstraints = getValueByPath(fromObject, [
|
|
14203
|
+
'liveConnectConstraints',
|
|
14204
|
+
]);
|
|
14205
|
+
if (parentObject !== undefined && fromLiveConnectConstraints != null) {
|
|
14206
|
+
setValueByPath(parentObject, ['bidiGenerateContentSetup'], liveConnectConstraintsToMldev(apiClient, fromLiveConnectConstraints));
|
|
14207
|
+
}
|
|
14208
|
+
const fromLockAdditionalFields = getValueByPath(fromObject, [
|
|
14209
|
+
'lockAdditionalFields',
|
|
14210
|
+
]);
|
|
14211
|
+
if (parentObject !== undefined && fromLockAdditionalFields != null) {
|
|
14212
|
+
setValueByPath(parentObject, ['fieldMask'], fromLockAdditionalFields);
|
|
14213
|
+
}
|
|
14214
|
+
return toObject;
|
|
14215
|
+
}
|
|
14216
|
+
function createAuthTokenParametersToMldev(apiClient, fromObject) {
|
|
14217
|
+
const toObject = {};
|
|
14218
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14219
|
+
if (fromConfig != null) {
|
|
14220
|
+
setValueByPath(toObject, ['config'], createAuthTokenConfigToMldev(apiClient, fromConfig, toObject));
|
|
14221
|
+
}
|
|
14222
|
+
return toObject;
|
|
14223
|
+
}
|
|
14224
|
+
function authTokenFromMldev(apiClient, fromObject) {
|
|
14225
|
+
const toObject = {};
|
|
14226
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
14227
|
+
if (fromName != null) {
|
|
14228
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
14229
|
+
}
|
|
14230
|
+
return toObject;
|
|
14231
|
+
}
|
|
14232
|
+
|
|
14233
|
+
/**
|
|
14234
|
+
* @license
|
|
14235
|
+
* Copyright 2025 Google LLC
|
|
14236
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14237
|
+
*/
|
|
14238
|
+
/**
|
|
14239
|
+
* Returns a comma-separated list of field masks from a given object.
|
|
14240
|
+
*
|
|
14241
|
+
* @param setup The object to extract field masks from.
|
|
14242
|
+
* @return A comma-separated list of field masks.
|
|
14243
|
+
*/
|
|
14244
|
+
function getFieldMasks(setup) {
|
|
14245
|
+
const fields = [];
|
|
14246
|
+
for (const key in setup) {
|
|
14247
|
+
if (Object.prototype.hasOwnProperty.call(setup, key)) {
|
|
14248
|
+
const value = setup[key];
|
|
14249
|
+
// 2nd layer, recursively get field masks see TODO(b/418290100)
|
|
14250
|
+
if (typeof value === 'object' &&
|
|
14251
|
+
value != null &&
|
|
14252
|
+
Object.keys(value).length > 0) {
|
|
14253
|
+
const field = Object.keys(value).map((kk) => `${key}.${kk}`);
|
|
14254
|
+
fields.push(...field);
|
|
14255
|
+
}
|
|
14256
|
+
else {
|
|
14257
|
+
fields.push(key); // 1st layer
|
|
14258
|
+
}
|
|
14259
|
+
}
|
|
14260
|
+
}
|
|
14261
|
+
return fields.join(',');
|
|
14262
|
+
}
|
|
14263
|
+
/**
|
|
14264
|
+
* Converts bidiGenerateContentSetup.
|
|
14265
|
+
* @param requestDict - The request dictionary.
|
|
14266
|
+
* @param config - The configuration object.
|
|
14267
|
+
* @return - The modified request dictionary.
|
|
14268
|
+
*/
|
|
14269
|
+
function convertBidiSetupToTokenSetup(requestDict, config) {
|
|
14270
|
+
// Convert bidiGenerateContentSetup from bidiGenerateContentSetup.setup.
|
|
14271
|
+
let setupForMaskGeneration = null;
|
|
14272
|
+
const bidiGenerateContentSetupValue = requestDict['bidiGenerateContentSetup'];
|
|
14273
|
+
if (typeof bidiGenerateContentSetupValue === 'object' &&
|
|
14274
|
+
bidiGenerateContentSetupValue !== null &&
|
|
14275
|
+
'setup' in bidiGenerateContentSetupValue) {
|
|
14276
|
+
// Now we know bidiGenerateContentSetupValue is an object and has a 'setup'
|
|
14277
|
+
// property.
|
|
14278
|
+
const innerSetup = bidiGenerateContentSetupValue
|
|
14279
|
+
.setup;
|
|
14280
|
+
if (typeof innerSetup === 'object' && innerSetup !== null) {
|
|
14281
|
+
// Valid inner setup found.
|
|
14282
|
+
requestDict['bidiGenerateContentSetup'] = innerSetup;
|
|
14283
|
+
setupForMaskGeneration = innerSetup;
|
|
14284
|
+
}
|
|
14285
|
+
else {
|
|
14286
|
+
// `bidiGenerateContentSetupValue.setup` is not a valid object; treat as
|
|
14287
|
+
// if bidiGenerateContentSetup is invalid.
|
|
14288
|
+
delete requestDict['bidiGenerateContentSetup'];
|
|
14289
|
+
}
|
|
14290
|
+
}
|
|
14291
|
+
else if (bidiGenerateContentSetupValue !== undefined) {
|
|
14292
|
+
// `bidiGenerateContentSetup` exists but not in the expected
|
|
14293
|
+
// shape {setup: {...}}; treat as invalid.
|
|
14294
|
+
delete requestDict['bidiGenerateContentSetup'];
|
|
14295
|
+
}
|
|
14296
|
+
const preExistingFieldMask = requestDict['fieldMask'];
|
|
14297
|
+
// Handle mask generation setup.
|
|
14298
|
+
if (setupForMaskGeneration) {
|
|
14299
|
+
const generatedMaskFromBidi = getFieldMasks(setupForMaskGeneration);
|
|
14300
|
+
if (Array.isArray(config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
|
|
14301
|
+
(config === null || config === void 0 ? void 0 : config.lockAdditionalFields.length) === 0) {
|
|
14302
|
+
// Case 1: lockAdditionalFields is an empty array. Lock only fields from
|
|
14303
|
+
// bidi setup.
|
|
14304
|
+
if (generatedMaskFromBidi) {
|
|
14305
|
+
// Only assign if mask is not empty
|
|
14306
|
+
requestDict['fieldMask'] = generatedMaskFromBidi;
|
|
14307
|
+
}
|
|
14308
|
+
else {
|
|
14309
|
+
delete requestDict['fieldMask']; // If mask is empty, effectively no
|
|
14310
|
+
// specific fields locked by bidi
|
|
14311
|
+
}
|
|
14312
|
+
}
|
|
14313
|
+
else if ((config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
|
|
14314
|
+
config.lockAdditionalFields.length > 0 &&
|
|
14315
|
+
preExistingFieldMask !== null &&
|
|
14316
|
+
Array.isArray(preExistingFieldMask) &&
|
|
14317
|
+
preExistingFieldMask.length > 0) {
|
|
14318
|
+
// Case 2: Lock fields from bidi setup + additional fields
|
|
14319
|
+
// (preExistingFieldMask).
|
|
14320
|
+
const generationConfigFields = [
|
|
14321
|
+
'temperature',
|
|
14322
|
+
'topK',
|
|
14323
|
+
'topP',
|
|
14324
|
+
'maxOutputTokens',
|
|
14325
|
+
'responseModalities',
|
|
14326
|
+
'seed',
|
|
14327
|
+
'speechConfig',
|
|
14328
|
+
];
|
|
14329
|
+
let mappedFieldsFromPreExisting = [];
|
|
14330
|
+
if (preExistingFieldMask.length > 0) {
|
|
14331
|
+
mappedFieldsFromPreExisting = preExistingFieldMask.map((field) => {
|
|
14332
|
+
if (generationConfigFields.includes(field)) {
|
|
14333
|
+
return `generationConfig.${field}`;
|
|
14334
|
+
}
|
|
14335
|
+
return field; // Keep original field name if not in
|
|
14336
|
+
// generationConfigFields
|
|
14337
|
+
});
|
|
14338
|
+
}
|
|
14339
|
+
const finalMaskParts = [];
|
|
14340
|
+
if (generatedMaskFromBidi) {
|
|
14341
|
+
finalMaskParts.push(generatedMaskFromBidi);
|
|
14342
|
+
}
|
|
14343
|
+
if (mappedFieldsFromPreExisting.length > 0) {
|
|
14344
|
+
finalMaskParts.push(...mappedFieldsFromPreExisting);
|
|
14345
|
+
}
|
|
14346
|
+
if (finalMaskParts.length > 0) {
|
|
14347
|
+
requestDict['fieldMask'] = finalMaskParts.join(',');
|
|
14348
|
+
}
|
|
14349
|
+
else {
|
|
14350
|
+
// If no fields from bidi and no valid additional fields from
|
|
14351
|
+
// pre-existing mask.
|
|
14352
|
+
delete requestDict['fieldMask'];
|
|
14353
|
+
}
|
|
14354
|
+
}
|
|
14355
|
+
else {
|
|
14356
|
+
// Case 3: "Lock all fields" (meaning, don't send a field_mask, let server
|
|
14357
|
+
// defaults apply or all are mutable). This is hit if:
|
|
14358
|
+
// - `config.lockAdditionalFields` is undefined.
|
|
14359
|
+
// - `config.lockAdditionalFields` is non-empty, BUT
|
|
14360
|
+
// `preExistingFieldMask` is null, not a string, or an empty string.
|
|
14361
|
+
delete requestDict['fieldMask'];
|
|
14362
|
+
}
|
|
14363
|
+
}
|
|
14364
|
+
else {
|
|
14365
|
+
// No valid `bidiGenerateContentSetup` was found or extracted.
|
|
14366
|
+
// "Lock additional null fields if any".
|
|
14367
|
+
if (preExistingFieldMask !== null &&
|
|
14368
|
+
Array.isArray(preExistingFieldMask) &&
|
|
14369
|
+
preExistingFieldMask.length > 0) {
|
|
14370
|
+
// If there's a pre-existing field mask, it's a string, and it's not
|
|
14371
|
+
// empty, then we should lock all fields.
|
|
14372
|
+
requestDict['fieldMask'] = preExistingFieldMask.join(',');
|
|
14373
|
+
}
|
|
14374
|
+
else {
|
|
14375
|
+
delete requestDict['fieldMask'];
|
|
14376
|
+
}
|
|
14377
|
+
}
|
|
14378
|
+
return requestDict;
|
|
14379
|
+
}
|
|
14380
|
+
class Tokens extends BaseModule {
|
|
14381
|
+
constructor(apiClient) {
|
|
14382
|
+
super();
|
|
14383
|
+
this.apiClient = apiClient;
|
|
14384
|
+
}
|
|
14385
|
+
/**
|
|
14386
|
+
* Creates an ephemeral auth token resource.
|
|
14387
|
+
*
|
|
14388
|
+
* @experimental
|
|
14389
|
+
*
|
|
14390
|
+
* @remarks
|
|
14391
|
+
* Ephermeral auth tokens is only supported in the Gemini Developer API.
|
|
14392
|
+
* It can be used for the session connection to the Live constrained API.
|
|
14393
|
+
*
|
|
14394
|
+
* @param params - The parameters for the create request.
|
|
14395
|
+
* @return The created auth token.
|
|
14396
|
+
*
|
|
14397
|
+
* @example
|
|
14398
|
+
* ```ts
|
|
14399
|
+
* // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
|
|
14400
|
+
* // when using the token in Live API sessions. Each session connection can
|
|
14401
|
+
* // use a different configuration.
|
|
14402
|
+
* const config: CreateAuthTokenConfig = {
|
|
14403
|
+
* uses: 3,
|
|
14404
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14405
|
+
* }
|
|
14406
|
+
* const token = await ai.tokens.create(config);
|
|
14407
|
+
*
|
|
14408
|
+
* // Case 2: If LiveEphemeralParameters is set, lock all fields in
|
|
14409
|
+
* // LiveConnectConfig when using the token in Live API sessions. For
|
|
14410
|
+
* // example, changing `outputAudioTranscription` in the Live API
|
|
14411
|
+
* // connection will be ignored by the API.
|
|
14412
|
+
* const config: CreateAuthTokenConfig =
|
|
14413
|
+
* uses: 3,
|
|
14414
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14415
|
+
* LiveEphemeralParameters: {
|
|
14416
|
+
* model: 'gemini-2.0-flash-001',
|
|
14417
|
+
* config: {
|
|
14418
|
+
* 'responseModalities': ['AUDIO'],
|
|
14419
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14420
|
+
* }
|
|
14421
|
+
* }
|
|
14422
|
+
* }
|
|
14423
|
+
* const token = await ai.tokens.create(config);
|
|
14424
|
+
*
|
|
14425
|
+
* // Case 3: If LiveEphemeralParameters is set and lockAdditionalFields is
|
|
14426
|
+
* // set, lock LiveConnectConfig with set and additional fields (e.g.
|
|
14427
|
+
* // responseModalities, systemInstruction, temperature in this example) when
|
|
14428
|
+
* // using the token in Live API sessions.
|
|
14429
|
+
* const config: CreateAuthTokenConfig =
|
|
14430
|
+
* uses: 3,
|
|
14431
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14432
|
+
* LiveEphemeralParameters: {
|
|
14433
|
+
* model: 'gemini-2.0-flash-001',
|
|
14434
|
+
* config: {
|
|
14435
|
+
* 'responseModalities': ['AUDIO'],
|
|
14436
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14437
|
+
* }
|
|
14438
|
+
* },
|
|
14439
|
+
* lockAdditionalFields: ['temperature'],
|
|
14440
|
+
* }
|
|
14441
|
+
* const token = await ai.tokens.create(config);
|
|
14442
|
+
*
|
|
14443
|
+
* // Case 4: If LiveEphemeralParameters is set and lockAdditionalFields is
|
|
14444
|
+
* // empty array, lock LiveConnectConfig with set fields (e.g.
|
|
14445
|
+
* // responseModalities, systemInstruction in this example) when using the
|
|
14446
|
+
* // token in Live API sessions.
|
|
14447
|
+
* const config: CreateAuthTokenConfig =
|
|
14448
|
+
* uses: 3,
|
|
14449
|
+
* expireTime: '2025-05-01T00:00:00Z',
|
|
14450
|
+
* LiveEphemeralParameters: {
|
|
14451
|
+
* model: 'gemini-2.0-flash-001',
|
|
14452
|
+
* config: {
|
|
14453
|
+
* 'responseModalities': ['AUDIO'],
|
|
14454
|
+
* 'systemInstruction': 'Always answer in English.',
|
|
14455
|
+
* }
|
|
14456
|
+
* },
|
|
14457
|
+
* lockAdditionalFields: [],
|
|
14458
|
+
* }
|
|
14459
|
+
* const token = await ai.tokens.create(config);
|
|
14460
|
+
* ```
|
|
14461
|
+
*/
|
|
14462
|
+
async create(params) {
|
|
14463
|
+
var _a, _b;
|
|
14464
|
+
let response;
|
|
14465
|
+
let path = '';
|
|
14466
|
+
let queryParams = {};
|
|
14467
|
+
if (this.apiClient.isVertexAI()) {
|
|
14468
|
+
throw new Error('The client.tokens.create method is only supported by the Gemini Developer API.');
|
|
14469
|
+
}
|
|
14470
|
+
else {
|
|
14471
|
+
const body = createAuthTokenParametersToMldev(this.apiClient, params);
|
|
14472
|
+
path = formatMap('auth_tokens', body['_url']);
|
|
14473
|
+
queryParams = body['_query'];
|
|
14474
|
+
delete body['config'];
|
|
14475
|
+
delete body['_url'];
|
|
14476
|
+
delete body['_query'];
|
|
14477
|
+
const transformedBody = convertBidiSetupToTokenSetup(body, params.config);
|
|
14478
|
+
response = this.apiClient
|
|
14479
|
+
.request({
|
|
14480
|
+
path: path,
|
|
14481
|
+
queryParams: queryParams,
|
|
14482
|
+
body: JSON.stringify(transformedBody),
|
|
14483
|
+
httpMethod: 'POST',
|
|
14484
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
14485
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
14486
|
+
})
|
|
14487
|
+
.then((httpResponse) => {
|
|
14488
|
+
return httpResponse.json();
|
|
14489
|
+
});
|
|
14490
|
+
return response.then((apiResponse) => {
|
|
14491
|
+
const resp = authTokenFromMldev(this.apiClient, apiResponse);
|
|
14492
|
+
return resp;
|
|
14493
|
+
});
|
|
14494
|
+
}
|
|
14495
|
+
}
|
|
14496
|
+
}
|
|
14497
|
+
|
|
14498
|
+
/**
|
|
14499
|
+
* @license
|
|
14500
|
+
* Copyright 2025 Google LLC
|
|
14501
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14502
|
+
*/
|
|
14503
|
+
function getTuningJobParametersToMldev(apiClient, fromObject) {
|
|
14504
|
+
const toObject = {};
|
|
14505
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
14506
|
+
if (fromName != null) {
|
|
14507
|
+
setValueByPath(toObject, ['_url', 'name'], fromName);
|
|
14508
|
+
}
|
|
14509
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
14510
|
+
if (fromConfig != null) {
|
|
14511
|
+
setValueByPath(toObject, ['config'], fromConfig);
|
|
14512
|
+
}
|
|
14513
|
+
return toObject;
|
|
14514
|
+
}
|
|
14515
|
+
function listTuningJobsConfigToMldev(apiClient, fromObject, parentObject) {
|
|
14516
|
+
const toObject = {};
|
|
14517
|
+
const fromPageSize = getValueByPath(fromObject, ['pageSize']);
|
|
14518
|
+
if (parentObject !== undefined && fromPageSize != null) {
|
|
14519
|
+
setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
|
|
14520
|
+
}
|
|
14521
|
+
const fromPageToken = getValueByPath(fromObject, ['pageToken']);
|
|
14522
|
+
if (parentObject !== undefined && fromPageToken != null) {
|
|
14523
|
+
setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
|
|
13575
14524
|
}
|
|
13576
14525
|
const fromFilter = getValueByPath(fromObject, ['filter']);
|
|
13577
14526
|
if (parentObject !== undefined && fromFilter != null) {
|
|
@@ -14479,6 +15428,13 @@ class WebAuth {
|
|
|
14479
15428
|
if (headers.get(GOOGLE_API_KEY_HEADER) !== null) {
|
|
14480
15429
|
return;
|
|
14481
15430
|
}
|
|
15431
|
+
if (this.apiKey.startsWith('auth_tokens/')) {
|
|
15432
|
+
throw new Error('Ephemeral tokens are only supported by the live API.');
|
|
15433
|
+
}
|
|
15434
|
+
// Check if API key is empty or null
|
|
15435
|
+
if (!this.apiKey) {
|
|
15436
|
+
throw new Error('API key is missing. Please provide a valid API key.');
|
|
15437
|
+
}
|
|
14482
15438
|
headers.append(GOOGLE_API_KEY_HEADER, this.apiKey);
|
|
14483
15439
|
}
|
|
14484
15440
|
}
|
|
@@ -14566,9 +15522,10 @@ class GoogleGenAI {
|
|
|
14566
15522
|
this.caches = new Caches(this.apiClient);
|
|
14567
15523
|
this.files = new Files(this.apiClient);
|
|
14568
15524
|
this.operations = new Operations(this.apiClient);
|
|
15525
|
+
this.authTokens = new Tokens(this.apiClient);
|
|
14569
15526
|
this.tunings = new Tunings(this.apiClient);
|
|
14570
15527
|
}
|
|
14571
15528
|
}
|
|
14572
15529
|
|
|
14573
|
-
export { ActivityHandling, AdapterSize, AuthType, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, JobState, Language, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
15530
|
+
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 };
|
|
14574
15531
|
//# sourceMappingURL=index.mjs.map
|