@google/genai 1.46.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 +423 -243
- package/dist/index.cjs +390 -77
- package/dist/index.mjs +391 -78
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +390 -77
- package/dist/node/index.mjs +391 -78
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +423 -243
- package/dist/tokenizer/node.cjs +140 -68
- package/dist/tokenizer/node.d.ts +31 -27
- package/dist/tokenizer/node.mjs +140 -68
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +146 -70
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +232 -84
- package/dist/vertex_internal/index.js +146 -70
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +391 -78
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +423 -243
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -646,38 +646,18 @@ exports.Type = void 0;
|
|
|
646
646
|
*/
|
|
647
647
|
Type["NULL"] = "NULL";
|
|
648
648
|
})(exports.Type || (exports.Type = {}));
|
|
649
|
-
/**
|
|
650
|
-
exports.
|
|
651
|
-
(function (
|
|
652
|
-
/**
|
|
653
|
-
* Defaults to unspecified.
|
|
654
|
-
*/
|
|
655
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
656
|
-
/**
|
|
657
|
-
* Blocks Low and above confidence URL that is risky.
|
|
658
|
-
*/
|
|
659
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
660
|
-
/**
|
|
661
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
662
|
-
*/
|
|
663
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
664
|
-
/**
|
|
665
|
-
* Blocks High and above confidence URL that is risky.
|
|
666
|
-
*/
|
|
667
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
668
|
-
/**
|
|
669
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
670
|
-
*/
|
|
671
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
649
|
+
/** The environment being operated. */
|
|
650
|
+
exports.Environment = void 0;
|
|
651
|
+
(function (Environment) {
|
|
672
652
|
/**
|
|
673
|
-
*
|
|
653
|
+
* Defaults to browser.
|
|
674
654
|
*/
|
|
675
|
-
|
|
655
|
+
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
676
656
|
/**
|
|
677
|
-
*
|
|
657
|
+
* Operates in a web browser.
|
|
678
658
|
*/
|
|
679
|
-
|
|
680
|
-
})(exports.
|
|
659
|
+
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
660
|
+
})(exports.Environment || (exports.Environment = {}));
|
|
681
661
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
682
662
|
exports.AuthType = void 0;
|
|
683
663
|
(function (AuthType) {
|
|
@@ -748,6 +728,38 @@ exports.ApiSpec = void 0;
|
|
|
748
728
|
*/
|
|
749
729
|
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
750
730
|
})(exports.ApiSpec || (exports.ApiSpec = {}));
|
|
731
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
732
|
+
exports.PhishBlockThreshold = void 0;
|
|
733
|
+
(function (PhishBlockThreshold) {
|
|
734
|
+
/**
|
|
735
|
+
* Defaults to unspecified.
|
|
736
|
+
*/
|
|
737
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
738
|
+
/**
|
|
739
|
+
* Blocks Low and above confidence URL that is risky.
|
|
740
|
+
*/
|
|
741
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
742
|
+
/**
|
|
743
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
744
|
+
*/
|
|
745
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
746
|
+
/**
|
|
747
|
+
* Blocks High and above confidence URL that is risky.
|
|
748
|
+
*/
|
|
749
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
750
|
+
/**
|
|
751
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
752
|
+
*/
|
|
753
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
754
|
+
/**
|
|
755
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
756
|
+
*/
|
|
757
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
758
|
+
/**
|
|
759
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
760
|
+
*/
|
|
761
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
762
|
+
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
751
763
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
752
764
|
exports.Behavior = void 0;
|
|
753
765
|
(function (Behavior) {
|
|
@@ -807,6 +819,10 @@ exports.ThinkingLevel = void 0;
|
|
|
807
819
|
* Unspecified thinking level.
|
|
808
820
|
*/
|
|
809
821
|
ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
|
|
822
|
+
/**
|
|
823
|
+
* MINIMAL thinking level.
|
|
824
|
+
*/
|
|
825
|
+
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
810
826
|
/**
|
|
811
827
|
* Low thinking level.
|
|
812
828
|
*/
|
|
@@ -819,10 +835,6 @@ exports.ThinkingLevel = void 0;
|
|
|
819
835
|
* High thinking level.
|
|
820
836
|
*/
|
|
821
837
|
ThinkingLevel["HIGH"] = "HIGH";
|
|
822
|
-
/**
|
|
823
|
-
* MINIMAL thinking level.
|
|
824
|
-
*/
|
|
825
|
-
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
826
838
|
})(exports.ThinkingLevel || (exports.ThinkingLevel = {}));
|
|
827
839
|
/** Enum that controls the generation of people. */
|
|
828
840
|
exports.PersonGeneration = void 0;
|
|
@@ -840,6 +852,22 @@ exports.PersonGeneration = void 0;
|
|
|
840
852
|
*/
|
|
841
853
|
PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
|
|
842
854
|
})(exports.PersonGeneration || (exports.PersonGeneration = {}));
|
|
855
|
+
/** 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. */
|
|
856
|
+
exports.ProminentPeople = void 0;
|
|
857
|
+
(function (ProminentPeople) {
|
|
858
|
+
/**
|
|
859
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
860
|
+
*/
|
|
861
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
862
|
+
/**
|
|
863
|
+
* Allows the model to generate images of prominent people.
|
|
864
|
+
*/
|
|
865
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
866
|
+
/**
|
|
867
|
+
* Prevents the model from generating images of prominent people.
|
|
868
|
+
*/
|
|
869
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
870
|
+
})(exports.ProminentPeople || (exports.ProminentPeople = {}));
|
|
843
871
|
/** The harm category to be blocked. */
|
|
844
872
|
exports.HarmCategory = void 0;
|
|
845
873
|
(function (HarmCategory) {
|
|
@@ -1158,6 +1186,42 @@ exports.Modality = void 0;
|
|
|
1158
1186
|
*/
|
|
1159
1187
|
Modality["AUDIO"] = "AUDIO";
|
|
1160
1188
|
})(exports.Modality || (exports.Modality = {}));
|
|
1189
|
+
/** The stage of the underlying model. This enum is not supported in Vertex AI. */
|
|
1190
|
+
exports.ModelStage = void 0;
|
|
1191
|
+
(function (ModelStage) {
|
|
1192
|
+
/**
|
|
1193
|
+
* Unspecified model stage.
|
|
1194
|
+
*/
|
|
1195
|
+
ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
|
|
1196
|
+
/**
|
|
1197
|
+
* The underlying model is subject to lots of tunings.
|
|
1198
|
+
*/
|
|
1199
|
+
ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
|
|
1200
|
+
/**
|
|
1201
|
+
* Models in this stage are for experimental purposes only.
|
|
1202
|
+
*/
|
|
1203
|
+
ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
|
|
1204
|
+
/**
|
|
1205
|
+
* Models in this stage are more mature than experimental models.
|
|
1206
|
+
*/
|
|
1207
|
+
ModelStage["PREVIEW"] = "PREVIEW";
|
|
1208
|
+
/**
|
|
1209
|
+
* Models in this stage are considered stable and ready for production use.
|
|
1210
|
+
*/
|
|
1211
|
+
ModelStage["STABLE"] = "STABLE";
|
|
1212
|
+
/**
|
|
1213
|
+
* 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.
|
|
1214
|
+
*/
|
|
1215
|
+
ModelStage["LEGACY"] = "LEGACY";
|
|
1216
|
+
/**
|
|
1217
|
+
* Models in this stage are deprecated. These models cannot be used.
|
|
1218
|
+
*/
|
|
1219
|
+
ModelStage["DEPRECATED"] = "DEPRECATED";
|
|
1220
|
+
/**
|
|
1221
|
+
* Models in this stage are retired. These models cannot be used.
|
|
1222
|
+
*/
|
|
1223
|
+
ModelStage["RETIRED"] = "RETIRED";
|
|
1224
|
+
})(exports.ModelStage || (exports.ModelStage = {}));
|
|
1161
1225
|
/** The media resolution to use. */
|
|
1162
1226
|
exports.MediaResolution = void 0;
|
|
1163
1227
|
(function (MediaResolution) {
|
|
@@ -1394,6 +1458,26 @@ exports.TuningTask = void 0;
|
|
|
1394
1458
|
*/
|
|
1395
1459
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1396
1460
|
})(exports.TuningTask || (exports.TuningTask = {}));
|
|
1461
|
+
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1462
|
+
exports.DocumentState = void 0;
|
|
1463
|
+
(function (DocumentState) {
|
|
1464
|
+
/**
|
|
1465
|
+
* The default value. This value is used if the state is omitted.
|
|
1466
|
+
*/
|
|
1467
|
+
DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
1468
|
+
/**
|
|
1469
|
+
* Some `Chunks` of the `Document` are being processed (embedding and vector storage).
|
|
1470
|
+
*/
|
|
1471
|
+
DocumentState["STATE_PENDING"] = "STATE_PENDING";
|
|
1472
|
+
/**
|
|
1473
|
+
* All `Chunks` of the `Document` is processed and available for querying.
|
|
1474
|
+
*/
|
|
1475
|
+
DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
|
|
1476
|
+
/**
|
|
1477
|
+
* Some `Chunks` of the `Document` failed processing.
|
|
1478
|
+
*/
|
|
1479
|
+
DocumentState["STATE_FAILED"] = "STATE_FAILED";
|
|
1480
|
+
})(exports.DocumentState || (exports.DocumentState = {}));
|
|
1397
1481
|
/** The tokenization quality used for given media. */
|
|
1398
1482
|
exports.PartMediaResolutionLevel = void 0;
|
|
1399
1483
|
(function (PartMediaResolutionLevel) {
|
|
@@ -1458,42 +1542,34 @@ exports.ResourceScope = void 0;
|
|
|
1458
1542
|
*/
|
|
1459
1543
|
ResourceScope["COLLECTION"] = "COLLECTION";
|
|
1460
1544
|
})(exports.ResourceScope || (exports.ResourceScope = {}));
|
|
1461
|
-
/**
|
|
1462
|
-
exports.
|
|
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
|
-
})(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
|
|
1469
|
-
/** The environment being operated. */
|
|
1470
|
-
exports.Environment = void 0;
|
|
1471
|
-
(function (Environment) {
|
|
1545
|
+
/** Pricing and performance service tier. */
|
|
1546
|
+
exports.ServiceTier = void 0;
|
|
1547
|
+
(function (ServiceTier) {
|
|
1472
1548
|
/**
|
|
1473
|
-
*
|
|
1549
|
+
* Default service tier, which is standard.
|
|
1474
1550
|
*/
|
|
1475
|
-
|
|
1551
|
+
ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
|
|
1476
1552
|
/**
|
|
1477
|
-
*
|
|
1553
|
+
* Flex service tier.
|
|
1478
1554
|
*/
|
|
1479
|
-
|
|
1480
|
-
})(exports.Environment || (exports.Environment = {}));
|
|
1481
|
-
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1482
|
-
exports.ProminentPeople = void 0;
|
|
1483
|
-
(function (ProminentPeople) {
|
|
1555
|
+
ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
|
|
1484
1556
|
/**
|
|
1485
|
-
*
|
|
1557
|
+
* Standard service tier.
|
|
1486
1558
|
*/
|
|
1487
|
-
|
|
1559
|
+
ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
|
|
1488
1560
|
/**
|
|
1489
|
-
*
|
|
1561
|
+
* Priority service tier.
|
|
1490
1562
|
*/
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1563
|
+
ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_PRIORITY";
|
|
1564
|
+
})(exports.ServiceTier || (exports.ServiceTier = {}));
|
|
1565
|
+
/** Options for feature selection preference. */
|
|
1566
|
+
exports.FeatureSelectionPreference = void 0;
|
|
1567
|
+
(function (FeatureSelectionPreference) {
|
|
1568
|
+
FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
|
|
1569
|
+
FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
|
|
1570
|
+
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1571
|
+
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1572
|
+
})(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
|
|
1497
1573
|
/** Enum representing the Vertex embedding API to use. */
|
|
1498
1574
|
exports.EmbeddingApiType = void 0;
|
|
1499
1575
|
(function (EmbeddingApiType) {
|
|
@@ -1668,14 +1744,6 @@ exports.TuningMethod = void 0;
|
|
|
1668
1744
|
*/
|
|
1669
1745
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1670
1746
|
})(exports.TuningMethod || (exports.TuningMethod = {}));
|
|
1671
|
-
/** State for the lifecycle of a Document. */
|
|
1672
|
-
exports.DocumentState = void 0;
|
|
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
|
-
})(exports.DocumentState || (exports.DocumentState = {}));
|
|
1679
1747
|
/** State for the lifecycle of a File. */
|
|
1680
1748
|
exports.FileState = void 0;
|
|
1681
1749
|
(function (FileState) {
|
|
@@ -1835,6 +1903,10 @@ exports.TurnCoverage = void 0;
|
|
|
1835
1903
|
* The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
|
|
1836
1904
|
*/
|
|
1837
1905
|
TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
|
|
1906
|
+
/**
|
|
1907
|
+
* Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
|
|
1908
|
+
*/
|
|
1909
|
+
TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
|
|
1838
1910
|
})(exports.TurnCoverage || (exports.TurnCoverage = {}));
|
|
1839
1911
|
/** Scale of the generated music. */
|
|
1840
1912
|
exports.Scale = void 0;
|
|
@@ -2404,7 +2476,6 @@ class GenerateVideosResponse {
|
|
|
2404
2476
|
class GenerateVideosOperation {
|
|
2405
2477
|
/**
|
|
2406
2478
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2407
|
-
* @internal
|
|
2408
2479
|
*/
|
|
2409
2480
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2410
2481
|
const operation = new GenerateVideosOperation();
|
|
@@ -2450,7 +2521,6 @@ class ImportFileResponse {
|
|
|
2450
2521
|
class ImportFileOperation {
|
|
2451
2522
|
/**
|
|
2452
2523
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2453
|
-
* @internal
|
|
2454
2524
|
*/
|
|
2455
2525
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2456
2526
|
const operation = new ImportFileOperation();
|
|
@@ -2705,7 +2775,6 @@ class UploadToFileSearchStoreResponse {
|
|
|
2705
2775
|
class UploadToFileSearchStoreOperation {
|
|
2706
2776
|
/**
|
|
2707
2777
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2708
|
-
* @internal
|
|
2709
2778
|
*/
|
|
2710
2779
|
_fromAPIResponse({ apiResponse, _isVertexAI, }) {
|
|
2711
2780
|
const operation = new UploadToFileSearchStoreOperation();
|
|
@@ -4358,6 +4427,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4358
4427
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
4359
4428
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
4360
4429
|
}
|
|
4430
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
4431
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
4432
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
4433
|
+
}
|
|
4361
4434
|
return toObject;
|
|
4362
4435
|
}
|
|
4363
4436
|
function generateContentResponseFromMldev$1(fromObject) {
|
|
@@ -4398,6 +4471,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
4398
4471
|
if (fromUsageMetadata != null) {
|
|
4399
4472
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
4400
4473
|
}
|
|
4474
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
4475
|
+
if (fromModelStatus != null) {
|
|
4476
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
4477
|
+
}
|
|
4401
4478
|
return toObject;
|
|
4402
4479
|
}
|
|
4403
4480
|
function getBatchJobParametersToMldev(apiClient, fromObject) {
|
|
@@ -4685,6 +4762,10 @@ function partToMldev$4(fromObject) {
|
|
|
4685
4762
|
if (fromToolResponse != null) {
|
|
4686
4763
|
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
4687
4764
|
}
|
|
4765
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
4766
|
+
if (fromPartMetadata != null) {
|
|
4767
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
4768
|
+
}
|
|
4688
4769
|
return toObject;
|
|
4689
4770
|
}
|
|
4690
4771
|
function safetySettingToMldev$1(fromObject) {
|
|
@@ -6019,6 +6100,10 @@ function partToMldev$3(fromObject) {
|
|
|
6019
6100
|
if (fromToolResponse != null) {
|
|
6020
6101
|
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
6021
6102
|
}
|
|
6103
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
6104
|
+
if (fromPartMetadata != null) {
|
|
6105
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
6106
|
+
}
|
|
6022
6107
|
return toObject;
|
|
6023
6108
|
}
|
|
6024
6109
|
function partToVertex$2(fromObject) {
|
|
@@ -6085,6 +6170,9 @@ function partToVertex$2(fromObject) {
|
|
|
6085
6170
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
6086
6171
|
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
6087
6172
|
}
|
|
6173
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
6174
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
6175
|
+
}
|
|
6088
6176
|
return toObject;
|
|
6089
6177
|
}
|
|
6090
6178
|
function toolConfigToMldev$1(fromObject) {
|
|
@@ -7341,7 +7429,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7341
7429
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7342
7430
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7343
7431
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7344
|
-
const SDK_VERSION = '1.
|
|
7432
|
+
const SDK_VERSION = '1.47.0'; // x-release-please-version
|
|
7345
7433
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7346
7434
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7347
7435
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -7401,6 +7489,11 @@ class ApiClient {
|
|
|
7401
7489
|
// Vertex Express or global endpoint case.
|
|
7402
7490
|
initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
|
|
7403
7491
|
}
|
|
7492
|
+
else if (this.clientOptions.project &&
|
|
7493
|
+
this.clientOptions.location &&
|
|
7494
|
+
this.clientOptions.location === 'us') {
|
|
7495
|
+
initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
|
|
7496
|
+
}
|
|
7404
7497
|
else if (this.clientOptions.project && this.clientOptions.location) {
|
|
7405
7498
|
initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
|
|
7406
7499
|
}
|
|
@@ -11209,7 +11302,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
11209
11302
|
}
|
|
11210
11303
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
11211
11304
|
if (fromSpeechConfig != null) {
|
|
11212
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
11305
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
11213
11306
|
}
|
|
11214
11307
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
11215
11308
|
'stopSequences',
|
|
@@ -11430,7 +11523,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
11430
11523
|
}
|
|
11431
11524
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
11432
11525
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
11433
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
11526
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
11434
11527
|
}
|
|
11435
11528
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
11436
11529
|
'thinkingConfig',
|
|
@@ -11690,6 +11783,22 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
11690
11783
|
}
|
|
11691
11784
|
return toObject;
|
|
11692
11785
|
}
|
|
11786
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
11787
|
+
const toObject = {};
|
|
11788
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
11789
|
+
'speakerVoiceConfigs',
|
|
11790
|
+
]);
|
|
11791
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
11792
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
11793
|
+
if (Array.isArray(transformedList)) {
|
|
11794
|
+
transformedList = transformedList.map((item) => {
|
|
11795
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
11796
|
+
});
|
|
11797
|
+
}
|
|
11798
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
11799
|
+
}
|
|
11800
|
+
return toObject;
|
|
11801
|
+
}
|
|
11693
11802
|
function partToMldev$2(fromObject) {
|
|
11694
11803
|
const toObject = {};
|
|
11695
11804
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -11756,6 +11865,10 @@ function partToMldev$2(fromObject) {
|
|
|
11756
11865
|
if (fromToolResponse != null) {
|
|
11757
11866
|
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
11758
11867
|
}
|
|
11868
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
11869
|
+
if (fromPartMetadata != null) {
|
|
11870
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
11871
|
+
}
|
|
11759
11872
|
return toObject;
|
|
11760
11873
|
}
|
|
11761
11874
|
function partToVertex$1(fromObject) {
|
|
@@ -11822,6 +11935,23 @@ function partToVertex$1(fromObject) {
|
|
|
11822
11935
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
11823
11936
|
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
11824
11937
|
}
|
|
11938
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
11939
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
11940
|
+
}
|
|
11941
|
+
return toObject;
|
|
11942
|
+
}
|
|
11943
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
11944
|
+
const toObject = {};
|
|
11945
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
11946
|
+
if (fromMimeType != null) {
|
|
11947
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
11948
|
+
}
|
|
11949
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
11950
|
+
'voiceSampleAudio',
|
|
11951
|
+
]);
|
|
11952
|
+
if (fromVoiceSampleAudio != null) {
|
|
11953
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
11954
|
+
}
|
|
11825
11955
|
return toObject;
|
|
11826
11956
|
}
|
|
11827
11957
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
@@ -11835,6 +11965,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
11835
11965
|
}
|
|
11836
11966
|
return toObject;
|
|
11837
11967
|
}
|
|
11968
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
11969
|
+
const toObject = {};
|
|
11970
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
11971
|
+
if (fromSpeaker != null) {
|
|
11972
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
11973
|
+
}
|
|
11974
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11975
|
+
if (fromVoiceConfig != null) {
|
|
11976
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
11977
|
+
}
|
|
11978
|
+
return toObject;
|
|
11979
|
+
}
|
|
11980
|
+
function speechConfigToVertex$1(fromObject) {
|
|
11981
|
+
const toObject = {};
|
|
11982
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11983
|
+
if (fromVoiceConfig != null) {
|
|
11984
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
11985
|
+
}
|
|
11986
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
11987
|
+
if (fromLanguageCode != null) {
|
|
11988
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
11989
|
+
}
|
|
11990
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
11991
|
+
'multiSpeakerVoiceConfig',
|
|
11992
|
+
]);
|
|
11993
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
11994
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
11995
|
+
}
|
|
11996
|
+
return toObject;
|
|
11997
|
+
}
|
|
11838
11998
|
function toolToMldev$2(fromObject) {
|
|
11839
11999
|
const toObject = {};
|
|
11840
12000
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -12068,6 +12228,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
12068
12228
|
}
|
|
12069
12229
|
return toObject;
|
|
12070
12230
|
}
|
|
12231
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
12232
|
+
const toObject = {};
|
|
12233
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
12234
|
+
'replicatedVoiceConfig',
|
|
12235
|
+
]);
|
|
12236
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
12237
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
12238
|
+
}
|
|
12239
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
12240
|
+
'prebuiltVoiceConfig',
|
|
12241
|
+
]);
|
|
12242
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
12243
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
12244
|
+
}
|
|
12245
|
+
return toObject;
|
|
12246
|
+
}
|
|
12071
12247
|
|
|
12072
12248
|
/**
|
|
12073
12249
|
* @license
|
|
@@ -13121,6 +13297,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
13121
13297
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
13122
13298
|
throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
|
|
13123
13299
|
}
|
|
13300
|
+
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
13301
|
+
if (parentObject !== undefined && fromServiceTier != null) {
|
|
13302
|
+
setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
|
|
13303
|
+
}
|
|
13124
13304
|
return toObject;
|
|
13125
13305
|
}
|
|
13126
13306
|
function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
|
|
@@ -13267,7 +13447,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
13267
13447
|
}
|
|
13268
13448
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
13269
13449
|
if (fromSpeechConfig != null) {
|
|
13270
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
13450
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
13271
13451
|
}
|
|
13272
13452
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
13273
13453
|
'audioTimestamp',
|
|
@@ -13295,6 +13475,9 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
13295
13475
|
if (parentObject !== undefined && fromModelArmorConfig != null) {
|
|
13296
13476
|
setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
|
|
13297
13477
|
}
|
|
13478
|
+
if (getValueByPath(fromObject, ['serviceTier']) !== undefined) {
|
|
13479
|
+
throw new Error('serviceTier parameter is not supported in Vertex AI.');
|
|
13480
|
+
}
|
|
13298
13481
|
return toObject;
|
|
13299
13482
|
}
|
|
13300
13483
|
function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
|
|
@@ -13379,6 +13562,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
|
|
|
13379
13562
|
if (fromUsageMetadata != null) {
|
|
13380
13563
|
setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
|
|
13381
13564
|
}
|
|
13565
|
+
const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
|
|
13566
|
+
if (fromModelStatus != null) {
|
|
13567
|
+
setValueByPath(toObject, ['modelStatus'], fromModelStatus);
|
|
13568
|
+
}
|
|
13382
13569
|
return toObject;
|
|
13383
13570
|
}
|
|
13384
13571
|
function generateContentResponseFromVertex(fromObject, _rootObject) {
|
|
@@ -13764,6 +13951,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
13764
13951
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
13765
13952
|
throw new Error('compressionQuality parameter is not supported in Gemini API.');
|
|
13766
13953
|
}
|
|
13954
|
+
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
13955
|
+
throw new Error('labels parameter is not supported in Gemini API.');
|
|
13956
|
+
}
|
|
13767
13957
|
return toObject;
|
|
13768
13958
|
}
|
|
13769
13959
|
function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -13854,6 +14044,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
13854
14044
|
if (parentObject !== undefined && fromCompressionQuality != null) {
|
|
13855
14045
|
setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
|
|
13856
14046
|
}
|
|
14047
|
+
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
14048
|
+
if (parentObject !== undefined && fromLabels != null) {
|
|
14049
|
+
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
14050
|
+
}
|
|
13857
14051
|
return toObject;
|
|
13858
14052
|
}
|
|
13859
14053
|
function generateVideosOperationFromMldev(fromObject, rootObject) {
|
|
@@ -14123,7 +14317,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
14123
14317
|
}
|
|
14124
14318
|
return toObject;
|
|
14125
14319
|
}
|
|
14126
|
-
function generationConfigToVertex(fromObject,
|
|
14320
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
14127
14321
|
const toObject = {};
|
|
14128
14322
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
14129
14323
|
'modelSelectionConfig',
|
|
@@ -14219,7 +14413,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
14219
14413
|
}
|
|
14220
14414
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14221
14415
|
if (fromSpeechConfig != null) {
|
|
14222
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
14416
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
14223
14417
|
}
|
|
14224
14418
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
14225
14419
|
'stopSequences',
|
|
@@ -14676,6 +14870,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
14676
14870
|
}
|
|
14677
14871
|
return toObject;
|
|
14678
14872
|
}
|
|
14873
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
14874
|
+
const toObject = {};
|
|
14875
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
14876
|
+
'speakerVoiceConfigs',
|
|
14877
|
+
]);
|
|
14878
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
14879
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
14880
|
+
if (Array.isArray(transformedList)) {
|
|
14881
|
+
transformedList = transformedList.map((item) => {
|
|
14882
|
+
return speakerVoiceConfigToVertex(item);
|
|
14883
|
+
});
|
|
14884
|
+
}
|
|
14885
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
14886
|
+
}
|
|
14887
|
+
return toObject;
|
|
14888
|
+
}
|
|
14679
14889
|
function partToMldev$1(fromObject, rootObject) {
|
|
14680
14890
|
const toObject = {};
|
|
14681
14891
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -14742,6 +14952,10 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
14742
14952
|
if (fromToolResponse != null) {
|
|
14743
14953
|
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
14744
14954
|
}
|
|
14955
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
14956
|
+
if (fromPartMetadata != null) {
|
|
14957
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
14958
|
+
}
|
|
14745
14959
|
return toObject;
|
|
14746
14960
|
}
|
|
14747
14961
|
function partToVertex(fromObject, _rootObject) {
|
|
@@ -14808,6 +15022,9 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
14808
15022
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
14809
15023
|
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
14810
15024
|
}
|
|
15025
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
15026
|
+
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
15027
|
+
}
|
|
14811
15028
|
return toObject;
|
|
14812
15029
|
}
|
|
14813
15030
|
function productImageToVertex(fromObject, rootObject) {
|
|
@@ -14978,6 +15195,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
14978
15195
|
}
|
|
14979
15196
|
return toObject;
|
|
14980
15197
|
}
|
|
15198
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
15199
|
+
const toObject = {};
|
|
15200
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
15201
|
+
if (fromMimeType != null) {
|
|
15202
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15203
|
+
}
|
|
15204
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
15205
|
+
'voiceSampleAudio',
|
|
15206
|
+
]);
|
|
15207
|
+
if (fromVoiceSampleAudio != null) {
|
|
15208
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
15209
|
+
}
|
|
15210
|
+
return toObject;
|
|
15211
|
+
}
|
|
14981
15212
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
14982
15213
|
const toObject = {};
|
|
14983
15214
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -15127,6 +15358,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
15127
15358
|
}
|
|
15128
15359
|
return toObject;
|
|
15129
15360
|
}
|
|
15361
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
15362
|
+
const toObject = {};
|
|
15363
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
15364
|
+
if (fromSpeaker != null) {
|
|
15365
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
15366
|
+
}
|
|
15367
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15368
|
+
if (fromVoiceConfig != null) {
|
|
15369
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
15370
|
+
}
|
|
15371
|
+
return toObject;
|
|
15372
|
+
}
|
|
15373
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
15374
|
+
const toObject = {};
|
|
15375
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15376
|
+
if (fromVoiceConfig != null) {
|
|
15377
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
15378
|
+
}
|
|
15379
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
15380
|
+
if (fromLanguageCode != null) {
|
|
15381
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
15382
|
+
}
|
|
15383
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
15384
|
+
'multiSpeakerVoiceConfig',
|
|
15385
|
+
]);
|
|
15386
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
15387
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
15388
|
+
}
|
|
15389
|
+
return toObject;
|
|
15390
|
+
}
|
|
15130
15391
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
15131
15392
|
const toObject = {};
|
|
15132
15393
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -15609,6 +15870,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
15609
15870
|
}
|
|
15610
15871
|
return toObject;
|
|
15611
15872
|
}
|
|
15873
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
15874
|
+
const toObject = {};
|
|
15875
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
15876
|
+
'replicatedVoiceConfig',
|
|
15877
|
+
]);
|
|
15878
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
15879
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
15880
|
+
}
|
|
15881
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
15882
|
+
'prebuiltVoiceConfig',
|
|
15883
|
+
]);
|
|
15884
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
15885
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
15886
|
+
}
|
|
15887
|
+
return toObject;
|
|
15888
|
+
}
|
|
15612
15889
|
|
|
15613
15890
|
/**
|
|
15614
15891
|
* @license
|
|
@@ -18641,6 +18918,10 @@ function partToMldev(fromObject) {
|
|
|
18641
18918
|
if (fromToolResponse != null) {
|
|
18642
18919
|
setValueByPath(toObject, ['toolResponse'], fromToolResponse);
|
|
18643
18920
|
}
|
|
18921
|
+
const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
|
|
18922
|
+
if (fromPartMetadata != null) {
|
|
18923
|
+
setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
|
|
18924
|
+
}
|
|
18644
18925
|
return toObject;
|
|
18645
18926
|
}
|
|
18646
18927
|
function sessionResumptionConfigToMldev(fromObject) {
|
|
@@ -19275,6 +19556,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19275
19556
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
|
|
19276
19557
|
}
|
|
19277
19558
|
}
|
|
19559
|
+
else if (discriminatorTuningMode === 'DISTILLATION') {
|
|
19560
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
19561
|
+
if (parentObject !== undefined && fromTuningMode != null) {
|
|
19562
|
+
setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
|
|
19563
|
+
}
|
|
19564
|
+
}
|
|
19278
19565
|
const fromCustomBaseModel = getValueByPath(fromObject, [
|
|
19279
19566
|
'customBaseModel',
|
|
19280
19567
|
]);
|
|
@@ -19294,6 +19581,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19294
19581
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
19295
19582
|
}
|
|
19296
19583
|
}
|
|
19584
|
+
else if (discriminatorBatchSize === 'DISTILLATION') {
|
|
19585
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
19586
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
19587
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
19588
|
+
}
|
|
19589
|
+
}
|
|
19297
19590
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
19298
19591
|
'config',
|
|
19299
19592
|
'method',
|
|
@@ -19309,6 +19602,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19309
19602
|
setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
19310
19603
|
}
|
|
19311
19604
|
}
|
|
19605
|
+
else if (discriminatorLearningRate === 'DISTILLATION') {
|
|
19606
|
+
const fromLearningRate = getValueByPath(fromObject, [
|
|
19607
|
+
'learningRate',
|
|
19608
|
+
]);
|
|
19609
|
+
if (parentObject !== undefined && fromLearningRate != null) {
|
|
19610
|
+
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
|
|
19611
|
+
}
|
|
19612
|
+
}
|
|
19312
19613
|
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
19313
19614
|
if (parentObject !== undefined && fromLabels != null) {
|
|
19314
19615
|
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
@@ -19812,6 +20113,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
19812
20113
|
if (fromVeoTuningSpec != null) {
|
|
19813
20114
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
19814
20115
|
}
|
|
20116
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20117
|
+
'distillationSamplingSpec',
|
|
20118
|
+
]);
|
|
20119
|
+
if (fromDistillationSamplingSpec != null) {
|
|
20120
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20121
|
+
}
|
|
20122
|
+
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20123
|
+
'tuningJobMetadata',
|
|
20124
|
+
]);
|
|
20125
|
+
if (fromTuningJobMetadata != null) {
|
|
20126
|
+
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20127
|
+
}
|
|
19815
20128
|
return toObject;
|
|
19816
20129
|
}
|
|
19817
20130
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|