@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/web/index.mjs
CHANGED
|
@@ -586,6 +586,18 @@ function videoFromVertex$1(fromObject) {
|
|
|
586
586
|
* Copyright 2025 Google LLC
|
|
587
587
|
* SPDX-License-Identifier: Apache-2.0
|
|
588
588
|
*/
|
|
589
|
+
/** Programming language of the `code`. */
|
|
590
|
+
var Language;
|
|
591
|
+
(function (Language) {
|
|
592
|
+
/**
|
|
593
|
+
* Unspecified language. This value should not be used.
|
|
594
|
+
*/
|
|
595
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
596
|
+
/**
|
|
597
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
598
|
+
*/
|
|
599
|
+
Language["PYTHON"] = "PYTHON";
|
|
600
|
+
})(Language || (Language = {}));
|
|
589
601
|
/** Outcome of the code execution. */
|
|
590
602
|
var Outcome;
|
|
591
603
|
(function (Outcome) {
|
|
@@ -606,18 +618,6 @@ var Outcome;
|
|
|
606
618
|
*/
|
|
607
619
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
608
620
|
})(Outcome || (Outcome = {}));
|
|
609
|
-
/** Programming language of the `code`. */
|
|
610
|
-
var Language;
|
|
611
|
-
(function (Language) {
|
|
612
|
-
/**
|
|
613
|
-
* Unspecified language. This value should not be used.
|
|
614
|
-
*/
|
|
615
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
616
|
-
/**
|
|
617
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
618
|
-
*/
|
|
619
|
-
Language["PYTHON"] = "PYTHON";
|
|
620
|
-
})(Language || (Language = {}));
|
|
621
621
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
622
622
|
var FunctionResponseScheduling;
|
|
623
623
|
(function (FunctionResponseScheduling) {
|
|
@@ -674,38 +674,18 @@ var Type;
|
|
|
674
674
|
*/
|
|
675
675
|
Type["NULL"] = "NULL";
|
|
676
676
|
})(Type || (Type = {}));
|
|
677
|
-
/**
|
|
678
|
-
var
|
|
679
|
-
(function (
|
|
680
|
-
/**
|
|
681
|
-
* Defaults to unspecified.
|
|
682
|
-
*/
|
|
683
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
684
|
-
/**
|
|
685
|
-
* Blocks Low and above confidence URL that is risky.
|
|
686
|
-
*/
|
|
687
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
688
|
-
/**
|
|
689
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
690
|
-
*/
|
|
691
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
692
|
-
/**
|
|
693
|
-
* Blocks High and above confidence URL that is risky.
|
|
694
|
-
*/
|
|
695
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
696
|
-
/**
|
|
697
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
698
|
-
*/
|
|
699
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
677
|
+
/** The environment being operated. */
|
|
678
|
+
var Environment;
|
|
679
|
+
(function (Environment) {
|
|
700
680
|
/**
|
|
701
|
-
*
|
|
681
|
+
* Defaults to browser.
|
|
702
682
|
*/
|
|
703
|
-
|
|
683
|
+
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
704
684
|
/**
|
|
705
|
-
*
|
|
685
|
+
* Operates in a web browser.
|
|
706
686
|
*/
|
|
707
|
-
|
|
708
|
-
})(
|
|
687
|
+
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
688
|
+
})(Environment || (Environment = {}));
|
|
709
689
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
710
690
|
var AuthType;
|
|
711
691
|
(function (AuthType) {
|
|
@@ -776,6 +756,38 @@ var ApiSpec;
|
|
|
776
756
|
*/
|
|
777
757
|
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
778
758
|
})(ApiSpec || (ApiSpec = {}));
|
|
759
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
760
|
+
var PhishBlockThreshold;
|
|
761
|
+
(function (PhishBlockThreshold) {
|
|
762
|
+
/**
|
|
763
|
+
* Defaults to unspecified.
|
|
764
|
+
*/
|
|
765
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
766
|
+
/**
|
|
767
|
+
* Blocks Low and above confidence URL that is risky.
|
|
768
|
+
*/
|
|
769
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
770
|
+
/**
|
|
771
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
772
|
+
*/
|
|
773
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
774
|
+
/**
|
|
775
|
+
* Blocks High and above confidence URL that is risky.
|
|
776
|
+
*/
|
|
777
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
778
|
+
/**
|
|
779
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
780
|
+
*/
|
|
781
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
782
|
+
/**
|
|
783
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
784
|
+
*/
|
|
785
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
786
|
+
/**
|
|
787
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
788
|
+
*/
|
|
789
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
790
|
+
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
779
791
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
780
792
|
var Behavior;
|
|
781
793
|
(function (Behavior) {
|
|
@@ -835,6 +847,10 @@ var ThinkingLevel;
|
|
|
835
847
|
* Unspecified thinking level.
|
|
836
848
|
*/
|
|
837
849
|
ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
|
|
850
|
+
/**
|
|
851
|
+
* MINIMAL thinking level.
|
|
852
|
+
*/
|
|
853
|
+
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
838
854
|
/**
|
|
839
855
|
* Low thinking level.
|
|
840
856
|
*/
|
|
@@ -847,10 +863,6 @@ var ThinkingLevel;
|
|
|
847
863
|
* High thinking level.
|
|
848
864
|
*/
|
|
849
865
|
ThinkingLevel["HIGH"] = "HIGH";
|
|
850
|
-
/**
|
|
851
|
-
* MINIMAL thinking level.
|
|
852
|
-
*/
|
|
853
|
-
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
854
866
|
})(ThinkingLevel || (ThinkingLevel = {}));
|
|
855
867
|
/** Enum that controls the generation of people. */
|
|
856
868
|
var PersonGeneration;
|
|
@@ -868,6 +880,22 @@ var PersonGeneration;
|
|
|
868
880
|
*/
|
|
869
881
|
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
870
882
|
})(PersonGeneration || (PersonGeneration = {}));
|
|
883
|
+
/** 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. */
|
|
884
|
+
var ProminentPeople;
|
|
885
|
+
(function (ProminentPeople) {
|
|
886
|
+
/**
|
|
887
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
888
|
+
*/
|
|
889
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
890
|
+
/**
|
|
891
|
+
* Allows the model to generate images of prominent people.
|
|
892
|
+
*/
|
|
893
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
894
|
+
/**
|
|
895
|
+
* Prevents the model from generating images of prominent people.
|
|
896
|
+
*/
|
|
897
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
898
|
+
})(ProminentPeople || (ProminentPeople = {}));
|
|
871
899
|
/** The harm category to be blocked. */
|
|
872
900
|
var HarmCategory;
|
|
873
901
|
(function (HarmCategory) {
|
|
@@ -1186,6 +1214,42 @@ var Modality;
|
|
|
1186
1214
|
*/
|
|
1187
1215
|
Modality["AUDIO"] = "AUDIO";
|
|
1188
1216
|
})(Modality || (Modality = {}));
|
|
1217
|
+
/** The stage of the underlying model. This enum is not supported in Vertex AI. */
|
|
1218
|
+
var ModelStage;
|
|
1219
|
+
(function (ModelStage) {
|
|
1220
|
+
/**
|
|
1221
|
+
* Unspecified model stage.
|
|
1222
|
+
*/
|
|
1223
|
+
ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
|
|
1224
|
+
/**
|
|
1225
|
+
* The underlying model is subject to lots of tunings.
|
|
1226
|
+
*/
|
|
1227
|
+
ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
|
|
1228
|
+
/**
|
|
1229
|
+
* Models in this stage are for experimental purposes only.
|
|
1230
|
+
*/
|
|
1231
|
+
ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
|
|
1232
|
+
/**
|
|
1233
|
+
* Models in this stage are more mature than experimental models.
|
|
1234
|
+
*/
|
|
1235
|
+
ModelStage["PREVIEW"] = "PREVIEW";
|
|
1236
|
+
/**
|
|
1237
|
+
* Models in this stage are considered stable and ready for production use.
|
|
1238
|
+
*/
|
|
1239
|
+
ModelStage["STABLE"] = "STABLE";
|
|
1240
|
+
/**
|
|
1241
|
+
* 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.
|
|
1242
|
+
*/
|
|
1243
|
+
ModelStage["LEGACY"] = "LEGACY";
|
|
1244
|
+
/**
|
|
1245
|
+
* Models in this stage are deprecated. These models cannot be used.
|
|
1246
|
+
*/
|
|
1247
|
+
ModelStage["DEPRECATED"] = "DEPRECATED";
|
|
1248
|
+
/**
|
|
1249
|
+
* Models in this stage are retired. These models cannot be used.
|
|
1250
|
+
*/
|
|
1251
|
+
ModelStage["RETIRED"] = "RETIRED";
|
|
1252
|
+
})(ModelStage || (ModelStage = {}));
|
|
1189
1253
|
/** The media resolution to use. */
|
|
1190
1254
|
var MediaResolution;
|
|
1191
1255
|
(function (MediaResolution) {
|
|
@@ -1422,6 +1486,26 @@ var TuningTask;
|
|
|
1422
1486
|
*/
|
|
1423
1487
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1424
1488
|
})(TuningTask || (TuningTask = {}));
|
|
1489
|
+
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1490
|
+
var DocumentState;
|
|
1491
|
+
(function (DocumentState) {
|
|
1492
|
+
/**
|
|
1493
|
+
* The default value. This value is used if the state is omitted.
|
|
1494
|
+
*/
|
|
1495
|
+
DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
1496
|
+
/**
|
|
1497
|
+
* Some `Chunks` of the `Document` are being processed (embedding and vector storage).
|
|
1498
|
+
*/
|
|
1499
|
+
DocumentState["STATE_PENDING"] = "STATE_PENDING";
|
|
1500
|
+
/**
|
|
1501
|
+
* All `Chunks` of the `Document` is processed and available for querying.
|
|
1502
|
+
*/
|
|
1503
|
+
DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
|
|
1504
|
+
/**
|
|
1505
|
+
* Some `Chunks` of the `Document` failed processing.
|
|
1506
|
+
*/
|
|
1507
|
+
DocumentState["STATE_FAILED"] = "STATE_FAILED";
|
|
1508
|
+
})(DocumentState || (DocumentState = {}));
|
|
1425
1509
|
/** The tokenization quality used for given media. */
|
|
1426
1510
|
var PartMediaResolutionLevel;
|
|
1427
1511
|
(function (PartMediaResolutionLevel) {
|
|
@@ -1446,6 +1530,34 @@ var PartMediaResolutionLevel;
|
|
|
1446
1530
|
*/
|
|
1447
1531
|
PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
|
|
1448
1532
|
})(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
|
|
1533
|
+
/** The type of tool in the function call. */
|
|
1534
|
+
var ToolType;
|
|
1535
|
+
(function (ToolType) {
|
|
1536
|
+
/**
|
|
1537
|
+
* Unspecified tool type.
|
|
1538
|
+
*/
|
|
1539
|
+
ToolType["TOOL_TYPE_UNSPECIFIED"] = "TOOL_TYPE_UNSPECIFIED";
|
|
1540
|
+
/**
|
|
1541
|
+
* Google search tool, maps to Tool.google_search.search_types.web_search.
|
|
1542
|
+
*/
|
|
1543
|
+
ToolType["GOOGLE_SEARCH_WEB"] = "GOOGLE_SEARCH_WEB";
|
|
1544
|
+
/**
|
|
1545
|
+
* Image search tool, maps to Tool.google_search.search_types.image_search.
|
|
1546
|
+
*/
|
|
1547
|
+
ToolType["GOOGLE_SEARCH_IMAGE"] = "GOOGLE_SEARCH_IMAGE";
|
|
1548
|
+
/**
|
|
1549
|
+
* URL context tool, maps to Tool.url_context.
|
|
1550
|
+
*/
|
|
1551
|
+
ToolType["URL_CONTEXT"] = "URL_CONTEXT";
|
|
1552
|
+
/**
|
|
1553
|
+
* Google maps tool, maps to Tool.google_maps.
|
|
1554
|
+
*/
|
|
1555
|
+
ToolType["GOOGLE_MAPS"] = "GOOGLE_MAPS";
|
|
1556
|
+
/**
|
|
1557
|
+
* File search tool, maps to Tool.file_search.
|
|
1558
|
+
*/
|
|
1559
|
+
ToolType["FILE_SEARCH"] = "FILE_SEARCH";
|
|
1560
|
+
})(ToolType || (ToolType = {}));
|
|
1449
1561
|
/** Resource scope. */
|
|
1450
1562
|
var ResourceScope;
|
|
1451
1563
|
(function (ResourceScope) {
|
|
@@ -1458,42 +1570,34 @@ var ResourceScope;
|
|
|
1458
1570
|
*/
|
|
1459
1571
|
ResourceScope["COLLECTION"] = "COLLECTION";
|
|
1460
1572
|
})(ResourceScope || (ResourceScope = {}));
|
|
1461
|
-
/**
|
|
1462
|
-
var
|
|
1463
|
-
(function (
|
|
1464
|
-
FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
|
|
1465
|
-
FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
|
|
1466
|
-
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1467
|
-
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1468
|
-
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1469
|
-
/** The environment being operated. */
|
|
1470
|
-
var Environment;
|
|
1471
|
-
(function (Environment) {
|
|
1573
|
+
/** Pricing and performance service tier. */
|
|
1574
|
+
var ServiceTier;
|
|
1575
|
+
(function (ServiceTier) {
|
|
1472
1576
|
/**
|
|
1473
|
-
*
|
|
1577
|
+
* Default service tier, which is standard.
|
|
1474
1578
|
*/
|
|
1475
|
-
|
|
1579
|
+
ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
|
|
1476
1580
|
/**
|
|
1477
|
-
*
|
|
1581
|
+
* Flex service tier.
|
|
1478
1582
|
*/
|
|
1479
|
-
|
|
1480
|
-
})(Environment || (Environment = {}));
|
|
1481
|
-
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1482
|
-
var ProminentPeople;
|
|
1483
|
-
(function (ProminentPeople) {
|
|
1583
|
+
ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
|
|
1484
1584
|
/**
|
|
1485
|
-
*
|
|
1585
|
+
* Standard service tier.
|
|
1486
1586
|
*/
|
|
1487
|
-
|
|
1587
|
+
ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
|
|
1488
1588
|
/**
|
|
1489
|
-
*
|
|
1589
|
+
* Priority service tier.
|
|
1490
1590
|
*/
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1591
|
+
ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_PRIORITY";
|
|
1592
|
+
})(ServiceTier || (ServiceTier = {}));
|
|
1593
|
+
/** Options for feature selection preference. */
|
|
1594
|
+
var FeatureSelectionPreference;
|
|
1595
|
+
(function (FeatureSelectionPreference) {
|
|
1596
|
+
FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
|
|
1597
|
+
FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
|
|
1598
|
+
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1599
|
+
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1600
|
+
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1497
1601
|
/** Enum representing the Vertex embedding API to use. */
|
|
1498
1602
|
var EmbeddingApiType;
|
|
1499
1603
|
(function (EmbeddingApiType) {
|
|
@@ -1668,14 +1772,6 @@ var TuningMethod;
|
|
|
1668
1772
|
*/
|
|
1669
1773
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1670
1774
|
})(TuningMethod || (TuningMethod = {}));
|
|
1671
|
-
/** State for the lifecycle of a Document. */
|
|
1672
|
-
var DocumentState;
|
|
1673
|
-
(function (DocumentState) {
|
|
1674
|
-
DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
1675
|
-
DocumentState["STATE_PENDING"] = "STATE_PENDING";
|
|
1676
|
-
DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
|
|
1677
|
-
DocumentState["STATE_FAILED"] = "STATE_FAILED";
|
|
1678
|
-
})(DocumentState || (DocumentState = {}));
|
|
1679
1775
|
/** State for the lifecycle of a File. */
|
|
1680
1776
|
var FileState;
|
|
1681
1777
|
(function (FileState) {
|
|
@@ -1835,6 +1931,10 @@ var TurnCoverage;
|
|
|
1835
1931
|
* The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
|
|
1836
1932
|
*/
|
|
1837
1933
|
TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
|
|
1934
|
+
/**
|
|
1935
|
+
* Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
|
|
1936
|
+
*/
|
|
1937
|
+
TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
|
|
1838
1938
|
})(TurnCoverage || (TurnCoverage = {}));
|
|
1839
1939
|
/** Scale of the generated music. */
|
|
1840
1940
|
var Scale;
|
|
@@ -1941,6 +2041,14 @@ var LiveMusicPlaybackControl;
|
|
|
1941
2041
|
*/
|
|
1942
2042
|
LiveMusicPlaybackControl["RESET_CONTEXT"] = "RESET_CONTEXT";
|
|
1943
2043
|
})(LiveMusicPlaybackControl || (LiveMusicPlaybackControl = {}));
|
|
2044
|
+
/** The output from a server-side `ToolCall` execution.
|
|
2045
|
+
|
|
2046
|
+
This message contains the results of a tool invocation that was initiated by a
|
|
2047
|
+
`ToolCall` from the model. The client should pass this `ToolResponse` back to
|
|
2048
|
+
the API in a subsequent turn within a `Content` message, along with the
|
|
2049
|
+
corresponding `ToolCall`. */
|
|
2050
|
+
class ToolResponse {
|
|
2051
|
+
}
|
|
1944
2052
|
/** Raw media bytes for function response.
|
|
1945
2053
|
|
|
1946
2054
|
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
@@ -2396,7 +2504,6 @@ class GenerateVideosResponse {
|
|
|
2396
2504
|
class GenerateVideosOperation {
|
|
2397
2505
|
/**
|
|
2398
2506
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2399
|
-
* @internal
|
|
2400
2507
|
*/
|
|
2401
2508
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2402
2509
|
const operation = new GenerateVideosOperation();
|
|
@@ -2442,7 +2549,6 @@ class ImportFileResponse {
|
|
|
2442
2549
|
class ImportFileOperation {
|
|
2443
2550
|
/**
|
|
2444
2551
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2445
|
-
* @internal
|
|
2446
2552
|
*/
|
|
2447
2553
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2448
2554
|
const operation = new ImportFileOperation();
|
|
@@ -2697,7 +2803,6 @@ class UploadToFileSearchStoreResponse {
|
|
|
2697
2803
|
class UploadToFileSearchStoreOperation {
|
|
2698
2804
|
/**
|
|
2699
2805
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2700
|
-
* @internal
|
|
2701
2806
|
*/
|
|
2702
2807
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2703
2808
|
const operation = new UploadToFileSearchStoreOperation();
|
|
@@ -4350,6 +4455,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4350
4455
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
4351
4456
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
4352
4457
|
}
|
|
4458
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
4459
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
4460
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
4461
|
+
}
|
|
4353
4462
|
return toObject;
|
|
4354
4463
|
}
|
|
4355
4464
|
function generateContentResponseFromMldev$1(fromObject) {
|
|
@@ -4390,6 +4499,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
4390
4499
|
if (fromUsageMetadata != null) {
|
|
4391
4500
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
4392
4501
|
}
|
|
4502
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
4503
|
+
if (fromModelStatus != null) {
|
|
4504
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
4505
|
+
}
|
|
4393
4506
|
return toObject;
|
|
4394
4507
|
}
|
|
4395
4508
|
function getBatchJobParametersToMldev(apiClient, fromObject) {
|
|
@@ -4669,6 +4782,18 @@ function partToMldev$4(fromObject) {
|
|
|
4669
4782
|
if (fromVideoMetadata != null) {
|
|
4670
4783
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
4671
4784
|
}
|
|
4785
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
4786
|
+
if (fromToolCall != null) {
|
|
4787
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
4788
|
+
}
|
|
4789
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
4790
|
+
if (fromToolResponse != null) {
|
|
4791
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
4792
|
+
}
|
|
4793
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
4794
|
+
if (fromPartMetadata != null) {
|
|
4795
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
4796
|
+
}
|
|
4672
4797
|
return toObject;
|
|
4673
4798
|
}
|
|
4674
4799
|
function safetySettingToMldev$1(fromObject) {
|
|
@@ -4700,6 +4825,10 @@ function toolConfigToMldev$2(fromObject) {
|
|
|
4700
4825
|
if (fromFunctionCallingConfig != null) {
|
|
4701
4826
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4702
4827
|
}
|
|
4828
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
4829
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
4830
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
4831
|
+
}
|
|
4703
4832
|
return toObject;
|
|
4704
4833
|
}
|
|
4705
4834
|
function toolToMldev$4(fromObject) {
|
|
@@ -5522,6 +5651,24 @@ function contentToMldev$3(fromObject) {
|
|
|
5522
5651
|
}
|
|
5523
5652
|
return toObject;
|
|
5524
5653
|
}
|
|
5654
|
+
function contentToVertex$2(fromObject) {
|
|
5655
|
+
const toObject = {};
|
|
5656
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5657
|
+
if (fromParts != null) {
|
|
5658
|
+
let transformedList = fromParts;
|
|
5659
|
+
if (Array.isArray(transformedList)) {
|
|
5660
|
+
transformedList = transformedList.map((item) => {
|
|
5661
|
+
return partToVertex$2(item);
|
|
5662
|
+
});
|
|
5663
|
+
}
|
|
5664
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
5665
|
+
}
|
|
5666
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
5667
|
+
if (fromRole != null) {
|
|
5668
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
5669
|
+
}
|
|
5670
|
+
return toObject;
|
|
5671
|
+
}
|
|
5525
5672
|
function createCachedContentConfigToMldev(fromObject, parentObject) {
|
|
5526
5673
|
const toObject = {};
|
|
5527
5674
|
const fromTtl = getValueByPath(fromObject, ['ttl']);
|
|
@@ -5590,7 +5737,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5590
5737
|
let transformedList = tContents(fromContents);
|
|
5591
5738
|
if (Array.isArray(transformedList)) {
|
|
5592
5739
|
transformedList = transformedList.map((item) => {
|
|
5593
|
-
return item;
|
|
5740
|
+
return contentToVertex$2(item);
|
|
5594
5741
|
});
|
|
5595
5742
|
}
|
|
5596
5743
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -5599,7 +5746,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5599
5746
|
'systemInstruction',
|
|
5600
5747
|
]);
|
|
5601
5748
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
5602
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
5749
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
|
|
5603
5750
|
}
|
|
5604
5751
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
5605
5752
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -5613,7 +5760,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5613
5760
|
}
|
|
5614
5761
|
const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
|
|
5615
5762
|
if (parentObject !== undefined && fromToolConfig != null) {
|
|
5616
|
-
setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
|
|
5763
|
+
setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex$1(fromToolConfig));
|
|
5617
5764
|
}
|
|
5618
5765
|
const fromKmsKeyName = getValueByPath(fromObject, ['kmsKeyName']);
|
|
5619
5766
|
if (parentObject !== undefined && fromKmsKeyName != null) {
|
|
@@ -5973,6 +6120,87 @@ function partToMldev$3(fromObject) {
|
|
|
5973
6120
|
if (fromVideoMetadata != null) {
|
|
5974
6121
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
5975
6122
|
}
|
|
6123
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
6124
|
+
if (fromToolCall != null) {
|
|
6125
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
6126
|
+
}
|
|
6127
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
6128
|
+
if (fromToolResponse != null) {
|
|
6129
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
6130
|
+
}
|
|
6131
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
6132
|
+
if (fromPartMetadata != null) {
|
|
6133
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
6134
|
+
}
|
|
6135
|
+
return toObject;
|
|
6136
|
+
}
|
|
6137
|
+
function partToVertex$2(fromObject) {
|
|
6138
|
+
const toObject = {};
|
|
6139
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
6140
|
+
'mediaResolution',
|
|
6141
|
+
]);
|
|
6142
|
+
if (fromMediaResolution != null) {
|
|
6143
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
6144
|
+
}
|
|
6145
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
6146
|
+
'codeExecutionResult',
|
|
6147
|
+
]);
|
|
6148
|
+
if (fromCodeExecutionResult != null) {
|
|
6149
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6150
|
+
}
|
|
6151
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6152
|
+
'executableCode',
|
|
6153
|
+
]);
|
|
6154
|
+
if (fromExecutableCode != null) {
|
|
6155
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6156
|
+
}
|
|
6157
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6158
|
+
if (fromFileData != null) {
|
|
6159
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
6160
|
+
}
|
|
6161
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
6162
|
+
if (fromFunctionCall != null) {
|
|
6163
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
6164
|
+
}
|
|
6165
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
6166
|
+
'functionResponse',
|
|
6167
|
+
]);
|
|
6168
|
+
if (fromFunctionResponse != null) {
|
|
6169
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
6170
|
+
}
|
|
6171
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
6172
|
+
if (fromInlineData != null) {
|
|
6173
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
6174
|
+
}
|
|
6175
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
6176
|
+
if (fromText != null) {
|
|
6177
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
6178
|
+
}
|
|
6179
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
6180
|
+
if (fromThought != null) {
|
|
6181
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
6182
|
+
}
|
|
6183
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
6184
|
+
'thoughtSignature',
|
|
6185
|
+
]);
|
|
6186
|
+
if (fromThoughtSignature != null) {
|
|
6187
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
6188
|
+
}
|
|
6189
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
6190
|
+
'videoMetadata',
|
|
6191
|
+
]);
|
|
6192
|
+
if (fromVideoMetadata != null) {
|
|
6193
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
6194
|
+
}
|
|
6195
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
6196
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
6197
|
+
}
|
|
6198
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
6199
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
6200
|
+
}
|
|
6201
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
6202
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
6203
|
+
}
|
|
5976
6204
|
return toObject;
|
|
5977
6205
|
}
|
|
5978
6206
|
function toolConfigToMldev$1(fromObject) {
|
|
@@ -5989,6 +6217,30 @@ function toolConfigToMldev$1(fromObject) {
|
|
|
5989
6217
|
if (fromFunctionCallingConfig != null) {
|
|
5990
6218
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5991
6219
|
}
|
|
6220
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
6221
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
6222
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
6223
|
+
}
|
|
6224
|
+
return toObject;
|
|
6225
|
+
}
|
|
6226
|
+
function toolConfigToVertex$1(fromObject) {
|
|
6227
|
+
const toObject = {};
|
|
6228
|
+
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
6229
|
+
'retrievalConfig',
|
|
6230
|
+
]);
|
|
6231
|
+
if (fromRetrievalConfig != null) {
|
|
6232
|
+
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
6233
|
+
}
|
|
6234
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
6235
|
+
'functionCallingConfig',
|
|
6236
|
+
]);
|
|
6237
|
+
if (fromFunctionCallingConfig != null) {
|
|
6238
|
+
setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
|
|
6239
|
+
}
|
|
6240
|
+
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
6241
|
+
undefined) {
|
|
6242
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
6243
|
+
}
|
|
5992
6244
|
return toObject;
|
|
5993
6245
|
}
|
|
5994
6246
|
function toolToMldev$3(fromObject) {
|
|
@@ -7476,6 +7728,24 @@ function contentToMldev$2(fromObject) {
|
|
|
7476
7728
|
}
|
|
7477
7729
|
return toObject;
|
|
7478
7730
|
}
|
|
7731
|
+
function contentToVertex$1(fromObject) {
|
|
7732
|
+
const toObject = {};
|
|
7733
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7734
|
+
if (fromParts != null) {
|
|
7735
|
+
let transformedList = fromParts;
|
|
7736
|
+
if (Array.isArray(transformedList)) {
|
|
7737
|
+
transformedList = transformedList.map((item) => {
|
|
7738
|
+
return partToVertex$1(item);
|
|
7739
|
+
});
|
|
7740
|
+
}
|
|
7741
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
7742
|
+
}
|
|
7743
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
7744
|
+
if (fromRole != null) {
|
|
7745
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
7746
|
+
}
|
|
7747
|
+
return toObject;
|
|
7748
|
+
}
|
|
7479
7749
|
function fileDataToMldev$2(fromObject) {
|
|
7480
7750
|
const toObject = {};
|
|
7481
7751
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -7644,7 +7914,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
7644
7914
|
}
|
|
7645
7915
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7646
7916
|
if (fromSpeechConfig != null) {
|
|
7647
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
7917
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
7648
7918
|
}
|
|
7649
7919
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
7650
7920
|
'stopSequences',
|
|
@@ -7865,7 +8135,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
7865
8135
|
}
|
|
7866
8136
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7867
8137
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
7868
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
8138
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
7869
8139
|
}
|
|
7870
8140
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
7871
8141
|
'thinkingConfig',
|
|
@@ -7883,7 +8153,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
7883
8153
|
'systemInstruction',
|
|
7884
8154
|
]);
|
|
7885
8155
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
7886
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], tContent(fromSystemInstruction));
|
|
8156
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
7887
8157
|
}
|
|
7888
8158
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
7889
8159
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -8079,53 +8349,141 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8079
8349
|
if (fromSetupComplete != null) {
|
|
8080
8350
|
setValueByPath(toObject, ['setupComplete'], fromSetupComplete);
|
|
8081
8351
|
}
|
|
8082
|
-
const fromServerContent = getValueByPath(fromObject, [
|
|
8083
|
-
'serverContent',
|
|
8352
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
8353
|
+
'serverContent',
|
|
8354
|
+
]);
|
|
8355
|
+
if (fromServerContent != null) {
|
|
8356
|
+
setValueByPath(toObject, ['serverContent'], fromServerContent);
|
|
8357
|
+
}
|
|
8358
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8359
|
+
if (fromToolCall != null) {
|
|
8360
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
8361
|
+
}
|
|
8362
|
+
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
8363
|
+
'toolCallCancellation',
|
|
8364
|
+
]);
|
|
8365
|
+
if (fromToolCallCancellation != null) {
|
|
8366
|
+
setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
|
|
8367
|
+
}
|
|
8368
|
+
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8369
|
+
'usageMetadata',
|
|
8370
|
+
]);
|
|
8371
|
+
if (fromUsageMetadata != null) {
|
|
8372
|
+
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
|
|
8373
|
+
}
|
|
8374
|
+
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
8375
|
+
if (fromGoAway != null) {
|
|
8376
|
+
setValueByPath(toObject, ['goAway'], fromGoAway);
|
|
8377
|
+
}
|
|
8378
|
+
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
8379
|
+
'sessionResumptionUpdate',
|
|
8380
|
+
]);
|
|
8381
|
+
if (fromSessionResumptionUpdate != null) {
|
|
8382
|
+
setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
|
|
8383
|
+
}
|
|
8384
|
+
const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
|
|
8385
|
+
'voiceActivityDetectionSignal',
|
|
8386
|
+
]);
|
|
8387
|
+
if (fromVoiceActivityDetectionSignal != null) {
|
|
8388
|
+
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
8389
|
+
}
|
|
8390
|
+
const fromVoiceActivity = getValueByPath(fromObject, [
|
|
8391
|
+
'voiceActivity',
|
|
8392
|
+
]);
|
|
8393
|
+
if (fromVoiceActivity != null) {
|
|
8394
|
+
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
8395
|
+
}
|
|
8396
|
+
return toObject;
|
|
8397
|
+
}
|
|
8398
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
8399
|
+
const toObject = {};
|
|
8400
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
8401
|
+
'speakerVoiceConfigs',
|
|
8402
|
+
]);
|
|
8403
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
8404
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
8405
|
+
if (Array.isArray(transformedList)) {
|
|
8406
|
+
transformedList = transformedList.map((item) => {
|
|
8407
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
8408
|
+
});
|
|
8409
|
+
}
|
|
8410
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
8411
|
+
}
|
|
8412
|
+
return toObject;
|
|
8413
|
+
}
|
|
8414
|
+
function partToMldev$2(fromObject) {
|
|
8415
|
+
const toObject = {};
|
|
8416
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8417
|
+
'mediaResolution',
|
|
8418
|
+
]);
|
|
8419
|
+
if (fromMediaResolution != null) {
|
|
8420
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
8421
|
+
}
|
|
8422
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8423
|
+
'codeExecutionResult',
|
|
8424
|
+
]);
|
|
8425
|
+
if (fromCodeExecutionResult != null) {
|
|
8426
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8427
|
+
}
|
|
8428
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8429
|
+
'executableCode',
|
|
8430
|
+
]);
|
|
8431
|
+
if (fromExecutableCode != null) {
|
|
8432
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8433
|
+
}
|
|
8434
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8435
|
+
if (fromFileData != null) {
|
|
8436
|
+
setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
|
|
8437
|
+
}
|
|
8438
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8439
|
+
if (fromFunctionCall != null) {
|
|
8440
|
+
setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
|
|
8441
|
+
}
|
|
8442
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
8443
|
+
'functionResponse',
|
|
8444
|
+
]);
|
|
8445
|
+
if (fromFunctionResponse != null) {
|
|
8446
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
8447
|
+
}
|
|
8448
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8449
|
+
if (fromInlineData != null) {
|
|
8450
|
+
setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
|
|
8451
|
+
}
|
|
8452
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8453
|
+
if (fromText != null) {
|
|
8454
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8455
|
+
}
|
|
8456
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8457
|
+
if (fromThought != null) {
|
|
8458
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
8459
|
+
}
|
|
8460
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8461
|
+
'thoughtSignature',
|
|
8462
|
+
]);
|
|
8463
|
+
if (fromThoughtSignature != null) {
|
|
8464
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8465
|
+
}
|
|
8466
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8467
|
+
'videoMetadata',
|
|
8084
8468
|
]);
|
|
8085
|
-
if (
|
|
8086
|
-
setValueByPath(toObject, ['
|
|
8469
|
+
if (fromVideoMetadata != null) {
|
|
8470
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
8087
8471
|
}
|
|
8088
8472
|
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8089
8473
|
if (fromToolCall != null) {
|
|
8090
8474
|
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
8091
8475
|
}
|
|
8092
|
-
const
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
if (fromToolCallCancellation != null) {
|
|
8096
|
-
setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
|
|
8097
|
-
}
|
|
8098
|
-
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8099
|
-
'usageMetadata',
|
|
8100
|
-
]);
|
|
8101
|
-
if (fromUsageMetadata != null) {
|
|
8102
|
-
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
|
|
8103
|
-
}
|
|
8104
|
-
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
8105
|
-
if (fromGoAway != null) {
|
|
8106
|
-
setValueByPath(toObject, ['goAway'], fromGoAway);
|
|
8107
|
-
}
|
|
8108
|
-
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
8109
|
-
'sessionResumptionUpdate',
|
|
8110
|
-
]);
|
|
8111
|
-
if (fromSessionResumptionUpdate != null) {
|
|
8112
|
-
setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
|
|
8113
|
-
}
|
|
8114
|
-
const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
|
|
8115
|
-
'voiceActivityDetectionSignal',
|
|
8116
|
-
]);
|
|
8117
|
-
if (fromVoiceActivityDetectionSignal != null) {
|
|
8118
|
-
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
8476
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
8477
|
+
if (fromToolResponse != null) {
|
|
8478
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
8119
8479
|
}
|
|
8120
|
-
const
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
if (fromVoiceActivity != null) {
|
|
8124
|
-
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
8480
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
8481
|
+
if (fromPartMetadata != null) {
|
|
8482
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
8125
8483
|
}
|
|
8126
8484
|
return toObject;
|
|
8127
8485
|
}
|
|
8128
|
-
function
|
|
8486
|
+
function partToVertex$1(fromObject) {
|
|
8129
8487
|
const toObject = {};
|
|
8130
8488
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8131
8489
|
'mediaResolution',
|
|
@@ -8147,11 +8505,11 @@ function partToMldev$2(fromObject) {
|
|
|
8147
8505
|
}
|
|
8148
8506
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8149
8507
|
if (fromFileData != null) {
|
|
8150
|
-
setValueByPath(toObject, ['fileData'],
|
|
8508
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
8151
8509
|
}
|
|
8152
8510
|
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8153
8511
|
if (fromFunctionCall != null) {
|
|
8154
|
-
setValueByPath(toObject, ['functionCall'],
|
|
8512
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
8155
8513
|
}
|
|
8156
8514
|
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
8157
8515
|
'functionResponse',
|
|
@@ -8161,7 +8519,7 @@ function partToMldev$2(fromObject) {
|
|
|
8161
8519
|
}
|
|
8162
8520
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8163
8521
|
if (fromInlineData != null) {
|
|
8164
|
-
setValueByPath(toObject, ['inlineData'],
|
|
8522
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
8165
8523
|
}
|
|
8166
8524
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
8167
8525
|
if (fromText != null) {
|
|
@@ -8183,6 +8541,29 @@ function partToMldev$2(fromObject) {
|
|
|
8183
8541
|
if (fromVideoMetadata != null) {
|
|
8184
8542
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
8185
8543
|
}
|
|
8544
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
8545
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
8546
|
+
}
|
|
8547
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
8548
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
8549
|
+
}
|
|
8550
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
8551
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
8552
|
+
}
|
|
8553
|
+
return toObject;
|
|
8554
|
+
}
|
|
8555
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
8556
|
+
const toObject = {};
|
|
8557
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8558
|
+
if (fromMimeType != null) {
|
|
8559
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8560
|
+
}
|
|
8561
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
8562
|
+
'voiceSampleAudio',
|
|
8563
|
+
]);
|
|
8564
|
+
if (fromVoiceSampleAudio != null) {
|
|
8565
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
8566
|
+
}
|
|
8186
8567
|
return toObject;
|
|
8187
8568
|
}
|
|
8188
8569
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
@@ -8196,6 +8577,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
8196
8577
|
}
|
|
8197
8578
|
return toObject;
|
|
8198
8579
|
}
|
|
8580
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
8581
|
+
const toObject = {};
|
|
8582
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
8583
|
+
if (fromSpeaker != null) {
|
|
8584
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
8585
|
+
}
|
|
8586
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
8587
|
+
if (fromVoiceConfig != null) {
|
|
8588
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
8589
|
+
}
|
|
8590
|
+
return toObject;
|
|
8591
|
+
}
|
|
8592
|
+
function speechConfigToVertex$1(fromObject) {
|
|
8593
|
+
const toObject = {};
|
|
8594
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
8595
|
+
if (fromVoiceConfig != null) {
|
|
8596
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
8597
|
+
}
|
|
8598
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
8599
|
+
if (fromLanguageCode != null) {
|
|
8600
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
8601
|
+
}
|
|
8602
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
8603
|
+
'multiSpeakerVoiceConfig',
|
|
8604
|
+
]);
|
|
8605
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
8606
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
8607
|
+
}
|
|
8608
|
+
return toObject;
|
|
8609
|
+
}
|
|
8199
8610
|
function toolToMldev$2(fromObject) {
|
|
8200
8611
|
const toObject = {};
|
|
8201
8612
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -8429,6 +8840,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
8429
8840
|
}
|
|
8430
8841
|
return toObject;
|
|
8431
8842
|
}
|
|
8843
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
8844
|
+
const toObject = {};
|
|
8845
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
8846
|
+
'replicatedVoiceConfig',
|
|
8847
|
+
]);
|
|
8848
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
8849
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
8850
|
+
}
|
|
8851
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
8852
|
+
'prebuiltVoiceConfig',
|
|
8853
|
+
]);
|
|
8854
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
8855
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
8856
|
+
}
|
|
8857
|
+
return toObject;
|
|
8858
|
+
}
|
|
8432
8859
|
|
|
8433
8860
|
/**
|
|
8434
8861
|
* @license
|
|
@@ -8551,7 +8978,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
8551
8978
|
}
|
|
8552
8979
|
return toObject;
|
|
8553
8980
|
}
|
|
8554
|
-
function computeTokensParametersToVertex(apiClient, fromObject,
|
|
8981
|
+
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
8555
8982
|
const toObject = {};
|
|
8556
8983
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
8557
8984
|
if (fromModel != null) {
|
|
@@ -8562,7 +8989,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
|
|
|
8562
8989
|
let transformedList = tContents(fromContents);
|
|
8563
8990
|
if (Array.isArray(transformedList)) {
|
|
8564
8991
|
transformedList = transformedList.map((item) => {
|
|
8565
|
-
return item;
|
|
8992
|
+
return contentToVertex(item);
|
|
8566
8993
|
});
|
|
8567
8994
|
}
|
|
8568
8995
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -8631,6 +9058,24 @@ function contentToMldev$1(fromObject, rootObject) {
|
|
|
8631
9058
|
}
|
|
8632
9059
|
return toObject;
|
|
8633
9060
|
}
|
|
9061
|
+
function contentToVertex(fromObject, rootObject) {
|
|
9062
|
+
const toObject = {};
|
|
9063
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
9064
|
+
if (fromParts != null) {
|
|
9065
|
+
let transformedList = fromParts;
|
|
9066
|
+
if (Array.isArray(transformedList)) {
|
|
9067
|
+
transformedList = transformedList.map((item) => {
|
|
9068
|
+
return partToVertex(item);
|
|
9069
|
+
});
|
|
9070
|
+
}
|
|
9071
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
9072
|
+
}
|
|
9073
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
9074
|
+
if (fromRole != null) {
|
|
9075
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
9076
|
+
}
|
|
9077
|
+
return toObject;
|
|
9078
|
+
}
|
|
8634
9079
|
function controlReferenceConfigToVertex(fromObject, _rootObject) {
|
|
8635
9080
|
const toObject = {};
|
|
8636
9081
|
const fromControlType = getValueByPath(fromObject, ['controlType']);
|
|
@@ -8664,7 +9109,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
8664
9109
|
'systemInstruction',
|
|
8665
9110
|
]);
|
|
8666
9111
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8667
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
9112
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
8668
9113
|
}
|
|
8669
9114
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8670
9115
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -8717,7 +9162,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
8717
9162
|
let transformedList = tContents(fromContents);
|
|
8718
9163
|
if (Array.isArray(transformedList)) {
|
|
8719
9164
|
transformedList = transformedList.map((item) => {
|
|
8720
|
-
return item;
|
|
9165
|
+
return contentToVertex(item);
|
|
8721
9166
|
});
|
|
8722
9167
|
}
|
|
8723
9168
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9121,7 +9566,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
|
|
|
9121
9566
|
if (discriminatorContent === 'EMBED_CONTENT') {
|
|
9122
9567
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
9123
9568
|
if (fromContent != null) {
|
|
9124
|
-
setValueByPath(toObject, ['content'], tContent(fromContent));
|
|
9569
|
+
setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
|
|
9125
9570
|
}
|
|
9126
9571
|
}
|
|
9127
9572
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -9464,6 +9909,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
9464
9909
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
9465
9910
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
9466
9911
|
}
|
|
9912
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
9913
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
9914
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
9915
|
+
}
|
|
9467
9916
|
return toObject;
|
|
9468
9917
|
}
|
|
9469
9918
|
function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
|
|
@@ -9472,7 +9921,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
9472
9921
|
'systemInstruction',
|
|
9473
9922
|
]);
|
|
9474
9923
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
9475
|
-
setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
|
|
9924
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
9476
9925
|
}
|
|
9477
9926
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
9478
9927
|
if (fromTemperature != null) {
|
|
@@ -9584,7 +10033,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
9584
10033
|
}
|
|
9585
10034
|
const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
|
|
9586
10035
|
if (parentObject !== undefined && fromToolConfig != null) {
|
|
9587
|
-
setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
|
|
10036
|
+
setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex(fromToolConfig));
|
|
9588
10037
|
}
|
|
9589
10038
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
9590
10039
|
if (parentObject !== undefined && fromLabels != null) {
|
|
@@ -9610,7 +10059,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
9610
10059
|
}
|
|
9611
10060
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
9612
10061
|
if (fromSpeechConfig != null) {
|
|
9613
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
10062
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
9614
10063
|
}
|
|
9615
10064
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
9616
10065
|
'audioTimestamp',
|
|
@@ -9638,6 +10087,9 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
9638
10087
|
if (parentObject !== undefined && fromModelArmorConfig != null) {
|
|
9639
10088
|
setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
|
|
9640
10089
|
}
|
|
10090
|
+
if (getValueByPath(fromObject, ['serviceTier']) !== undefined) {
|
|
10091
|
+
throw new Error('serviceTier parameter is not supported in Vertex AI.');
|
|
10092
|
+
}
|
|
9641
10093
|
return toObject;
|
|
9642
10094
|
}
|
|
9643
10095
|
function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
|
|
@@ -9673,7 +10125,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9673
10125
|
let transformedList = tContents(fromContents);
|
|
9674
10126
|
if (Array.isArray(transformedList)) {
|
|
9675
10127
|
transformedList = transformedList.map((item) => {
|
|
9676
|
-
return item;
|
|
10128
|
+
return contentToVertex(item);
|
|
9677
10129
|
});
|
|
9678
10130
|
}
|
|
9679
10131
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9722,6 +10174,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
|
|
|
9722
10174
|
if (fromUsageMetadata != null) {
|
|
9723
10175
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
9724
10176
|
}
|
|
10177
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
10178
|
+
if (fromModelStatus != null) {
|
|
10179
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
10180
|
+
}
|
|
9725
10181
|
return toObject;
|
|
9726
10182
|
}
|
|
9727
10183
|
function generateContentResponseFromVertex(fromObject, _rootObject) {
|
|
@@ -10107,6 +10563,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
10107
10563
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
10108
10564
|
throw new Error('compressionQuality parameter is not supported in Gemini API.');
|
|
10109
10565
|
}
|
|
10566
|
+
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
10567
|
+
throw new Error('labels parameter is not supported in Gemini API.');
|
|
10568
|
+
}
|
|
10110
10569
|
return toObject;
|
|
10111
10570
|
}
|
|
10112
10571
|
function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -10197,6 +10656,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
10197
10656
|
if (parentObject !== undefined && fromCompressionQuality != null) {
|
|
10198
10657
|
setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
|
|
10199
10658
|
}
|
|
10659
|
+
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
10660
|
+
if (parentObject !== undefined && fromLabels != null) {
|
|
10661
|
+
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
10662
|
+
}
|
|
10200
10663
|
return toObject;
|
|
10201
10664
|
}
|
|
10202
10665
|
function generateVideosOperationFromMldev(fromObject, rootObject) {
|
|
@@ -10466,7 +10929,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
10466
10929
|
}
|
|
10467
10930
|
return toObject;
|
|
10468
10931
|
}
|
|
10469
|
-
function generationConfigToVertex(fromObject,
|
|
10932
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
10470
10933
|
const toObject = {};
|
|
10471
10934
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
10472
10935
|
'modelSelectionConfig',
|
|
@@ -10562,7 +11025,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
10562
11025
|
}
|
|
10563
11026
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
10564
11027
|
if (fromSpeechConfig != null) {
|
|
10565
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
11028
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
10566
11029
|
}
|
|
10567
11030
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
10568
11031
|
'stopSequences',
|
|
@@ -11019,6 +11482,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
11019
11482
|
}
|
|
11020
11483
|
return toObject;
|
|
11021
11484
|
}
|
|
11485
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
11486
|
+
const toObject = {};
|
|
11487
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
11488
|
+
'speakerVoiceConfigs',
|
|
11489
|
+
]);
|
|
11490
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
11491
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
11492
|
+
if (Array.isArray(transformedList)) {
|
|
11493
|
+
transformedList = transformedList.map((item) => {
|
|
11494
|
+
return speakerVoiceConfigToVertex(item);
|
|
11495
|
+
});
|
|
11496
|
+
}
|
|
11497
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
11498
|
+
}
|
|
11499
|
+
return toObject;
|
|
11500
|
+
}
|
|
11022
11501
|
function partToMldev$1(fromObject, rootObject) {
|
|
11023
11502
|
const toObject = {};
|
|
11024
11503
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -11077,6 +11556,87 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11077
11556
|
if (fromVideoMetadata != null) {
|
|
11078
11557
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
11079
11558
|
}
|
|
11559
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
11560
|
+
if (fromToolCall != null) {
|
|
11561
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
11562
|
+
}
|
|
11563
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
11564
|
+
if (fromToolResponse != null) {
|
|
11565
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
11566
|
+
}
|
|
11567
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
11568
|
+
if (fromPartMetadata != null) {
|
|
11569
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
11570
|
+
}
|
|
11571
|
+
return toObject;
|
|
11572
|
+
}
|
|
11573
|
+
function partToVertex(fromObject, _rootObject) {
|
|
11574
|
+
const toObject = {};
|
|
11575
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11576
|
+
'mediaResolution',
|
|
11577
|
+
]);
|
|
11578
|
+
if (fromMediaResolution != null) {
|
|
11579
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
11580
|
+
}
|
|
11581
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
11582
|
+
'codeExecutionResult',
|
|
11583
|
+
]);
|
|
11584
|
+
if (fromCodeExecutionResult != null) {
|
|
11585
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
11586
|
+
}
|
|
11587
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11588
|
+
'executableCode',
|
|
11589
|
+
]);
|
|
11590
|
+
if (fromExecutableCode != null) {
|
|
11591
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
11592
|
+
}
|
|
11593
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11594
|
+
if (fromFileData != null) {
|
|
11595
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
11596
|
+
}
|
|
11597
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
11598
|
+
if (fromFunctionCall != null) {
|
|
11599
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
11600
|
+
}
|
|
11601
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
11602
|
+
'functionResponse',
|
|
11603
|
+
]);
|
|
11604
|
+
if (fromFunctionResponse != null) {
|
|
11605
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
11606
|
+
}
|
|
11607
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
11608
|
+
if (fromInlineData != null) {
|
|
11609
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
11610
|
+
}
|
|
11611
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
11612
|
+
if (fromText != null) {
|
|
11613
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
11614
|
+
}
|
|
11615
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
11616
|
+
if (fromThought != null) {
|
|
11617
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
11618
|
+
}
|
|
11619
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
11620
|
+
'thoughtSignature',
|
|
11621
|
+
]);
|
|
11622
|
+
if (fromThoughtSignature != null) {
|
|
11623
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
11624
|
+
}
|
|
11625
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
11626
|
+
'videoMetadata',
|
|
11627
|
+
]);
|
|
11628
|
+
if (fromVideoMetadata != null) {
|
|
11629
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
11630
|
+
}
|
|
11631
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
11632
|
+
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
11633
|
+
}
|
|
11634
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
11635
|
+
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
11636
|
+
}
|
|
11637
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
11638
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
11639
|
+
}
|
|
11080
11640
|
return toObject;
|
|
11081
11641
|
}
|
|
11082
11642
|
function productImageToVertex(fromObject, rootObject) {
|
|
@@ -11247,6 +11807,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
11247
11807
|
}
|
|
11248
11808
|
return toObject;
|
|
11249
11809
|
}
|
|
11810
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
11811
|
+
const toObject = {};
|
|
11812
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
11813
|
+
if (fromMimeType != null) {
|
|
11814
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
11815
|
+
}
|
|
11816
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
11817
|
+
'voiceSampleAudio',
|
|
11818
|
+
]);
|
|
11819
|
+
if (fromVoiceSampleAudio != null) {
|
|
11820
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
11821
|
+
}
|
|
11822
|
+
return toObject;
|
|
11823
|
+
}
|
|
11250
11824
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
11251
11825
|
const toObject = {};
|
|
11252
11826
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -11396,6 +11970,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
11396
11970
|
}
|
|
11397
11971
|
return toObject;
|
|
11398
11972
|
}
|
|
11973
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
11974
|
+
const toObject = {};
|
|
11975
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
11976
|
+
if (fromSpeaker != null) {
|
|
11977
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
11978
|
+
}
|
|
11979
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11980
|
+
if (fromVoiceConfig != null) {
|
|
11981
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
11982
|
+
}
|
|
11983
|
+
return toObject;
|
|
11984
|
+
}
|
|
11985
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
11986
|
+
const toObject = {};
|
|
11987
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11988
|
+
if (fromVoiceConfig != null) {
|
|
11989
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
11990
|
+
}
|
|
11991
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
11992
|
+
if (fromLanguageCode != null) {
|
|
11993
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
11994
|
+
}
|
|
11995
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
11996
|
+
'multiSpeakerVoiceConfig',
|
|
11997
|
+
]);
|
|
11998
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
11999
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
12000
|
+
}
|
|
12001
|
+
return toObject;
|
|
12002
|
+
}
|
|
11399
12003
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
11400
12004
|
const toObject = {};
|
|
11401
12005
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -11410,6 +12014,30 @@ function toolConfigToMldev(fromObject, rootObject) {
|
|
|
11410
12014
|
if (fromFunctionCallingConfig != null) {
|
|
11411
12015
|
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
11412
12016
|
}
|
|
12017
|
+
const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
|
|
12018
|
+
if (fromIncludeServerSideToolInvocations != null) {
|
|
12019
|
+
setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
|
|
12020
|
+
}
|
|
12021
|
+
return toObject;
|
|
12022
|
+
}
|
|
12023
|
+
function toolConfigToVertex(fromObject, _rootObject) {
|
|
12024
|
+
const toObject = {};
|
|
12025
|
+
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
12026
|
+
'retrievalConfig',
|
|
12027
|
+
]);
|
|
12028
|
+
if (fromRetrievalConfig != null) {
|
|
12029
|
+
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
12030
|
+
}
|
|
12031
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
12032
|
+
'functionCallingConfig',
|
|
12033
|
+
]);
|
|
12034
|
+
if (fromFunctionCallingConfig != null) {
|
|
12035
|
+
setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
|
|
12036
|
+
}
|
|
12037
|
+
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
12038
|
+
undefined) {
|
|
12039
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
12040
|
+
}
|
|
11413
12041
|
return toObject;
|
|
11414
12042
|
}
|
|
11415
12043
|
function toolToMldev$1(fromObject, rootObject) {
|
|
@@ -11854,6 +12482,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
11854
12482
|
}
|
|
11855
12483
|
return toObject;
|
|
11856
12484
|
}
|
|
12485
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
12486
|
+
const toObject = {};
|
|
12487
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
12488
|
+
'replicatedVoiceConfig',
|
|
12489
|
+
]);
|
|
12490
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
12491
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
12492
|
+
}
|
|
12493
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
12494
|
+
'prebuiltVoiceConfig',
|
|
12495
|
+
]);
|
|
12496
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
12497
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
12498
|
+
}
|
|
12499
|
+
return toObject;
|
|
12500
|
+
}
|
|
11857
12501
|
|
|
11858
12502
|
/**
|
|
11859
12503
|
* @license
|
|
@@ -12099,7 +12743,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12099
12743
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12100
12744
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12101
12745
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12102
|
-
const SDK_VERSION = '1.
|
|
12746
|
+
const SDK_VERSION = '1.47.0'; // x-release-please-version
|
|
12103
12747
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12104
12748
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12105
12749
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -12159,6 +12803,11 @@ class ApiClient {
|
|
|
12159
12803
|
// Vertex Express or global endpoint case.
|
|
12160
12804
|
initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
|
|
12161
12805
|
}
|
|
12806
|
+
else if (this.clientOptions.project &&
|
|
12807
|
+
this.clientOptions.location &&
|
|
12808
|
+
this.clientOptions.location === 'us') {
|
|
12809
|
+
initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
|
|
12810
|
+
}
|
|
12162
12811
|
else if (this.clientOptions.project && this.clientOptions.location) {
|
|
12163
12812
|
initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
|
|
12164
12813
|
}
|
|
@@ -13458,7 +14107,7 @@ class Session {
|
|
|
13458
14107
|
}
|
|
13459
14108
|
}
|
|
13460
14109
|
const clientMessage = {
|
|
13461
|
-
toolResponse: { functionResponses: functionResponses },
|
|
14110
|
+
toolResponse: { 'functionResponses': functionResponses },
|
|
13462
14111
|
};
|
|
13463
14112
|
return clientMessage;
|
|
13464
14113
|
}
|
|
@@ -15788,6 +16437,18 @@ function partToMldev(fromObject) {
|
|
|
15788
16437
|
if (fromVideoMetadata != null) {
|
|
15789
16438
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
15790
16439
|
}
|
|
16440
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
16441
|
+
if (fromToolCall != null) {
|
|
16442
|
+
setValueByPath(toObject, ['toolCall'], fromToolCall);
|
|
16443
|
+
}
|
|
16444
|
+
const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
|
|
16445
|
+
if (fromToolResponse != null) {
|
|
16446
|
+
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
16447
|
+
}
|
|
16448
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
16449
|
+
if (fromPartMetadata != null) {
|
|
16450
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
16451
|
+
}
|
|
15791
16452
|
return toObject;
|
|
15792
16453
|
}
|
|
15793
16454
|
function sessionResumptionConfigToMldev(fromObject) {
|
|
@@ -18772,6 +19433,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18772
19433
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
|
|
18773
19434
|
}
|
|
18774
19435
|
}
|
|
19436
|
+
else if (discriminatorTuningMode === 'DISTILLATION') {
|
|
19437
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
19438
|
+
if (parentObject !== undefined && fromTuningMode != null) {
|
|
19439
|
+
setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
|
|
19440
|
+
}
|
|
19441
|
+
}
|
|
18775
19442
|
const fromCustomBaseModel = getValueByPath(fromObject, [
|
|
18776
19443
|
'customBaseModel',
|
|
18777
19444
|
]);
|
|
@@ -18791,6 +19458,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18791
19458
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
18792
19459
|
}
|
|
18793
19460
|
}
|
|
19461
|
+
else if (discriminatorBatchSize === 'DISTILLATION') {
|
|
19462
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
19463
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
19464
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
19465
|
+
}
|
|
19466
|
+
}
|
|
18794
19467
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
18795
19468
|
'config',
|
|
18796
19469
|
'method',
|
|
@@ -18806,6 +19479,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
18806
19479
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
18807
19480
|
}
|
|
18808
19481
|
}
|
|
19482
|
+
else if (discriminatorLearningRate === 'DISTILLATION') {
|
|
19483
|
+
const fromLearningRate = getValueByPath(fromObject, [
|
|
19484
|
+
'learningRate',
|
|
19485
|
+
]);
|
|
19486
|
+
if (parentObject !== undefined && fromLearningRate != null) {
|
|
19487
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
19488
|
+
}
|
|
19489
|
+
}
|
|
18809
19490
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
18810
19491
|
if (parentObject !== undefined && fromLabels != null) {
|
|
18811
19492
|
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
@@ -19309,6 +19990,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19309
19990
|
if (fromVeoTuningSpec != null) {
|
|
19310
19991
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
19311
19992
|
}
|
|
19993
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
19994
|
+
'distillationSamplingSpec',
|
|
19995
|
+
]);
|
|
19996
|
+
if (fromDistillationSamplingSpec != null) {
|
|
19997
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
19998
|
+
}
|
|
19999
|
+
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20000
|
+
'tuningJobMetadata',
|
|
20001
|
+
]);
|
|
20002
|
+
if (fromTuningJobMetadata != null) {
|
|
20003
|
+
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20004
|
+
}
|
|
19312
20005
|
return toObject;
|
|
19313
20006
|
}
|
|
19314
20007
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|
|
@@ -19743,18 +20436,18 @@ const MAX_RETRY_COUNT = 3;
|
|
|
19743
20436
|
const INITIAL_RETRY_DELAY_MS = 1000;
|
|
19744
20437
|
const DELAY_MULTIPLIER = 2;
|
|
19745
20438
|
const X_GOOG_UPLOAD_STATUS_HEADER_FIELD = 'x-goog-upload-status';
|
|
19746
|
-
async function uploadBlob(file, uploadUrl, apiClient) {
|
|
20439
|
+
async function uploadBlob(file, uploadUrl, apiClient, httpOptions) {
|
|
19747
20440
|
var _a;
|
|
19748
|
-
const response = await uploadBlobInternal(file, uploadUrl, apiClient);
|
|
20441
|
+
const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
|
|
19749
20442
|
const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
|
|
19750
20443
|
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') {
|
|
19751
20444
|
throw new Error('Failed to upload file: Upload status is not finalized.');
|
|
19752
20445
|
}
|
|
19753
20446
|
return responseJson['file'];
|
|
19754
20447
|
}
|
|
19755
|
-
async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
|
|
20448
|
+
async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
|
|
19756
20449
|
var _a;
|
|
19757
|
-
const response = await uploadBlobInternal(file, uploadUrl, apiClient);
|
|
20450
|
+
const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
|
|
19758
20451
|
const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
|
|
19759
20452
|
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') {
|
|
19760
20453
|
throw new Error('Failed to upload file: Upload status is not finalized.');
|
|
@@ -19764,8 +20457,18 @@ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
|
|
|
19764
20457
|
Object.assign(typedResp, resp);
|
|
19765
20458
|
return typedResp;
|
|
19766
20459
|
}
|
|
19767
|
-
async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
19768
|
-
var _a, _b;
|
|
20460
|
+
async function uploadBlobInternal(file, uploadUrl, apiClient, httpOptions) {
|
|
20461
|
+
var _a, _b, _c;
|
|
20462
|
+
let finalUrl = uploadUrl;
|
|
20463
|
+
const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a = apiClient.clientOptions.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl);
|
|
20464
|
+
if (effectiveBaseUrl) {
|
|
20465
|
+
const baseUri = new URL(effectiveBaseUrl);
|
|
20466
|
+
const uploadUri = new URL(uploadUrl);
|
|
20467
|
+
uploadUri.protocol = baseUri.protocol;
|
|
20468
|
+
uploadUri.host = baseUri.host;
|
|
20469
|
+
uploadUri.port = baseUri.port;
|
|
20470
|
+
finalUrl = uploadUri.toString();
|
|
20471
|
+
}
|
|
19769
20472
|
let fileSize = 0;
|
|
19770
20473
|
let offset = 0;
|
|
19771
20474
|
let response = new HttpResponse(new Response());
|
|
@@ -19780,21 +20483,14 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
|
19780
20483
|
let retryCount = 0;
|
|
19781
20484
|
let currentDelayMs = INITIAL_RETRY_DELAY_MS;
|
|
19782
20485
|
while (retryCount < MAX_RETRY_COUNT) {
|
|
20486
|
+
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) });
|
|
19783
20487
|
response = await apiClient.request({
|
|
19784
20488
|
path: '',
|
|
19785
20489
|
body: chunk,
|
|
19786
20490
|
httpMethod: 'POST',
|
|
19787
|
-
httpOptions: {
|
|
19788
|
-
apiVersion: '',
|
|
19789
|
-
baseUrl: uploadUrl,
|
|
19790
|
-
headers: {
|
|
19791
|
-
'X-Goog-Upload-Command': uploadCommand,
|
|
19792
|
-
'X-Goog-Upload-Offset': String(offset),
|
|
19793
|
-
'Content-Length': String(chunkSize),
|
|
19794
|
-
},
|
|
19795
|
-
},
|
|
20491
|
+
httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: '', baseUrl: finalUrl, headers: mergedHeaders }),
|
|
19796
20492
|
});
|
|
19797
|
-
if ((
|
|
20493
|
+
if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
|
|
19798
20494
|
break;
|
|
19799
20495
|
}
|
|
19800
20496
|
retryCount++;
|
|
@@ -19804,7 +20500,7 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
|
|
|
19804
20500
|
offset += chunkSize;
|
|
19805
20501
|
// The `x-goog-upload-status` header field can be `active`, `final` and
|
|
19806
20502
|
//`cancelled` in resposne.
|
|
19807
|
-
if (((
|
|
20503
|
+
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') {
|
|
19808
20504
|
break;
|
|
19809
20505
|
}
|
|
19810
20506
|
// TODO(b/401391430) Investigate why the upload status is not finalized
|
|
@@ -19824,17 +20520,17 @@ function sleep(ms) {
|
|
|
19824
20520
|
}
|
|
19825
20521
|
|
|
19826
20522
|
class BrowserUploader {
|
|
19827
|
-
async upload(file, uploadUrl, apiClient) {
|
|
20523
|
+
async upload(file, uploadUrl, apiClient, httpOptions) {
|
|
19828
20524
|
if (typeof file === 'string') {
|
|
19829
20525
|
throw new Error('File path is not supported in browser uploader.');
|
|
19830
20526
|
}
|
|
19831
|
-
return await uploadBlob(file, uploadUrl, apiClient);
|
|
20527
|
+
return await uploadBlob(file, uploadUrl, apiClient, httpOptions);
|
|
19832
20528
|
}
|
|
19833
|
-
async uploadToFileSearchStore(file, uploadUrl, apiClient) {
|
|
20529
|
+
async uploadToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
|
|
19834
20530
|
if (typeof file === 'string') {
|
|
19835
20531
|
throw new Error('File path is not supported in browser uploader.');
|
|
19836
20532
|
}
|
|
19837
|
-
return await uploadBlobToFileSearchStore(file, uploadUrl, apiClient);
|
|
20533
|
+
return await uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions);
|
|
19838
20534
|
}
|
|
19839
20535
|
async stat(file) {
|
|
19840
20536
|
if (typeof file === 'string') {
|
|
@@ -20024,5 +20720,5 @@ class GoogleGenAI {
|
|
|
20024
20720
|
}
|
|
20025
20721
|
}
|
|
20026
20722
|
|
|
20027
|
-
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 };
|
|
20723
|
+
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 };
|
|
20028
20724
|
//# sourceMappingURL=index.mjs.map
|