@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.mjs
CHANGED
|
@@ -594,18 +594,6 @@ function videoFromVertex$1(fromObject) {
|
|
|
594
594
|
* Copyright 2025 Google LLC
|
|
595
595
|
* SPDX-License-Identifier: Apache-2.0
|
|
596
596
|
*/
|
|
597
|
-
/** Programming language of the `code`. */
|
|
598
|
-
var Language;
|
|
599
|
-
(function (Language) {
|
|
600
|
-
/**
|
|
601
|
-
* Unspecified language. This value should not be used.
|
|
602
|
-
*/
|
|
603
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
604
|
-
/**
|
|
605
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
606
|
-
*/
|
|
607
|
-
Language["PYTHON"] = "PYTHON";
|
|
608
|
-
})(Language || (Language = {}));
|
|
609
597
|
/** Outcome of the code execution. */
|
|
610
598
|
var Outcome;
|
|
611
599
|
(function (Outcome) {
|
|
@@ -614,18 +602,30 @@ var Outcome;
|
|
|
614
602
|
*/
|
|
615
603
|
Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
|
|
616
604
|
/**
|
|
617
|
-
* Code execution completed successfully.
|
|
605
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
618
606
|
*/
|
|
619
607
|
Outcome["OUTCOME_OK"] = "OUTCOME_OK";
|
|
620
608
|
/**
|
|
621
|
-
* Code execution
|
|
609
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
622
610
|
*/
|
|
623
611
|
Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
|
|
624
612
|
/**
|
|
625
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
613
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
626
614
|
*/
|
|
627
615
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
628
616
|
})(Outcome || (Outcome = {}));
|
|
617
|
+
/** Programming language of the `code`. */
|
|
618
|
+
var Language;
|
|
619
|
+
(function (Language) {
|
|
620
|
+
/**
|
|
621
|
+
* Unspecified language. This value should not be used.
|
|
622
|
+
*/
|
|
623
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
624
|
+
/**
|
|
625
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
626
|
+
*/
|
|
627
|
+
Language["PYTHON"] = "PYTHON";
|
|
628
|
+
})(Language || (Language = {}));
|
|
629
629
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
630
630
|
var FunctionResponseScheduling;
|
|
631
631
|
(function (FunctionResponseScheduling) {
|
|
@@ -693,6 +693,14 @@ var Environment;
|
|
|
693
693
|
* Operates in a web browser.
|
|
694
694
|
*/
|
|
695
695
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
696
|
+
/**
|
|
697
|
+
* Operates in a mobile environment.
|
|
698
|
+
*/
|
|
699
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
700
|
+
/**
|
|
701
|
+
* Operates in a desktop environment.
|
|
702
|
+
*/
|
|
703
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
696
704
|
})(Environment || (Environment = {}));
|
|
697
705
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
698
706
|
var AuthType;
|
|
@@ -824,30 +832,6 @@ var DynamicRetrievalConfigMode;
|
|
|
824
832
|
*/
|
|
825
833
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
826
834
|
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
827
|
-
/** Function calling mode. */
|
|
828
|
-
var FunctionCallingConfigMode;
|
|
829
|
-
(function (FunctionCallingConfigMode) {
|
|
830
|
-
/**
|
|
831
|
-
* Unspecified function calling mode. This value should not be used.
|
|
832
|
-
*/
|
|
833
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
834
|
-
/**
|
|
835
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
836
|
-
*/
|
|
837
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
838
|
-
/**
|
|
839
|
-
* 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".
|
|
840
|
-
*/
|
|
841
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
842
|
-
/**
|
|
843
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
844
|
-
*/
|
|
845
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
846
|
-
/**
|
|
847
|
-
* 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".
|
|
848
|
-
*/
|
|
849
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
850
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
851
835
|
/** The number of thoughts tokens that the model should generate. */
|
|
852
836
|
var ThinkingLevel;
|
|
853
837
|
(function (ThinkingLevel) {
|
|
@@ -996,6 +980,30 @@ var HarmBlockThreshold;
|
|
|
996
980
|
*/
|
|
997
981
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
998
982
|
})(HarmBlockThreshold || (HarmBlockThreshold = {}));
|
|
983
|
+
/** Function calling mode. */
|
|
984
|
+
var FunctionCallingConfigMode;
|
|
985
|
+
(function (FunctionCallingConfigMode) {
|
|
986
|
+
/**
|
|
987
|
+
* Unspecified function calling mode. This value should not be used.
|
|
988
|
+
*/
|
|
989
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
990
|
+
/**
|
|
991
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
992
|
+
*/
|
|
993
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
994
|
+
/**
|
|
995
|
+
* 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".
|
|
996
|
+
*/
|
|
997
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
998
|
+
/**
|
|
999
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1000
|
+
*/
|
|
1001
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1002
|
+
/**
|
|
1003
|
+
* 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".
|
|
1004
|
+
*/
|
|
1005
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1006
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
999
1007
|
/** Output only. The reason why the model stopped generating tokens.
|
|
1000
1008
|
|
|
1001
1009
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1478,7 +1486,23 @@ var PairwiseChoice;
|
|
|
1478
1486
|
*/
|
|
1479
1487
|
PairwiseChoice["TIE"] = "TIE";
|
|
1480
1488
|
})(PairwiseChoice || (PairwiseChoice = {}));
|
|
1481
|
-
/** The tuning
|
|
1489
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
1490
|
+
var TuningSpeed;
|
|
1491
|
+
(function (TuningSpeed) {
|
|
1492
|
+
/**
|
|
1493
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
1494
|
+
*/
|
|
1495
|
+
TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
|
|
1496
|
+
/**
|
|
1497
|
+
* Regular tuning speed.
|
|
1498
|
+
*/
|
|
1499
|
+
TuningSpeed["REGULAR"] = "REGULAR";
|
|
1500
|
+
/**
|
|
1501
|
+
* Fast tuning speed.
|
|
1502
|
+
*/
|
|
1503
|
+
TuningSpeed["FAST"] = "FAST";
|
|
1504
|
+
})(TuningSpeed || (TuningSpeed = {}));
|
|
1505
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
1482
1506
|
var TuningTask;
|
|
1483
1507
|
(function (TuningTask) {
|
|
1484
1508
|
/**
|
|
@@ -1498,6 +1522,22 @@ var TuningTask;
|
|
|
1498
1522
|
*/
|
|
1499
1523
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1500
1524
|
})(TuningTask || (TuningTask = {}));
|
|
1525
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
1526
|
+
var VideoOrientation;
|
|
1527
|
+
(function (VideoOrientation) {
|
|
1528
|
+
/**
|
|
1529
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
1530
|
+
*/
|
|
1531
|
+
VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
|
|
1532
|
+
/**
|
|
1533
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
1534
|
+
*/
|
|
1535
|
+
VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
|
|
1536
|
+
/**
|
|
1537
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
1538
|
+
*/
|
|
1539
|
+
VideoOrientation["PORTRAIT"] = "PORTRAIT";
|
|
1540
|
+
})(VideoOrientation || (VideoOrientation = {}));
|
|
1501
1541
|
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1502
1542
|
var DocumentState;
|
|
1503
1543
|
(function (DocumentState) {
|
|
@@ -1797,6 +1837,10 @@ var TuningMethod;
|
|
|
1797
1837
|
* Distillation tuning.
|
|
1798
1838
|
*/
|
|
1799
1839
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1840
|
+
/**
|
|
1841
|
+
* Reinforcement tuning.
|
|
1842
|
+
*/
|
|
1843
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1800
1844
|
})(TuningMethod || (TuningMethod = {}));
|
|
1801
1845
|
/** State for the lifecycle of a File. */
|
|
1802
1846
|
var FileState;
|
|
@@ -5118,6 +5162,7 @@ var PagedItem;
|
|
|
5118
5162
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5119
5163
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5120
5164
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5165
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5121
5166
|
})(PagedItem || (PagedItem = {}));
|
|
5122
5167
|
/**
|
|
5123
5168
|
* Pager class for iterating through paginated results.
|
|
@@ -5838,6 +5883,21 @@ function blobToMldev$3(fromObject) {
|
|
|
5838
5883
|
}
|
|
5839
5884
|
return toObject;
|
|
5840
5885
|
}
|
|
5886
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
5887
|
+
const toObject = {};
|
|
5888
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5889
|
+
if (fromOutcome != null) {
|
|
5890
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
5891
|
+
}
|
|
5892
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
5893
|
+
if (fromOutput != null) {
|
|
5894
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
5895
|
+
}
|
|
5896
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
5897
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5898
|
+
}
|
|
5899
|
+
return toObject;
|
|
5900
|
+
}
|
|
5841
5901
|
function contentToMldev$3(fromObject) {
|
|
5842
5902
|
const toObject = {};
|
|
5843
5903
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -6033,6 +6093,21 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6033
6093
|
}
|
|
6034
6094
|
return toObject;
|
|
6035
6095
|
}
|
|
6096
|
+
function executableCodeToVertex$2(fromObject) {
|
|
6097
|
+
const toObject = {};
|
|
6098
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6099
|
+
if (fromCode != null) {
|
|
6100
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
6101
|
+
}
|
|
6102
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
6103
|
+
if (fromLanguage != null) {
|
|
6104
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
6105
|
+
}
|
|
6106
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
6107
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6108
|
+
}
|
|
6109
|
+
return toObject;
|
|
6110
|
+
}
|
|
6036
6111
|
function fileDataToMldev$3(fromObject) {
|
|
6037
6112
|
const toObject = {};
|
|
6038
6113
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6316,13 +6391,13 @@ function partToVertex$2(fromObject) {
|
|
|
6316
6391
|
'codeExecutionResult',
|
|
6317
6392
|
]);
|
|
6318
6393
|
if (fromCodeExecutionResult != null) {
|
|
6319
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6394
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
6320
6395
|
}
|
|
6321
6396
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6322
6397
|
'executableCode',
|
|
6323
6398
|
]);
|
|
6324
6399
|
if (fromExecutableCode != null) {
|
|
6325
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6400
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
6326
6401
|
}
|
|
6327
6402
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6328
6403
|
if (fromFileData != null) {
|
|
@@ -7880,6 +7955,21 @@ function blobToMldev$2(fromObject) {
|
|
|
7880
7955
|
}
|
|
7881
7956
|
return toObject;
|
|
7882
7957
|
}
|
|
7958
|
+
function codeExecutionResultToVertex$1(fromObject) {
|
|
7959
|
+
const toObject = {};
|
|
7960
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7961
|
+
if (fromOutcome != null) {
|
|
7962
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
7963
|
+
}
|
|
7964
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
7965
|
+
if (fromOutput != null) {
|
|
7966
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
7967
|
+
}
|
|
7968
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
7969
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
7970
|
+
}
|
|
7971
|
+
return toObject;
|
|
7972
|
+
}
|
|
7883
7973
|
function contentToMldev$2(fromObject) {
|
|
7884
7974
|
const toObject = {};
|
|
7885
7975
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -7916,6 +8006,21 @@ function contentToVertex$1(fromObject) {
|
|
|
7916
8006
|
}
|
|
7917
8007
|
return toObject;
|
|
7918
8008
|
}
|
|
8009
|
+
function executableCodeToVertex$1(fromObject) {
|
|
8010
|
+
const toObject = {};
|
|
8011
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8012
|
+
if (fromCode != null) {
|
|
8013
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
8014
|
+
}
|
|
8015
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
8016
|
+
if (fromLanguage != null) {
|
|
8017
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
8018
|
+
}
|
|
8019
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
8020
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8021
|
+
}
|
|
8022
|
+
return toObject;
|
|
8023
|
+
}
|
|
7919
8024
|
function fileDataToMldev$2(fromObject) {
|
|
7920
8025
|
const toObject = {};
|
|
7921
8026
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -8655,13 +8760,13 @@ function partToVertex$1(fromObject) {
|
|
|
8655
8760
|
'codeExecutionResult',
|
|
8656
8761
|
]);
|
|
8657
8762
|
if (fromCodeExecutionResult != null) {
|
|
8658
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8763
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
8659
8764
|
}
|
|
8660
8765
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8661
8766
|
'executableCode',
|
|
8662
8767
|
]);
|
|
8663
8768
|
if (fromExecutableCode != null) {
|
|
8664
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8769
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
8665
8770
|
}
|
|
8666
8771
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8667
8772
|
if (fromFileData != null) {
|
|
@@ -9093,6 +9198,21 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9093
9198
|
}
|
|
9094
9199
|
return toObject;
|
|
9095
9200
|
}
|
|
9201
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9202
|
+
const toObject = {};
|
|
9203
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9204
|
+
if (fromOutcome != null) {
|
|
9205
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
9206
|
+
}
|
|
9207
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
9208
|
+
if (fromOutput != null) {
|
|
9209
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
9210
|
+
}
|
|
9211
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9212
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9213
|
+
}
|
|
9214
|
+
return toObject;
|
|
9215
|
+
}
|
|
9096
9216
|
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
9097
9217
|
const toObject = {};
|
|
9098
9218
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -9805,6 +9925,21 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9805
9925
|
}
|
|
9806
9926
|
return toObject;
|
|
9807
9927
|
}
|
|
9928
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
9929
|
+
const toObject = {};
|
|
9930
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9931
|
+
if (fromCode != null) {
|
|
9932
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
9933
|
+
}
|
|
9934
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
9935
|
+
if (fromLanguage != null) {
|
|
9936
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
9937
|
+
}
|
|
9938
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
9939
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9940
|
+
}
|
|
9941
|
+
return toObject;
|
|
9942
|
+
}
|
|
9808
9943
|
function fileDataToMldev$1(fromObject, _rootObject) {
|
|
9809
9944
|
const toObject = {};
|
|
9810
9945
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -11683,7 +11818,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11683
11818
|
}
|
|
11684
11819
|
return toObject;
|
|
11685
11820
|
}
|
|
11686
|
-
function partToVertex(fromObject,
|
|
11821
|
+
function partToVertex(fromObject, rootObject) {
|
|
11687
11822
|
const toObject = {};
|
|
11688
11823
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11689
11824
|
'mediaResolution',
|
|
@@ -11695,13 +11830,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
11695
11830
|
'codeExecutionResult',
|
|
11696
11831
|
]);
|
|
11697
11832
|
if (fromCodeExecutionResult != null) {
|
|
11698
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
11833
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11699
11834
|
}
|
|
11700
11835
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11701
11836
|
'executableCode',
|
|
11702
11837
|
]);
|
|
11703
11838
|
if (fromExecutableCode != null) {
|
|
11704
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
11839
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11705
11840
|
}
|
|
11706
11841
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11707
11842
|
if (fromFileData != null) {
|
|
@@ -12801,7 +12936,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12801
12936
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12802
12937
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12803
12938
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12804
|
-
const SDK_VERSION = '2.
|
|
12939
|
+
const SDK_VERSION = '2.7.0'; // x-release-please-version
|
|
12805
12940
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12806
12941
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12807
12942
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -19894,6 +20029,24 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19894
20029
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19895
20030
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19896
20031
|
}
|
|
20032
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
20033
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20034
|
+
}
|
|
20035
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
20036
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20037
|
+
}
|
|
20038
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
20039
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20040
|
+
}
|
|
20041
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
20042
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20043
|
+
}
|
|
20044
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
20045
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20046
|
+
}
|
|
20047
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
20048
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20049
|
+
}
|
|
19897
20050
|
return toObject;
|
|
19898
20051
|
}
|
|
19899
20052
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -19929,6 +20082,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19929
20082
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19930
20083
|
}
|
|
19931
20084
|
}
|
|
20085
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
20086
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
20087
|
+
'validationDataset',
|
|
20088
|
+
]);
|
|
20089
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
20090
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20091
|
+
}
|
|
20092
|
+
}
|
|
19932
20093
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19933
20094
|
'tunedModelDisplayName',
|
|
19934
20095
|
]);
|
|
@@ -19964,6 +20125,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19964
20125
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19965
20126
|
}
|
|
19966
20127
|
}
|
|
20128
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
20129
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20130
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
20131
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20132
|
+
}
|
|
20133
|
+
}
|
|
19967
20134
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
19968
20135
|
'config',
|
|
19969
20136
|
'method',
|
|
@@ -19999,6 +20166,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19999
20166
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20000
20167
|
}
|
|
20001
20168
|
}
|
|
20169
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
20170
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20171
|
+
'learningRateMultiplier',
|
|
20172
|
+
]);
|
|
20173
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
20174
|
+
setValueByPath(parentObject, [
|
|
20175
|
+
'reinforcementTuningSpec',
|
|
20176
|
+
'hyperParameters',
|
|
20177
|
+
'learningRateMultiplier',
|
|
20178
|
+
], fromLearningRateMultiplier);
|
|
20179
|
+
}
|
|
20180
|
+
}
|
|
20002
20181
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
20003
20182
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
20004
20183
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -20052,6 +20231,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20052
20231
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20053
20232
|
}
|
|
20054
20233
|
}
|
|
20234
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20235
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20236
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20237
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20238
|
+
}
|
|
20239
|
+
}
|
|
20055
20240
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
20056
20241
|
'config',
|
|
20057
20242
|
'method',
|
|
@@ -20096,6 +20281,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20096
20281
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20097
20282
|
}
|
|
20098
20283
|
}
|
|
20284
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20285
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20286
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20287
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20288
|
+
}
|
|
20289
|
+
}
|
|
20099
20290
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
20100
20291
|
'config',
|
|
20101
20292
|
'method',
|
|
@@ -20155,6 +20346,40 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20155
20346
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
20156
20347
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
20157
20348
|
}
|
|
20349
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20350
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20351
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20352
|
+
}
|
|
20353
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20354
|
+
'compositeRewardConfig',
|
|
20355
|
+
]);
|
|
20356
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20357
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20358
|
+
}
|
|
20359
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20360
|
+
'samplesPerPrompt',
|
|
20361
|
+
]);
|
|
20362
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20363
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20364
|
+
}
|
|
20365
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20366
|
+
'evaluateInterval',
|
|
20367
|
+
]);
|
|
20368
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20369
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20370
|
+
}
|
|
20371
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20372
|
+
'checkpointInterval',
|
|
20373
|
+
]);
|
|
20374
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20375
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20376
|
+
}
|
|
20377
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20378
|
+
'maxOutputTokens',
|
|
20379
|
+
]);
|
|
20380
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20381
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20382
|
+
}
|
|
20158
20383
|
return toObject;
|
|
20159
20384
|
}
|
|
20160
20385
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20205,6 +20430,250 @@ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
|
|
|
20205
20430
|
}
|
|
20206
20431
|
return toObject;
|
|
20207
20432
|
}
|
|
20433
|
+
function distillationHyperParametersFromVertex(fromObject, rootObject) {
|
|
20434
|
+
const toObject = {};
|
|
20435
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20436
|
+
if (fromAdapterSize != null) {
|
|
20437
|
+
setValueByPath(toObject, ['adapterSize'], fromAdapterSize);
|
|
20438
|
+
}
|
|
20439
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20440
|
+
if (fromEpochCount != null) {
|
|
20441
|
+
setValueByPath(toObject, ['epochCount'], fromEpochCount);
|
|
20442
|
+
}
|
|
20443
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20444
|
+
'learningRateMultiplier',
|
|
20445
|
+
]);
|
|
20446
|
+
if (fromLearningRateMultiplier != null) {
|
|
20447
|
+
setValueByPath(toObject, ['learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20448
|
+
}
|
|
20449
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
20450
|
+
'generationConfig',
|
|
20451
|
+
]);
|
|
20452
|
+
if (fromGenerationConfig != null) {
|
|
20453
|
+
setValueByPath(toObject, ['generationConfig'], generationConfigFromVertex(fromGenerationConfig));
|
|
20454
|
+
}
|
|
20455
|
+
const fromLearningRate = getValueByPath(fromObject, ['learningRate']);
|
|
20456
|
+
if (fromLearningRate != null) {
|
|
20457
|
+
setValueByPath(toObject, ['learningRate'], fromLearningRate);
|
|
20458
|
+
}
|
|
20459
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20460
|
+
if (fromBatchSize != null) {
|
|
20461
|
+
setValueByPath(toObject, ['batchSize'], fromBatchSize);
|
|
20462
|
+
}
|
|
20463
|
+
return toObject;
|
|
20464
|
+
}
|
|
20465
|
+
function distillationSamplingSpecFromVertex(fromObject, rootObject) {
|
|
20466
|
+
const toObject = {};
|
|
20467
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20468
|
+
'baseTeacherModel',
|
|
20469
|
+
]);
|
|
20470
|
+
if (fromBaseTeacherModel != null) {
|
|
20471
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20472
|
+
}
|
|
20473
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20474
|
+
'tunedTeacherModelSource',
|
|
20475
|
+
]);
|
|
20476
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20477
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20478
|
+
}
|
|
20479
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20480
|
+
'validationDatasetUri',
|
|
20481
|
+
]);
|
|
20482
|
+
if (fromValidationDatasetUri != null) {
|
|
20483
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20484
|
+
}
|
|
20485
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20486
|
+
'promptDatasetUri',
|
|
20487
|
+
]);
|
|
20488
|
+
if (fromPromptDatasetUri != null) {
|
|
20489
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20490
|
+
}
|
|
20491
|
+
const fromHyperparameters = getValueByPath(fromObject, [
|
|
20492
|
+
'hyperparameters',
|
|
20493
|
+
]);
|
|
20494
|
+
if (fromHyperparameters != null) {
|
|
20495
|
+
setValueByPath(toObject, ['hyperparameters'], distillationHyperParametersFromVertex(fromHyperparameters));
|
|
20496
|
+
}
|
|
20497
|
+
return toObject;
|
|
20498
|
+
}
|
|
20499
|
+
function distillationSpecFromVertex(fromObject, rootObject) {
|
|
20500
|
+
const toObject = {};
|
|
20501
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20502
|
+
'promptDatasetUri',
|
|
20503
|
+
]);
|
|
20504
|
+
if (fromPromptDatasetUri != null) {
|
|
20505
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20506
|
+
}
|
|
20507
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20508
|
+
'baseTeacherModel',
|
|
20509
|
+
]);
|
|
20510
|
+
if (fromBaseTeacherModel != null) {
|
|
20511
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20512
|
+
}
|
|
20513
|
+
const fromHyperParameters = getValueByPath(fromObject, [
|
|
20514
|
+
'hyperParameters',
|
|
20515
|
+
]);
|
|
20516
|
+
if (fromHyperParameters != null) {
|
|
20517
|
+
setValueByPath(toObject, ['hyperParameters'], distillationHyperParametersFromVertex(fromHyperParameters));
|
|
20518
|
+
}
|
|
20519
|
+
const fromPipelineRootDirectory = getValueByPath(fromObject, [
|
|
20520
|
+
'pipelineRootDirectory',
|
|
20521
|
+
]);
|
|
20522
|
+
if (fromPipelineRootDirectory != null) {
|
|
20523
|
+
setValueByPath(toObject, ['pipelineRootDirectory'], fromPipelineRootDirectory);
|
|
20524
|
+
}
|
|
20525
|
+
const fromStudentModel = getValueByPath(fromObject, ['studentModel']);
|
|
20526
|
+
if (fromStudentModel != null) {
|
|
20527
|
+
setValueByPath(toObject, ['studentModel'], fromStudentModel);
|
|
20528
|
+
}
|
|
20529
|
+
const fromTrainingDatasetUri = getValueByPath(fromObject, [
|
|
20530
|
+
'trainingDatasetUri',
|
|
20531
|
+
]);
|
|
20532
|
+
if (fromTrainingDatasetUri != null) {
|
|
20533
|
+
setValueByPath(toObject, ['trainingDatasetUri'], fromTrainingDatasetUri);
|
|
20534
|
+
}
|
|
20535
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20536
|
+
'tunedTeacherModelSource',
|
|
20537
|
+
]);
|
|
20538
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20539
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20540
|
+
}
|
|
20541
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20542
|
+
'validationDatasetUri',
|
|
20543
|
+
]);
|
|
20544
|
+
if (fromValidationDatasetUri != null) {
|
|
20545
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20546
|
+
}
|
|
20547
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
20548
|
+
if (fromTuningMode != null) {
|
|
20549
|
+
setValueByPath(toObject, ['tuningMode'], fromTuningMode);
|
|
20550
|
+
}
|
|
20551
|
+
return toObject;
|
|
20552
|
+
}
|
|
20553
|
+
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20554
|
+
const toObject = {};
|
|
20555
|
+
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
20556
|
+
'modelConfig',
|
|
20557
|
+
]);
|
|
20558
|
+
if (fromModelSelectionConfig != null) {
|
|
20559
|
+
setValueByPath(toObject, ['modelSelectionConfig'], fromModelSelectionConfig);
|
|
20560
|
+
}
|
|
20561
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
20562
|
+
'responseJsonSchema',
|
|
20563
|
+
]);
|
|
20564
|
+
if (fromResponseJsonSchema != null) {
|
|
20565
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
20566
|
+
}
|
|
20567
|
+
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
20568
|
+
'audioTimestamp',
|
|
20569
|
+
]);
|
|
20570
|
+
if (fromAudioTimestamp != null) {
|
|
20571
|
+
setValueByPath(toObject, ['audioTimestamp'], fromAudioTimestamp);
|
|
20572
|
+
}
|
|
20573
|
+
const fromCandidateCount = getValueByPath(fromObject, [
|
|
20574
|
+
'candidateCount',
|
|
20575
|
+
]);
|
|
20576
|
+
if (fromCandidateCount != null) {
|
|
20577
|
+
setValueByPath(toObject, ['candidateCount'], fromCandidateCount);
|
|
20578
|
+
}
|
|
20579
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
20580
|
+
'enableAffectiveDialog',
|
|
20581
|
+
]);
|
|
20582
|
+
if (fromEnableAffectiveDialog != null) {
|
|
20583
|
+
setValueByPath(toObject, ['enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
20584
|
+
}
|
|
20585
|
+
const fromFrequencyPenalty = getValueByPath(fromObject, [
|
|
20586
|
+
'frequencyPenalty',
|
|
20587
|
+
]);
|
|
20588
|
+
if (fromFrequencyPenalty != null) {
|
|
20589
|
+
setValueByPath(toObject, ['frequencyPenalty'], fromFrequencyPenalty);
|
|
20590
|
+
}
|
|
20591
|
+
const fromLogprobs = getValueByPath(fromObject, ['logprobs']);
|
|
20592
|
+
if (fromLogprobs != null) {
|
|
20593
|
+
setValueByPath(toObject, ['logprobs'], fromLogprobs);
|
|
20594
|
+
}
|
|
20595
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20596
|
+
'maxOutputTokens',
|
|
20597
|
+
]);
|
|
20598
|
+
if (fromMaxOutputTokens != null) {
|
|
20599
|
+
setValueByPath(toObject, ['maxOutputTokens'], fromMaxOutputTokens);
|
|
20600
|
+
}
|
|
20601
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20602
|
+
'mediaResolution',
|
|
20603
|
+
]);
|
|
20604
|
+
if (fromMediaResolution != null) {
|
|
20605
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20606
|
+
}
|
|
20607
|
+
const fromPresencePenalty = getValueByPath(fromObject, [
|
|
20608
|
+
'presencePenalty',
|
|
20609
|
+
]);
|
|
20610
|
+
if (fromPresencePenalty != null) {
|
|
20611
|
+
setValueByPath(toObject, ['presencePenalty'], fromPresencePenalty);
|
|
20612
|
+
}
|
|
20613
|
+
const fromResponseLogprobs = getValueByPath(fromObject, [
|
|
20614
|
+
'responseLogprobs',
|
|
20615
|
+
]);
|
|
20616
|
+
if (fromResponseLogprobs != null) {
|
|
20617
|
+
setValueByPath(toObject, ['responseLogprobs'], fromResponseLogprobs);
|
|
20618
|
+
}
|
|
20619
|
+
const fromResponseMimeType = getValueByPath(fromObject, [
|
|
20620
|
+
'responseMimeType',
|
|
20621
|
+
]);
|
|
20622
|
+
if (fromResponseMimeType != null) {
|
|
20623
|
+
setValueByPath(toObject, ['responseMimeType'], fromResponseMimeType);
|
|
20624
|
+
}
|
|
20625
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
20626
|
+
'responseModalities',
|
|
20627
|
+
]);
|
|
20628
|
+
if (fromResponseModalities != null) {
|
|
20629
|
+
setValueByPath(toObject, ['responseModalities'], fromResponseModalities);
|
|
20630
|
+
}
|
|
20631
|
+
const fromResponseSchema = getValueByPath(fromObject, [
|
|
20632
|
+
'responseSchema',
|
|
20633
|
+
]);
|
|
20634
|
+
if (fromResponseSchema != null) {
|
|
20635
|
+
setValueByPath(toObject, ['responseSchema'], fromResponseSchema);
|
|
20636
|
+
}
|
|
20637
|
+
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
20638
|
+
'routingConfig',
|
|
20639
|
+
]);
|
|
20640
|
+
if (fromRoutingConfig != null) {
|
|
20641
|
+
setValueByPath(toObject, ['routingConfig'], fromRoutingConfig);
|
|
20642
|
+
}
|
|
20643
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
20644
|
+
if (fromSeed != null) {
|
|
20645
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
20646
|
+
}
|
|
20647
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
20648
|
+
if (fromSpeechConfig != null) {
|
|
20649
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
20650
|
+
}
|
|
20651
|
+
const fromStopSequences = getValueByPath(fromObject, [
|
|
20652
|
+
'stopSequences',
|
|
20653
|
+
]);
|
|
20654
|
+
if (fromStopSequences != null) {
|
|
20655
|
+
setValueByPath(toObject, ['stopSequences'], fromStopSequences);
|
|
20656
|
+
}
|
|
20657
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
20658
|
+
if (fromTemperature != null) {
|
|
20659
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
20660
|
+
}
|
|
20661
|
+
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
20662
|
+
'thinkingConfig',
|
|
20663
|
+
]);
|
|
20664
|
+
if (fromThinkingConfig != null) {
|
|
20665
|
+
setValueByPath(toObject, ['thinkingConfig'], fromThinkingConfig);
|
|
20666
|
+
}
|
|
20667
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
20668
|
+
if (fromTopK != null) {
|
|
20669
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
20670
|
+
}
|
|
20671
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
20672
|
+
if (fromTopP != null) {
|
|
20673
|
+
setValueByPath(toObject, ['topP'], fromTopP);
|
|
20674
|
+
}
|
|
20675
|
+
return toObject;
|
|
20676
|
+
}
|
|
20208
20677
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
20209
20678
|
const toObject = {};
|
|
20210
20679
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -20330,6 +20799,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20330
20799
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20331
20800
|
}
|
|
20332
20801
|
}
|
|
20802
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
20803
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
20804
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
20805
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
20806
|
+
}
|
|
20807
|
+
}
|
|
20333
20808
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20334
20809
|
'config',
|
|
20335
20810
|
'method',
|
|
@@ -20361,6 +20836,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20361
20836
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20362
20837
|
}
|
|
20363
20838
|
}
|
|
20839
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
20840
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
20841
|
+
'vertexDatasetResource',
|
|
20842
|
+
]);
|
|
20843
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
20844
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
20845
|
+
}
|
|
20846
|
+
}
|
|
20364
20847
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20365
20848
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20366
20849
|
}
|
|
@@ -20418,7 +20901,7 @@ function tuningJobFromMldev(fromObject, rootObject) {
|
|
|
20418
20901
|
}
|
|
20419
20902
|
return toObject;
|
|
20420
20903
|
}
|
|
20421
|
-
function tuningJobFromVertex(fromObject,
|
|
20904
|
+
function tuningJobFromVertex(fromObject, rootObject) {
|
|
20422
20905
|
const toObject = {};
|
|
20423
20906
|
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
20424
20907
|
'sdkHttpResponse',
|
|
@@ -20488,7 +20971,7 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20488
20971
|
'distillationSpec',
|
|
20489
20972
|
]);
|
|
20490
20973
|
if (fromDistillationSpec != null) {
|
|
20491
|
-
setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
|
|
20974
|
+
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20492
20975
|
}
|
|
20493
20976
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20494
20977
|
'tuningDataStats',
|
|
@@ -20572,18 +21055,24 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20572
21055
|
if (fromVeoTuningSpec != null) {
|
|
20573
21056
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
20574
21057
|
}
|
|
20575
|
-
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20576
|
-
'distillationSamplingSpec',
|
|
20577
|
-
]);
|
|
20578
|
-
if (fromDistillationSamplingSpec != null) {
|
|
20579
|
-
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20580
|
-
}
|
|
20581
21058
|
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20582
21059
|
'tuningJobMetadata',
|
|
20583
21060
|
]);
|
|
20584
21061
|
if (fromTuningJobMetadata != null) {
|
|
20585
21062
|
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20586
21063
|
}
|
|
21064
|
+
const fromVeoLoraTuningSpec = getValueByPath(fromObject, [
|
|
21065
|
+
'veoLoraTuningSpec',
|
|
21066
|
+
]);
|
|
21067
|
+
if (fromVeoLoraTuningSpec != null) {
|
|
21068
|
+
setValueByPath(toObject, ['veoLoraTuningSpec'], fromVeoLoraTuningSpec);
|
|
21069
|
+
}
|
|
21070
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
21071
|
+
'distillationSamplingSpec',
|
|
21072
|
+
]);
|
|
21073
|
+
if (fromDistillationSamplingSpec != null) {
|
|
21074
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], distillationSamplingSpecFromVertex(fromDistillationSamplingSpec));
|
|
21075
|
+
}
|
|
20587
21076
|
return toObject;
|
|
20588
21077
|
}
|
|
20589
21078
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|
|
@@ -21545,5 +22034,5 @@ function getApiKeyFromEnv() {
|
|
|
21545
22034
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
21546
22035
|
}
|
|
21547
22036
|
|
|
21548
|
-
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 };
|
|
22037
|
+
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 };
|
|
21549
22038
|
//# sourceMappingURL=index.mjs.map
|