@google/genai 2.5.0 → 2.7.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 +344 -95
- package/dist/index.cjs +545 -56
- package/dist/index.mjs +546 -57
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +545 -56
- package/dist/node/index.mjs +546 -57
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +344 -95
- package/dist/tokenizer/node.cjs +84 -40
- package/dist/tokenizer/node.d.ts +28 -24
- package/dist/tokenizer/node.mjs +84 -40
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +85 -41
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +227 -90
- package/dist/vertex_internal/index.js +85 -41
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +546 -57
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +344 -95
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -616,18 +616,6 @@ function videoFromVertex$1(fromObject) {
|
|
|
616
616
|
* Copyright 2025 Google LLC
|
|
617
617
|
* SPDX-License-Identifier: Apache-2.0
|
|
618
618
|
*/
|
|
619
|
-
/** Programming language of the `code`. */
|
|
620
|
-
exports.Language = void 0;
|
|
621
|
-
(function (Language) {
|
|
622
|
-
/**
|
|
623
|
-
* Unspecified language. This value should not be used.
|
|
624
|
-
*/
|
|
625
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
626
|
-
/**
|
|
627
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
628
|
-
*/
|
|
629
|
-
Language["PYTHON"] = "PYTHON";
|
|
630
|
-
})(exports.Language || (exports.Language = {}));
|
|
631
619
|
/** Outcome of the code execution. */
|
|
632
620
|
exports.Outcome = void 0;
|
|
633
621
|
(function (Outcome) {
|
|
@@ -636,18 +624,30 @@ exports.Outcome = void 0;
|
|
|
636
624
|
*/
|
|
637
625
|
Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
|
|
638
626
|
/**
|
|
639
|
-
* Code execution completed successfully.
|
|
627
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
640
628
|
*/
|
|
641
629
|
Outcome["OUTCOME_OK"] = "OUTCOME_OK";
|
|
642
630
|
/**
|
|
643
|
-
* Code execution
|
|
631
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
644
632
|
*/
|
|
645
633
|
Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
|
|
646
634
|
/**
|
|
647
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
635
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
648
636
|
*/
|
|
649
637
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
650
638
|
})(exports.Outcome || (exports.Outcome = {}));
|
|
639
|
+
/** Programming language of the `code`. */
|
|
640
|
+
exports.Language = void 0;
|
|
641
|
+
(function (Language) {
|
|
642
|
+
/**
|
|
643
|
+
* Unspecified language. This value should not be used.
|
|
644
|
+
*/
|
|
645
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
646
|
+
/**
|
|
647
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
648
|
+
*/
|
|
649
|
+
Language["PYTHON"] = "PYTHON";
|
|
650
|
+
})(exports.Language || (exports.Language = {}));
|
|
651
651
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
652
652
|
exports.FunctionResponseScheduling = void 0;
|
|
653
653
|
(function (FunctionResponseScheduling) {
|
|
@@ -715,6 +715,14 @@ exports.Environment = void 0;
|
|
|
715
715
|
* Operates in a web browser.
|
|
716
716
|
*/
|
|
717
717
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
718
|
+
/**
|
|
719
|
+
* Operates in a mobile environment.
|
|
720
|
+
*/
|
|
721
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
722
|
+
/**
|
|
723
|
+
* Operates in a desktop environment.
|
|
724
|
+
*/
|
|
725
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
718
726
|
})(exports.Environment || (exports.Environment = {}));
|
|
719
727
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
720
728
|
exports.AuthType = void 0;
|
|
@@ -846,30 +854,6 @@ exports.DynamicRetrievalConfigMode = void 0;
|
|
|
846
854
|
*/
|
|
847
855
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
848
856
|
})(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
|
|
849
|
-
/** Function calling mode. */
|
|
850
|
-
exports.FunctionCallingConfigMode = void 0;
|
|
851
|
-
(function (FunctionCallingConfigMode) {
|
|
852
|
-
/**
|
|
853
|
-
* Unspecified function calling mode. This value should not be used.
|
|
854
|
-
*/
|
|
855
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
856
|
-
/**
|
|
857
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
858
|
-
*/
|
|
859
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
860
|
-
/**
|
|
861
|
-
* Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
862
|
-
*/
|
|
863
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
864
|
-
/**
|
|
865
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
866
|
-
*/
|
|
867
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
868
|
-
/**
|
|
869
|
-
* Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
870
|
-
*/
|
|
871
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
872
|
-
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
873
857
|
/** The number of thoughts tokens that the model should generate. */
|
|
874
858
|
exports.ThinkingLevel = void 0;
|
|
875
859
|
(function (ThinkingLevel) {
|
|
@@ -1018,6 +1002,30 @@ exports.HarmBlockThreshold = void 0;
|
|
|
1018
1002
|
*/
|
|
1019
1003
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
1020
1004
|
})(exports.HarmBlockThreshold || (exports.HarmBlockThreshold = {}));
|
|
1005
|
+
/** Function calling mode. */
|
|
1006
|
+
exports.FunctionCallingConfigMode = void 0;
|
|
1007
|
+
(function (FunctionCallingConfigMode) {
|
|
1008
|
+
/**
|
|
1009
|
+
* Unspecified function calling mode. This value should not be used.
|
|
1010
|
+
*/
|
|
1011
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1012
|
+
/**
|
|
1013
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1014
|
+
*/
|
|
1015
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1016
|
+
/**
|
|
1017
|
+
* Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
1018
|
+
*/
|
|
1019
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1020
|
+
/**
|
|
1021
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1022
|
+
*/
|
|
1023
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1024
|
+
/**
|
|
1025
|
+
* Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
1026
|
+
*/
|
|
1027
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1028
|
+
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
1021
1029
|
/** Output only. The reason why the model stopped generating tokens.
|
|
1022
1030
|
|
|
1023
1031
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1500,7 +1508,23 @@ exports.PairwiseChoice = void 0;
|
|
|
1500
1508
|
*/
|
|
1501
1509
|
PairwiseChoice["TIE"] = "TIE";
|
|
1502
1510
|
})(exports.PairwiseChoice || (exports.PairwiseChoice = {}));
|
|
1503
|
-
/** The tuning
|
|
1511
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
1512
|
+
exports.TuningSpeed = void 0;
|
|
1513
|
+
(function (TuningSpeed) {
|
|
1514
|
+
/**
|
|
1515
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
1516
|
+
*/
|
|
1517
|
+
TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
|
|
1518
|
+
/**
|
|
1519
|
+
* Regular tuning speed.
|
|
1520
|
+
*/
|
|
1521
|
+
TuningSpeed["REGULAR"] = "REGULAR";
|
|
1522
|
+
/**
|
|
1523
|
+
* Fast tuning speed.
|
|
1524
|
+
*/
|
|
1525
|
+
TuningSpeed["FAST"] = "FAST";
|
|
1526
|
+
})(exports.TuningSpeed || (exports.TuningSpeed = {}));
|
|
1527
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
1504
1528
|
exports.TuningTask = void 0;
|
|
1505
1529
|
(function (TuningTask) {
|
|
1506
1530
|
/**
|
|
@@ -1520,6 +1544,22 @@ exports.TuningTask = void 0;
|
|
|
1520
1544
|
*/
|
|
1521
1545
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1522
1546
|
})(exports.TuningTask || (exports.TuningTask = {}));
|
|
1547
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
1548
|
+
exports.VideoOrientation = void 0;
|
|
1549
|
+
(function (VideoOrientation) {
|
|
1550
|
+
/**
|
|
1551
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
1552
|
+
*/
|
|
1553
|
+
VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
|
|
1554
|
+
/**
|
|
1555
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
1556
|
+
*/
|
|
1557
|
+
VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
|
|
1558
|
+
/**
|
|
1559
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
1560
|
+
*/
|
|
1561
|
+
VideoOrientation["PORTRAIT"] = "PORTRAIT";
|
|
1562
|
+
})(exports.VideoOrientation || (exports.VideoOrientation = {}));
|
|
1523
1563
|
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1524
1564
|
exports.DocumentState = void 0;
|
|
1525
1565
|
(function (DocumentState) {
|
|
@@ -1819,6 +1859,10 @@ exports.TuningMethod = void 0;
|
|
|
1819
1859
|
* Distillation tuning.
|
|
1820
1860
|
*/
|
|
1821
1861
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1862
|
+
/**
|
|
1863
|
+
* Reinforcement tuning.
|
|
1864
|
+
*/
|
|
1865
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1822
1866
|
})(exports.TuningMethod || (exports.TuningMethod = {}));
|
|
1823
1867
|
/** State for the lifecycle of a File. */
|
|
1824
1868
|
exports.FileState = void 0;
|
|
@@ -5140,6 +5184,7 @@ exports.PagedItem = void 0;
|
|
|
5140
5184
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5141
5185
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5142
5186
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5187
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5143
5188
|
})(exports.PagedItem || (exports.PagedItem = {}));
|
|
5144
5189
|
/**
|
|
5145
5190
|
* Pager class for iterating through paginated results.
|
|
@@ -5860,6 +5905,21 @@ function blobToMldev$3(fromObject) {
|
|
|
5860
5905
|
}
|
|
5861
5906
|
return toObject;
|
|
5862
5907
|
}
|
|
5908
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
5909
|
+
const toObject = {};
|
|
5910
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5911
|
+
if (fromOutcome != null) {
|
|
5912
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
5913
|
+
}
|
|
5914
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
5915
|
+
if (fromOutput != null) {
|
|
5916
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
5917
|
+
}
|
|
5918
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
5919
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5920
|
+
}
|
|
5921
|
+
return toObject;
|
|
5922
|
+
}
|
|
5863
5923
|
function contentToMldev$3(fromObject) {
|
|
5864
5924
|
const toObject = {};
|
|
5865
5925
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -6055,6 +6115,21 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6055
6115
|
}
|
|
6056
6116
|
return toObject;
|
|
6057
6117
|
}
|
|
6118
|
+
function executableCodeToVertex$2(fromObject) {
|
|
6119
|
+
const toObject = {};
|
|
6120
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6121
|
+
if (fromCode != null) {
|
|
6122
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
6123
|
+
}
|
|
6124
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
6125
|
+
if (fromLanguage != null) {
|
|
6126
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
6127
|
+
}
|
|
6128
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
6129
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6130
|
+
}
|
|
6131
|
+
return toObject;
|
|
6132
|
+
}
|
|
6058
6133
|
function fileDataToMldev$3(fromObject) {
|
|
6059
6134
|
const toObject = {};
|
|
6060
6135
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6338,13 +6413,13 @@ function partToVertex$2(fromObject) {
|
|
|
6338
6413
|
'codeExecutionResult',
|
|
6339
6414
|
]);
|
|
6340
6415
|
if (fromCodeExecutionResult != null) {
|
|
6341
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6416
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
6342
6417
|
}
|
|
6343
6418
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6344
6419
|
'executableCode',
|
|
6345
6420
|
]);
|
|
6346
6421
|
if (fromExecutableCode != null) {
|
|
6347
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6422
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
6348
6423
|
}
|
|
6349
6424
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6350
6425
|
if (fromFileData != null) {
|
|
@@ -7902,6 +7977,21 @@ function blobToMldev$2(fromObject) {
|
|
|
7902
7977
|
}
|
|
7903
7978
|
return toObject;
|
|
7904
7979
|
}
|
|
7980
|
+
function codeExecutionResultToVertex$1(fromObject) {
|
|
7981
|
+
const toObject = {};
|
|
7982
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7983
|
+
if (fromOutcome != null) {
|
|
7984
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
7985
|
+
}
|
|
7986
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
7987
|
+
if (fromOutput != null) {
|
|
7988
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
7989
|
+
}
|
|
7990
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
7991
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
7992
|
+
}
|
|
7993
|
+
return toObject;
|
|
7994
|
+
}
|
|
7905
7995
|
function contentToMldev$2(fromObject) {
|
|
7906
7996
|
const toObject = {};
|
|
7907
7997
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -7938,6 +8028,21 @@ function contentToVertex$1(fromObject) {
|
|
|
7938
8028
|
}
|
|
7939
8029
|
return toObject;
|
|
7940
8030
|
}
|
|
8031
|
+
function executableCodeToVertex$1(fromObject) {
|
|
8032
|
+
const toObject = {};
|
|
8033
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8034
|
+
if (fromCode != null) {
|
|
8035
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
8036
|
+
}
|
|
8037
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
8038
|
+
if (fromLanguage != null) {
|
|
8039
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
8040
|
+
}
|
|
8041
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
8042
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8043
|
+
}
|
|
8044
|
+
return toObject;
|
|
8045
|
+
}
|
|
7941
8046
|
function fileDataToMldev$2(fromObject) {
|
|
7942
8047
|
const toObject = {};
|
|
7943
8048
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -8677,13 +8782,13 @@ function partToVertex$1(fromObject) {
|
|
|
8677
8782
|
'codeExecutionResult',
|
|
8678
8783
|
]);
|
|
8679
8784
|
if (fromCodeExecutionResult != null) {
|
|
8680
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8785
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
8681
8786
|
}
|
|
8682
8787
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8683
8788
|
'executableCode',
|
|
8684
8789
|
]);
|
|
8685
8790
|
if (fromExecutableCode != null) {
|
|
8686
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8791
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
8687
8792
|
}
|
|
8688
8793
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8689
8794
|
if (fromFileData != null) {
|
|
@@ -9115,6 +9220,21 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9115
9220
|
}
|
|
9116
9221
|
return toObject;
|
|
9117
9222
|
}
|
|
9223
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9224
|
+
const toObject = {};
|
|
9225
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9226
|
+
if (fromOutcome != null) {
|
|
9227
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
9228
|
+
}
|
|
9229
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
9230
|
+
if (fromOutput != null) {
|
|
9231
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
9232
|
+
}
|
|
9233
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9234
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9235
|
+
}
|
|
9236
|
+
return toObject;
|
|
9237
|
+
}
|
|
9118
9238
|
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
9119
9239
|
const toObject = {};
|
|
9120
9240
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -9827,6 +9947,21 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9827
9947
|
}
|
|
9828
9948
|
return toObject;
|
|
9829
9949
|
}
|
|
9950
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
9951
|
+
const toObject = {};
|
|
9952
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9953
|
+
if (fromCode != null) {
|
|
9954
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
9955
|
+
}
|
|
9956
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
9957
|
+
if (fromLanguage != null) {
|
|
9958
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
9959
|
+
}
|
|
9960
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9961
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9962
|
+
}
|
|
9963
|
+
return toObject;
|
|
9964
|
+
}
|
|
9830
9965
|
function fileDataToMldev$1(fromObject, _rootObject) {
|
|
9831
9966
|
const toObject = {};
|
|
9832
9967
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -11705,7 +11840,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11705
11840
|
}
|
|
11706
11841
|
return toObject;
|
|
11707
11842
|
}
|
|
11708
|
-
function partToVertex(fromObject,
|
|
11843
|
+
function partToVertex(fromObject, rootObject) {
|
|
11709
11844
|
const toObject = {};
|
|
11710
11845
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11711
11846
|
'mediaResolution',
|
|
@@ -11717,13 +11852,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
11717
11852
|
'codeExecutionResult',
|
|
11718
11853
|
]);
|
|
11719
11854
|
if (fromCodeExecutionResult != null) {
|
|
11720
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
11855
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11721
11856
|
}
|
|
11722
11857
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11723
11858
|
'executableCode',
|
|
11724
11859
|
]);
|
|
11725
11860
|
if (fromExecutableCode != null) {
|
|
11726
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
11861
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11727
11862
|
}
|
|
11728
11863
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11729
11864
|
if (fromFileData != null) {
|
|
@@ -12823,7 +12958,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12823
12958
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12824
12959
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12825
12960
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12826
|
-
const SDK_VERSION = '2.
|
|
12961
|
+
const SDK_VERSION = '2.7.0'; // x-release-please-version
|
|
12827
12962
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12828
12963
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12829
12964
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -19916,6 +20051,24 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19916
20051
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19917
20052
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19918
20053
|
}
|
|
20054
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
20055
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20056
|
+
}
|
|
20057
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
20058
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20059
|
+
}
|
|
20060
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
20061
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20062
|
+
}
|
|
20063
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
20064
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20065
|
+
}
|
|
20066
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
20067
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20068
|
+
}
|
|
20069
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
20070
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20071
|
+
}
|
|
19919
20072
|
return toObject;
|
|
19920
20073
|
}
|
|
19921
20074
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -19951,6 +20104,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19951
20104
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19952
20105
|
}
|
|
19953
20106
|
}
|
|
20107
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
20108
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
20109
|
+
'validationDataset',
|
|
20110
|
+
]);
|
|
20111
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
20112
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20113
|
+
}
|
|
20114
|
+
}
|
|
19954
20115
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19955
20116
|
'tunedModelDisplayName',
|
|
19956
20117
|
]);
|
|
@@ -19986,6 +20147,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19986
20147
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19987
20148
|
}
|
|
19988
20149
|
}
|
|
20150
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
20151
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20152
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
20153
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20154
|
+
}
|
|
20155
|
+
}
|
|
19989
20156
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
19990
20157
|
'config',
|
|
19991
20158
|
'method',
|
|
@@ -20021,6 +20188,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20021
20188
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20022
20189
|
}
|
|
20023
20190
|
}
|
|
20191
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
20192
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20193
|
+
'learningRateMultiplier',
|
|
20194
|
+
]);
|
|
20195
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
20196
|
+
setValueByPath(parentObject, [
|
|
20197
|
+
'reinforcementTuningSpec',
|
|
20198
|
+
'hyperParameters',
|
|
20199
|
+
'learningRateMultiplier',
|
|
20200
|
+
], fromLearningRateMultiplier);
|
|
20201
|
+
}
|
|
20202
|
+
}
|
|
20024
20203
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
20025
20204
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
20026
20205
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -20074,6 +20253,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20074
20253
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20075
20254
|
}
|
|
20076
20255
|
}
|
|
20256
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20257
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20258
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20259
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20260
|
+
}
|
|
20261
|
+
}
|
|
20077
20262
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
20078
20263
|
'config',
|
|
20079
20264
|
'method',
|
|
@@ -20118,6 +20303,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20118
20303
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20119
20304
|
}
|
|
20120
20305
|
}
|
|
20306
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20307
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20308
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20309
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20310
|
+
}
|
|
20311
|
+
}
|
|
20121
20312
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
20122
20313
|
'config',
|
|
20123
20314
|
'method',
|
|
@@ -20177,6 +20368,40 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20177
20368
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
20178
20369
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
20179
20370
|
}
|
|
20371
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20372
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20373
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20374
|
+
}
|
|
20375
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20376
|
+
'compositeRewardConfig',
|
|
20377
|
+
]);
|
|
20378
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20379
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20380
|
+
}
|
|
20381
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20382
|
+
'samplesPerPrompt',
|
|
20383
|
+
]);
|
|
20384
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20385
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20386
|
+
}
|
|
20387
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20388
|
+
'evaluateInterval',
|
|
20389
|
+
]);
|
|
20390
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20391
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20392
|
+
}
|
|
20393
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20394
|
+
'checkpointInterval',
|
|
20395
|
+
]);
|
|
20396
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20397
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20398
|
+
}
|
|
20399
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20400
|
+
'maxOutputTokens',
|
|
20401
|
+
]);
|
|
20402
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20403
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20404
|
+
}
|
|
20180
20405
|
return toObject;
|
|
20181
20406
|
}
|
|
20182
20407
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20227,6 +20452,250 @@ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
|
|
|
20227
20452
|
}
|
|
20228
20453
|
return toObject;
|
|
20229
20454
|
}
|
|
20455
|
+
function distillationHyperParametersFromVertex(fromObject, rootObject) {
|
|
20456
|
+
const toObject = {};
|
|
20457
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20458
|
+
if (fromAdapterSize != null) {
|
|
20459
|
+
setValueByPath(toObject, ['adapterSize'], fromAdapterSize);
|
|
20460
|
+
}
|
|
20461
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20462
|
+
if (fromEpochCount != null) {
|
|
20463
|
+
setValueByPath(toObject, ['epochCount'], fromEpochCount);
|
|
20464
|
+
}
|
|
20465
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20466
|
+
'learningRateMultiplier',
|
|
20467
|
+
]);
|
|
20468
|
+
if (fromLearningRateMultiplier != null) {
|
|
20469
|
+
setValueByPath(toObject, ['learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20470
|
+
}
|
|
20471
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
20472
|
+
'generationConfig',
|
|
20473
|
+
]);
|
|
20474
|
+
if (fromGenerationConfig != null) {
|
|
20475
|
+
setValueByPath(toObject, ['generationConfig'], generationConfigFromVertex(fromGenerationConfig));
|
|
20476
|
+
}
|
|
20477
|
+
const fromLearningRate = getValueByPath(fromObject, ['learningRate']);
|
|
20478
|
+
if (fromLearningRate != null) {
|
|
20479
|
+
setValueByPath(toObject, ['learningRate'], fromLearningRate);
|
|
20480
|
+
}
|
|
20481
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20482
|
+
if (fromBatchSize != null) {
|
|
20483
|
+
setValueByPath(toObject, ['batchSize'], fromBatchSize);
|
|
20484
|
+
}
|
|
20485
|
+
return toObject;
|
|
20486
|
+
}
|
|
20487
|
+
function distillationSamplingSpecFromVertex(fromObject, rootObject) {
|
|
20488
|
+
const toObject = {};
|
|
20489
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20490
|
+
'baseTeacherModel',
|
|
20491
|
+
]);
|
|
20492
|
+
if (fromBaseTeacherModel != null) {
|
|
20493
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20494
|
+
}
|
|
20495
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20496
|
+
'tunedTeacherModelSource',
|
|
20497
|
+
]);
|
|
20498
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20499
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20500
|
+
}
|
|
20501
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20502
|
+
'validationDatasetUri',
|
|
20503
|
+
]);
|
|
20504
|
+
if (fromValidationDatasetUri != null) {
|
|
20505
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20506
|
+
}
|
|
20507
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20508
|
+
'promptDatasetUri',
|
|
20509
|
+
]);
|
|
20510
|
+
if (fromPromptDatasetUri != null) {
|
|
20511
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20512
|
+
}
|
|
20513
|
+
const fromHyperparameters = getValueByPath(fromObject, [
|
|
20514
|
+
'hyperparameters',
|
|
20515
|
+
]);
|
|
20516
|
+
if (fromHyperparameters != null) {
|
|
20517
|
+
setValueByPath(toObject, ['hyperparameters'], distillationHyperParametersFromVertex(fromHyperparameters));
|
|
20518
|
+
}
|
|
20519
|
+
return toObject;
|
|
20520
|
+
}
|
|
20521
|
+
function distillationSpecFromVertex(fromObject, rootObject) {
|
|
20522
|
+
const toObject = {};
|
|
20523
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20524
|
+
'promptDatasetUri',
|
|
20525
|
+
]);
|
|
20526
|
+
if (fromPromptDatasetUri != null) {
|
|
20527
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20528
|
+
}
|
|
20529
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20530
|
+
'baseTeacherModel',
|
|
20531
|
+
]);
|
|
20532
|
+
if (fromBaseTeacherModel != null) {
|
|
20533
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20534
|
+
}
|
|
20535
|
+
const fromHyperParameters = getValueByPath(fromObject, [
|
|
20536
|
+
'hyperParameters',
|
|
20537
|
+
]);
|
|
20538
|
+
if (fromHyperParameters != null) {
|
|
20539
|
+
setValueByPath(toObject, ['hyperParameters'], distillationHyperParametersFromVertex(fromHyperParameters));
|
|
20540
|
+
}
|
|
20541
|
+
const fromPipelineRootDirectory = getValueByPath(fromObject, [
|
|
20542
|
+
'pipelineRootDirectory',
|
|
20543
|
+
]);
|
|
20544
|
+
if (fromPipelineRootDirectory != null) {
|
|
20545
|
+
setValueByPath(toObject, ['pipelineRootDirectory'], fromPipelineRootDirectory);
|
|
20546
|
+
}
|
|
20547
|
+
const fromStudentModel = getValueByPath(fromObject, ['studentModel']);
|
|
20548
|
+
if (fromStudentModel != null) {
|
|
20549
|
+
setValueByPath(toObject, ['studentModel'], fromStudentModel);
|
|
20550
|
+
}
|
|
20551
|
+
const fromTrainingDatasetUri = getValueByPath(fromObject, [
|
|
20552
|
+
'trainingDatasetUri',
|
|
20553
|
+
]);
|
|
20554
|
+
if (fromTrainingDatasetUri != null) {
|
|
20555
|
+
setValueByPath(toObject, ['trainingDatasetUri'], fromTrainingDatasetUri);
|
|
20556
|
+
}
|
|
20557
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20558
|
+
'tunedTeacherModelSource',
|
|
20559
|
+
]);
|
|
20560
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20561
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20562
|
+
}
|
|
20563
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20564
|
+
'validationDatasetUri',
|
|
20565
|
+
]);
|
|
20566
|
+
if (fromValidationDatasetUri != null) {
|
|
20567
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20568
|
+
}
|
|
20569
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
20570
|
+
if (fromTuningMode != null) {
|
|
20571
|
+
setValueByPath(toObject, ['tuningMode'], fromTuningMode);
|
|
20572
|
+
}
|
|
20573
|
+
return toObject;
|
|
20574
|
+
}
|
|
20575
|
+
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20576
|
+
const toObject = {};
|
|
20577
|
+
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
20578
|
+
'modelConfig',
|
|
20579
|
+
]);
|
|
20580
|
+
if (fromModelSelectionConfig != null) {
|
|
20581
|
+
setValueByPath(toObject, ['modelSelectionConfig'], fromModelSelectionConfig);
|
|
20582
|
+
}
|
|
20583
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
20584
|
+
'responseJsonSchema',
|
|
20585
|
+
]);
|
|
20586
|
+
if (fromResponseJsonSchema != null) {
|
|
20587
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
20588
|
+
}
|
|
20589
|
+
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
20590
|
+
'audioTimestamp',
|
|
20591
|
+
]);
|
|
20592
|
+
if (fromAudioTimestamp != null) {
|
|
20593
|
+
setValueByPath(toObject, ['audioTimestamp'], fromAudioTimestamp);
|
|
20594
|
+
}
|
|
20595
|
+
const fromCandidateCount = getValueByPath(fromObject, [
|
|
20596
|
+
'candidateCount',
|
|
20597
|
+
]);
|
|
20598
|
+
if (fromCandidateCount != null) {
|
|
20599
|
+
setValueByPath(toObject, ['candidateCount'], fromCandidateCount);
|
|
20600
|
+
}
|
|
20601
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
20602
|
+
'enableAffectiveDialog',
|
|
20603
|
+
]);
|
|
20604
|
+
if (fromEnableAffectiveDialog != null) {
|
|
20605
|
+
setValueByPath(toObject, ['enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
20606
|
+
}
|
|
20607
|
+
const fromFrequencyPenalty = getValueByPath(fromObject, [
|
|
20608
|
+
'frequencyPenalty',
|
|
20609
|
+
]);
|
|
20610
|
+
if (fromFrequencyPenalty != null) {
|
|
20611
|
+
setValueByPath(toObject, ['frequencyPenalty'], fromFrequencyPenalty);
|
|
20612
|
+
}
|
|
20613
|
+
const fromLogprobs = getValueByPath(fromObject, ['logprobs']);
|
|
20614
|
+
if (fromLogprobs != null) {
|
|
20615
|
+
setValueByPath(toObject, ['logprobs'], fromLogprobs);
|
|
20616
|
+
}
|
|
20617
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20618
|
+
'maxOutputTokens',
|
|
20619
|
+
]);
|
|
20620
|
+
if (fromMaxOutputTokens != null) {
|
|
20621
|
+
setValueByPath(toObject, ['maxOutputTokens'], fromMaxOutputTokens);
|
|
20622
|
+
}
|
|
20623
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20624
|
+
'mediaResolution',
|
|
20625
|
+
]);
|
|
20626
|
+
if (fromMediaResolution != null) {
|
|
20627
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20628
|
+
}
|
|
20629
|
+
const fromPresencePenalty = getValueByPath(fromObject, [
|
|
20630
|
+
'presencePenalty',
|
|
20631
|
+
]);
|
|
20632
|
+
if (fromPresencePenalty != null) {
|
|
20633
|
+
setValueByPath(toObject, ['presencePenalty'], fromPresencePenalty);
|
|
20634
|
+
}
|
|
20635
|
+
const fromResponseLogprobs = getValueByPath(fromObject, [
|
|
20636
|
+
'responseLogprobs',
|
|
20637
|
+
]);
|
|
20638
|
+
if (fromResponseLogprobs != null) {
|
|
20639
|
+
setValueByPath(toObject, ['responseLogprobs'], fromResponseLogprobs);
|
|
20640
|
+
}
|
|
20641
|
+
const fromResponseMimeType = getValueByPath(fromObject, [
|
|
20642
|
+
'responseMimeType',
|
|
20643
|
+
]);
|
|
20644
|
+
if (fromResponseMimeType != null) {
|
|
20645
|
+
setValueByPath(toObject, ['responseMimeType'], fromResponseMimeType);
|
|
20646
|
+
}
|
|
20647
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
20648
|
+
'responseModalities',
|
|
20649
|
+
]);
|
|
20650
|
+
if (fromResponseModalities != null) {
|
|
20651
|
+
setValueByPath(toObject, ['responseModalities'], fromResponseModalities);
|
|
20652
|
+
}
|
|
20653
|
+
const fromResponseSchema = getValueByPath(fromObject, [
|
|
20654
|
+
'responseSchema',
|
|
20655
|
+
]);
|
|
20656
|
+
if (fromResponseSchema != null) {
|
|
20657
|
+
setValueByPath(toObject, ['responseSchema'], fromResponseSchema);
|
|
20658
|
+
}
|
|
20659
|
+
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
20660
|
+
'routingConfig',
|
|
20661
|
+
]);
|
|
20662
|
+
if (fromRoutingConfig != null) {
|
|
20663
|
+
setValueByPath(toObject, ['routingConfig'], fromRoutingConfig);
|
|
20664
|
+
}
|
|
20665
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
20666
|
+
if (fromSeed != null) {
|
|
20667
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
20668
|
+
}
|
|
20669
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
20670
|
+
if (fromSpeechConfig != null) {
|
|
20671
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
20672
|
+
}
|
|
20673
|
+
const fromStopSequences = getValueByPath(fromObject, [
|
|
20674
|
+
'stopSequences',
|
|
20675
|
+
]);
|
|
20676
|
+
if (fromStopSequences != null) {
|
|
20677
|
+
setValueByPath(toObject, ['stopSequences'], fromStopSequences);
|
|
20678
|
+
}
|
|
20679
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
20680
|
+
if (fromTemperature != null) {
|
|
20681
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
20682
|
+
}
|
|
20683
|
+
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
20684
|
+
'thinkingConfig',
|
|
20685
|
+
]);
|
|
20686
|
+
if (fromThinkingConfig != null) {
|
|
20687
|
+
setValueByPath(toObject, ['thinkingConfig'], fromThinkingConfig);
|
|
20688
|
+
}
|
|
20689
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
20690
|
+
if (fromTopK != null) {
|
|
20691
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
20692
|
+
}
|
|
20693
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
20694
|
+
if (fromTopP != null) {
|
|
20695
|
+
setValueByPath(toObject, ['topP'], fromTopP);
|
|
20696
|
+
}
|
|
20697
|
+
return toObject;
|
|
20698
|
+
}
|
|
20230
20699
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
20231
20700
|
const toObject = {};
|
|
20232
20701
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -20352,6 +20821,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20352
20821
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20353
20822
|
}
|
|
20354
20823
|
}
|
|
20824
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
20825
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
20826
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
20827
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
20828
|
+
}
|
|
20829
|
+
}
|
|
20355
20830
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20356
20831
|
'config',
|
|
20357
20832
|
'method',
|
|
@@ -20383,6 +20858,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20383
20858
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20384
20859
|
}
|
|
20385
20860
|
}
|
|
20861
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
20862
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
20863
|
+
'vertexDatasetResource',
|
|
20864
|
+
]);
|
|
20865
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
20866
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
20867
|
+
}
|
|
20868
|
+
}
|
|
20386
20869
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20387
20870
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20388
20871
|
}
|
|
@@ -20440,7 +20923,7 @@ function tuningJobFromMldev(fromObject, rootObject) {
|
|
|
20440
20923
|
}
|
|
20441
20924
|
return toObject;
|
|
20442
20925
|
}
|
|
20443
|
-
function tuningJobFromVertex(fromObject,
|
|
20926
|
+
function tuningJobFromVertex(fromObject, rootObject) {
|
|
20444
20927
|
const toObject = {};
|
|
20445
20928
|
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
20446
20929
|
'sdkHttpResponse',
|
|
@@ -20510,7 +20993,7 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20510
20993
|
'distillationSpec',
|
|
20511
20994
|
]);
|
|
20512
20995
|
if (fromDistillationSpec != null) {
|
|
20513
|
-
setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
|
|
20996
|
+
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20514
20997
|
}
|
|
20515
20998
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20516
20999
|
'tuningDataStats',
|
|
@@ -20594,18 +21077,24 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20594
21077
|
if (fromVeoTuningSpec != null) {
|
|
20595
21078
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
20596
21079
|
}
|
|
20597
|
-
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20598
|
-
'distillationSamplingSpec',
|
|
20599
|
-
]);
|
|
20600
|
-
if (fromDistillationSamplingSpec != null) {
|
|
20601
|
-
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20602
|
-
}
|
|
20603
21080
|
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20604
21081
|
'tuningJobMetadata',
|
|
20605
21082
|
]);
|
|
20606
21083
|
if (fromTuningJobMetadata != null) {
|
|
20607
21084
|
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20608
21085
|
}
|
|
21086
|
+
const fromVeoLoraTuningSpec = getValueByPath(fromObject, [
|
|
21087
|
+
'veoLoraTuningSpec',
|
|
21088
|
+
]);
|
|
21089
|
+
if (fromVeoLoraTuningSpec != null) {
|
|
21090
|
+
setValueByPath(toObject, ['veoLoraTuningSpec'], fromVeoLoraTuningSpec);
|
|
21091
|
+
}
|
|
21092
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
21093
|
+
'distillationSamplingSpec',
|
|
21094
|
+
]);
|
|
21095
|
+
if (fromDistillationSamplingSpec != null) {
|
|
21096
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], distillationSamplingSpecFromVertex(fromDistillationSamplingSpec));
|
|
21097
|
+
}
|
|
20609
21098
|
return toObject;
|
|
20610
21099
|
}
|
|
20611
21100
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|