@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/web/index.mjs
CHANGED
|
@@ -586,18 +586,6 @@ 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 = {}));
|
|
601
589
|
/** Outcome of the code execution. */
|
|
602
590
|
var Outcome;
|
|
603
591
|
(function (Outcome) {
|
|
@@ -606,18 +594,30 @@ var Outcome;
|
|
|
606
594
|
*/
|
|
607
595
|
Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
|
|
608
596
|
/**
|
|
609
|
-
* Code execution completed successfully.
|
|
597
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
610
598
|
*/
|
|
611
599
|
Outcome["OUTCOME_OK"] = "OUTCOME_OK";
|
|
612
600
|
/**
|
|
613
|
-
* Code execution
|
|
601
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
614
602
|
*/
|
|
615
603
|
Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
|
|
616
604
|
/**
|
|
617
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
605
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
618
606
|
*/
|
|
619
607
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
620
608
|
})(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) {
|
|
@@ -685,6 +685,14 @@ var Environment;
|
|
|
685
685
|
* Operates in a web browser.
|
|
686
686
|
*/
|
|
687
687
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
688
|
+
/**
|
|
689
|
+
* Operates in a mobile environment.
|
|
690
|
+
*/
|
|
691
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
692
|
+
/**
|
|
693
|
+
* Operates in a desktop environment.
|
|
694
|
+
*/
|
|
695
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
688
696
|
})(Environment || (Environment = {}));
|
|
689
697
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
690
698
|
var AuthType;
|
|
@@ -816,30 +824,6 @@ var DynamicRetrievalConfigMode;
|
|
|
816
824
|
*/
|
|
817
825
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
818
826
|
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
819
|
-
/** Function calling mode. */
|
|
820
|
-
var FunctionCallingConfigMode;
|
|
821
|
-
(function (FunctionCallingConfigMode) {
|
|
822
|
-
/**
|
|
823
|
-
* Unspecified function calling mode. This value should not be used.
|
|
824
|
-
*/
|
|
825
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
826
|
-
/**
|
|
827
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
828
|
-
*/
|
|
829
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
830
|
-
/**
|
|
831
|
-
* 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".
|
|
832
|
-
*/
|
|
833
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
834
|
-
/**
|
|
835
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
836
|
-
*/
|
|
837
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
838
|
-
/**
|
|
839
|
-
* 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".
|
|
840
|
-
*/
|
|
841
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
842
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
843
827
|
/** The number of thoughts tokens that the model should generate. */
|
|
844
828
|
var ThinkingLevel;
|
|
845
829
|
(function (ThinkingLevel) {
|
|
@@ -988,6 +972,30 @@ var HarmBlockThreshold;
|
|
|
988
972
|
*/
|
|
989
973
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
990
974
|
})(HarmBlockThreshold || (HarmBlockThreshold = {}));
|
|
975
|
+
/** Function calling mode. */
|
|
976
|
+
var FunctionCallingConfigMode;
|
|
977
|
+
(function (FunctionCallingConfigMode) {
|
|
978
|
+
/**
|
|
979
|
+
* Unspecified function calling mode. This value should not be used.
|
|
980
|
+
*/
|
|
981
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
982
|
+
/**
|
|
983
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
984
|
+
*/
|
|
985
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
986
|
+
/**
|
|
987
|
+
* 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".
|
|
988
|
+
*/
|
|
989
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
990
|
+
/**
|
|
991
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
992
|
+
*/
|
|
993
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
994
|
+
/**
|
|
995
|
+
* 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".
|
|
996
|
+
*/
|
|
997
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
998
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
991
999
|
/** Output only. The reason why the model stopped generating tokens.
|
|
992
1000
|
|
|
993
1001
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1470,7 +1478,23 @@ var PairwiseChoice;
|
|
|
1470
1478
|
*/
|
|
1471
1479
|
PairwiseChoice["TIE"] = "TIE";
|
|
1472
1480
|
})(PairwiseChoice || (PairwiseChoice = {}));
|
|
1473
|
-
/** The tuning
|
|
1481
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
1482
|
+
var TuningSpeed;
|
|
1483
|
+
(function (TuningSpeed) {
|
|
1484
|
+
/**
|
|
1485
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
1486
|
+
*/
|
|
1487
|
+
TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
|
|
1488
|
+
/**
|
|
1489
|
+
* Regular tuning speed.
|
|
1490
|
+
*/
|
|
1491
|
+
TuningSpeed["REGULAR"] = "REGULAR";
|
|
1492
|
+
/**
|
|
1493
|
+
* Fast tuning speed.
|
|
1494
|
+
*/
|
|
1495
|
+
TuningSpeed["FAST"] = "FAST";
|
|
1496
|
+
})(TuningSpeed || (TuningSpeed = {}));
|
|
1497
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
1474
1498
|
var TuningTask;
|
|
1475
1499
|
(function (TuningTask) {
|
|
1476
1500
|
/**
|
|
@@ -1490,6 +1514,22 @@ var TuningTask;
|
|
|
1490
1514
|
*/
|
|
1491
1515
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1492
1516
|
})(TuningTask || (TuningTask = {}));
|
|
1517
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
1518
|
+
var VideoOrientation;
|
|
1519
|
+
(function (VideoOrientation) {
|
|
1520
|
+
/**
|
|
1521
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
1522
|
+
*/
|
|
1523
|
+
VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
|
|
1524
|
+
/**
|
|
1525
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
1526
|
+
*/
|
|
1527
|
+
VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
|
|
1528
|
+
/**
|
|
1529
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
1530
|
+
*/
|
|
1531
|
+
VideoOrientation["PORTRAIT"] = "PORTRAIT";
|
|
1532
|
+
})(VideoOrientation || (VideoOrientation = {}));
|
|
1493
1533
|
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1494
1534
|
var DocumentState;
|
|
1495
1535
|
(function (DocumentState) {
|
|
@@ -1789,6 +1829,10 @@ var TuningMethod;
|
|
|
1789
1829
|
* Distillation tuning.
|
|
1790
1830
|
*/
|
|
1791
1831
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1832
|
+
/**
|
|
1833
|
+
* Reinforcement tuning.
|
|
1834
|
+
*/
|
|
1835
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1792
1836
|
})(TuningMethod || (TuningMethod = {}));
|
|
1793
1837
|
/** State for the lifecycle of a File. */
|
|
1794
1838
|
var FileState;
|
|
@@ -5110,6 +5154,7 @@ var PagedItem;
|
|
|
5110
5154
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5111
5155
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5112
5156
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5157
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5113
5158
|
})(PagedItem || (PagedItem = {}));
|
|
5114
5159
|
/**
|
|
5115
5160
|
* Pager class for iterating through paginated results.
|
|
@@ -5830,6 +5875,21 @@ function blobToMldev$3(fromObject) {
|
|
|
5830
5875
|
}
|
|
5831
5876
|
return toObject;
|
|
5832
5877
|
}
|
|
5878
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
5879
|
+
const toObject = {};
|
|
5880
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5881
|
+
if (fromOutcome != null) {
|
|
5882
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
5883
|
+
}
|
|
5884
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
5885
|
+
if (fromOutput != null) {
|
|
5886
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
5887
|
+
}
|
|
5888
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
5889
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5890
|
+
}
|
|
5891
|
+
return toObject;
|
|
5892
|
+
}
|
|
5833
5893
|
function contentToMldev$3(fromObject) {
|
|
5834
5894
|
const toObject = {};
|
|
5835
5895
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -6025,6 +6085,21 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6025
6085
|
}
|
|
6026
6086
|
return toObject;
|
|
6027
6087
|
}
|
|
6088
|
+
function executableCodeToVertex$2(fromObject) {
|
|
6089
|
+
const toObject = {};
|
|
6090
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6091
|
+
if (fromCode != null) {
|
|
6092
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
6093
|
+
}
|
|
6094
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
6095
|
+
if (fromLanguage != null) {
|
|
6096
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
6097
|
+
}
|
|
6098
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
6099
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6100
|
+
}
|
|
6101
|
+
return toObject;
|
|
6102
|
+
}
|
|
6028
6103
|
function fileDataToMldev$3(fromObject) {
|
|
6029
6104
|
const toObject = {};
|
|
6030
6105
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6308,13 +6383,13 @@ function partToVertex$2(fromObject) {
|
|
|
6308
6383
|
'codeExecutionResult',
|
|
6309
6384
|
]);
|
|
6310
6385
|
if (fromCodeExecutionResult != null) {
|
|
6311
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6386
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
6312
6387
|
}
|
|
6313
6388
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6314
6389
|
'executableCode',
|
|
6315
6390
|
]);
|
|
6316
6391
|
if (fromExecutableCode != null) {
|
|
6317
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6392
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
6318
6393
|
}
|
|
6319
6394
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6320
6395
|
if (fromFileData != null) {
|
|
@@ -7872,6 +7947,21 @@ function blobToMldev$2(fromObject) {
|
|
|
7872
7947
|
}
|
|
7873
7948
|
return toObject;
|
|
7874
7949
|
}
|
|
7950
|
+
function codeExecutionResultToVertex$1(fromObject) {
|
|
7951
|
+
const toObject = {};
|
|
7952
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7953
|
+
if (fromOutcome != null) {
|
|
7954
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
7955
|
+
}
|
|
7956
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
7957
|
+
if (fromOutput != null) {
|
|
7958
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
7959
|
+
}
|
|
7960
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
7961
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
7962
|
+
}
|
|
7963
|
+
return toObject;
|
|
7964
|
+
}
|
|
7875
7965
|
function contentToMldev$2(fromObject) {
|
|
7876
7966
|
const toObject = {};
|
|
7877
7967
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -7908,6 +7998,21 @@ function contentToVertex$1(fromObject) {
|
|
|
7908
7998
|
}
|
|
7909
7999
|
return toObject;
|
|
7910
8000
|
}
|
|
8001
|
+
function executableCodeToVertex$1(fromObject) {
|
|
8002
|
+
const toObject = {};
|
|
8003
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8004
|
+
if (fromCode != null) {
|
|
8005
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
8006
|
+
}
|
|
8007
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
8008
|
+
if (fromLanguage != null) {
|
|
8009
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
8010
|
+
}
|
|
8011
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
8012
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8013
|
+
}
|
|
8014
|
+
return toObject;
|
|
8015
|
+
}
|
|
7911
8016
|
function fileDataToMldev$2(fromObject) {
|
|
7912
8017
|
const toObject = {};
|
|
7913
8018
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -8647,13 +8752,13 @@ function partToVertex$1(fromObject) {
|
|
|
8647
8752
|
'codeExecutionResult',
|
|
8648
8753
|
]);
|
|
8649
8754
|
if (fromCodeExecutionResult != null) {
|
|
8650
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8755
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
8651
8756
|
}
|
|
8652
8757
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8653
8758
|
'executableCode',
|
|
8654
8759
|
]);
|
|
8655
8760
|
if (fromExecutableCode != null) {
|
|
8656
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8761
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
8657
8762
|
}
|
|
8658
8763
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8659
8764
|
if (fromFileData != null) {
|
|
@@ -9085,6 +9190,21 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9085
9190
|
}
|
|
9086
9191
|
return toObject;
|
|
9087
9192
|
}
|
|
9193
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9194
|
+
const toObject = {};
|
|
9195
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9196
|
+
if (fromOutcome != null) {
|
|
9197
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
9198
|
+
}
|
|
9199
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
9200
|
+
if (fromOutput != null) {
|
|
9201
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
9202
|
+
}
|
|
9203
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9204
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9205
|
+
}
|
|
9206
|
+
return toObject;
|
|
9207
|
+
}
|
|
9088
9208
|
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
9089
9209
|
const toObject = {};
|
|
9090
9210
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -9797,6 +9917,21 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9797
9917
|
}
|
|
9798
9918
|
return toObject;
|
|
9799
9919
|
}
|
|
9920
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
9921
|
+
const toObject = {};
|
|
9922
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9923
|
+
if (fromCode != null) {
|
|
9924
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
9925
|
+
}
|
|
9926
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
9927
|
+
if (fromLanguage != null) {
|
|
9928
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
9929
|
+
}
|
|
9930
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9931
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9932
|
+
}
|
|
9933
|
+
return toObject;
|
|
9934
|
+
}
|
|
9800
9935
|
function fileDataToMldev$1(fromObject, _rootObject) {
|
|
9801
9936
|
const toObject = {};
|
|
9802
9937
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -11675,7 +11810,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11675
11810
|
}
|
|
11676
11811
|
return toObject;
|
|
11677
11812
|
}
|
|
11678
|
-
function partToVertex(fromObject,
|
|
11813
|
+
function partToVertex(fromObject, rootObject) {
|
|
11679
11814
|
const toObject = {};
|
|
11680
11815
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11681
11816
|
'mediaResolution',
|
|
@@ -11687,13 +11822,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
11687
11822
|
'codeExecutionResult',
|
|
11688
11823
|
]);
|
|
11689
11824
|
if (fromCodeExecutionResult != null) {
|
|
11690
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
11825
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11691
11826
|
}
|
|
11692
11827
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11693
11828
|
'executableCode',
|
|
11694
11829
|
]);
|
|
11695
11830
|
if (fromExecutableCode != null) {
|
|
11696
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
11831
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11697
11832
|
}
|
|
11698
11833
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11699
11834
|
if (fromFileData != null) {
|
|
@@ -12793,7 +12928,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12793
12928
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12794
12929
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12795
12930
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12796
|
-
const SDK_VERSION = '2.
|
|
12931
|
+
const SDK_VERSION = '2.7.0'; // x-release-please-version
|
|
12797
12932
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12798
12933
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12799
12934
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -19707,6 +19842,24 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19707
19842
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19708
19843
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19709
19844
|
}
|
|
19845
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
19846
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19847
|
+
}
|
|
19848
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
19849
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19850
|
+
}
|
|
19851
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
19852
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19853
|
+
}
|
|
19854
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
19855
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19856
|
+
}
|
|
19857
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
19858
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19859
|
+
}
|
|
19860
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
19861
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19862
|
+
}
|
|
19710
19863
|
return toObject;
|
|
19711
19864
|
}
|
|
19712
19865
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -19742,6 +19895,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19742
19895
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19743
19896
|
}
|
|
19744
19897
|
}
|
|
19898
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
19899
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
19900
|
+
'validationDataset',
|
|
19901
|
+
]);
|
|
19902
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
19903
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19904
|
+
}
|
|
19905
|
+
}
|
|
19745
19906
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19746
19907
|
'tunedModelDisplayName',
|
|
19747
19908
|
]);
|
|
@@ -19777,6 +19938,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19777
19938
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19778
19939
|
}
|
|
19779
19940
|
}
|
|
19941
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
19942
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
19943
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
19944
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19945
|
+
}
|
|
19946
|
+
}
|
|
19780
19947
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
19781
19948
|
'config',
|
|
19782
19949
|
'method',
|
|
@@ -19812,6 +19979,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19812
19979
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
19813
19980
|
}
|
|
19814
19981
|
}
|
|
19982
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
19983
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
19984
|
+
'learningRateMultiplier',
|
|
19985
|
+
]);
|
|
19986
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
19987
|
+
setValueByPath(parentObject, [
|
|
19988
|
+
'reinforcementTuningSpec',
|
|
19989
|
+
'hyperParameters',
|
|
19990
|
+
'learningRateMultiplier',
|
|
19991
|
+
], fromLearningRateMultiplier);
|
|
19992
|
+
}
|
|
19993
|
+
}
|
|
19815
19994
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
19816
19995
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
19817
19996
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -19865,6 +20044,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19865
20044
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
19866
20045
|
}
|
|
19867
20046
|
}
|
|
20047
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20048
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20049
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20050
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20051
|
+
}
|
|
20052
|
+
}
|
|
19868
20053
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
19869
20054
|
'config',
|
|
19870
20055
|
'method',
|
|
@@ -19909,6 +20094,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19909
20094
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
19910
20095
|
}
|
|
19911
20096
|
}
|
|
20097
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20098
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20099
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20100
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20101
|
+
}
|
|
20102
|
+
}
|
|
19912
20103
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
19913
20104
|
'config',
|
|
19914
20105
|
'method',
|
|
@@ -19968,6 +20159,40 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19968
20159
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
19969
20160
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
19970
20161
|
}
|
|
20162
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20163
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20164
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20165
|
+
}
|
|
20166
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20167
|
+
'compositeRewardConfig',
|
|
20168
|
+
]);
|
|
20169
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20170
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20171
|
+
}
|
|
20172
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20173
|
+
'samplesPerPrompt',
|
|
20174
|
+
]);
|
|
20175
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20176
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20177
|
+
}
|
|
20178
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20179
|
+
'evaluateInterval',
|
|
20180
|
+
]);
|
|
20181
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20182
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20183
|
+
}
|
|
20184
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20185
|
+
'checkpointInterval',
|
|
20186
|
+
]);
|
|
20187
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20188
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20189
|
+
}
|
|
20190
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20191
|
+
'maxOutputTokens',
|
|
20192
|
+
]);
|
|
20193
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20194
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20195
|
+
}
|
|
19971
20196
|
return toObject;
|
|
19972
20197
|
}
|
|
19973
20198
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20018,6 +20243,250 @@ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
|
|
|
20018
20243
|
}
|
|
20019
20244
|
return toObject;
|
|
20020
20245
|
}
|
|
20246
|
+
function distillationHyperParametersFromVertex(fromObject, rootObject) {
|
|
20247
|
+
const toObject = {};
|
|
20248
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20249
|
+
if (fromAdapterSize != null) {
|
|
20250
|
+
setValueByPath(toObject, ['adapterSize'], fromAdapterSize);
|
|
20251
|
+
}
|
|
20252
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20253
|
+
if (fromEpochCount != null) {
|
|
20254
|
+
setValueByPath(toObject, ['epochCount'], fromEpochCount);
|
|
20255
|
+
}
|
|
20256
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20257
|
+
'learningRateMultiplier',
|
|
20258
|
+
]);
|
|
20259
|
+
if (fromLearningRateMultiplier != null) {
|
|
20260
|
+
setValueByPath(toObject, ['learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20261
|
+
}
|
|
20262
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
20263
|
+
'generationConfig',
|
|
20264
|
+
]);
|
|
20265
|
+
if (fromGenerationConfig != null) {
|
|
20266
|
+
setValueByPath(toObject, ['generationConfig'], generationConfigFromVertex(fromGenerationConfig));
|
|
20267
|
+
}
|
|
20268
|
+
const fromLearningRate = getValueByPath(fromObject, ['learningRate']);
|
|
20269
|
+
if (fromLearningRate != null) {
|
|
20270
|
+
setValueByPath(toObject, ['learningRate'], fromLearningRate);
|
|
20271
|
+
}
|
|
20272
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20273
|
+
if (fromBatchSize != null) {
|
|
20274
|
+
setValueByPath(toObject, ['batchSize'], fromBatchSize);
|
|
20275
|
+
}
|
|
20276
|
+
return toObject;
|
|
20277
|
+
}
|
|
20278
|
+
function distillationSamplingSpecFromVertex(fromObject, rootObject) {
|
|
20279
|
+
const toObject = {};
|
|
20280
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20281
|
+
'baseTeacherModel',
|
|
20282
|
+
]);
|
|
20283
|
+
if (fromBaseTeacherModel != null) {
|
|
20284
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20285
|
+
}
|
|
20286
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20287
|
+
'tunedTeacherModelSource',
|
|
20288
|
+
]);
|
|
20289
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20290
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20291
|
+
}
|
|
20292
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20293
|
+
'validationDatasetUri',
|
|
20294
|
+
]);
|
|
20295
|
+
if (fromValidationDatasetUri != null) {
|
|
20296
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20297
|
+
}
|
|
20298
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20299
|
+
'promptDatasetUri',
|
|
20300
|
+
]);
|
|
20301
|
+
if (fromPromptDatasetUri != null) {
|
|
20302
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20303
|
+
}
|
|
20304
|
+
const fromHyperparameters = getValueByPath(fromObject, [
|
|
20305
|
+
'hyperparameters',
|
|
20306
|
+
]);
|
|
20307
|
+
if (fromHyperparameters != null) {
|
|
20308
|
+
setValueByPath(toObject, ['hyperparameters'], distillationHyperParametersFromVertex(fromHyperparameters));
|
|
20309
|
+
}
|
|
20310
|
+
return toObject;
|
|
20311
|
+
}
|
|
20312
|
+
function distillationSpecFromVertex(fromObject, rootObject) {
|
|
20313
|
+
const toObject = {};
|
|
20314
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20315
|
+
'promptDatasetUri',
|
|
20316
|
+
]);
|
|
20317
|
+
if (fromPromptDatasetUri != null) {
|
|
20318
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20319
|
+
}
|
|
20320
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20321
|
+
'baseTeacherModel',
|
|
20322
|
+
]);
|
|
20323
|
+
if (fromBaseTeacherModel != null) {
|
|
20324
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20325
|
+
}
|
|
20326
|
+
const fromHyperParameters = getValueByPath(fromObject, [
|
|
20327
|
+
'hyperParameters',
|
|
20328
|
+
]);
|
|
20329
|
+
if (fromHyperParameters != null) {
|
|
20330
|
+
setValueByPath(toObject, ['hyperParameters'], distillationHyperParametersFromVertex(fromHyperParameters));
|
|
20331
|
+
}
|
|
20332
|
+
const fromPipelineRootDirectory = getValueByPath(fromObject, [
|
|
20333
|
+
'pipelineRootDirectory',
|
|
20334
|
+
]);
|
|
20335
|
+
if (fromPipelineRootDirectory != null) {
|
|
20336
|
+
setValueByPath(toObject, ['pipelineRootDirectory'], fromPipelineRootDirectory);
|
|
20337
|
+
}
|
|
20338
|
+
const fromStudentModel = getValueByPath(fromObject, ['studentModel']);
|
|
20339
|
+
if (fromStudentModel != null) {
|
|
20340
|
+
setValueByPath(toObject, ['studentModel'], fromStudentModel);
|
|
20341
|
+
}
|
|
20342
|
+
const fromTrainingDatasetUri = getValueByPath(fromObject, [
|
|
20343
|
+
'trainingDatasetUri',
|
|
20344
|
+
]);
|
|
20345
|
+
if (fromTrainingDatasetUri != null) {
|
|
20346
|
+
setValueByPath(toObject, ['trainingDatasetUri'], fromTrainingDatasetUri);
|
|
20347
|
+
}
|
|
20348
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20349
|
+
'tunedTeacherModelSource',
|
|
20350
|
+
]);
|
|
20351
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20352
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20353
|
+
}
|
|
20354
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20355
|
+
'validationDatasetUri',
|
|
20356
|
+
]);
|
|
20357
|
+
if (fromValidationDatasetUri != null) {
|
|
20358
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20359
|
+
}
|
|
20360
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
20361
|
+
if (fromTuningMode != null) {
|
|
20362
|
+
setValueByPath(toObject, ['tuningMode'], fromTuningMode);
|
|
20363
|
+
}
|
|
20364
|
+
return toObject;
|
|
20365
|
+
}
|
|
20366
|
+
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20367
|
+
const toObject = {};
|
|
20368
|
+
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
20369
|
+
'modelConfig',
|
|
20370
|
+
]);
|
|
20371
|
+
if (fromModelSelectionConfig != null) {
|
|
20372
|
+
setValueByPath(toObject, ['modelSelectionConfig'], fromModelSelectionConfig);
|
|
20373
|
+
}
|
|
20374
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
20375
|
+
'responseJsonSchema',
|
|
20376
|
+
]);
|
|
20377
|
+
if (fromResponseJsonSchema != null) {
|
|
20378
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
20379
|
+
}
|
|
20380
|
+
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
20381
|
+
'audioTimestamp',
|
|
20382
|
+
]);
|
|
20383
|
+
if (fromAudioTimestamp != null) {
|
|
20384
|
+
setValueByPath(toObject, ['audioTimestamp'], fromAudioTimestamp);
|
|
20385
|
+
}
|
|
20386
|
+
const fromCandidateCount = getValueByPath(fromObject, [
|
|
20387
|
+
'candidateCount',
|
|
20388
|
+
]);
|
|
20389
|
+
if (fromCandidateCount != null) {
|
|
20390
|
+
setValueByPath(toObject, ['candidateCount'], fromCandidateCount);
|
|
20391
|
+
}
|
|
20392
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
20393
|
+
'enableAffectiveDialog',
|
|
20394
|
+
]);
|
|
20395
|
+
if (fromEnableAffectiveDialog != null) {
|
|
20396
|
+
setValueByPath(toObject, ['enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
20397
|
+
}
|
|
20398
|
+
const fromFrequencyPenalty = getValueByPath(fromObject, [
|
|
20399
|
+
'frequencyPenalty',
|
|
20400
|
+
]);
|
|
20401
|
+
if (fromFrequencyPenalty != null) {
|
|
20402
|
+
setValueByPath(toObject, ['frequencyPenalty'], fromFrequencyPenalty);
|
|
20403
|
+
}
|
|
20404
|
+
const fromLogprobs = getValueByPath(fromObject, ['logprobs']);
|
|
20405
|
+
if (fromLogprobs != null) {
|
|
20406
|
+
setValueByPath(toObject, ['logprobs'], fromLogprobs);
|
|
20407
|
+
}
|
|
20408
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20409
|
+
'maxOutputTokens',
|
|
20410
|
+
]);
|
|
20411
|
+
if (fromMaxOutputTokens != null) {
|
|
20412
|
+
setValueByPath(toObject, ['maxOutputTokens'], fromMaxOutputTokens);
|
|
20413
|
+
}
|
|
20414
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20415
|
+
'mediaResolution',
|
|
20416
|
+
]);
|
|
20417
|
+
if (fromMediaResolution != null) {
|
|
20418
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20419
|
+
}
|
|
20420
|
+
const fromPresencePenalty = getValueByPath(fromObject, [
|
|
20421
|
+
'presencePenalty',
|
|
20422
|
+
]);
|
|
20423
|
+
if (fromPresencePenalty != null) {
|
|
20424
|
+
setValueByPath(toObject, ['presencePenalty'], fromPresencePenalty);
|
|
20425
|
+
}
|
|
20426
|
+
const fromResponseLogprobs = getValueByPath(fromObject, [
|
|
20427
|
+
'responseLogprobs',
|
|
20428
|
+
]);
|
|
20429
|
+
if (fromResponseLogprobs != null) {
|
|
20430
|
+
setValueByPath(toObject, ['responseLogprobs'], fromResponseLogprobs);
|
|
20431
|
+
}
|
|
20432
|
+
const fromResponseMimeType = getValueByPath(fromObject, [
|
|
20433
|
+
'responseMimeType',
|
|
20434
|
+
]);
|
|
20435
|
+
if (fromResponseMimeType != null) {
|
|
20436
|
+
setValueByPath(toObject, ['responseMimeType'], fromResponseMimeType);
|
|
20437
|
+
}
|
|
20438
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
20439
|
+
'responseModalities',
|
|
20440
|
+
]);
|
|
20441
|
+
if (fromResponseModalities != null) {
|
|
20442
|
+
setValueByPath(toObject, ['responseModalities'], fromResponseModalities);
|
|
20443
|
+
}
|
|
20444
|
+
const fromResponseSchema = getValueByPath(fromObject, [
|
|
20445
|
+
'responseSchema',
|
|
20446
|
+
]);
|
|
20447
|
+
if (fromResponseSchema != null) {
|
|
20448
|
+
setValueByPath(toObject, ['responseSchema'], fromResponseSchema);
|
|
20449
|
+
}
|
|
20450
|
+
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
20451
|
+
'routingConfig',
|
|
20452
|
+
]);
|
|
20453
|
+
if (fromRoutingConfig != null) {
|
|
20454
|
+
setValueByPath(toObject, ['routingConfig'], fromRoutingConfig);
|
|
20455
|
+
}
|
|
20456
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
20457
|
+
if (fromSeed != null) {
|
|
20458
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
20459
|
+
}
|
|
20460
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
20461
|
+
if (fromSpeechConfig != null) {
|
|
20462
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
20463
|
+
}
|
|
20464
|
+
const fromStopSequences = getValueByPath(fromObject, [
|
|
20465
|
+
'stopSequences',
|
|
20466
|
+
]);
|
|
20467
|
+
if (fromStopSequences != null) {
|
|
20468
|
+
setValueByPath(toObject, ['stopSequences'], fromStopSequences);
|
|
20469
|
+
}
|
|
20470
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
20471
|
+
if (fromTemperature != null) {
|
|
20472
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
20473
|
+
}
|
|
20474
|
+
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
20475
|
+
'thinkingConfig',
|
|
20476
|
+
]);
|
|
20477
|
+
if (fromThinkingConfig != null) {
|
|
20478
|
+
setValueByPath(toObject, ['thinkingConfig'], fromThinkingConfig);
|
|
20479
|
+
}
|
|
20480
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
20481
|
+
if (fromTopK != null) {
|
|
20482
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
20483
|
+
}
|
|
20484
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
20485
|
+
if (fromTopP != null) {
|
|
20486
|
+
setValueByPath(toObject, ['topP'], fromTopP);
|
|
20487
|
+
}
|
|
20488
|
+
return toObject;
|
|
20489
|
+
}
|
|
20021
20490
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
20022
20491
|
const toObject = {};
|
|
20023
20492
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -20143,6 +20612,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20143
20612
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20144
20613
|
}
|
|
20145
20614
|
}
|
|
20615
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
20616
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
20617
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
20618
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
20619
|
+
}
|
|
20620
|
+
}
|
|
20146
20621
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20147
20622
|
'config',
|
|
20148
20623
|
'method',
|
|
@@ -20174,6 +20649,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20174
20649
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20175
20650
|
}
|
|
20176
20651
|
}
|
|
20652
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
20653
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
20654
|
+
'vertexDatasetResource',
|
|
20655
|
+
]);
|
|
20656
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
20657
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
20658
|
+
}
|
|
20659
|
+
}
|
|
20177
20660
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20178
20661
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20179
20662
|
}
|
|
@@ -20231,7 +20714,7 @@ function tuningJobFromMldev(fromObject, rootObject) {
|
|
|
20231
20714
|
}
|
|
20232
20715
|
return toObject;
|
|
20233
20716
|
}
|
|
20234
|
-
function tuningJobFromVertex(fromObject,
|
|
20717
|
+
function tuningJobFromVertex(fromObject, rootObject) {
|
|
20235
20718
|
const toObject = {};
|
|
20236
20719
|
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
20237
20720
|
'sdkHttpResponse',
|
|
@@ -20301,7 +20784,7 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20301
20784
|
'distillationSpec',
|
|
20302
20785
|
]);
|
|
20303
20786
|
if (fromDistillationSpec != null) {
|
|
20304
|
-
setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
|
|
20787
|
+
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20305
20788
|
}
|
|
20306
20789
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20307
20790
|
'tuningDataStats',
|
|
@@ -20385,18 +20868,24 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20385
20868
|
if (fromVeoTuningSpec != null) {
|
|
20386
20869
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
20387
20870
|
}
|
|
20388
|
-
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20389
|
-
'distillationSamplingSpec',
|
|
20390
|
-
]);
|
|
20391
|
-
if (fromDistillationSamplingSpec != null) {
|
|
20392
|
-
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20393
|
-
}
|
|
20394
20871
|
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20395
20872
|
'tuningJobMetadata',
|
|
20396
20873
|
]);
|
|
20397
20874
|
if (fromTuningJobMetadata != null) {
|
|
20398
20875
|
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20399
20876
|
}
|
|
20877
|
+
const fromVeoLoraTuningSpec = getValueByPath(fromObject, [
|
|
20878
|
+
'veoLoraTuningSpec',
|
|
20879
|
+
]);
|
|
20880
|
+
if (fromVeoLoraTuningSpec != null) {
|
|
20881
|
+
setValueByPath(toObject, ['veoLoraTuningSpec'], fromVeoLoraTuningSpec);
|
|
20882
|
+
}
|
|
20883
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20884
|
+
'distillationSamplingSpec',
|
|
20885
|
+
]);
|
|
20886
|
+
if (fromDistillationSamplingSpec != null) {
|
|
20887
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], distillationSamplingSpecFromVertex(fromDistillationSamplingSpec));
|
|
20888
|
+
}
|
|
20400
20889
|
return toObject;
|
|
20401
20890
|
}
|
|
20402
20891
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|
|
@@ -21108,5 +21597,5 @@ class GoogleGenAI {
|
|
|
21108
21597
|
}
|
|
21109
21598
|
}
|
|
21110
21599
|
|
|
21111
|
-
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, ImageResizeMode, 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 };
|
|
21600
|
+
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, ImageResizeMode, 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, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
21112
21601
|
//# sourceMappingURL=index.mjs.map
|