@google/genai 2.6.0 → 2.8.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 +487 -69
- package/dist/index.cjs +567 -144
- package/dist/index.mjs +565 -145
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +567 -144
- package/dist/node/index.mjs +565 -145
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +487 -69
- package/dist/tokenizer/node.cjs +81 -25
- package/dist/tokenizer/node.d.ts +16 -31
- package/dist/tokenizer/node.mjs +81 -25
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +82 -26
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +371 -66
- package/dist/vertex_internal/index.js +82 -26
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +565 -145
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +487 -69
- package/package.json +1 -1
package/dist/web/index.mjs
CHANGED
|
@@ -618,7 +618,7 @@ var Language;
|
|
|
618
618
|
*/
|
|
619
619
|
Language["PYTHON"] = "PYTHON";
|
|
620
620
|
})(Language || (Language = {}));
|
|
621
|
-
/** Specifies how the response should be scheduled in the conversation. */
|
|
621
|
+
/** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
|
|
622
622
|
var FunctionResponseScheduling;
|
|
623
623
|
(function (FunctionResponseScheduling) {
|
|
624
624
|
/**
|
|
@@ -824,30 +824,6 @@ var DynamicRetrievalConfigMode;
|
|
|
824
824
|
*/
|
|
825
825
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
826
826
|
})(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
827
|
/** The number of thoughts tokens that the model should generate. */
|
|
852
828
|
var ThinkingLevel;
|
|
853
829
|
(function (ThinkingLevel) {
|
|
@@ -996,6 +972,30 @@ var HarmBlockThreshold;
|
|
|
996
972
|
*/
|
|
997
973
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
998
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 = {}));
|
|
999
999
|
/** Output only. The reason why the model stopped generating tokens.
|
|
1000
1000
|
|
|
1001
1001
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1814,6 +1814,58 @@ var ImageResizeMode;
|
|
|
1814
1814
|
*/
|
|
1815
1815
|
ImageResizeMode["PAD"] = "PAD";
|
|
1816
1816
|
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1817
|
+
/** Defines how to parse sample response. */
|
|
1818
|
+
var ResponseParseType;
|
|
1819
|
+
(function (ResponseParseType) {
|
|
1820
|
+
/**
|
|
1821
|
+
* Default value. This value is unused.
|
|
1822
|
+
*/
|
|
1823
|
+
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1824
|
+
/**
|
|
1825
|
+
* Use the sample response as is.
|
|
1826
|
+
*/
|
|
1827
|
+
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1828
|
+
/**
|
|
1829
|
+
* Use regex to extract the important part of sample response.
|
|
1830
|
+
*/
|
|
1831
|
+
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1832
|
+
})(ResponseParseType || (ResponseParseType = {}));
|
|
1833
|
+
/** Match operation to use for evaluation. */
|
|
1834
|
+
var MatchOperation;
|
|
1835
|
+
(function (MatchOperation) {
|
|
1836
|
+
/**
|
|
1837
|
+
* Default value. This value is unused.
|
|
1838
|
+
*/
|
|
1839
|
+
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1840
|
+
/**
|
|
1841
|
+
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1842
|
+
*/
|
|
1843
|
+
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1844
|
+
/**
|
|
1845
|
+
* `expression` is a substring of target.
|
|
1846
|
+
*/
|
|
1847
|
+
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1848
|
+
/**
|
|
1849
|
+
* `expression` is an exact match of target.
|
|
1850
|
+
*/
|
|
1851
|
+
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1852
|
+
})(MatchOperation || (MatchOperation = {}));
|
|
1853
|
+
/** Represents how much to think for the tuning job. */
|
|
1854
|
+
var ReinforcementTuningThinkingLevel;
|
|
1855
|
+
(function (ReinforcementTuningThinkingLevel) {
|
|
1856
|
+
/**
|
|
1857
|
+
* Unspecified thinking level.
|
|
1858
|
+
*/
|
|
1859
|
+
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1860
|
+
/**
|
|
1861
|
+
* Little to no thinking.
|
|
1862
|
+
*/
|
|
1863
|
+
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1864
|
+
/**
|
|
1865
|
+
* High thinking level.
|
|
1866
|
+
*/
|
|
1867
|
+
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1868
|
+
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1817
1869
|
/** Enum representing the tuning method. */
|
|
1818
1870
|
var TuningMethod;
|
|
1819
1871
|
(function (TuningMethod) {
|
|
@@ -1829,6 +1881,10 @@ var TuningMethod;
|
|
|
1829
1881
|
* Distillation tuning.
|
|
1830
1882
|
*/
|
|
1831
1883
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1884
|
+
/**
|
|
1885
|
+
* Reinforcement tuning.
|
|
1886
|
+
*/
|
|
1887
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1832
1888
|
})(TuningMethod || (TuningMethod = {}));
|
|
1833
1889
|
/** State for the lifecycle of a File. */
|
|
1834
1890
|
var FileState;
|
|
@@ -2203,24 +2259,13 @@ the API in a subsequent turn within a `Content` message, along with the
|
|
|
2203
2259
|
corresponding `ToolCall`. */
|
|
2204
2260
|
class ToolResponse {
|
|
2205
2261
|
}
|
|
2206
|
-
/** Raw media bytes for function response.
|
|
2207
|
-
|
|
2208
|
-
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
2209
|
-
field. */
|
|
2262
|
+
/** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
|
|
2210
2263
|
class FunctionResponseBlob {
|
|
2211
2264
|
}
|
|
2212
|
-
/** URI based data for function response. */
|
|
2265
|
+
/** URI based data for function response. This data type is not supported in Gemini API. */
|
|
2213
2266
|
class FunctionResponseFileData {
|
|
2214
2267
|
}
|
|
2215
|
-
/** A datatype containing media that is part of a `FunctionResponse` message.
|
|
2216
|
-
|
|
2217
|
-
A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
2218
|
-
`FunctionResponsePart` can only contain one of the accepted types in
|
|
2219
|
-
`FunctionResponsePart.data`.
|
|
2220
|
-
|
|
2221
|
-
A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
2222
|
-
type and subtype of the media if the `inline_data` field is filled with raw
|
|
2223
|
-
bytes. */
|
|
2268
|
+
/** A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes. */
|
|
2224
2269
|
class FunctionResponsePart {
|
|
2225
2270
|
}
|
|
2226
2271
|
/**
|
|
@@ -2245,7 +2290,7 @@ function createFunctionResponsePartFromUri(uri, mimeType) {
|
|
|
2245
2290
|
},
|
|
2246
2291
|
};
|
|
2247
2292
|
}
|
|
2248
|
-
/**
|
|
2293
|
+
/** The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. */
|
|
2249
2294
|
class FunctionResponse {
|
|
2250
2295
|
}
|
|
2251
2296
|
/**
|
|
@@ -2673,6 +2718,12 @@ class GenerateVideosOperation {
|
|
|
2673
2718
|
return operation;
|
|
2674
2719
|
}
|
|
2675
2720
|
}
|
|
2721
|
+
/** Defines how to parse sample response for reinforcement tuning. */
|
|
2722
|
+
class ReinforcementTuningParseResponseConfig {
|
|
2723
|
+
}
|
|
2724
|
+
/** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
|
|
2725
|
+
class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
2726
|
+
}
|
|
2676
2727
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
2677
2728
|
class EvaluateDatasetResponse {
|
|
2678
2729
|
}
|
|
@@ -2682,6 +2733,12 @@ class ListTuningJobsResponse {
|
|
|
2682
2733
|
/** Empty response for tunings.cancel method. */
|
|
2683
2734
|
class CancelTuningJobResponse {
|
|
2684
2735
|
}
|
|
2736
|
+
/** Response for the validate_reward method.
|
|
2737
|
+
|
|
2738
|
+
Contains the computed reward for a reinforcement tuning reward
|
|
2739
|
+
configuration. */
|
|
2740
|
+
class ValidateRewardResponse {
|
|
2741
|
+
}
|
|
2685
2742
|
/** Empty response for caches.delete method. */
|
|
2686
2743
|
class DeleteCachedContentResponse {
|
|
2687
2744
|
}
|
|
@@ -5150,6 +5207,7 @@ var PagedItem;
|
|
|
5150
5207
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5151
5208
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5152
5209
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5210
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5153
5211
|
})(PagedItem || (PagedItem = {}));
|
|
5154
5212
|
/**
|
|
5155
5213
|
* Pager class for iterating through paginated results.
|
|
@@ -5870,7 +5928,7 @@ function blobToMldev$3(fromObject) {
|
|
|
5870
5928
|
}
|
|
5871
5929
|
return toObject;
|
|
5872
5930
|
}
|
|
5873
|
-
function codeExecutionResultToVertex$
|
|
5931
|
+
function codeExecutionResultToVertex$3(fromObject) {
|
|
5874
5932
|
const toObject = {};
|
|
5875
5933
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5876
5934
|
if (fromOutcome != null) {
|
|
@@ -5885,24 +5943,6 @@ function codeExecutionResultToVertex$2(fromObject) {
|
|
|
5885
5943
|
}
|
|
5886
5944
|
return toObject;
|
|
5887
5945
|
}
|
|
5888
|
-
function computerUseToVertex$2(fromObject) {
|
|
5889
|
-
const toObject = {};
|
|
5890
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
5891
|
-
if (fromEnvironment != null) {
|
|
5892
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
5893
|
-
}
|
|
5894
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
5895
|
-
'excludedPredefinedFunctions',
|
|
5896
|
-
]);
|
|
5897
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
5898
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
5899
|
-
}
|
|
5900
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
5901
|
-
undefined) {
|
|
5902
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5903
|
-
}
|
|
5904
|
-
return toObject;
|
|
5905
|
-
}
|
|
5906
5946
|
function contentToMldev$3(fromObject) {
|
|
5907
5947
|
const toObject = {};
|
|
5908
5948
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -5921,14 +5961,14 @@ function contentToMldev$3(fromObject) {
|
|
|
5921
5961
|
}
|
|
5922
5962
|
return toObject;
|
|
5923
5963
|
}
|
|
5924
|
-
function contentToVertex$
|
|
5964
|
+
function contentToVertex$3(fromObject) {
|
|
5925
5965
|
const toObject = {};
|
|
5926
5966
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5927
5967
|
if (fromParts != null) {
|
|
5928
5968
|
let transformedList = fromParts;
|
|
5929
5969
|
if (Array.isArray(transformedList)) {
|
|
5930
5970
|
transformedList = transformedList.map((item) => {
|
|
5931
|
-
return partToVertex$
|
|
5971
|
+
return partToVertex$3(item);
|
|
5932
5972
|
});
|
|
5933
5973
|
}
|
|
5934
5974
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -6007,7 +6047,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
6007
6047
|
let transformedList = tContents(fromContents);
|
|
6008
6048
|
if (Array.isArray(transformedList)) {
|
|
6009
6049
|
transformedList = transformedList.map((item) => {
|
|
6010
|
-
return contentToVertex$
|
|
6050
|
+
return contentToVertex$3(item);
|
|
6011
6051
|
});
|
|
6012
6052
|
}
|
|
6013
6053
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -6016,7 +6056,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
6016
6056
|
'systemInstruction',
|
|
6017
6057
|
]);
|
|
6018
6058
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
6019
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$
|
|
6059
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$3(tContent(fromSystemInstruction)));
|
|
6020
6060
|
}
|
|
6021
6061
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
6022
6062
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -6098,7 +6138,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6098
6138
|
}
|
|
6099
6139
|
return toObject;
|
|
6100
6140
|
}
|
|
6101
|
-
function executableCodeToVertex$
|
|
6141
|
+
function executableCodeToVertex$3(fromObject) {
|
|
6102
6142
|
const toObject = {};
|
|
6103
6143
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6104
6144
|
if (fromCode != null) {
|
|
@@ -6312,6 +6352,16 @@ function listCachedContentsResponseFromVertex(fromObject) {
|
|
|
6312
6352
|
}
|
|
6313
6353
|
return toObject;
|
|
6314
6354
|
}
|
|
6355
|
+
function mcpServerToVertex$2(fromObject) {
|
|
6356
|
+
const toObject = {};
|
|
6357
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
6358
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6359
|
+
}
|
|
6360
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
6361
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6362
|
+
}
|
|
6363
|
+
return toObject;
|
|
6364
|
+
}
|
|
6315
6365
|
function partToMldev$3(fromObject) {
|
|
6316
6366
|
const toObject = {};
|
|
6317
6367
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -6384,7 +6434,7 @@ function partToMldev$3(fromObject) {
|
|
|
6384
6434
|
}
|
|
6385
6435
|
return toObject;
|
|
6386
6436
|
}
|
|
6387
|
-
function partToVertex$
|
|
6437
|
+
function partToVertex$3(fromObject) {
|
|
6388
6438
|
const toObject = {};
|
|
6389
6439
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
6390
6440
|
'mediaResolution',
|
|
@@ -6396,13 +6446,13 @@ function partToVertex$2(fromObject) {
|
|
|
6396
6446
|
'codeExecutionResult',
|
|
6397
6447
|
]);
|
|
6398
6448
|
if (fromCodeExecutionResult != null) {
|
|
6399
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
6449
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$3(fromCodeExecutionResult));
|
|
6400
6450
|
}
|
|
6401
6451
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6402
6452
|
'executableCode',
|
|
6403
6453
|
]);
|
|
6404
6454
|
if (fromExecutableCode != null) {
|
|
6405
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
6455
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$3(fromExecutableCode));
|
|
6406
6456
|
}
|
|
6407
6457
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6408
6458
|
if (fromFileData != null) {
|
|
@@ -6568,7 +6618,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6568
6618
|
}
|
|
6569
6619
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
6570
6620
|
if (fromComputerUse != null) {
|
|
6571
|
-
setValueByPath(toObject, ['computerUse'],
|
|
6621
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
6572
6622
|
}
|
|
6573
6623
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
6574
6624
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -6621,8 +6671,15 @@ function toolToVertex$2(fromObject) {
|
|
|
6621
6671
|
if (fromUrlContext != null) {
|
|
6622
6672
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
6623
6673
|
}
|
|
6624
|
-
|
|
6625
|
-
|
|
6674
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
6675
|
+
if (fromMcpServers != null) {
|
|
6676
|
+
let transformedList = fromMcpServers;
|
|
6677
|
+
if (Array.isArray(transformedList)) {
|
|
6678
|
+
transformedList = transformedList.map((item) => {
|
|
6679
|
+
return mcpServerToVertex$2(item);
|
|
6680
|
+
});
|
|
6681
|
+
}
|
|
6682
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6626
6683
|
}
|
|
6627
6684
|
return toObject;
|
|
6628
6685
|
}
|
|
@@ -7960,7 +8017,7 @@ function blobToMldev$2(fromObject) {
|
|
|
7960
8017
|
}
|
|
7961
8018
|
return toObject;
|
|
7962
8019
|
}
|
|
7963
|
-
function codeExecutionResultToVertex$
|
|
8020
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
7964
8021
|
const toObject = {};
|
|
7965
8022
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7966
8023
|
if (fromOutcome != null) {
|
|
@@ -7975,24 +8032,6 @@ function codeExecutionResultToVertex$1(fromObject) {
|
|
|
7975
8032
|
}
|
|
7976
8033
|
return toObject;
|
|
7977
8034
|
}
|
|
7978
|
-
function computerUseToVertex$1(fromObject) {
|
|
7979
|
-
const toObject = {};
|
|
7980
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
7981
|
-
if (fromEnvironment != null) {
|
|
7982
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
7983
|
-
}
|
|
7984
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
7985
|
-
'excludedPredefinedFunctions',
|
|
7986
|
-
]);
|
|
7987
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
7988
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
7989
|
-
}
|
|
7990
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
7991
|
-
undefined) {
|
|
7992
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
7993
|
-
}
|
|
7994
|
-
return toObject;
|
|
7995
|
-
}
|
|
7996
8035
|
function contentToMldev$2(fromObject) {
|
|
7997
8036
|
const toObject = {};
|
|
7998
8037
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -8011,14 +8050,14 @@ function contentToMldev$2(fromObject) {
|
|
|
8011
8050
|
}
|
|
8012
8051
|
return toObject;
|
|
8013
8052
|
}
|
|
8014
|
-
function contentToVertex$
|
|
8053
|
+
function contentToVertex$2(fromObject) {
|
|
8015
8054
|
const toObject = {};
|
|
8016
8055
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8017
8056
|
if (fromParts != null) {
|
|
8018
8057
|
let transformedList = fromParts;
|
|
8019
8058
|
if (Array.isArray(transformedList)) {
|
|
8020
8059
|
transformedList = transformedList.map((item) => {
|
|
8021
|
-
return partToVertex$
|
|
8060
|
+
return partToVertex$2(item);
|
|
8022
8061
|
});
|
|
8023
8062
|
}
|
|
8024
8063
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -8029,7 +8068,7 @@ function contentToVertex$1(fromObject) {
|
|
|
8029
8068
|
}
|
|
8030
8069
|
return toObject;
|
|
8031
8070
|
}
|
|
8032
|
-
function executableCodeToVertex$
|
|
8071
|
+
function executableCodeToVertex$2(fromObject) {
|
|
8033
8072
|
const toObject = {};
|
|
8034
8073
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8035
8074
|
if (fromCode != null) {
|
|
@@ -8368,11 +8407,11 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
8368
8407
|
}
|
|
8369
8408
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8370
8409
|
}
|
|
8371
|
-
const
|
|
8372
|
-
'
|
|
8410
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
8411
|
+
'translationConfig',
|
|
8373
8412
|
]);
|
|
8374
|
-
if (parentObject !== undefined &&
|
|
8375
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
8413
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
8414
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
8376
8415
|
}
|
|
8377
8416
|
return toObject;
|
|
8378
8417
|
}
|
|
@@ -8438,7 +8477,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8438
8477
|
'systemInstruction',
|
|
8439
8478
|
]);
|
|
8440
8479
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8441
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$
|
|
8480
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
|
|
8442
8481
|
}
|
|
8443
8482
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8444
8483
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -8506,8 +8545,8 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8506
8545
|
}
|
|
8507
8546
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8508
8547
|
}
|
|
8509
|
-
if (getValueByPath(fromObject, ['
|
|
8510
|
-
throw new Error('
|
|
8548
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
8549
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8511
8550
|
}
|
|
8512
8551
|
return toObject;
|
|
8513
8552
|
}
|
|
@@ -8699,6 +8738,16 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8699
8738
|
}
|
|
8700
8739
|
return toObject;
|
|
8701
8740
|
}
|
|
8741
|
+
function mcpServerToVertex$1(fromObject) {
|
|
8742
|
+
const toObject = {};
|
|
8743
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
8744
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8745
|
+
}
|
|
8746
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
8747
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8748
|
+
}
|
|
8749
|
+
return toObject;
|
|
8750
|
+
}
|
|
8702
8751
|
function partToMldev$2(fromObject) {
|
|
8703
8752
|
const toObject = {};
|
|
8704
8753
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -8771,7 +8820,7 @@ function partToMldev$2(fromObject) {
|
|
|
8771
8820
|
}
|
|
8772
8821
|
return toObject;
|
|
8773
8822
|
}
|
|
8774
|
-
function partToVertex$
|
|
8823
|
+
function partToVertex$2(fromObject) {
|
|
8775
8824
|
const toObject = {};
|
|
8776
8825
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8777
8826
|
'mediaResolution',
|
|
@@ -8783,13 +8832,13 @@ function partToVertex$1(fromObject) {
|
|
|
8783
8832
|
'codeExecutionResult',
|
|
8784
8833
|
]);
|
|
8785
8834
|
if (fromCodeExecutionResult != null) {
|
|
8786
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
8835
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
8787
8836
|
}
|
|
8788
8837
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8789
8838
|
'executableCode',
|
|
8790
8839
|
]);
|
|
8791
8840
|
if (fromExecutableCode != null) {
|
|
8792
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
8841
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
8793
8842
|
}
|
|
8794
8843
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8795
8844
|
if (fromFileData != null) {
|
|
@@ -8941,7 +8990,7 @@ function toolToVertex$1(fromObject) {
|
|
|
8941
8990
|
}
|
|
8942
8991
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
8943
8992
|
if (fromComputerUse != null) {
|
|
8944
|
-
setValueByPath(toObject, ['computerUse'],
|
|
8993
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
8945
8994
|
}
|
|
8946
8995
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8947
8996
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -8994,8 +9043,15 @@ function toolToVertex$1(fromObject) {
|
|
|
8994
9043
|
if (fromUrlContext != null) {
|
|
8995
9044
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8996
9045
|
}
|
|
8997
|
-
|
|
8998
|
-
|
|
9046
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
9047
|
+
if (fromMcpServers != null) {
|
|
9048
|
+
let transformedList = fromMcpServers;
|
|
9049
|
+
if (Array.isArray(transformedList)) {
|
|
9050
|
+
transformedList = transformedList.map((item) => {
|
|
9051
|
+
return mcpServerToVertex$1(item);
|
|
9052
|
+
});
|
|
9053
|
+
}
|
|
9054
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
8999
9055
|
}
|
|
9000
9056
|
return toObject;
|
|
9001
9057
|
}
|
|
@@ -9221,7 +9277,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9221
9277
|
}
|
|
9222
9278
|
return toObject;
|
|
9223
9279
|
}
|
|
9224
|
-
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9280
|
+
function codeExecutionResultToVertex$1(fromObject, _rootObject) {
|
|
9225
9281
|
const toObject = {};
|
|
9226
9282
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9227
9283
|
if (fromOutcome != null) {
|
|
@@ -9247,7 +9303,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9247
9303
|
let transformedList = tContents(fromContents);
|
|
9248
9304
|
if (Array.isArray(transformedList)) {
|
|
9249
9305
|
transformedList = transformedList.map((item) => {
|
|
9250
|
-
return contentToVertex(item);
|
|
9306
|
+
return contentToVertex$1(item);
|
|
9251
9307
|
});
|
|
9252
9308
|
}
|
|
9253
9309
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9274,24 +9330,6 @@ function computeTokensResponseFromVertex(fromObject, _rootObject) {
|
|
|
9274
9330
|
}
|
|
9275
9331
|
return toObject;
|
|
9276
9332
|
}
|
|
9277
|
-
function computerUseToVertex(fromObject, _rootObject) {
|
|
9278
|
-
const toObject = {};
|
|
9279
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
9280
|
-
if (fromEnvironment != null) {
|
|
9281
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
9282
|
-
}
|
|
9283
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
9284
|
-
'excludedPredefinedFunctions',
|
|
9285
|
-
]);
|
|
9286
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
9287
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
9288
|
-
}
|
|
9289
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
9290
|
-
undefined) {
|
|
9291
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9292
|
-
}
|
|
9293
|
-
return toObject;
|
|
9294
|
-
}
|
|
9295
9333
|
function contentEmbeddingFromVertex(fromObject, rootObject) {
|
|
9296
9334
|
const toObject = {};
|
|
9297
9335
|
const fromValues = getValueByPath(fromObject, ['values']);
|
|
@@ -9334,14 +9372,14 @@ function contentToMldev$1(fromObject, rootObject) {
|
|
|
9334
9372
|
}
|
|
9335
9373
|
return toObject;
|
|
9336
9374
|
}
|
|
9337
|
-
function contentToVertex(fromObject, rootObject) {
|
|
9375
|
+
function contentToVertex$1(fromObject, rootObject) {
|
|
9338
9376
|
const toObject = {};
|
|
9339
9377
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
9340
9378
|
if (fromParts != null) {
|
|
9341
9379
|
let transformedList = fromParts;
|
|
9342
9380
|
if (Array.isArray(transformedList)) {
|
|
9343
9381
|
transformedList = transformedList.map((item) => {
|
|
9344
|
-
return partToVertex(item);
|
|
9382
|
+
return partToVertex$1(item);
|
|
9345
9383
|
});
|
|
9346
9384
|
}
|
|
9347
9385
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -9385,7 +9423,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
9385
9423
|
'systemInstruction',
|
|
9386
9424
|
]);
|
|
9387
9425
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
9388
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
9426
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
9389
9427
|
}
|
|
9390
9428
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
9391
9429
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -9438,7 +9476,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9438
9476
|
let transformedList = tContents(fromContents);
|
|
9439
9477
|
if (Array.isArray(transformedList)) {
|
|
9440
9478
|
transformedList = transformedList.map((item) => {
|
|
9441
|
-
return contentToVertex(item);
|
|
9479
|
+
return contentToVertex$1(item);
|
|
9442
9480
|
});
|
|
9443
9481
|
}
|
|
9444
9482
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9874,7 +9912,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
|
|
|
9874
9912
|
if (discriminatorContent === 'EMBED_CONTENT') {
|
|
9875
9913
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
9876
9914
|
if (fromContent != null) {
|
|
9877
|
-
setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
|
|
9915
|
+
setValueByPath(toObject, ['content'], contentToVertex$1(tContent(fromContent)));
|
|
9878
9916
|
}
|
|
9879
9917
|
}
|
|
9880
9918
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -9966,7 +10004,7 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9966
10004
|
}
|
|
9967
10005
|
return toObject;
|
|
9968
10006
|
}
|
|
9969
|
-
function executableCodeToVertex(fromObject, _rootObject) {
|
|
10007
|
+
function executableCodeToVertex$1(fromObject, _rootObject) {
|
|
9970
10008
|
const toObject = {};
|
|
9971
10009
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9972
10010
|
if (fromCode != null) {
|
|
@@ -10209,7 +10247,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
10209
10247
|
'systemInstruction',
|
|
10210
10248
|
]);
|
|
10211
10249
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
10212
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
10250
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
10213
10251
|
}
|
|
10214
10252
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
10215
10253
|
if (fromTemperature != null) {
|
|
@@ -10414,7 +10452,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
10414
10452
|
let transformedList = tContents(fromContents);
|
|
10415
10453
|
if (Array.isArray(transformedList)) {
|
|
10416
10454
|
transformedList = transformedList.map((item) => {
|
|
10417
|
-
return contentToVertex(item);
|
|
10455
|
+
return contentToVertex$1(item);
|
|
10418
10456
|
});
|
|
10419
10457
|
}
|
|
10420
10458
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -11669,6 +11707,16 @@ function maskReferenceConfigToVertex(fromObject, _rootObject) {
|
|
|
11669
11707
|
}
|
|
11670
11708
|
return toObject;
|
|
11671
11709
|
}
|
|
11710
|
+
function mcpServerToVertex(fromObject, _rootObject) {
|
|
11711
|
+
const toObject = {};
|
|
11712
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
11713
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11714
|
+
}
|
|
11715
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
11716
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11717
|
+
}
|
|
11718
|
+
return toObject;
|
|
11719
|
+
}
|
|
11672
11720
|
function modelFromMldev(fromObject, rootObject) {
|
|
11673
11721
|
const toObject = {};
|
|
11674
11722
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -11859,7 +11907,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11859
11907
|
}
|
|
11860
11908
|
return toObject;
|
|
11861
11909
|
}
|
|
11862
|
-
function partToVertex(fromObject, rootObject) {
|
|
11910
|
+
function partToVertex$1(fromObject, rootObject) {
|
|
11863
11911
|
const toObject = {};
|
|
11864
11912
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11865
11913
|
'mediaResolution',
|
|
@@ -11871,13 +11919,13 @@ function partToVertex(fromObject, rootObject) {
|
|
|
11871
11919
|
'codeExecutionResult',
|
|
11872
11920
|
]);
|
|
11873
11921
|
if (fromCodeExecutionResult != null) {
|
|
11874
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11922
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
11875
11923
|
}
|
|
11876
11924
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11877
11925
|
'executableCode',
|
|
11878
11926
|
]);
|
|
11879
11927
|
if (fromExecutableCode != null) {
|
|
11880
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11928
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
11881
11929
|
}
|
|
11882
11930
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11883
11931
|
if (fromFileData != null) {
|
|
@@ -12360,7 +12408,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12360
12408
|
}
|
|
12361
12409
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
12362
12410
|
if (fromComputerUse != null) {
|
|
12363
|
-
setValueByPath(toObject, ['computerUse'],
|
|
12411
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
12364
12412
|
}
|
|
12365
12413
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
12366
12414
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -12413,8 +12461,15 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12413
12461
|
if (fromUrlContext != null) {
|
|
12414
12462
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
12415
12463
|
}
|
|
12416
|
-
|
|
12417
|
-
|
|
12464
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
12465
|
+
if (fromMcpServers != null) {
|
|
12466
|
+
let transformedList = fromMcpServers;
|
|
12467
|
+
if (Array.isArray(transformedList)) {
|
|
12468
|
+
transformedList = transformedList.map((item) => {
|
|
12469
|
+
return mcpServerToVertex(item);
|
|
12470
|
+
});
|
|
12471
|
+
}
|
|
12472
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
12418
12473
|
}
|
|
12419
12474
|
return toObject;
|
|
12420
12475
|
}
|
|
@@ -12977,7 +13032,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12977
13032
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12978
13033
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12979
13034
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12980
|
-
const SDK_VERSION = '2.
|
|
13035
|
+
const SDK_VERSION = '2.8.0'; // x-release-please-version
|
|
12981
13036
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12982
13037
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12983
13038
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -16627,11 +16682,11 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
16627
16682
|
}
|
|
16628
16683
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
16629
16684
|
}
|
|
16630
|
-
const
|
|
16631
|
-
'
|
|
16685
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
16686
|
+
'translationConfig',
|
|
16632
16687
|
]);
|
|
16633
|
-
if (parentObject !== undefined &&
|
|
16634
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
16688
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
16689
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
16635
16690
|
}
|
|
16636
16691
|
return toObject;
|
|
16637
16692
|
}
|
|
@@ -19821,6 +19876,39 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
|
|
|
19821
19876
|
}
|
|
19822
19877
|
return toObject;
|
|
19823
19878
|
}
|
|
19879
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
19880
|
+
const toObject = {};
|
|
19881
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
19882
|
+
if (fromOutcome != null) {
|
|
19883
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
19884
|
+
}
|
|
19885
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
19886
|
+
if (fromOutput != null) {
|
|
19887
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
19888
|
+
}
|
|
19889
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
19890
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
19891
|
+
}
|
|
19892
|
+
return toObject;
|
|
19893
|
+
}
|
|
19894
|
+
function contentToVertex(fromObject, rootObject) {
|
|
19895
|
+
const toObject = {};
|
|
19896
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
19897
|
+
if (fromParts != null) {
|
|
19898
|
+
let transformedList = fromParts;
|
|
19899
|
+
if (Array.isArray(transformedList)) {
|
|
19900
|
+
transformedList = transformedList.map((item) => {
|
|
19901
|
+
return partToVertex(item);
|
|
19902
|
+
});
|
|
19903
|
+
}
|
|
19904
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
19905
|
+
}
|
|
19906
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
19907
|
+
if (fromRole != null) {
|
|
19908
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
19909
|
+
}
|
|
19910
|
+
return toObject;
|
|
19911
|
+
}
|
|
19824
19912
|
function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
19825
19913
|
const toObject = {};
|
|
19826
19914
|
if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
|
|
@@ -19891,6 +19979,30 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19891
19979
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19892
19980
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19893
19981
|
}
|
|
19982
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
19983
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19984
|
+
}
|
|
19985
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
19986
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19987
|
+
}
|
|
19988
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
19989
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19990
|
+
}
|
|
19991
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
19992
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19993
|
+
}
|
|
19994
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
19995
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19996
|
+
}
|
|
19997
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
19998
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19999
|
+
}
|
|
20000
|
+
if (getValueByPath(fromObject, ['thinkingLevel']) !== undefined) {
|
|
20001
|
+
throw new Error('thinkingLevel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20002
|
+
}
|
|
20003
|
+
if (getValueByPath(fromObject, ['validationDatasetUri']) !== undefined) {
|
|
20004
|
+
throw new Error('validationDatasetUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20005
|
+
}
|
|
19894
20006
|
return toObject;
|
|
19895
20007
|
}
|
|
19896
20008
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -19926,6 +20038,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19926
20038
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19927
20039
|
}
|
|
19928
20040
|
}
|
|
20041
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
20042
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
20043
|
+
'validationDataset',
|
|
20044
|
+
]);
|
|
20045
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
20046
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20047
|
+
}
|
|
20048
|
+
}
|
|
19929
20049
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19930
20050
|
'tunedModelDisplayName',
|
|
19931
20051
|
]);
|
|
@@ -19961,6 +20081,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19961
20081
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19962
20082
|
}
|
|
19963
20083
|
}
|
|
20084
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
20085
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20086
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
20087
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20088
|
+
}
|
|
20089
|
+
}
|
|
19964
20090
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
19965
20091
|
'config',
|
|
19966
20092
|
'method',
|
|
@@ -19996,6 +20122,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19996
20122
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
19997
20123
|
}
|
|
19998
20124
|
}
|
|
20125
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
20126
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20127
|
+
'learningRateMultiplier',
|
|
20128
|
+
]);
|
|
20129
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
20130
|
+
setValueByPath(parentObject, [
|
|
20131
|
+
'reinforcementTuningSpec',
|
|
20132
|
+
'hyperParameters',
|
|
20133
|
+
'learningRateMultiplier',
|
|
20134
|
+
], fromLearningRateMultiplier);
|
|
20135
|
+
}
|
|
20136
|
+
}
|
|
19999
20137
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
20000
20138
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
20001
20139
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -20049,6 +20187,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20049
20187
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20050
20188
|
}
|
|
20051
20189
|
}
|
|
20190
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20191
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20192
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20193
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20194
|
+
}
|
|
20195
|
+
}
|
|
20052
20196
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
20053
20197
|
'config',
|
|
20054
20198
|
'method',
|
|
@@ -20093,6 +20237,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20093
20237
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20094
20238
|
}
|
|
20095
20239
|
}
|
|
20240
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20241
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20242
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20243
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20244
|
+
}
|
|
20245
|
+
}
|
|
20096
20246
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
20097
20247
|
'config',
|
|
20098
20248
|
'method',
|
|
@@ -20152,6 +20302,52 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20152
20302
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
20153
20303
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
20154
20304
|
}
|
|
20305
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20306
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20307
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20308
|
+
}
|
|
20309
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20310
|
+
'compositeRewardConfig',
|
|
20311
|
+
]);
|
|
20312
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20313
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20314
|
+
}
|
|
20315
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20316
|
+
'samplesPerPrompt',
|
|
20317
|
+
]);
|
|
20318
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20319
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20320
|
+
}
|
|
20321
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20322
|
+
'evaluateInterval',
|
|
20323
|
+
]);
|
|
20324
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20325
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20326
|
+
}
|
|
20327
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20328
|
+
'checkpointInterval',
|
|
20329
|
+
]);
|
|
20330
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20331
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20332
|
+
}
|
|
20333
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20334
|
+
'maxOutputTokens',
|
|
20335
|
+
]);
|
|
20336
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20337
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20338
|
+
}
|
|
20339
|
+
const fromThinkingLevel = getValueByPath(fromObject, [
|
|
20340
|
+
'thinkingLevel',
|
|
20341
|
+
]);
|
|
20342
|
+
if (parentObject !== undefined && fromThinkingLevel != null) {
|
|
20343
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'thinkingLevel'], fromThinkingLevel);
|
|
20344
|
+
}
|
|
20345
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20346
|
+
'validationDatasetUri',
|
|
20347
|
+
]);
|
|
20348
|
+
if (parentObject !== undefined && fromValidationDatasetUri != null) {
|
|
20349
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'validationDatasetUri'], fromValidationDatasetUri);
|
|
20350
|
+
}
|
|
20155
20351
|
return toObject;
|
|
20156
20352
|
}
|
|
20157
20353
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20322,6 +20518,21 @@ function distillationSpecFromVertex(fromObject, rootObject) {
|
|
|
20322
20518
|
}
|
|
20323
20519
|
return toObject;
|
|
20324
20520
|
}
|
|
20521
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
20522
|
+
const toObject = {};
|
|
20523
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
20524
|
+
if (fromCode != null) {
|
|
20525
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
20526
|
+
}
|
|
20527
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
20528
|
+
if (fromLanguage != null) {
|
|
20529
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
20530
|
+
}
|
|
20531
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
20532
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20533
|
+
}
|
|
20534
|
+
return toObject;
|
|
20535
|
+
}
|
|
20325
20536
|
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20326
20537
|
const toObject = {};
|
|
20327
20538
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
@@ -20512,6 +20723,99 @@ function listTuningJobsResponseFromVertex(fromObject, rootObject) {
|
|
|
20512
20723
|
}
|
|
20513
20724
|
return toObject;
|
|
20514
20725
|
}
|
|
20726
|
+
function partToVertex(fromObject, rootObject) {
|
|
20727
|
+
const toObject = {};
|
|
20728
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20729
|
+
'mediaResolution',
|
|
20730
|
+
]);
|
|
20731
|
+
if (fromMediaResolution != null) {
|
|
20732
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20733
|
+
}
|
|
20734
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
20735
|
+
'codeExecutionResult',
|
|
20736
|
+
]);
|
|
20737
|
+
if (fromCodeExecutionResult != null) {
|
|
20738
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
20739
|
+
}
|
|
20740
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
20741
|
+
'executableCode',
|
|
20742
|
+
]);
|
|
20743
|
+
if (fromExecutableCode != null) {
|
|
20744
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
20745
|
+
}
|
|
20746
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
20747
|
+
if (fromFileData != null) {
|
|
20748
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
20749
|
+
}
|
|
20750
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
20751
|
+
if (fromFunctionCall != null) {
|
|
20752
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
20753
|
+
}
|
|
20754
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
20755
|
+
'functionResponse',
|
|
20756
|
+
]);
|
|
20757
|
+
if (fromFunctionResponse != null) {
|
|
20758
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
20759
|
+
}
|
|
20760
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
20761
|
+
if (fromInlineData != null) {
|
|
20762
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
20763
|
+
}
|
|
20764
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
20765
|
+
if (fromText != null) {
|
|
20766
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
20767
|
+
}
|
|
20768
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
20769
|
+
if (fromThought != null) {
|
|
20770
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
20771
|
+
}
|
|
20772
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
20773
|
+
'thoughtSignature',
|
|
20774
|
+
]);
|
|
20775
|
+
if (fromThoughtSignature != null) {
|
|
20776
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
20777
|
+
}
|
|
20778
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
20779
|
+
'videoMetadata',
|
|
20780
|
+
]);
|
|
20781
|
+
if (fromVideoMetadata != null) {
|
|
20782
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
20783
|
+
}
|
|
20784
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
20785
|
+
throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20786
|
+
}
|
|
20787
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
20788
|
+
throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20789
|
+
}
|
|
20790
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
20791
|
+
throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20792
|
+
}
|
|
20793
|
+
return toObject;
|
|
20794
|
+
}
|
|
20795
|
+
function reinforcementTuningExampleToVertex(fromObject, rootObject) {
|
|
20796
|
+
const toObject = {};
|
|
20797
|
+
const fromContents = getValueByPath(fromObject, ['contents']);
|
|
20798
|
+
if (fromContents != null) {
|
|
20799
|
+
let transformedList = fromContents;
|
|
20800
|
+
if (Array.isArray(transformedList)) {
|
|
20801
|
+
transformedList = transformedList.map((item) => {
|
|
20802
|
+
return contentToVertex(item);
|
|
20803
|
+
});
|
|
20804
|
+
}
|
|
20805
|
+
setValueByPath(toObject, ['contents'], transformedList);
|
|
20806
|
+
}
|
|
20807
|
+
const fromReferences = getValueByPath(fromObject, ['references']);
|
|
20808
|
+
if (fromReferences != null) {
|
|
20809
|
+
setValueByPath(toObject, ['references'], fromReferences);
|
|
20810
|
+
}
|
|
20811
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
20812
|
+
'systemInstruction',
|
|
20813
|
+
]);
|
|
20814
|
+
if (fromSystemInstruction != null) {
|
|
20815
|
+
setValueByPath(toObject, ['systemInstruction'], contentToVertex(fromSystemInstruction));
|
|
20816
|
+
}
|
|
20817
|
+
return toObject;
|
|
20818
|
+
}
|
|
20515
20819
|
function tunedModelFromMldev(fromObject, _rootObject) {
|
|
20516
20820
|
const toObject = {};
|
|
20517
20821
|
const fromModel = getValueByPath(fromObject, ['name']);
|
|
@@ -20571,6 +20875,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20571
20875
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20572
20876
|
}
|
|
20573
20877
|
}
|
|
20878
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
20879
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
20880
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
20881
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
20882
|
+
}
|
|
20883
|
+
}
|
|
20574
20884
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20575
20885
|
'config',
|
|
20576
20886
|
'method',
|
|
@@ -20602,6 +20912,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20602
20912
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20603
20913
|
}
|
|
20604
20914
|
}
|
|
20915
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
20916
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
20917
|
+
'vertexDatasetResource',
|
|
20918
|
+
]);
|
|
20919
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
20920
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
20921
|
+
}
|
|
20922
|
+
}
|
|
20605
20923
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20606
20924
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20607
20925
|
}
|
|
@@ -20731,6 +21049,12 @@ function tuningJobFromVertex(fromObject, rootObject) {
|
|
|
20731
21049
|
if (fromDistillationSpec != null) {
|
|
20732
21050
|
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20733
21051
|
}
|
|
21052
|
+
const fromReinforcementTuningSpec = getValueByPath(fromObject, [
|
|
21053
|
+
'reinforcementTuningSpec',
|
|
21054
|
+
]);
|
|
21055
|
+
if (fromReinforcementTuningSpec != null) {
|
|
21056
|
+
setValueByPath(toObject, ['reinforcementTuningSpec'], fromReinforcementTuningSpec);
|
|
21057
|
+
}
|
|
20734
21058
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20735
21059
|
'tuningDataStats',
|
|
20736
21060
|
]);
|
|
@@ -20873,6 +21197,62 @@ function tuningValidationDatasetToVertex(fromObject, _rootObject) {
|
|
|
20873
21197
|
}
|
|
20874
21198
|
return toObject;
|
|
20875
21199
|
}
|
|
21200
|
+
function validateRewardParametersToVertex(fromObject, rootObject) {
|
|
21201
|
+
const toObject = {};
|
|
21202
|
+
const fromParent = getValueByPath(fromObject, ['parent']);
|
|
21203
|
+
if (fromParent != null) {
|
|
21204
|
+
setValueByPath(toObject, ['_url', 'parent'], fromParent);
|
|
21205
|
+
}
|
|
21206
|
+
const fromSampleResponse = getValueByPath(fromObject, [
|
|
21207
|
+
'sampleResponse',
|
|
21208
|
+
]);
|
|
21209
|
+
if (fromSampleResponse != null) {
|
|
21210
|
+
setValueByPath(toObject, ['sampleResponse'], contentToVertex(fromSampleResponse));
|
|
21211
|
+
}
|
|
21212
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
21213
|
+
if (fromExample != null) {
|
|
21214
|
+
setValueByPath(toObject, ['example'], reinforcementTuningExampleToVertex(fromExample));
|
|
21215
|
+
}
|
|
21216
|
+
const fromSingleRewardConfig = getValueByPath(fromObject, [
|
|
21217
|
+
'singleRewardConfig',
|
|
21218
|
+
]);
|
|
21219
|
+
if (fromSingleRewardConfig != null) {
|
|
21220
|
+
setValueByPath(toObject, ['singleRewardConfig'], fromSingleRewardConfig);
|
|
21221
|
+
}
|
|
21222
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
21223
|
+
'compositeRewardConfig',
|
|
21224
|
+
]);
|
|
21225
|
+
if (fromCompositeRewardConfig != null) {
|
|
21226
|
+
setValueByPath(toObject, ['compositeRewardConfig'], fromCompositeRewardConfig);
|
|
21227
|
+
}
|
|
21228
|
+
return toObject;
|
|
21229
|
+
}
|
|
21230
|
+
function validateRewardResponseFromVertex(fromObject, _rootObject) {
|
|
21231
|
+
const toObject = {};
|
|
21232
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
21233
|
+
'sdkHttpResponse',
|
|
21234
|
+
]);
|
|
21235
|
+
if (fromSdkHttpResponse != null) {
|
|
21236
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
21237
|
+
}
|
|
21238
|
+
const fromOverallReward = getValueByPath(fromObject, [
|
|
21239
|
+
'overallReward',
|
|
21240
|
+
]);
|
|
21241
|
+
if (fromOverallReward != null) {
|
|
21242
|
+
setValueByPath(toObject, ['overallReward'], fromOverallReward);
|
|
21243
|
+
}
|
|
21244
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
21245
|
+
if (fromError != null) {
|
|
21246
|
+
setValueByPath(toObject, ['error'], fromError);
|
|
21247
|
+
}
|
|
21248
|
+
const fromRewardInfoDetails = getValueByPath(fromObject, [
|
|
21249
|
+
'rewardInfoDetails',
|
|
21250
|
+
]);
|
|
21251
|
+
if (fromRewardInfoDetails != null) {
|
|
21252
|
+
setValueByPath(toObject, ['rewardInfoDetails'], fromRewardInfoDetails);
|
|
21253
|
+
}
|
|
21254
|
+
return toObject;
|
|
21255
|
+
}
|
|
20876
21256
|
|
|
20877
21257
|
/**
|
|
20878
21258
|
* @license
|
|
@@ -21219,6 +21599,46 @@ class Tunings extends BaseModule {
|
|
|
21219
21599
|
});
|
|
21220
21600
|
}
|
|
21221
21601
|
}
|
|
21602
|
+
async validateReward(params) {
|
|
21603
|
+
var _a, _b;
|
|
21604
|
+
let response;
|
|
21605
|
+
let path = '';
|
|
21606
|
+
let queryParams = {};
|
|
21607
|
+
if (this.apiClient.isVertexAI()) {
|
|
21608
|
+
const body = validateRewardParametersToVertex(params);
|
|
21609
|
+
path = formatMap('{parent}/tuningJobs:validateReinforcementTuningReward', body['_url']);
|
|
21610
|
+
queryParams = body['_query'];
|
|
21611
|
+
delete body['_url'];
|
|
21612
|
+
delete body['_query'];
|
|
21613
|
+
response = this.apiClient
|
|
21614
|
+
.request({
|
|
21615
|
+
path: path,
|
|
21616
|
+
queryParams: queryParams,
|
|
21617
|
+
body: JSON.stringify(body),
|
|
21618
|
+
httpMethod: 'POST',
|
|
21619
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
21620
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
21621
|
+
})
|
|
21622
|
+
.then((httpResponse) => {
|
|
21623
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
21624
|
+
const response = jsonResponse;
|
|
21625
|
+
response.sdkHttpResponse = {
|
|
21626
|
+
headers: httpResponse.headers,
|
|
21627
|
+
};
|
|
21628
|
+
return response;
|
|
21629
|
+
});
|
|
21630
|
+
});
|
|
21631
|
+
return response.then((apiResponse) => {
|
|
21632
|
+
const resp = validateRewardResponseFromVertex(apiResponse);
|
|
21633
|
+
const typedResp = new ValidateRewardResponse();
|
|
21634
|
+
Object.assign(typedResp, resp);
|
|
21635
|
+
return typedResp;
|
|
21636
|
+
});
|
|
21637
|
+
}
|
|
21638
|
+
else {
|
|
21639
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
21640
|
+
}
|
|
21641
|
+
}
|
|
21222
21642
|
}
|
|
21223
21643
|
|
|
21224
21644
|
/**
|
|
@@ -21542,5 +21962,5 @@ class GoogleGenAI {
|
|
|
21542
21962
|
}
|
|
21543
21963
|
}
|
|
21544
21964
|
|
|
21545
|
-
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 };
|
|
21965
|
+
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, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseParseType, 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, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
21546
21966
|
//# sourceMappingURL=index.mjs.map
|