@google/genai 1.45.0 → 1.47.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/dist/genai.d.ts +781 -275
- package/dist/index.cjs +862 -165
- package/dist/index.mjs +862 -166
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +873 -174
- package/dist/node/index.mjs +873 -175
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +781 -275
- package/dist/tokenizer/node.cjs +180 -80
- package/dist/tokenizer/node.d.ts +105 -29
- package/dist/tokenizer/node.mjs +180 -80
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +232 -123
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +319 -93
- package/dist/vertex_internal/index.js +232 -123
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +860 -164
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +781 -275
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -556,6 +556,18 @@ function videoFromVertex$1(fromObject) {
|
|
|
556
556
|
* Copyright 2025 Google LLC
|
|
557
557
|
* SPDX-License-Identifier: Apache-2.0
|
|
558
558
|
*/
|
|
559
|
+
/** Programming language of the `code`. */
|
|
560
|
+
var Language;
|
|
561
|
+
(function (Language) {
|
|
562
|
+
/**
|
|
563
|
+
* Unspecified language. This value should not be used.
|
|
564
|
+
*/
|
|
565
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
566
|
+
/**
|
|
567
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
568
|
+
*/
|
|
569
|
+
Language["PYTHON"] = "PYTHON";
|
|
570
|
+
})(Language || (Language = {}));
|
|
559
571
|
/** Outcome of the code execution. */
|
|
560
572
|
var Outcome;
|
|
561
573
|
(function (Outcome) {
|
|
@@ -576,18 +588,6 @@ var Outcome;
|
|
|
576
588
|
*/
|
|
577
589
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
578
590
|
})(Outcome || (Outcome = {}));
|
|
579
|
-
/** Programming language of the `code`. */
|
|
580
|
-
var Language;
|
|
581
|
-
(function (Language) {
|
|
582
|
-
/**
|
|
583
|
-
* Unspecified language. This value should not be used.
|
|
584
|
-
*/
|
|
585
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
586
|
-
/**
|
|
587
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
588
|
-
*/
|
|
589
|
-
Language["PYTHON"] = "PYTHON";
|
|
590
|
-
})(Language || (Language = {}));
|
|
591
591
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
592
592
|
var FunctionResponseScheduling;
|
|
593
593
|
(function (FunctionResponseScheduling) {
|
|
@@ -644,38 +644,18 @@ var Type;
|
|
|
644
644
|
*/
|
|
645
645
|
Type["NULL"] = "NULL";
|
|
646
646
|
})(Type || (Type = {}));
|
|
647
|
-
/**
|
|
648
|
-
var
|
|
649
|
-
(function (
|
|
650
|
-
/**
|
|
651
|
-
* Defaults to unspecified.
|
|
652
|
-
*/
|
|
653
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
654
|
-
/**
|
|
655
|
-
* Blocks Low and above confidence URL that is risky.
|
|
656
|
-
*/
|
|
657
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
658
|
-
/**
|
|
659
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
660
|
-
*/
|
|
661
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
662
|
-
/**
|
|
663
|
-
* Blocks High and above confidence URL that is risky.
|
|
664
|
-
*/
|
|
665
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
666
|
-
/**
|
|
667
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
668
|
-
*/
|
|
669
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
647
|
+
/** The environment being operated. */
|
|
648
|
+
var Environment;
|
|
649
|
+
(function (Environment) {
|
|
670
650
|
/**
|
|
671
|
-
*
|
|
651
|
+
* Defaults to browser.
|
|
672
652
|
*/
|
|
673
|
-
|
|
653
|
+
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
674
654
|
/**
|
|
675
|
-
*
|
|
655
|
+
* Operates in a web browser.
|
|
676
656
|
*/
|
|
677
|
-
|
|
678
|
-
})(
|
|
657
|
+
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
658
|
+
})(Environment || (Environment = {}));
|
|
679
659
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
680
660
|
var AuthType;
|
|
681
661
|
(function (AuthType) {
|
|
@@ -746,6 +726,38 @@ var ApiSpec;
|
|
|
746
726
|
*/
|
|
747
727
|
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
748
728
|
})(ApiSpec || (ApiSpec = {}));
|
|
729
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
730
|
+
var PhishBlockThreshold;
|
|
731
|
+
(function (PhishBlockThreshold) {
|
|
732
|
+
/**
|
|
733
|
+
* Defaults to unspecified.
|
|
734
|
+
*/
|
|
735
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
736
|
+
/**
|
|
737
|
+
* Blocks Low and above confidence URL that is risky.
|
|
738
|
+
*/
|
|
739
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
740
|
+
/**
|
|
741
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
742
|
+
*/
|
|
743
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
744
|
+
/**
|
|
745
|
+
* Blocks High and above confidence URL that is risky.
|
|
746
|
+
*/
|
|
747
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
748
|
+
/**
|
|
749
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
750
|
+
*/
|
|
751
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
752
|
+
/**
|
|
753
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
754
|
+
*/
|
|
755
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
756
|
+
/**
|
|
757
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
758
|
+
*/
|
|
759
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
760
|
+
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
749
761
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
750
762
|
var Behavior;
|
|
751
763
|
(function (Behavior) {
|
|
@@ -805,6 +817,10 @@ var ThinkingLevel;
|
|
|
805
817
|
* Unspecified thinking level.
|
|
806
818
|
*/
|
|
807
819
|
ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
|
|
820
|
+
/**
|
|
821
|
+
* MINIMAL thinking level.
|
|
822
|
+
*/
|
|
823
|
+
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
808
824
|
/**
|
|
809
825
|
* Low thinking level.
|
|
810
826
|
*/
|
|
@@ -817,10 +833,6 @@ var ThinkingLevel;
|
|
|
817
833
|
* High thinking level.
|
|
818
834
|
*/
|
|
819
835
|
ThinkingLevel["HIGH"] = "HIGH";
|
|
820
|
-
/**
|
|
821
|
-
* MINIMAL thinking level.
|
|
822
|
-
*/
|
|
823
|
-
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
824
836
|
})(ThinkingLevel || (ThinkingLevel = {}));
|
|
825
837
|
/** Enum that controls the generation of people. */
|
|
826
838
|
var PersonGeneration;
|
|
@@ -838,6 +850,22 @@ var PersonGeneration;
|
|
|
838
850
|
*/
|
|
839
851
|
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
840
852
|
})(PersonGeneration || (PersonGeneration = {}));
|
|
853
|
+
/** Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This enum is not supported in Gemini API. */
|
|
854
|
+
var ProminentPeople;
|
|
855
|
+
(function (ProminentPeople) {
|
|
856
|
+
/**
|
|
857
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
858
|
+
*/
|
|
859
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
860
|
+
/**
|
|
861
|
+
* Allows the model to generate images of prominent people.
|
|
862
|
+
*/
|
|
863
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
864
|
+
/**
|
|
865
|
+
* Prevents the model from generating images of prominent people.
|
|
866
|
+
*/
|
|
867
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
868
|
+
})(ProminentPeople || (ProminentPeople = {}));
|
|
841
869
|
/** The harm category to be blocked. */
|
|
842
870
|
var HarmCategory;
|
|
843
871
|
(function (HarmCategory) {
|
|
@@ -1156,6 +1184,42 @@ var Modality;
|
|
|
1156
1184
|
*/
|
|
1157
1185
|
Modality["AUDIO"] = "AUDIO";
|
|
1158
1186
|
})(Modality || (Modality = {}));
|
|
1187
|
+
/** The stage of the underlying model. This enum is not supported in Vertex AI. */
|
|
1188
|
+
var ModelStage;
|
|
1189
|
+
(function (ModelStage) {
|
|
1190
|
+
/**
|
|
1191
|
+
* Unspecified model stage.
|
|
1192
|
+
*/
|
|
1193
|
+
ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
|
|
1194
|
+
/**
|
|
1195
|
+
* The underlying model is subject to lots of tunings.
|
|
1196
|
+
*/
|
|
1197
|
+
ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
|
|
1198
|
+
/**
|
|
1199
|
+
* Models in this stage are for experimental purposes only.
|
|
1200
|
+
*/
|
|
1201
|
+
ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
|
|
1202
|
+
/**
|
|
1203
|
+
* Models in this stage are more mature than experimental models.
|
|
1204
|
+
*/
|
|
1205
|
+
ModelStage["PREVIEW"] = "PREVIEW";
|
|
1206
|
+
/**
|
|
1207
|
+
* Models in this stage are considered stable and ready for production use.
|
|
1208
|
+
*/
|
|
1209
|
+
ModelStage["STABLE"] = "STABLE";
|
|
1210
|
+
/**
|
|
1211
|
+
* If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.
|
|
1212
|
+
*/
|
|
1213
|
+
ModelStage["LEGACY"] = "LEGACY";
|
|
1214
|
+
/**
|
|
1215
|
+
* Models in this stage are deprecated. These models cannot be used.
|
|
1216
|
+
*/
|
|
1217
|
+
ModelStage["DEPRECATED"] = "DEPRECATED";
|
|
1218
|
+
/**
|
|
1219
|
+
* Models in this stage are retired. These models cannot be used.
|
|
1220
|
+
*/
|
|
1221
|
+
ModelStage["RETIRED"] = "RETIRED";
|
|
1222
|
+
})(ModelStage || (ModelStage = {}));
|
|
1159
1223
|
/** The media resolution to use. */
|
|
1160
1224
|
var MediaResolution;
|
|
1161
1225
|
(function (MediaResolution) {
|
|
@@ -1392,6 +1456,26 @@ var TuningTask;
|
|
|
1392
1456
|
*/
|
|
1393
1457
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1394
1458
|
})(TuningTask || (TuningTask = {}));
|
|
1459
|
+
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1460
|
+
var DocumentState;
|
|
1461
|
+
(function (DocumentState) {
|
|
1462
|
+
/**
|
|
1463
|
+
* The default value. This value is used if the state is omitted.
|
|
1464
|
+
*/
|
|
1465
|
+
DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
1466
|
+
/**
|
|
1467
|
+
* Some `Chunks` of the `Document` are being processed (embedding and vector storage).
|
|
1468
|
+
*/
|
|
1469
|
+
DocumentState["STATE_PENDING"] = "STATE_PENDING";
|
|
1470
|
+
/**
|
|
1471
|
+
* All `Chunks` of the `Document` is processed and available for querying.
|
|
1472
|
+
*/
|
|
1473
|
+
DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
|
|
1474
|
+
/**
|
|
1475
|
+
* Some `Chunks` of the `Document` failed processing.
|
|
1476
|
+
*/
|
|
1477
|
+
DocumentState["STATE_FAILED"] = "STATE_FAILED";
|
|
1478
|
+
})(DocumentState || (DocumentState = {}));
|
|
1395
1479
|
/** The tokenization quality used for given media. */
|
|
1396
1480
|
var PartMediaResolutionLevel;
|
|
1397
1481
|
(function (PartMediaResolutionLevel) {
|
|
@@ -1416,6 +1500,34 @@ var PartMediaResolutionLevel;
|
|
|
1416
1500
|
*/
|
|
1417
1501
|
PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
|
|
1418
1502
|
})(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
|
|
1503
|
+
/** The type of tool in the function call. */
|
|
1504
|
+
var ToolType;
|
|
1505
|
+
(function (ToolType) {
|
|
1506
|
+
/**
|
|
1507
|
+
* Unspecified tool type.
|
|
1508
|
+
*/
|
|
1509
|
+
ToolType["TOOL_TYPE_UNSPECIFIED"] = "TOOL_TYPE_UNSPECIFIED";
|
|
1510
|
+
/**
|
|
1511
|
+
* Google search tool, maps to Tool.google_search.search_types.web_search.
|
|
1512
|
+
*/
|
|
1513
|
+
ToolType["GOOGLE_SEARCH_WEB"] = "GOOGLE_SEARCH_WEB";
|
|
1514
|
+
/**
|
|
1515
|
+
* Image search tool, maps to Tool.google_search.search_types.image_search.
|
|
1516
|
+
*/
|
|
1517
|
+
ToolType["GOOGLE_SEARCH_IMAGE"] = "GOOGLE_SEARCH_IMAGE";
|
|
1518
|
+
/**
|
|
1519
|
+
* URL context tool, maps to Tool.url_context.
|
|
1520
|
+
*/
|
|
1521
|
+
ToolType["URL_CONTEXT"] = "URL_CONTEXT";
|
|
1522
|
+
/**
|
|
1523
|
+
* Google maps tool, maps to Tool.google_maps.
|
|
1524
|
+
*/
|
|
1525
|
+
ToolType["GOOGLE_MAPS"] = "GOOGLE_MAPS";
|
|
1526
|
+
/**
|
|
1527
|
+
* File search tool, maps to Tool.file_search.
|
|
1528
|
+
*/
|
|
1529
|
+
ToolType["FILE_SEARCH"] = "FILE_SEARCH";
|
|
1530
|
+
})(ToolType || (ToolType = {}));
|
|
1419
1531
|
/** Resource scope. */
|
|
1420
1532
|
var ResourceScope;
|
|
1421
1533
|
(function (ResourceScope) {
|
|
@@ -1428,42 +1540,34 @@ var ResourceScope;
|
|
|
1428
1540
|
*/
|
|
1429
1541
|
ResourceScope["COLLECTION"] = "COLLECTION";
|
|
1430
1542
|
})(ResourceScope || (ResourceScope = {}));
|
|
1431
|
-
/**
|
|
1432
|
-
var
|
|
1433
|
-
(function (
|
|
1434
|
-
FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
|
|
1435
|
-
FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
|
|
1436
|
-
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1437
|
-
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1438
|
-
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1439
|
-
/** The environment being operated. */
|
|
1440
|
-
var Environment;
|
|
1441
|
-
(function (Environment) {
|
|
1543
|
+
/** Pricing and performance service tier. */
|
|
1544
|
+
var ServiceTier;
|
|
1545
|
+
(function (ServiceTier) {
|
|
1442
1546
|
/**
|
|
1443
|
-
*
|
|
1547
|
+
* Default service tier, which is standard.
|
|
1444
1548
|
*/
|
|
1445
|
-
|
|
1549
|
+
ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
|
|
1446
1550
|
/**
|
|
1447
|
-
*
|
|
1551
|
+
* Flex service tier.
|
|
1448
1552
|
*/
|
|
1449
|
-
|
|
1450
|
-
})(Environment || (Environment = {}));
|
|
1451
|
-
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1452
|
-
var ProminentPeople;
|
|
1453
|
-
(function (ProminentPeople) {
|
|
1553
|
+
ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
|
|
1454
1554
|
/**
|
|
1455
|
-
*
|
|
1555
|
+
* Standard service tier.
|
|
1456
1556
|
*/
|
|
1457
|
-
|
|
1557
|
+
ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
|
|
1458
1558
|
/**
|
|
1459
|
-
*
|
|
1559
|
+
* Priority service tier.
|
|
1460
1560
|
*/
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1561
|
+
ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_PRIORITY";
|
|
1562
|
+
})(ServiceTier || (ServiceTier = {}));
|
|
1563
|
+
/** Options for feature selection preference. */
|
|
1564
|
+
var FeatureSelectionPreference;
|
|
1565
|
+
(function (FeatureSelectionPreference) {
|
|
1566
|
+
FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
|
|
1567
|
+
FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
|
|
1568
|
+
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1569
|
+
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1570
|
+
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1467
1571
|
/** Enum representing the Vertex embedding API to use. */
|
|
1468
1572
|
var EmbeddingApiType;
|
|
1469
1573
|
(function (EmbeddingApiType) {
|
|
@@ -1638,14 +1742,6 @@ var TuningMethod;
|
|
|
1638
1742
|
*/
|
|
1639
1743
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1640
1744
|
})(TuningMethod || (TuningMethod = {}));
|
|
1641
|
-
/** State for the lifecycle of a Document. */
|
|
1642
|
-
var DocumentState;
|
|
1643
|
-
(function (DocumentState) {
|
|
1644
|
-
DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
1645
|
-
DocumentState["STATE_PENDING"] = "STATE_PENDING";
|
|
1646
|
-
DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
|
|
1647
|
-
DocumentState["STATE_FAILED"] = "STATE_FAILED";
|
|
1648
|
-
})(DocumentState || (DocumentState = {}));
|
|
1649
1745
|
/** State for the lifecycle of a File. */
|
|
1650
1746
|
var FileState;
|
|
1651
1747
|
(function (FileState) {
|
|
@@ -1805,6 +1901,10 @@ var TurnCoverage;
|
|
|
1805
1901
|
* The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
|
|
1806
1902
|
*/
|
|
1807
1903
|
TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
|
|
1904
|
+
/**
|
|
1905
|
+
* Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
|
|
1906
|
+
*/
|
|
1907
|
+
TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
|
|
1808
1908
|
})(TurnCoverage || (TurnCoverage = {}));
|
|
1809
1909
|
/** Scale of the generated music. */
|
|
1810
1910
|
var Scale;
|
|
@@ -1911,6 +2011,14 @@ var LiveMusicPlaybackControl;
|
|
|
1911
2011
|
*/
|
|
1912
2012
|
LiveMusicPlaybackControl["RESET_CONTEXT"] = "RESET_CONTEXT";
|
|
1913
2013
|
})(LiveMusicPlaybackControl || (LiveMusicPlaybackControl = {}));
|
|
2014
|
+
/** The output from a server-side `ToolCall` execution.
|
|
2015
|
+
|
|
2016
|
+
This message contains the results of a tool invocation that was initiated by a
|
|
2017
|
+
`ToolCall` from the model. The client should pass this `ToolResponse` back to
|
|
2018
|
+
the API in a subsequent turn within a `Content` message, along with the
|
|
2019
|
+
corresponding `ToolCall`. */
|
|
2020
|
+
class ToolResponse {
|
|
2021
|
+
}
|
|
1914
2022
|
/** Raw media bytes for function response.
|
|
1915
2023
|
|
|
1916
2024
|
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
@@ -2366,7 +2474,6 @@ class GenerateVideosResponse {
|
|
|
2366
2474
|
class GenerateVideosOperation {
|
|
2367
2475
|
/**
|
|
2368
2476
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2369
|
-
* @internal
|
|
2370
2477
|
*/
|
|
2371
2478
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2372
2479
|
const operation = new GenerateVideosOperation();
|
|
@@ -2412,7 +2519,6 @@ class ImportFileResponse {
|
|
|
2412
2519
|
class ImportFileOperation {
|
|
2413
2520
|
/**
|
|
2414
2521
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2415
|
-
* @internal
|
|
2416
2522
|
*/
|
|
2417
2523
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2418
2524
|
const operation = new ImportFileOperation();
|
|
@@ -2667,7 +2773,6 @@ class UploadToFileSearchStoreResponse {
|
|
|
2667
2773
|
class UploadToFileSearchStoreOperation {
|
|
2668
2774
|
/**
|
|
2669
2775
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2670
|
-
* @internal
|
|
2671
2776
|
*/
|
|
2672
2777
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2673
2778
|
const operation = new UploadToFileSearchStoreOperation();
|
|
@@ -4320,6 +4425,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4320
4425
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
4321
4426
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
4322
4427
|
}
|
|
4428
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
4429
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
4430
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
4431
|
+
}
|
|
4323
4432
|
return toObject;
|
|
4324
4433
|
}
|
|
4325
4434
|
function generateContentResponseFromMldev$1(fromObject) {
|
|
@@ -4360,6 +4469,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
4360
4469
|
if (fromUsageMetadata != null) {
|
|
4361
4470
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
4362
4471
|
}
|
|
4472
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
4473
|
+
if (fromModelStatus != null) {
|
|
4474
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
4475
|
+
}
|
|
4363
4476
|
return toObject;
|
|
4364
4477
|
}
|
|
4365
4478
|
function getBatchJobParametersToMldev(apiClient, fromObject) {
|
|
@@ -4639,6 +4752,18 @@ function partToMldev$4(fromObject) {
|
|
|
4639
4752
|
if (fromVideoMetadata != null) {
|
|
4640
4753
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
4641
4754
|
}
|
|
4755
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
4756
|
+
if (fromToolCall != null) {
|
|
4757
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
4758
|
+
}
|
|
4759
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
4760
|
+
if (fromToolResponse != null) {
|
|
4761
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
4762
|
+
}
|
|
4763
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
4764
|
+
if (fromPartMetadata != null) {
|
|
4765
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
4766
|
+
}
|
|
4642
4767
|
return toObject;
|
|
4643
4768
|
}
|
|
4644
4769
|
function safetySettingToMldev$1(fromObject) {
|
|
@@ -4670,6 +4795,10 @@ function toolConfigToMldev$2(fromObject) {
|
|
|
4670
4795
|
if (fromFunctionCallingConfig != null) {
|
|
4671
4796
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4672
4797
|
}
|
|
4798
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
4799
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
4800
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
4801
|
+
}
|
|
4673
4802
|
return toObject;
|
|
4674
4803
|
}
|
|
4675
4804
|
function toolToMldev$4(fromObject) {
|
|
@@ -5492,6 +5621,24 @@ function contentToMldev$3(fromObject) {
|
|
|
5492
5621
|
}
|
|
5493
5622
|
return toObject;
|
|
5494
5623
|
}
|
|
5624
|
+
function contentToVertex$2(fromObject) {
|
|
5625
|
+
const toObject = {};
|
|
5626
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5627
|
+
if (fromParts != null) {
|
|
5628
|
+
let transformedList = fromParts;
|
|
5629
|
+
if (Array.isArray(transformedList)) {
|
|
5630
|
+
transformedList = transformedList.map((item) => {
|
|
5631
|
+
return partToVertex$2(item);
|
|
5632
|
+
});
|
|
5633
|
+
}
|
|
5634
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
5635
|
+
}
|
|
5636
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
5637
|
+
if (fromRole != null) {
|
|
5638
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
5639
|
+
}
|
|
5640
|
+
return toObject;
|
|
5641
|
+
}
|
|
5495
5642
|
function createCachedContentConfigToMldev(fromObject, parentObject) {
|
|
5496
5643
|
const toObject = {};
|
|
5497
5644
|
const fromTtl = getValueByPath(fromObject, ['ttl']);
|
|
@@ -5560,7 +5707,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5560
5707
|
let transformedList = tContents(fromContents);
|
|
5561
5708
|
if (Array.isArray(transformedList)) {
|
|
5562
5709
|
transformedList = transformedList.map((item) => {
|
|
5563
|
-
return item;
|
|
5710
|
+
return contentToVertex$2(item);
|
|
5564
5711
|
});
|
|
5565
5712
|
}
|
|
5566
5713
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -5569,7 +5716,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5569
5716
|
'systemInstruction',
|
|
5570
5717
|
]);
|
|
5571
5718
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
5572
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
5719
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
|
|
5573
5720
|
}
|
|
5574
5721
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
5575
5722
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -5583,7 +5730,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5583
5730
|
}
|
|
5584
5731
|
const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
|
|
5585
5732
|
if (parentObject !== undefined && fromToolConfig != null) {
|
|
5586
|
-
setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
|
|
5733
|
+
setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex$1(fromToolConfig));
|
|
5587
5734
|
}
|
|
5588
5735
|
const fromKmsKeyName = getValueByPath(fromObject, ['kmsKeyName']);
|
|
5589
5736
|
if (parentObject !== undefined && fromKmsKeyName != null) {
|
|
@@ -5943,6 +6090,87 @@ function partToMldev$3(fromObject) {
|
|
|
5943
6090
|
if (fromVideoMetadata != null) {
|
|
5944
6091
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
5945
6092
|
}
|
|
6093
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
6094
|
+
if (fromToolCall != null) {
|
|
6095
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
6096
|
+
}
|
|
6097
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
6098
|
+
if (fromToolResponse != null) {
|
|
6099
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
6100
|
+
}
|
|
6101
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
6102
|
+
if (fromPartMetadata != null) {
|
|
6103
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
6104
|
+
}
|
|
6105
|
+
return toObject;
|
|
6106
|
+
}
|
|
6107
|
+
function partToVertex$2(fromObject) {
|
|
6108
|
+
const toObject = {};
|
|
6109
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
6110
|
+
'mediaResolution',
|
|
6111
|
+
]);
|
|
6112
|
+
if (fromMediaResolution != null) {
|
|
6113
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
6114
|
+
}
|
|
6115
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6116
|
+
'codeExecutionResult',
|
|
6117
|
+
]);
|
|
6118
|
+
if (fromCodeExecutionResult != null) {
|
|
6119
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6120
|
+
}
|
|
6121
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6122
|
+
'executableCode',
|
|
6123
|
+
]);
|
|
6124
|
+
if (fromExecutableCode != null) {
|
|
6125
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6126
|
+
}
|
|
6127
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6128
|
+
if (fromFileData != null) {
|
|
6129
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6130
|
+
}
|
|
6131
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6132
|
+
if (fromFunctionCall != null) {
|
|
6133
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
6134
|
+
}
|
|
6135
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
6136
|
+
'functionResponse',
|
|
6137
|
+
]);
|
|
6138
|
+
if (fromFunctionResponse != null) {
|
|
6139
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
6140
|
+
}
|
|
6141
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
6142
|
+
if (fromInlineData != null) {
|
|
6143
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
6144
|
+
}
|
|
6145
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
6146
|
+
if (fromText != null) {
|
|
6147
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
6148
|
+
}
|
|
6149
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
6150
|
+
if (fromThought != null) {
|
|
6151
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
6152
|
+
}
|
|
6153
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6154
|
+
'thoughtSignature',
|
|
6155
|
+
]);
|
|
6156
|
+
if (fromThoughtSignature != null) {
|
|
6157
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6158
|
+
}
|
|
6159
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
6160
|
+
'videoMetadata',
|
|
6161
|
+
]);
|
|
6162
|
+
if (fromVideoMetadata != null) {
|
|
6163
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
6164
|
+
}
|
|
6165
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
6166
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
6167
|
+
}
|
|
6168
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
6169
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
6170
|
+
}
|
|
6171
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
6172
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
6173
|
+
}
|
|
5946
6174
|
return toObject;
|
|
5947
6175
|
}
|
|
5948
6176
|
function toolConfigToMldev$1(fromObject) {
|
|
@@ -5959,6 +6187,30 @@ function toolConfigToMldev$1(fromObject) {
|
|
|
5959
6187
|
if (fromFunctionCallingConfig != null) {
|
|
5960
6188
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5961
6189
|
}
|
|
6190
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
6191
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
6192
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
6193
|
+
}
|
|
6194
|
+
return toObject;
|
|
6195
|
+
}
|
|
6196
|
+
function toolConfigToVertex$1(fromObject) {
|
|
6197
|
+
const toObject = {};
|
|
6198
|
+
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
6199
|
+
'retrievalConfig',
|
|
6200
|
+
]);
|
|
6201
|
+
if (fromRetrievalConfig != null) {
|
|
6202
|
+
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
6203
|
+
}
|
|
6204
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
6205
|
+
'functionCallingConfig',
|
|
6206
|
+
]);
|
|
6207
|
+
if (fromFunctionCallingConfig != null) {
|
|
6208
|
+
setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
|
|
6209
|
+
}
|
|
6210
|
+
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
6211
|
+
undefined) {
|
|
6212
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
6213
|
+
}
|
|
5962
6214
|
return toObject;
|
|
5963
6215
|
}
|
|
5964
6216
|
function toolToMldev$3(fromObject) {
|
|
@@ -7175,7 +7427,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7175
7427
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7176
7428
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7177
7429
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7178
|
-
const SDK_VERSION = '1.
|
|
7430
|
+
const SDK_VERSION = '1.47.0'; // x-release-please-version
|
|
7179
7431
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7180
7432
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7181
7433
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -7235,6 +7487,11 @@ class ApiClient {
|
|
|
7235
7487
|
// Vertex Express or global endpoint case.
|
|
7236
7488
|
initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
|
|
7237
7489
|
}
|
|
7490
|
+
else if (this.clientOptions.project &&
|
|
7491
|
+
this.clientOptions.location &&
|
|
7492
|
+
this.clientOptions.location === 'us') {
|
|
7493
|
+
initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
|
|
7494
|
+
}
|
|
7238
7495
|
else if (this.clientOptions.project && this.clientOptions.location) {
|
|
7239
7496
|
initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
|
|
7240
7497
|
}
|
|
@@ -7873,20 +8130,20 @@ const INITIAL_RETRY_DELAY_MS = 1000;
|
|
|
7873
8130
|
const DELAY_MULTIPLIER = 2;
|
|
7874
8131
|
const X_GOOG_UPLOAD_STATUS_HEADER_FIELD = 'x-goog-upload-status';
|
|
7875
8132
|
class CrossUploader {
|
|
7876
|
-
async upload(file, uploadUrl, apiClient) {
|
|
8133
|
+
async upload(file, uploadUrl, apiClient, httpOptions) {
|
|
7877
8134
|
if (typeof file === 'string') {
|
|
7878
8135
|
throw crossError();
|
|
7879
8136
|
}
|
|
7880
8137
|
else {
|
|
7881
|
-
return uploadBlob(file, uploadUrl, apiClient);
|
|
8138
|
+
return uploadBlob(file, uploadUrl, apiClient, httpOptions);
|
|
7882
8139
|
}
|
|
7883
8140
|
}
|
|
7884
|
-
async uploadToFileSearchStore(file, uploadUrl, apiClient) {
|
|
8141
|
+
async uploadToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
|
|
7885
8142
|
if (typeof file === 'string') {
|
|
7886
8143
|
throw crossError();
|
|
7887
8144
|
}
|
|
7888
8145
|
else {
|
|
7889
|
-
return uploadBlobToFileSearchStore(file, uploadUrl, apiClient);
|
|
8146
|
+
return uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions);
|
|
7890
8147
|
}
|
|
7891
8148
|
}
|
|
7892
8149
|
async stat(file) {
|
|
@@ -7898,18 +8155,18 @@ class CrossUploader {
|
|
|
7898
8155
|
}
|
|
7899
8156
|
}
|
|
7900
8157
|
}
|
|
7901
|
-
async function uploadBlob(file, uploadUrl, apiClient) {
|
|
8158
|
+
async function uploadBlob(file, uploadUrl, apiClient, httpOptions) {
|
|
7902
8159
|
var _a;
|
|
7903
|
-
const response = await uploadBlobInternal(file, uploadUrl, apiClient);
|
|
8160
|
+
const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
|
|
7904
8161
|
const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
|
|
7905
8162
|
if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
|
|
7906
8163
|
throw new Error('Failed to upload file: Upload status is not finalized.');
|
|
7907
8164
|
}
|
|
7908
8165
|
return responseJson['file'];
|
|
7909
8166
|
}
|
|
7910
|
-
async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
|
|
8167
|
+
async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
|
|
7911
8168
|
var _a;
|
|
7912
|
-
const response = await uploadBlobInternal(file, uploadUrl, apiClient);
|
|
8169
|
+
const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
|
|
7913
8170
|
const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
|
|
7914
8171
|
if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
|
|
7915
8172
|
throw new Error('Failed to upload file: Upload status is not finalized.');
|
|
@@ -7919,8 +8176,18 @@ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
|
|
|
7919
8176
|
Object.assign(typedResp, resp);
|
|
7920
8177
|
return typedResp;
|
|
7921
8178
|
}
|
|
7922
|
-
async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
7923
|
-
var _a, _b;
|
|
8179
|
+
async function uploadBlobInternal(file, uploadUrl, apiClient, httpOptions) {
|
|
8180
|
+
var _a, _b, _c;
|
|
8181
|
+
let finalUrl = uploadUrl;
|
|
8182
|
+
const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a = apiClient.clientOptions.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl);
|
|
8183
|
+
if (effectiveBaseUrl) {
|
|
8184
|
+
const baseUri = new URL(effectiveBaseUrl);
|
|
8185
|
+
const uploadUri = new URL(uploadUrl);
|
|
8186
|
+
uploadUri.protocol = baseUri.protocol;
|
|
8187
|
+
uploadUri.host = baseUri.host;
|
|
8188
|
+
uploadUri.port = baseUri.port;
|
|
8189
|
+
finalUrl = uploadUri.toString();
|
|
8190
|
+
}
|
|
7924
8191
|
let fileSize = 0;
|
|
7925
8192
|
let offset = 0;
|
|
7926
8193
|
let response = new HttpResponse(new Response());
|
|
@@ -7935,21 +8202,14 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
|
7935
8202
|
let retryCount = 0;
|
|
7936
8203
|
let currentDelayMs = INITIAL_RETRY_DELAY_MS;
|
|
7937
8204
|
while (retryCount < MAX_RETRY_COUNT) {
|
|
8205
|
+
const mergedHeaders = Object.assign(Object.assign({}, ((httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.headers) || {})), { 'X-Goog-Upload-Command': uploadCommand, 'X-Goog-Upload-Offset': String(offset), 'Content-Length': String(chunkSize) });
|
|
7938
8206
|
response = await apiClient.request({
|
|
7939
8207
|
path: '',
|
|
7940
8208
|
body: chunk,
|
|
7941
8209
|
httpMethod: 'POST',
|
|
7942
|
-
httpOptions: {
|
|
7943
|
-
apiVersion: '',
|
|
7944
|
-
baseUrl: uploadUrl,
|
|
7945
|
-
headers: {
|
|
7946
|
-
'X-Goog-Upload-Command': uploadCommand,
|
|
7947
|
-
'X-Goog-Upload-Offset': String(offset),
|
|
7948
|
-
'Content-Length': String(chunkSize),
|
|
7949
|
-
},
|
|
7950
|
-
},
|
|
8210
|
+
httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: '', baseUrl: finalUrl, headers: mergedHeaders }),
|
|
7951
8211
|
});
|
|
7952
|
-
if ((
|
|
8212
|
+
if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
|
|
7953
8213
|
break;
|
|
7954
8214
|
}
|
|
7955
8215
|
retryCount++;
|
|
@@ -7959,7 +8219,7 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
|
7959
8219
|
offset += chunkSize;
|
|
7960
8220
|
// The `x-goog-upload-status` header field can be `active`, `final` and
|
|
7961
8221
|
//`cancelled` in resposne.
|
|
7962
|
-
if (((
|
|
8222
|
+
if (((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'active') {
|
|
7963
8223
|
break;
|
|
7964
8224
|
}
|
|
7965
8225
|
// TODO(b/401391430) Investigate why the upload status is not finalized
|
|
@@ -10854,6 +11114,24 @@ function contentToMldev$2(fromObject) {
|
|
|
10854
11114
|
}
|
|
10855
11115
|
return toObject;
|
|
10856
11116
|
}
|
|
11117
|
+
function contentToVertex$1(fromObject) {
|
|
11118
|
+
const toObject = {};
|
|
11119
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
11120
|
+
if (fromParts != null) {
|
|
11121
|
+
let transformedList = fromParts;
|
|
11122
|
+
if (Array.isArray(transformedList)) {
|
|
11123
|
+
transformedList = transformedList.map((item) => {
|
|
11124
|
+
return partToVertex$1(item);
|
|
11125
|
+
});
|
|
11126
|
+
}
|
|
11127
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
11128
|
+
}
|
|
11129
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
11130
|
+
if (fromRole != null) {
|
|
11131
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
11132
|
+
}
|
|
11133
|
+
return toObject;
|
|
11134
|
+
}
|
|
10857
11135
|
function fileDataToMldev$2(fromObject) {
|
|
10858
11136
|
const toObject = {};
|
|
10859
11137
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -11022,7 +11300,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
11022
11300
|
}
|
|
11023
11301
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
11024
11302
|
if (fromSpeechConfig != null) {
|
|
11025
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
11303
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
11026
11304
|
}
|
|
11027
11305
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
11028
11306
|
'stopSequences',
|
|
@@ -11243,7 +11521,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
11243
11521
|
}
|
|
11244
11522
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
11245
11523
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
11246
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
11524
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
11247
11525
|
}
|
|
11248
11526
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
11249
11527
|
'thinkingConfig',
|
|
@@ -11261,7 +11539,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
11261
11539
|
'systemInstruction',
|
|
11262
11540
|
]);
|
|
11263
11541
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
11264
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], tContent(fromSystemInstruction));
|
|
11542
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
11265
11543
|
}
|
|
11266
11544
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
11267
11545
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -11454,56 +11732,144 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
11454
11732
|
const fromSetupComplete = getValueByPath(fromObject, [
|
|
11455
11733
|
'setupComplete',
|
|
11456
11734
|
]);
|
|
11457
|
-
if (fromSetupComplete != null) {
|
|
11458
|
-
setValueByPath(toObject, ['setupComplete'], fromSetupComplete);
|
|
11735
|
+
if (fromSetupComplete != null) {
|
|
11736
|
+
setValueByPath(toObject, ['setupComplete'], fromSetupComplete);
|
|
11737
|
+
}
|
|
11738
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
11739
|
+
'serverContent',
|
|
11740
|
+
]);
|
|
11741
|
+
if (fromServerContent != null) {
|
|
11742
|
+
setValueByPath(toObject, ['serverContent'], fromServerContent);
|
|
11743
|
+
}
|
|
11744
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
11745
|
+
if (fromToolCall != null) {
|
|
11746
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
11747
|
+
}
|
|
11748
|
+
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
11749
|
+
'toolCallCancellation',
|
|
11750
|
+
]);
|
|
11751
|
+
if (fromToolCallCancellation != null) {
|
|
11752
|
+
setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
|
|
11753
|
+
}
|
|
11754
|
+
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
11755
|
+
'usageMetadata',
|
|
11756
|
+
]);
|
|
11757
|
+
if (fromUsageMetadata != null) {
|
|
11758
|
+
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
|
|
11759
|
+
}
|
|
11760
|
+
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
11761
|
+
if (fromGoAway != null) {
|
|
11762
|
+
setValueByPath(toObject, ['goAway'], fromGoAway);
|
|
11763
|
+
}
|
|
11764
|
+
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
11765
|
+
'sessionResumptionUpdate',
|
|
11766
|
+
]);
|
|
11767
|
+
if (fromSessionResumptionUpdate != null) {
|
|
11768
|
+
setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
|
|
11769
|
+
}
|
|
11770
|
+
const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
|
|
11771
|
+
'voiceActivityDetectionSignal',
|
|
11772
|
+
]);
|
|
11773
|
+
if (fromVoiceActivityDetectionSignal != null) {
|
|
11774
|
+
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
11775
|
+
}
|
|
11776
|
+
const fromVoiceActivity = getValueByPath(fromObject, [
|
|
11777
|
+
'voiceActivity',
|
|
11778
|
+
]);
|
|
11779
|
+
if (fromVoiceActivity != null) {
|
|
11780
|
+
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
11781
|
+
}
|
|
11782
|
+
return toObject;
|
|
11783
|
+
}
|
|
11784
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
11785
|
+
const toObject = {};
|
|
11786
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
11787
|
+
'speakerVoiceConfigs',
|
|
11788
|
+
]);
|
|
11789
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
11790
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
11791
|
+
if (Array.isArray(transformedList)) {
|
|
11792
|
+
transformedList = transformedList.map((item) => {
|
|
11793
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
11794
|
+
});
|
|
11795
|
+
}
|
|
11796
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
11797
|
+
}
|
|
11798
|
+
return toObject;
|
|
11799
|
+
}
|
|
11800
|
+
function partToMldev$2(fromObject) {
|
|
11801
|
+
const toObject = {};
|
|
11802
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11803
|
+
'mediaResolution',
|
|
11804
|
+
]);
|
|
11805
|
+
if (fromMediaResolution != null) {
|
|
11806
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
11807
|
+
}
|
|
11808
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
11809
|
+
'codeExecutionResult',
|
|
11810
|
+
]);
|
|
11811
|
+
if (fromCodeExecutionResult != null) {
|
|
11812
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
11813
|
+
}
|
|
11814
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11815
|
+
'executableCode',
|
|
11816
|
+
]);
|
|
11817
|
+
if (fromExecutableCode != null) {
|
|
11818
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
11819
|
+
}
|
|
11820
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11821
|
+
if (fromFileData != null) {
|
|
11822
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
|
|
11823
|
+
}
|
|
11824
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
11825
|
+
if (fromFunctionCall != null) {
|
|
11826
|
+
setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
|
|
11827
|
+
}
|
|
11828
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
11829
|
+
'functionResponse',
|
|
11830
|
+
]);
|
|
11831
|
+
if (fromFunctionResponse != null) {
|
|
11832
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
11833
|
+
}
|
|
11834
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
11835
|
+
if (fromInlineData != null) {
|
|
11836
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
|
|
11837
|
+
}
|
|
11838
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
11839
|
+
if (fromText != null) {
|
|
11840
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
11841
|
+
}
|
|
11842
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
11843
|
+
if (fromThought != null) {
|
|
11844
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
11845
|
+
}
|
|
11846
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
11847
|
+
'thoughtSignature',
|
|
11848
|
+
]);
|
|
11849
|
+
if (fromThoughtSignature != null) {
|
|
11850
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
11459
11851
|
}
|
|
11460
|
-
const
|
|
11461
|
-
'
|
|
11852
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
11853
|
+
'videoMetadata',
|
|
11462
11854
|
]);
|
|
11463
|
-
if (
|
|
11464
|
-
setValueByPath(toObject, ['
|
|
11855
|
+
if (fromVideoMetadata != null) {
|
|
11856
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
11465
11857
|
}
|
|
11466
11858
|
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
11467
11859
|
if (fromToolCall != null) {
|
|
11468
11860
|
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
11469
11861
|
}
|
|
11470
|
-
const
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
if (fromToolCallCancellation != null) {
|
|
11474
|
-
setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
|
|
11475
|
-
}
|
|
11476
|
-
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
11477
|
-
'usageMetadata',
|
|
11478
|
-
]);
|
|
11479
|
-
if (fromUsageMetadata != null) {
|
|
11480
|
-
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
|
|
11481
|
-
}
|
|
11482
|
-
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
11483
|
-
if (fromGoAway != null) {
|
|
11484
|
-
setValueByPath(toObject, ['goAway'], fromGoAway);
|
|
11485
|
-
}
|
|
11486
|
-
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
11487
|
-
'sessionResumptionUpdate',
|
|
11488
|
-
]);
|
|
11489
|
-
if (fromSessionResumptionUpdate != null) {
|
|
11490
|
-
setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
|
|
11491
|
-
}
|
|
11492
|
-
const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
|
|
11493
|
-
'voiceActivityDetectionSignal',
|
|
11494
|
-
]);
|
|
11495
|
-
if (fromVoiceActivityDetectionSignal != null) {
|
|
11496
|
-
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
11862
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
11863
|
+
if (fromToolResponse != null) {
|
|
11864
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
11497
11865
|
}
|
|
11498
|
-
const
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
if (fromVoiceActivity != null) {
|
|
11502
|
-
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
11866
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
11867
|
+
if (fromPartMetadata != null) {
|
|
11868
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
11503
11869
|
}
|
|
11504
11870
|
return toObject;
|
|
11505
11871
|
}
|
|
11506
|
-
function
|
|
11872
|
+
function partToVertex$1(fromObject) {
|
|
11507
11873
|
const toObject = {};
|
|
11508
11874
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11509
11875
|
'mediaResolution',
|
|
@@ -11525,11 +11891,11 @@ function partToMldev$2(fromObject) {
|
|
|
11525
11891
|
}
|
|
11526
11892
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11527
11893
|
if (fromFileData != null) {
|
|
11528
|
-
setValueByPath(toObject, ['fileData'],
|
|
11894
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
11529
11895
|
}
|
|
11530
11896
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
11531
11897
|
if (fromFunctionCall != null) {
|
|
11532
|
-
setValueByPath(toObject, ['functionCall'],
|
|
11898
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
11533
11899
|
}
|
|
11534
11900
|
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
11535
11901
|
'functionResponse',
|
|
@@ -11539,7 +11905,7 @@ function partToMldev$2(fromObject) {
|
|
|
11539
11905
|
}
|
|
11540
11906
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
11541
11907
|
if (fromInlineData != null) {
|
|
11542
|
-
setValueByPath(toObject, ['inlineData'],
|
|
11908
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
11543
11909
|
}
|
|
11544
11910
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
11545
11911
|
if (fromText != null) {
|
|
@@ -11561,6 +11927,29 @@ function partToMldev$2(fromObject) {
|
|
|
11561
11927
|
if (fromVideoMetadata != null) {
|
|
11562
11928
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
11563
11929
|
}
|
|
11930
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
11931
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
11932
|
+
}
|
|
11933
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
11934
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
11935
|
+
}
|
|
11936
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
11937
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
11938
|
+
}
|
|
11939
|
+
return toObject;
|
|
11940
|
+
}
|
|
11941
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
11942
|
+
const toObject = {};
|
|
11943
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
11944
|
+
if (fromMimeType != null) {
|
|
11945
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
11946
|
+
}
|
|
11947
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
11948
|
+
'voiceSampleAudio',
|
|
11949
|
+
]);
|
|
11950
|
+
if (fromVoiceSampleAudio != null) {
|
|
11951
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
11952
|
+
}
|
|
11564
11953
|
return toObject;
|
|
11565
11954
|
}
|
|
11566
11955
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
@@ -11574,6 +11963,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
11574
11963
|
}
|
|
11575
11964
|
return toObject;
|
|
11576
11965
|
}
|
|
11966
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
11967
|
+
const toObject = {};
|
|
11968
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
11969
|
+
if (fromSpeaker != null) {
|
|
11970
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
11971
|
+
}
|
|
11972
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11973
|
+
if (fromVoiceConfig != null) {
|
|
11974
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
11975
|
+
}
|
|
11976
|
+
return toObject;
|
|
11977
|
+
}
|
|
11978
|
+
function speechConfigToVertex$1(fromObject) {
|
|
11979
|
+
const toObject = {};
|
|
11980
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11981
|
+
if (fromVoiceConfig != null) {
|
|
11982
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
11983
|
+
}
|
|
11984
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
11985
|
+
if (fromLanguageCode != null) {
|
|
11986
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
11987
|
+
}
|
|
11988
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
11989
|
+
'multiSpeakerVoiceConfig',
|
|
11990
|
+
]);
|
|
11991
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
11992
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
11993
|
+
}
|
|
11994
|
+
return toObject;
|
|
11995
|
+
}
|
|
11577
11996
|
function toolToMldev$2(fromObject) {
|
|
11578
11997
|
const toObject = {};
|
|
11579
11998
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -11807,6 +12226,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
11807
12226
|
}
|
|
11808
12227
|
return toObject;
|
|
11809
12228
|
}
|
|
12229
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
12230
|
+
const toObject = {};
|
|
12231
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
12232
|
+
'replicatedVoiceConfig',
|
|
12233
|
+
]);
|
|
12234
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
12235
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
12236
|
+
}
|
|
12237
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
12238
|
+
'prebuiltVoiceConfig',
|
|
12239
|
+
]);
|
|
12240
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
12241
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
12242
|
+
}
|
|
12243
|
+
return toObject;
|
|
12244
|
+
}
|
|
11810
12245
|
|
|
11811
12246
|
/**
|
|
11812
12247
|
* @license
|
|
@@ -11929,7 +12364,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
11929
12364
|
}
|
|
11930
12365
|
return toObject;
|
|
11931
12366
|
}
|
|
11932
|
-
function computeTokensParametersToVertex(apiClient, fromObject,
|
|
12367
|
+
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
11933
12368
|
const toObject = {};
|
|
11934
12369
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
11935
12370
|
if (fromModel != null) {
|
|
@@ -11940,7 +12375,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
|
|
|
11940
12375
|
let transformedList = tContents(fromContents);
|
|
11941
12376
|
if (Array.isArray(transformedList)) {
|
|
11942
12377
|
transformedList = transformedList.map((item) => {
|
|
11943
|
-
return item;
|
|
12378
|
+
return contentToVertex(item);
|
|
11944
12379
|
});
|
|
11945
12380
|
}
|
|
11946
12381
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -12009,6 +12444,24 @@ function contentToMldev$1(fromObject, rootObject) {
|
|
|
12009
12444
|
}
|
|
12010
12445
|
return toObject;
|
|
12011
12446
|
}
|
|
12447
|
+
function contentToVertex(fromObject, rootObject) {
|
|
12448
|
+
const toObject = {};
|
|
12449
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
12450
|
+
if (fromParts != null) {
|
|
12451
|
+
let transformedList = fromParts;
|
|
12452
|
+
if (Array.isArray(transformedList)) {
|
|
12453
|
+
transformedList = transformedList.map((item) => {
|
|
12454
|
+
return partToVertex(item);
|
|
12455
|
+
});
|
|
12456
|
+
}
|
|
12457
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
12458
|
+
}
|
|
12459
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
12460
|
+
if (fromRole != null) {
|
|
12461
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
12462
|
+
}
|
|
12463
|
+
return toObject;
|
|
12464
|
+
}
|
|
12012
12465
|
function controlReferenceConfigToVertex(fromObject, _rootObject) {
|
|
12013
12466
|
const toObject = {};
|
|
12014
12467
|
const fromControlType = getValueByPath(fromObject, ['controlType']);
|
|
@@ -12042,7 +12495,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
12042
12495
|
'systemInstruction',
|
|
12043
12496
|
]);
|
|
12044
12497
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
12045
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
12498
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
12046
12499
|
}
|
|
12047
12500
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
12048
12501
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -12095,7 +12548,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
12095
12548
|
let transformedList = tContents(fromContents);
|
|
12096
12549
|
if (Array.isArray(transformedList)) {
|
|
12097
12550
|
transformedList = transformedList.map((item) => {
|
|
12098
|
-
return item;
|
|
12551
|
+
return contentToVertex(item);
|
|
12099
12552
|
});
|
|
12100
12553
|
}
|
|
12101
12554
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -12499,7 +12952,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
|
|
|
12499
12952
|
if (discriminatorContent === 'EMBED_CONTENT') {
|
|
12500
12953
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
12501
12954
|
if (fromContent != null) {
|
|
12502
|
-
setValueByPath(toObject, ['content'], tContent(fromContent));
|
|
12955
|
+
setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
|
|
12503
12956
|
}
|
|
12504
12957
|
}
|
|
12505
12958
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -12842,6 +13295,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
12842
13295
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
12843
13296
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
12844
13297
|
}
|
|
13298
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
13299
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
13300
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
13301
|
+
}
|
|
12845
13302
|
return toObject;
|
|
12846
13303
|
}
|
|
12847
13304
|
function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
|
|
@@ -12850,7 +13307,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
12850
13307
|
'systemInstruction',
|
|
12851
13308
|
]);
|
|
12852
13309
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
12853
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
13310
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
12854
13311
|
}
|
|
12855
13312
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
12856
13313
|
if (fromTemperature != null) {
|
|
@@ -12962,7 +13419,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
12962
13419
|
}
|
|
12963
13420
|
const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
|
|
12964
13421
|
if (parentObject !== undefined && fromToolConfig != null) {
|
|
12965
|
-
setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
|
|
13422
|
+
setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex(fromToolConfig));
|
|
12966
13423
|
}
|
|
12967
13424
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
12968
13425
|
if (parentObject !== undefined && fromLabels != null) {
|
|
@@ -12988,7 +13445,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
12988
13445
|
}
|
|
12989
13446
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
12990
13447
|
if (fromSpeechConfig != null) {
|
|
12991
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
13448
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
12992
13449
|
}
|
|
12993
13450
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
12994
13451
|
'audioTimestamp',
|
|
@@ -13016,6 +13473,9 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
13016
13473
|
if (parentObject !== undefined && fromModelArmorConfig != null) {
|
|
13017
13474
|
setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
|
|
13018
13475
|
}
|
|
13476
|
+
if (getValueByPath(fromObject, ['serviceTier']) !== undefined) {
|
|
13477
|
+
throw new Error('serviceTier parameter is not supported in Vertex AI.');
|
|
13478
|
+
}
|
|
13019
13479
|
return toObject;
|
|
13020
13480
|
}
|
|
13021
13481
|
function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
|
|
@@ -13051,7 +13511,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
13051
13511
|
let transformedList = tContents(fromContents);
|
|
13052
13512
|
if (Array.isArray(transformedList)) {
|
|
13053
13513
|
transformedList = transformedList.map((item) => {
|
|
13054
|
-
return item;
|
|
13514
|
+
return contentToVertex(item);
|
|
13055
13515
|
});
|
|
13056
13516
|
}
|
|
13057
13517
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -13100,6 +13560,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
|
|
|
13100
13560
|
if (fromUsageMetadata != null) {
|
|
13101
13561
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
13102
13562
|
}
|
|
13563
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
13564
|
+
if (fromModelStatus != null) {
|
|
13565
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
13566
|
+
}
|
|
13103
13567
|
return toObject;
|
|
13104
13568
|
}
|
|
13105
13569
|
function generateContentResponseFromVertex(fromObject, _rootObject) {
|
|
@@ -13485,6 +13949,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
13485
13949
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
13486
13950
|
throw new Error('compressionQuality parameter is not supported in Gemini API.');
|
|
13487
13951
|
}
|
|
13952
|
+
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
13953
|
+
throw new Error('labels parameter is not supported in Gemini API.');
|
|
13954
|
+
}
|
|
13488
13955
|
return toObject;
|
|
13489
13956
|
}
|
|
13490
13957
|
function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -13575,6 +14042,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
13575
14042
|
if (parentObject !== undefined && fromCompressionQuality != null) {
|
|
13576
14043
|
setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
|
|
13577
14044
|
}
|
|
14045
|
+
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
14046
|
+
if (parentObject !== undefined && fromLabels != null) {
|
|
14047
|
+
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
14048
|
+
}
|
|
13578
14049
|
return toObject;
|
|
13579
14050
|
}
|
|
13580
14051
|
function generateVideosOperationFromMldev(fromObject, rootObject) {
|
|
@@ -13844,7 +14315,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
13844
14315
|
}
|
|
13845
14316
|
return toObject;
|
|
13846
14317
|
}
|
|
13847
|
-
function generationConfigToVertex(fromObject,
|
|
14318
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
13848
14319
|
const toObject = {};
|
|
13849
14320
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
13850
14321
|
'modelSelectionConfig',
|
|
@@ -13940,7 +14411,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
13940
14411
|
}
|
|
13941
14412
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
13942
14413
|
if (fromSpeechConfig != null) {
|
|
13943
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
14414
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
13944
14415
|
}
|
|
13945
14416
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
13946
14417
|
'stopSequences',
|
|
@@ -14397,6 +14868,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
14397
14868
|
}
|
|
14398
14869
|
return toObject;
|
|
14399
14870
|
}
|
|
14871
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
14872
|
+
const toObject = {};
|
|
14873
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
14874
|
+
'speakerVoiceConfigs',
|
|
14875
|
+
]);
|
|
14876
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
14877
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
14878
|
+
if (Array.isArray(transformedList)) {
|
|
14879
|
+
transformedList = transformedList.map((item) => {
|
|
14880
|
+
return speakerVoiceConfigToVertex(item);
|
|
14881
|
+
});
|
|
14882
|
+
}
|
|
14883
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
14884
|
+
}
|
|
14885
|
+
return toObject;
|
|
14886
|
+
}
|
|
14400
14887
|
function partToMldev$1(fromObject, rootObject) {
|
|
14401
14888
|
const toObject = {};
|
|
14402
14889
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -14455,6 +14942,87 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
14455
14942
|
if (fromVideoMetadata != null) {
|
|
14456
14943
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
14457
14944
|
}
|
|
14945
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
14946
|
+
if (fromToolCall != null) {
|
|
14947
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
14948
|
+
}
|
|
14949
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
14950
|
+
if (fromToolResponse != null) {
|
|
14951
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
14952
|
+
}
|
|
14953
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
14954
|
+
if (fromPartMetadata != null) {
|
|
14955
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
14956
|
+
}
|
|
14957
|
+
return toObject;
|
|
14958
|
+
}
|
|
14959
|
+
function partToVertex(fromObject, _rootObject) {
|
|
14960
|
+
const toObject = {};
|
|
14961
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
14962
|
+
'mediaResolution',
|
|
14963
|
+
]);
|
|
14964
|
+
if (fromMediaResolution != null) {
|
|
14965
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
14966
|
+
}
|
|
14967
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
14968
|
+
'codeExecutionResult',
|
|
14969
|
+
]);
|
|
14970
|
+
if (fromCodeExecutionResult != null) {
|
|
14971
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
14972
|
+
}
|
|
14973
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
14974
|
+
'executableCode',
|
|
14975
|
+
]);
|
|
14976
|
+
if (fromExecutableCode != null) {
|
|
14977
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
14978
|
+
}
|
|
14979
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
14980
|
+
if (fromFileData != null) {
|
|
14981
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
14982
|
+
}
|
|
14983
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
14984
|
+
if (fromFunctionCall != null) {
|
|
14985
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
14986
|
+
}
|
|
14987
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
14988
|
+
'functionResponse',
|
|
14989
|
+
]);
|
|
14990
|
+
if (fromFunctionResponse != null) {
|
|
14991
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
14992
|
+
}
|
|
14993
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
14994
|
+
if (fromInlineData != null) {
|
|
14995
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
14996
|
+
}
|
|
14997
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
14998
|
+
if (fromText != null) {
|
|
14999
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
15000
|
+
}
|
|
15001
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
15002
|
+
if (fromThought != null) {
|
|
15003
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
15004
|
+
}
|
|
15005
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
15006
|
+
'thoughtSignature',
|
|
15007
|
+
]);
|
|
15008
|
+
if (fromThoughtSignature != null) {
|
|
15009
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
15010
|
+
}
|
|
15011
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
15012
|
+
'videoMetadata',
|
|
15013
|
+
]);
|
|
15014
|
+
if (fromVideoMetadata != null) {
|
|
15015
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
15016
|
+
}
|
|
15017
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
15018
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
15019
|
+
}
|
|
15020
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
15021
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
15022
|
+
}
|
|
15023
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
15024
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
15025
|
+
}
|
|
14458
15026
|
return toObject;
|
|
14459
15027
|
}
|
|
14460
15028
|
function productImageToVertex(fromObject, rootObject) {
|
|
@@ -14625,6 +15193,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
14625
15193
|
}
|
|
14626
15194
|
return toObject;
|
|
14627
15195
|
}
|
|
15196
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
15197
|
+
const toObject = {};
|
|
15198
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
15199
|
+
if (fromMimeType != null) {
|
|
15200
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15201
|
+
}
|
|
15202
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
15203
|
+
'voiceSampleAudio',
|
|
15204
|
+
]);
|
|
15205
|
+
if (fromVoiceSampleAudio != null) {
|
|
15206
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
15207
|
+
}
|
|
15208
|
+
return toObject;
|
|
15209
|
+
}
|
|
14628
15210
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
14629
15211
|
const toObject = {};
|
|
14630
15212
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -14774,6 +15356,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
14774
15356
|
}
|
|
14775
15357
|
return toObject;
|
|
14776
15358
|
}
|
|
15359
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
15360
|
+
const toObject = {};
|
|
15361
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
15362
|
+
if (fromSpeaker != null) {
|
|
15363
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
15364
|
+
}
|
|
15365
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15366
|
+
if (fromVoiceConfig != null) {
|
|
15367
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
15368
|
+
}
|
|
15369
|
+
return toObject;
|
|
15370
|
+
}
|
|
15371
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
15372
|
+
const toObject = {};
|
|
15373
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15374
|
+
if (fromVoiceConfig != null) {
|
|
15375
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
15376
|
+
}
|
|
15377
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
15378
|
+
if (fromLanguageCode != null) {
|
|
15379
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
15380
|
+
}
|
|
15381
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
15382
|
+
'multiSpeakerVoiceConfig',
|
|
15383
|
+
]);
|
|
15384
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
15385
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
15386
|
+
}
|
|
15387
|
+
return toObject;
|
|
15388
|
+
}
|
|
14777
15389
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
14778
15390
|
const toObject = {};
|
|
14779
15391
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -14788,6 +15400,30 @@ function toolConfigToMldev(fromObject, rootObject) {
|
|
|
14788
15400
|
if (fromFunctionCallingConfig != null) {
|
|
14789
15401
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14790
15402
|
}
|
|
15403
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
15404
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
15405
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
15406
|
+
}
|
|
15407
|
+
return toObject;
|
|
15408
|
+
}
|
|
15409
|
+
function toolConfigToVertex(fromObject, _rootObject) {
|
|
15410
|
+
const toObject = {};
|
|
15411
|
+
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
15412
|
+
'retrievalConfig',
|
|
15413
|
+
]);
|
|
15414
|
+
if (fromRetrievalConfig != null) {
|
|
15415
|
+
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
15416
|
+
}
|
|
15417
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
15418
|
+
'functionCallingConfig',
|
|
15419
|
+
]);
|
|
15420
|
+
if (fromFunctionCallingConfig != null) {
|
|
15421
|
+
setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
|
|
15422
|
+
}
|
|
15423
|
+
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
15424
|
+
undefined) {
|
|
15425
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
15426
|
+
}
|
|
14791
15427
|
return toObject;
|
|
14792
15428
|
}
|
|
14793
15429
|
function toolToMldev$1(fromObject, rootObject) {
|
|
@@ -15232,6 +15868,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
15232
15868
|
}
|
|
15233
15869
|
return toObject;
|
|
15234
15870
|
}
|
|
15871
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
15872
|
+
const toObject = {};
|
|
15873
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
15874
|
+
'replicatedVoiceConfig',
|
|
15875
|
+
]);
|
|
15876
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
15877
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
15878
|
+
}
|
|
15879
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
15880
|
+
'prebuiltVoiceConfig',
|
|
15881
|
+
]);
|
|
15882
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
15883
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
15884
|
+
}
|
|
15885
|
+
return toObject;
|
|
15886
|
+
}
|
|
15235
15887
|
|
|
15236
15888
|
/**
|
|
15237
15889
|
* @license
|
|
@@ -15926,7 +16578,7 @@ class Session {
|
|
|
15926
16578
|
}
|
|
15927
16579
|
}
|
|
15928
16580
|
const clientMessage = {
|
|
15929
|
-
toolResponse: { functionResponses: functionResponses },
|
|
16581
|
+
toolResponse: { 'functionResponses': functionResponses },
|
|
15930
16582
|
};
|
|
15931
16583
|
return clientMessage;
|
|
15932
16584
|
}
|
|
@@ -18256,6 +18908,18 @@ function partToMldev(fromObject) {
|
|
|
18256
18908
|
if (fromVideoMetadata != null) {
|
|
18257
18909
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
18258
18910
|
}
|
|
18911
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
18912
|
+
if (fromToolCall != null) {
|
|
18913
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
18914
|
+
}
|
|
18915
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
18916
|
+
if (fromToolResponse != null) {
|
|
18917
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
18918
|
+
}
|
|
18919
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
18920
|
+
if (fromPartMetadata != null) {
|
|
18921
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
18922
|
+
}
|
|
18259
18923
|
return toObject;
|
|
18260
18924
|
}
|
|
18261
18925
|
function sessionResumptionConfigToMldev(fromObject) {
|
|
@@ -18890,6 +19554,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18890
19554
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
|
|
18891
19555
|
}
|
|
18892
19556
|
}
|
|
19557
|
+
else if (discriminatorTuningMode === 'DISTILLATION') {
|
|
19558
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
19559
|
+
if (parentObject !== undefined && fromTuningMode != null) {
|
|
19560
|
+
setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
|
|
19561
|
+
}
|
|
19562
|
+
}
|
|
18893
19563
|
const fromCustomBaseModel = getValueByPath(fromObject, [
|
|
18894
19564
|
'customBaseModel',
|
|
18895
19565
|
]);
|
|
@@ -18909,6 +19579,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18909
19579
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
18910
19580
|
}
|
|
18911
19581
|
}
|
|
19582
|
+
else if (discriminatorBatchSize === 'DISTILLATION') {
|
|
19583
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
19584
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
19585
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
19586
|
+
}
|
|
19587
|
+
}
|
|
18912
19588
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
18913
19589
|
'config',
|
|
18914
19590
|
'method',
|
|
@@ -18924,6 +19600,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18924
19600
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
18925
19601
|
}
|
|
18926
19602
|
}
|
|
19603
|
+
else if (discriminatorLearningRate === 'DISTILLATION') {
|
|
19604
|
+
const fromLearningRate = getValueByPath(fromObject, [
|
|
19605
|
+
'learningRate',
|
|
19606
|
+
]);
|
|
19607
|
+
if (parentObject !== undefined && fromLearningRate != null) {
|
|
19608
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
19609
|
+
}
|
|
19610
|
+
}
|
|
18927
19611
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
18928
19612
|
if (parentObject !== undefined && fromLabels != null) {
|
|
18929
19613
|
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
@@ -19427,6 +20111,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19427
20111
|
if (fromVeoTuningSpec != null) {
|
|
19428
20112
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
19429
20113
|
}
|
|
20114
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20115
|
+
'distillationSamplingSpec',
|
|
20116
|
+
]);
|
|
20117
|
+
if (fromDistillationSamplingSpec != null) {
|
|
20118
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20119
|
+
}
|
|
20120
|
+
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20121
|
+
'tuningJobMetadata',
|
|
20122
|
+
]);
|
|
20123
|
+
if (fromTuningJobMetadata != null) {
|
|
20124
|
+
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20125
|
+
}
|
|
19430
20126
|
return toObject;
|
|
19431
20127
|
}
|
|
19432
20128
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|
|
@@ -19969,5 +20665,5 @@ class GoogleGenAI {
|
|
|
19969
20665
|
}
|
|
19970
20666
|
}
|
|
19971
20667
|
|
|
19972
|
-
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
20668
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19973
20669
|
//# sourceMappingURL=index.mjs.map
|