@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/node/index.mjs
CHANGED
|
@@ -626,7 +626,7 @@ var Language;
|
|
|
626
626
|
*/
|
|
627
627
|
Language["PYTHON"] = "PYTHON";
|
|
628
628
|
})(Language || (Language = {}));
|
|
629
|
-
/** Specifies how the response should be scheduled in the conversation. */
|
|
629
|
+
/** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
|
|
630
630
|
var FunctionResponseScheduling;
|
|
631
631
|
(function (FunctionResponseScheduling) {
|
|
632
632
|
/**
|
|
@@ -832,30 +832,6 @@ var DynamicRetrievalConfigMode;
|
|
|
832
832
|
*/
|
|
833
833
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
834
834
|
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
835
|
-
/** Function calling mode. */
|
|
836
|
-
var FunctionCallingConfigMode;
|
|
837
|
-
(function (FunctionCallingConfigMode) {
|
|
838
|
-
/**
|
|
839
|
-
* Unspecified function calling mode. This value should not be used.
|
|
840
|
-
*/
|
|
841
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
842
|
-
/**
|
|
843
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
844
|
-
*/
|
|
845
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
846
|
-
/**
|
|
847
|
-
* 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".
|
|
848
|
-
*/
|
|
849
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
850
|
-
/**
|
|
851
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
852
|
-
*/
|
|
853
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
854
|
-
/**
|
|
855
|
-
* 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".
|
|
856
|
-
*/
|
|
857
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
858
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
859
835
|
/** The number of thoughts tokens that the model should generate. */
|
|
860
836
|
var ThinkingLevel;
|
|
861
837
|
(function (ThinkingLevel) {
|
|
@@ -1004,6 +980,30 @@ var HarmBlockThreshold;
|
|
|
1004
980
|
*/
|
|
1005
981
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
1006
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 = {}));
|
|
1007
1007
|
/** Output only. The reason why the model stopped generating tokens.
|
|
1008
1008
|
|
|
1009
1009
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1822,6 +1822,58 @@ var ImageResizeMode;
|
|
|
1822
1822
|
*/
|
|
1823
1823
|
ImageResizeMode["PAD"] = "PAD";
|
|
1824
1824
|
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1825
|
+
/** Defines how to parse sample response. */
|
|
1826
|
+
var ResponseParseType;
|
|
1827
|
+
(function (ResponseParseType) {
|
|
1828
|
+
/**
|
|
1829
|
+
* Default value. This value is unused.
|
|
1830
|
+
*/
|
|
1831
|
+
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1832
|
+
/**
|
|
1833
|
+
* Use the sample response as is.
|
|
1834
|
+
*/
|
|
1835
|
+
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1836
|
+
/**
|
|
1837
|
+
* Use regex to extract the important part of sample response.
|
|
1838
|
+
*/
|
|
1839
|
+
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1840
|
+
})(ResponseParseType || (ResponseParseType = {}));
|
|
1841
|
+
/** Match operation to use for evaluation. */
|
|
1842
|
+
var MatchOperation;
|
|
1843
|
+
(function (MatchOperation) {
|
|
1844
|
+
/**
|
|
1845
|
+
* Default value. This value is unused.
|
|
1846
|
+
*/
|
|
1847
|
+
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1848
|
+
/**
|
|
1849
|
+
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1850
|
+
*/
|
|
1851
|
+
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1852
|
+
/**
|
|
1853
|
+
* `expression` is a substring of target.
|
|
1854
|
+
*/
|
|
1855
|
+
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1856
|
+
/**
|
|
1857
|
+
* `expression` is an exact match of target.
|
|
1858
|
+
*/
|
|
1859
|
+
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1860
|
+
})(MatchOperation || (MatchOperation = {}));
|
|
1861
|
+
/** Represents how much to think for the tuning job. */
|
|
1862
|
+
var ReinforcementTuningThinkingLevel;
|
|
1863
|
+
(function (ReinforcementTuningThinkingLevel) {
|
|
1864
|
+
/**
|
|
1865
|
+
* Unspecified thinking level.
|
|
1866
|
+
*/
|
|
1867
|
+
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1868
|
+
/**
|
|
1869
|
+
* Little to no thinking.
|
|
1870
|
+
*/
|
|
1871
|
+
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1872
|
+
/**
|
|
1873
|
+
* High thinking level.
|
|
1874
|
+
*/
|
|
1875
|
+
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1876
|
+
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1825
1877
|
/** Enum representing the tuning method. */
|
|
1826
1878
|
var TuningMethod;
|
|
1827
1879
|
(function (TuningMethod) {
|
|
@@ -1837,6 +1889,10 @@ var TuningMethod;
|
|
|
1837
1889
|
* Distillation tuning.
|
|
1838
1890
|
*/
|
|
1839
1891
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1892
|
+
/**
|
|
1893
|
+
* Reinforcement tuning.
|
|
1894
|
+
*/
|
|
1895
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1840
1896
|
})(TuningMethod || (TuningMethod = {}));
|
|
1841
1897
|
/** State for the lifecycle of a File. */
|
|
1842
1898
|
var FileState;
|
|
@@ -2211,24 +2267,13 @@ the API in a subsequent turn within a `Content` message, along with the
|
|
|
2211
2267
|
corresponding `ToolCall`. */
|
|
2212
2268
|
class ToolResponse {
|
|
2213
2269
|
}
|
|
2214
|
-
/** Raw media bytes for function response.
|
|
2215
|
-
|
|
2216
|
-
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
2217
|
-
field. */
|
|
2270
|
+
/** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
|
|
2218
2271
|
class FunctionResponseBlob {
|
|
2219
2272
|
}
|
|
2220
|
-
/** URI based data for function response. */
|
|
2273
|
+
/** URI based data for function response. This data type is not supported in Gemini API. */
|
|
2221
2274
|
class FunctionResponseFileData {
|
|
2222
2275
|
}
|
|
2223
|
-
/** A datatype containing media that is part of a `FunctionResponse` message.
|
|
2224
|
-
|
|
2225
|
-
A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
2226
|
-
`FunctionResponsePart` can only contain one of the accepted types in
|
|
2227
|
-
`FunctionResponsePart.data`.
|
|
2228
|
-
|
|
2229
|
-
A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
2230
|
-
type and subtype of the media if the `inline_data` field is filled with raw
|
|
2231
|
-
bytes. */
|
|
2276
|
+
/** 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. */
|
|
2232
2277
|
class FunctionResponsePart {
|
|
2233
2278
|
}
|
|
2234
2279
|
/**
|
|
@@ -2253,7 +2298,7 @@ function createFunctionResponsePartFromUri(uri, mimeType) {
|
|
|
2253
2298
|
},
|
|
2254
2299
|
};
|
|
2255
2300
|
}
|
|
2256
|
-
/**
|
|
2301
|
+
/** 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. */
|
|
2257
2302
|
class FunctionResponse {
|
|
2258
2303
|
}
|
|
2259
2304
|
/**
|
|
@@ -2681,6 +2726,12 @@ class GenerateVideosOperation {
|
|
|
2681
2726
|
return operation;
|
|
2682
2727
|
}
|
|
2683
2728
|
}
|
|
2729
|
+
/** Defines how to parse sample response for reinforcement tuning. */
|
|
2730
|
+
class ReinforcementTuningParseResponseConfig {
|
|
2731
|
+
}
|
|
2732
|
+
/** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
|
|
2733
|
+
class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
2734
|
+
}
|
|
2684
2735
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
2685
2736
|
class EvaluateDatasetResponse {
|
|
2686
2737
|
}
|
|
@@ -2690,6 +2741,12 @@ class ListTuningJobsResponse {
|
|
|
2690
2741
|
/** Empty response for tunings.cancel method. */
|
|
2691
2742
|
class CancelTuningJobResponse {
|
|
2692
2743
|
}
|
|
2744
|
+
/** Response for the validate_reward method.
|
|
2745
|
+
|
|
2746
|
+
Contains the computed reward for a reinforcement tuning reward
|
|
2747
|
+
configuration. */
|
|
2748
|
+
class ValidateRewardResponse {
|
|
2749
|
+
}
|
|
2693
2750
|
/** Empty response for caches.delete method. */
|
|
2694
2751
|
class DeleteCachedContentResponse {
|
|
2695
2752
|
}
|
|
@@ -5158,6 +5215,7 @@ var PagedItem;
|
|
|
5158
5215
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5159
5216
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5160
5217
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5218
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5161
5219
|
})(PagedItem || (PagedItem = {}));
|
|
5162
5220
|
/**
|
|
5163
5221
|
* Pager class for iterating through paginated results.
|
|
@@ -5878,7 +5936,7 @@ function blobToMldev$3(fromObject) {
|
|
|
5878
5936
|
}
|
|
5879
5937
|
return toObject;
|
|
5880
5938
|
}
|
|
5881
|
-
function codeExecutionResultToVertex$
|
|
5939
|
+
function codeExecutionResultToVertex$3(fromObject) {
|
|
5882
5940
|
const toObject = {};
|
|
5883
5941
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5884
5942
|
if (fromOutcome != null) {
|
|
@@ -5893,24 +5951,6 @@ function codeExecutionResultToVertex$2(fromObject) {
|
|
|
5893
5951
|
}
|
|
5894
5952
|
return toObject;
|
|
5895
5953
|
}
|
|
5896
|
-
function computerUseToVertex$2(fromObject) {
|
|
5897
|
-
const toObject = {};
|
|
5898
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
5899
|
-
if (fromEnvironment != null) {
|
|
5900
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
5901
|
-
}
|
|
5902
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
5903
|
-
'excludedPredefinedFunctions',
|
|
5904
|
-
]);
|
|
5905
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
5906
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
5907
|
-
}
|
|
5908
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
5909
|
-
undefined) {
|
|
5910
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5911
|
-
}
|
|
5912
|
-
return toObject;
|
|
5913
|
-
}
|
|
5914
5954
|
function contentToMldev$3(fromObject) {
|
|
5915
5955
|
const toObject = {};
|
|
5916
5956
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -5929,14 +5969,14 @@ function contentToMldev$3(fromObject) {
|
|
|
5929
5969
|
}
|
|
5930
5970
|
return toObject;
|
|
5931
5971
|
}
|
|
5932
|
-
function contentToVertex$
|
|
5972
|
+
function contentToVertex$3(fromObject) {
|
|
5933
5973
|
const toObject = {};
|
|
5934
5974
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5935
5975
|
if (fromParts != null) {
|
|
5936
5976
|
let transformedList = fromParts;
|
|
5937
5977
|
if (Array.isArray(transformedList)) {
|
|
5938
5978
|
transformedList = transformedList.map((item) => {
|
|
5939
|
-
return partToVertex$
|
|
5979
|
+
return partToVertex$3(item);
|
|
5940
5980
|
});
|
|
5941
5981
|
}
|
|
5942
5982
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -6015,7 +6055,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
6015
6055
|
let transformedList = tContents(fromContents);
|
|
6016
6056
|
if (Array.isArray(transformedList)) {
|
|
6017
6057
|
transformedList = transformedList.map((item) => {
|
|
6018
|
-
return contentToVertex$
|
|
6058
|
+
return contentToVertex$3(item);
|
|
6019
6059
|
});
|
|
6020
6060
|
}
|
|
6021
6061
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -6024,7 +6064,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
6024
6064
|
'systemInstruction',
|
|
6025
6065
|
]);
|
|
6026
6066
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
6027
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$
|
|
6067
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$3(tContent(fromSystemInstruction)));
|
|
6028
6068
|
}
|
|
6029
6069
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
6030
6070
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -6106,7 +6146,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6106
6146
|
}
|
|
6107
6147
|
return toObject;
|
|
6108
6148
|
}
|
|
6109
|
-
function executableCodeToVertex$
|
|
6149
|
+
function executableCodeToVertex$3(fromObject) {
|
|
6110
6150
|
const toObject = {};
|
|
6111
6151
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6112
6152
|
if (fromCode != null) {
|
|
@@ -6320,6 +6360,16 @@ function listCachedContentsResponseFromVertex(fromObject) {
|
|
|
6320
6360
|
}
|
|
6321
6361
|
return toObject;
|
|
6322
6362
|
}
|
|
6363
|
+
function mcpServerToVertex$2(fromObject) {
|
|
6364
|
+
const toObject = {};
|
|
6365
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
6366
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6367
|
+
}
|
|
6368
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
6369
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6370
|
+
}
|
|
6371
|
+
return toObject;
|
|
6372
|
+
}
|
|
6323
6373
|
function partToMldev$3(fromObject) {
|
|
6324
6374
|
const toObject = {};
|
|
6325
6375
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -6392,7 +6442,7 @@ function partToMldev$3(fromObject) {
|
|
|
6392
6442
|
}
|
|
6393
6443
|
return toObject;
|
|
6394
6444
|
}
|
|
6395
|
-
function partToVertex$
|
|
6445
|
+
function partToVertex$3(fromObject) {
|
|
6396
6446
|
const toObject = {};
|
|
6397
6447
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
6398
6448
|
'mediaResolution',
|
|
@@ -6404,13 +6454,13 @@ function partToVertex$2(fromObject) {
|
|
|
6404
6454
|
'codeExecutionResult',
|
|
6405
6455
|
]);
|
|
6406
6456
|
if (fromCodeExecutionResult != null) {
|
|
6407
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
6457
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$3(fromCodeExecutionResult));
|
|
6408
6458
|
}
|
|
6409
6459
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6410
6460
|
'executableCode',
|
|
6411
6461
|
]);
|
|
6412
6462
|
if (fromExecutableCode != null) {
|
|
6413
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
6463
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$3(fromExecutableCode));
|
|
6414
6464
|
}
|
|
6415
6465
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6416
6466
|
if (fromFileData != null) {
|
|
@@ -6576,7 +6626,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6576
6626
|
}
|
|
6577
6627
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
6578
6628
|
if (fromComputerUse != null) {
|
|
6579
|
-
setValueByPath(toObject, ['computerUse'],
|
|
6629
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
6580
6630
|
}
|
|
6581
6631
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
6582
6632
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -6629,8 +6679,15 @@ function toolToVertex$2(fromObject) {
|
|
|
6629
6679
|
if (fromUrlContext != null) {
|
|
6630
6680
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
6631
6681
|
}
|
|
6632
|
-
|
|
6633
|
-
|
|
6682
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
6683
|
+
if (fromMcpServers != null) {
|
|
6684
|
+
let transformedList = fromMcpServers;
|
|
6685
|
+
if (Array.isArray(transformedList)) {
|
|
6686
|
+
transformedList = transformedList.map((item) => {
|
|
6687
|
+
return mcpServerToVertex$2(item);
|
|
6688
|
+
});
|
|
6689
|
+
}
|
|
6690
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6634
6691
|
}
|
|
6635
6692
|
return toObject;
|
|
6636
6693
|
}
|
|
@@ -7968,7 +8025,7 @@ function blobToMldev$2(fromObject) {
|
|
|
7968
8025
|
}
|
|
7969
8026
|
return toObject;
|
|
7970
8027
|
}
|
|
7971
|
-
function codeExecutionResultToVertex$
|
|
8028
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
7972
8029
|
const toObject = {};
|
|
7973
8030
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7974
8031
|
if (fromOutcome != null) {
|
|
@@ -7983,24 +8040,6 @@ function codeExecutionResultToVertex$1(fromObject) {
|
|
|
7983
8040
|
}
|
|
7984
8041
|
return toObject;
|
|
7985
8042
|
}
|
|
7986
|
-
function computerUseToVertex$1(fromObject) {
|
|
7987
|
-
const toObject = {};
|
|
7988
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
7989
|
-
if (fromEnvironment != null) {
|
|
7990
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
7991
|
-
}
|
|
7992
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
7993
|
-
'excludedPredefinedFunctions',
|
|
7994
|
-
]);
|
|
7995
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
7996
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
7997
|
-
}
|
|
7998
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
7999
|
-
undefined) {
|
|
8000
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8001
|
-
}
|
|
8002
|
-
return toObject;
|
|
8003
|
-
}
|
|
8004
8043
|
function contentToMldev$2(fromObject) {
|
|
8005
8044
|
const toObject = {};
|
|
8006
8045
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -8019,14 +8058,14 @@ function contentToMldev$2(fromObject) {
|
|
|
8019
8058
|
}
|
|
8020
8059
|
return toObject;
|
|
8021
8060
|
}
|
|
8022
|
-
function contentToVertex$
|
|
8061
|
+
function contentToVertex$2(fromObject) {
|
|
8023
8062
|
const toObject = {};
|
|
8024
8063
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8025
8064
|
if (fromParts != null) {
|
|
8026
8065
|
let transformedList = fromParts;
|
|
8027
8066
|
if (Array.isArray(transformedList)) {
|
|
8028
8067
|
transformedList = transformedList.map((item) => {
|
|
8029
|
-
return partToVertex$
|
|
8068
|
+
return partToVertex$2(item);
|
|
8030
8069
|
});
|
|
8031
8070
|
}
|
|
8032
8071
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -8037,7 +8076,7 @@ function contentToVertex$1(fromObject) {
|
|
|
8037
8076
|
}
|
|
8038
8077
|
return toObject;
|
|
8039
8078
|
}
|
|
8040
|
-
function executableCodeToVertex$
|
|
8079
|
+
function executableCodeToVertex$2(fromObject) {
|
|
8041
8080
|
const toObject = {};
|
|
8042
8081
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8043
8082
|
if (fromCode != null) {
|
|
@@ -8376,11 +8415,11 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
8376
8415
|
}
|
|
8377
8416
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8378
8417
|
}
|
|
8379
|
-
const
|
|
8380
|
-
'
|
|
8418
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
8419
|
+
'translationConfig',
|
|
8381
8420
|
]);
|
|
8382
|
-
if (parentObject !== undefined &&
|
|
8383
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
8421
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
8422
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
8384
8423
|
}
|
|
8385
8424
|
return toObject;
|
|
8386
8425
|
}
|
|
@@ -8446,7 +8485,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8446
8485
|
'systemInstruction',
|
|
8447
8486
|
]);
|
|
8448
8487
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8449
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$
|
|
8488
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
|
|
8450
8489
|
}
|
|
8451
8490
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8452
8491
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -8514,8 +8553,8 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8514
8553
|
}
|
|
8515
8554
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8516
8555
|
}
|
|
8517
|
-
if (getValueByPath(fromObject, ['
|
|
8518
|
-
throw new Error('
|
|
8556
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
8557
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8519
8558
|
}
|
|
8520
8559
|
return toObject;
|
|
8521
8560
|
}
|
|
@@ -8707,6 +8746,16 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8707
8746
|
}
|
|
8708
8747
|
return toObject;
|
|
8709
8748
|
}
|
|
8749
|
+
function mcpServerToVertex$1(fromObject) {
|
|
8750
|
+
const toObject = {};
|
|
8751
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
8752
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8753
|
+
}
|
|
8754
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
8755
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8756
|
+
}
|
|
8757
|
+
return toObject;
|
|
8758
|
+
}
|
|
8710
8759
|
function partToMldev$2(fromObject) {
|
|
8711
8760
|
const toObject = {};
|
|
8712
8761
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -8779,7 +8828,7 @@ function partToMldev$2(fromObject) {
|
|
|
8779
8828
|
}
|
|
8780
8829
|
return toObject;
|
|
8781
8830
|
}
|
|
8782
|
-
function partToVertex$
|
|
8831
|
+
function partToVertex$2(fromObject) {
|
|
8783
8832
|
const toObject = {};
|
|
8784
8833
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8785
8834
|
'mediaResolution',
|
|
@@ -8791,13 +8840,13 @@ function partToVertex$1(fromObject) {
|
|
|
8791
8840
|
'codeExecutionResult',
|
|
8792
8841
|
]);
|
|
8793
8842
|
if (fromCodeExecutionResult != null) {
|
|
8794
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
8843
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
8795
8844
|
}
|
|
8796
8845
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8797
8846
|
'executableCode',
|
|
8798
8847
|
]);
|
|
8799
8848
|
if (fromExecutableCode != null) {
|
|
8800
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
8849
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
8801
8850
|
}
|
|
8802
8851
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8803
8852
|
if (fromFileData != null) {
|
|
@@ -8949,7 +8998,7 @@ function toolToVertex$1(fromObject) {
|
|
|
8949
8998
|
}
|
|
8950
8999
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
8951
9000
|
if (fromComputerUse != null) {
|
|
8952
|
-
setValueByPath(toObject, ['computerUse'],
|
|
9001
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
8953
9002
|
}
|
|
8954
9003
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8955
9004
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -9002,8 +9051,15 @@ function toolToVertex$1(fromObject) {
|
|
|
9002
9051
|
if (fromUrlContext != null) {
|
|
9003
9052
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
9004
9053
|
}
|
|
9005
|
-
|
|
9006
|
-
|
|
9054
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
9055
|
+
if (fromMcpServers != null) {
|
|
9056
|
+
let transformedList = fromMcpServers;
|
|
9057
|
+
if (Array.isArray(transformedList)) {
|
|
9058
|
+
transformedList = transformedList.map((item) => {
|
|
9059
|
+
return mcpServerToVertex$1(item);
|
|
9060
|
+
});
|
|
9061
|
+
}
|
|
9062
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
9007
9063
|
}
|
|
9008
9064
|
return toObject;
|
|
9009
9065
|
}
|
|
@@ -9229,7 +9285,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9229
9285
|
}
|
|
9230
9286
|
return toObject;
|
|
9231
9287
|
}
|
|
9232
|
-
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9288
|
+
function codeExecutionResultToVertex$1(fromObject, _rootObject) {
|
|
9233
9289
|
const toObject = {};
|
|
9234
9290
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9235
9291
|
if (fromOutcome != null) {
|
|
@@ -9255,7 +9311,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9255
9311
|
let transformedList = tContents(fromContents);
|
|
9256
9312
|
if (Array.isArray(transformedList)) {
|
|
9257
9313
|
transformedList = transformedList.map((item) => {
|
|
9258
|
-
return contentToVertex(item);
|
|
9314
|
+
return contentToVertex$1(item);
|
|
9259
9315
|
});
|
|
9260
9316
|
}
|
|
9261
9317
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9282,24 +9338,6 @@ function computeTokensResponseFromVertex(fromObject, _rootObject) {
|
|
|
9282
9338
|
}
|
|
9283
9339
|
return toObject;
|
|
9284
9340
|
}
|
|
9285
|
-
function computerUseToVertex(fromObject, _rootObject) {
|
|
9286
|
-
const toObject = {};
|
|
9287
|
-
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
9288
|
-
if (fromEnvironment != null) {
|
|
9289
|
-
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
9290
|
-
}
|
|
9291
|
-
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
9292
|
-
'excludedPredefinedFunctions',
|
|
9293
|
-
]);
|
|
9294
|
-
if (fromExcludedPredefinedFunctions != null) {
|
|
9295
|
-
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
9296
|
-
}
|
|
9297
|
-
if (getValueByPath(fromObject, ['enablePromptInjectionDetection']) !==
|
|
9298
|
-
undefined) {
|
|
9299
|
-
throw new Error('enablePromptInjectionDetection parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9300
|
-
}
|
|
9301
|
-
return toObject;
|
|
9302
|
-
}
|
|
9303
9341
|
function contentEmbeddingFromVertex(fromObject, rootObject) {
|
|
9304
9342
|
const toObject = {};
|
|
9305
9343
|
const fromValues = getValueByPath(fromObject, ['values']);
|
|
@@ -9342,14 +9380,14 @@ function contentToMldev$1(fromObject, rootObject) {
|
|
|
9342
9380
|
}
|
|
9343
9381
|
return toObject;
|
|
9344
9382
|
}
|
|
9345
|
-
function contentToVertex(fromObject, rootObject) {
|
|
9383
|
+
function contentToVertex$1(fromObject, rootObject) {
|
|
9346
9384
|
const toObject = {};
|
|
9347
9385
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
9348
9386
|
if (fromParts != null) {
|
|
9349
9387
|
let transformedList = fromParts;
|
|
9350
9388
|
if (Array.isArray(transformedList)) {
|
|
9351
9389
|
transformedList = transformedList.map((item) => {
|
|
9352
|
-
return partToVertex(item);
|
|
9390
|
+
return partToVertex$1(item);
|
|
9353
9391
|
});
|
|
9354
9392
|
}
|
|
9355
9393
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -9393,7 +9431,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
9393
9431
|
'systemInstruction',
|
|
9394
9432
|
]);
|
|
9395
9433
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
9396
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
9434
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
9397
9435
|
}
|
|
9398
9436
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
9399
9437
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -9446,7 +9484,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9446
9484
|
let transformedList = tContents(fromContents);
|
|
9447
9485
|
if (Array.isArray(transformedList)) {
|
|
9448
9486
|
transformedList = transformedList.map((item) => {
|
|
9449
|
-
return contentToVertex(item);
|
|
9487
|
+
return contentToVertex$1(item);
|
|
9450
9488
|
});
|
|
9451
9489
|
}
|
|
9452
9490
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9882,7 +9920,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
|
|
|
9882
9920
|
if (discriminatorContent === 'EMBED_CONTENT') {
|
|
9883
9921
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
9884
9922
|
if (fromContent != null) {
|
|
9885
|
-
setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
|
|
9923
|
+
setValueByPath(toObject, ['content'], contentToVertex$1(tContent(fromContent)));
|
|
9886
9924
|
}
|
|
9887
9925
|
}
|
|
9888
9926
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -9974,7 +10012,7 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9974
10012
|
}
|
|
9975
10013
|
return toObject;
|
|
9976
10014
|
}
|
|
9977
|
-
function executableCodeToVertex(fromObject, _rootObject) {
|
|
10015
|
+
function executableCodeToVertex$1(fromObject, _rootObject) {
|
|
9978
10016
|
const toObject = {};
|
|
9979
10017
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9980
10018
|
if (fromCode != null) {
|
|
@@ -10217,7 +10255,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
10217
10255
|
'systemInstruction',
|
|
10218
10256
|
]);
|
|
10219
10257
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
10220
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
10258
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
10221
10259
|
}
|
|
10222
10260
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
10223
10261
|
if (fromTemperature != null) {
|
|
@@ -10422,7 +10460,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
10422
10460
|
let transformedList = tContents(fromContents);
|
|
10423
10461
|
if (Array.isArray(transformedList)) {
|
|
10424
10462
|
transformedList = transformedList.map((item) => {
|
|
10425
|
-
return contentToVertex(item);
|
|
10463
|
+
return contentToVertex$1(item);
|
|
10426
10464
|
});
|
|
10427
10465
|
}
|
|
10428
10466
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -11677,6 +11715,16 @@ function maskReferenceConfigToVertex(fromObject, _rootObject) {
|
|
|
11677
11715
|
}
|
|
11678
11716
|
return toObject;
|
|
11679
11717
|
}
|
|
11718
|
+
function mcpServerToVertex(fromObject, _rootObject) {
|
|
11719
|
+
const toObject = {};
|
|
11720
|
+
if (getValueByPath(fromObject, ['name']) !== undefined) {
|
|
11721
|
+
throw new Error('name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11722
|
+
}
|
|
11723
|
+
if (getValueByPath(fromObject, ['streamableHttpTransport']) !== undefined) {
|
|
11724
|
+
throw new Error('streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11725
|
+
}
|
|
11726
|
+
return toObject;
|
|
11727
|
+
}
|
|
11680
11728
|
function modelFromMldev(fromObject, rootObject) {
|
|
11681
11729
|
const toObject = {};
|
|
11682
11730
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -11867,7 +11915,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11867
11915
|
}
|
|
11868
11916
|
return toObject;
|
|
11869
11917
|
}
|
|
11870
|
-
function partToVertex(fromObject, rootObject) {
|
|
11918
|
+
function partToVertex$1(fromObject, rootObject) {
|
|
11871
11919
|
const toObject = {};
|
|
11872
11920
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11873
11921
|
'mediaResolution',
|
|
@@ -11879,13 +11927,13 @@ function partToVertex(fromObject, rootObject) {
|
|
|
11879
11927
|
'codeExecutionResult',
|
|
11880
11928
|
]);
|
|
11881
11929
|
if (fromCodeExecutionResult != null) {
|
|
11882
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11930
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
11883
11931
|
}
|
|
11884
11932
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11885
11933
|
'executableCode',
|
|
11886
11934
|
]);
|
|
11887
11935
|
if (fromExecutableCode != null) {
|
|
11888
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11936
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
11889
11937
|
}
|
|
11890
11938
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11891
11939
|
if (fromFileData != null) {
|
|
@@ -12368,7 +12416,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12368
12416
|
}
|
|
12369
12417
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
12370
12418
|
if (fromComputerUse != null) {
|
|
12371
|
-
setValueByPath(toObject, ['computerUse'],
|
|
12419
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
12372
12420
|
}
|
|
12373
12421
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
12374
12422
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -12421,8 +12469,15 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12421
12469
|
if (fromUrlContext != null) {
|
|
12422
12470
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
12423
12471
|
}
|
|
12424
|
-
|
|
12425
|
-
|
|
12472
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
12473
|
+
if (fromMcpServers != null) {
|
|
12474
|
+
let transformedList = fromMcpServers;
|
|
12475
|
+
if (Array.isArray(transformedList)) {
|
|
12476
|
+
transformedList = transformedList.map((item) => {
|
|
12477
|
+
return mcpServerToVertex(item);
|
|
12478
|
+
});
|
|
12479
|
+
}
|
|
12480
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
12426
12481
|
}
|
|
12427
12482
|
return toObject;
|
|
12428
12483
|
}
|
|
@@ -12985,7 +13040,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12985
13040
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12986
13041
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12987
13042
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12988
|
-
const SDK_VERSION = '2.
|
|
13043
|
+
const SDK_VERSION = '2.8.0'; // x-release-please-version
|
|
12989
13044
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12990
13045
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12991
13046
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -16635,11 +16690,11 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
16635
16690
|
}
|
|
16636
16691
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
16637
16692
|
}
|
|
16638
|
-
const
|
|
16639
|
-
'
|
|
16693
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
16694
|
+
'translationConfig',
|
|
16640
16695
|
]);
|
|
16641
|
-
if (parentObject !== undefined &&
|
|
16642
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
16696
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
16697
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
16643
16698
|
}
|
|
16644
16699
|
return toObject;
|
|
16645
16700
|
}
|
|
@@ -20008,6 +20063,39 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
|
|
|
20008
20063
|
}
|
|
20009
20064
|
return toObject;
|
|
20010
20065
|
}
|
|
20066
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
20067
|
+
const toObject = {};
|
|
20068
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
20069
|
+
if (fromOutcome != null) {
|
|
20070
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
20071
|
+
}
|
|
20072
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
20073
|
+
if (fromOutput != null) {
|
|
20074
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
20075
|
+
}
|
|
20076
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
20077
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20078
|
+
}
|
|
20079
|
+
return toObject;
|
|
20080
|
+
}
|
|
20081
|
+
function contentToVertex(fromObject, rootObject) {
|
|
20082
|
+
const toObject = {};
|
|
20083
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
20084
|
+
if (fromParts != null) {
|
|
20085
|
+
let transformedList = fromParts;
|
|
20086
|
+
if (Array.isArray(transformedList)) {
|
|
20087
|
+
transformedList = transformedList.map((item) => {
|
|
20088
|
+
return partToVertex(item);
|
|
20089
|
+
});
|
|
20090
|
+
}
|
|
20091
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
20092
|
+
}
|
|
20093
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
20094
|
+
if (fromRole != null) {
|
|
20095
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
20096
|
+
}
|
|
20097
|
+
return toObject;
|
|
20098
|
+
}
|
|
20011
20099
|
function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
20012
20100
|
const toObject = {};
|
|
20013
20101
|
if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
|
|
@@ -20078,6 +20166,30 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
20078
20166
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
20079
20167
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20080
20168
|
}
|
|
20169
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
20170
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20171
|
+
}
|
|
20172
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
20173
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20174
|
+
}
|
|
20175
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
20176
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20177
|
+
}
|
|
20178
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
20179
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20180
|
+
}
|
|
20181
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
20182
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20183
|
+
}
|
|
20184
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
20185
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20186
|
+
}
|
|
20187
|
+
if (getValueByPath(fromObject, ['thinkingLevel']) !== undefined) {
|
|
20188
|
+
throw new Error('thinkingLevel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20189
|
+
}
|
|
20190
|
+
if (getValueByPath(fromObject, ['validationDatasetUri']) !== undefined) {
|
|
20191
|
+
throw new Error('validationDatasetUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20192
|
+
}
|
|
20081
20193
|
return toObject;
|
|
20082
20194
|
}
|
|
20083
20195
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -20113,6 +20225,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20113
20225
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20114
20226
|
}
|
|
20115
20227
|
}
|
|
20228
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
20229
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
20230
|
+
'validationDataset',
|
|
20231
|
+
]);
|
|
20232
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
20233
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20234
|
+
}
|
|
20235
|
+
}
|
|
20116
20236
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
20117
20237
|
'tunedModelDisplayName',
|
|
20118
20238
|
]);
|
|
@@ -20148,6 +20268,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20148
20268
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20149
20269
|
}
|
|
20150
20270
|
}
|
|
20271
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
20272
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20273
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
20274
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20275
|
+
}
|
|
20276
|
+
}
|
|
20151
20277
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
20152
20278
|
'config',
|
|
20153
20279
|
'method',
|
|
@@ -20183,6 +20309,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20183
20309
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20184
20310
|
}
|
|
20185
20311
|
}
|
|
20312
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
20313
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20314
|
+
'learningRateMultiplier',
|
|
20315
|
+
]);
|
|
20316
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
20317
|
+
setValueByPath(parentObject, [
|
|
20318
|
+
'reinforcementTuningSpec',
|
|
20319
|
+
'hyperParameters',
|
|
20320
|
+
'learningRateMultiplier',
|
|
20321
|
+
], fromLearningRateMultiplier);
|
|
20322
|
+
}
|
|
20323
|
+
}
|
|
20186
20324
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
20187
20325
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
20188
20326
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -20236,6 +20374,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20236
20374
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20237
20375
|
}
|
|
20238
20376
|
}
|
|
20377
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20378
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20379
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20380
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20381
|
+
}
|
|
20382
|
+
}
|
|
20239
20383
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
20240
20384
|
'config',
|
|
20241
20385
|
'method',
|
|
@@ -20280,6 +20424,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20280
20424
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20281
20425
|
}
|
|
20282
20426
|
}
|
|
20427
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20428
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20429
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20430
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20431
|
+
}
|
|
20432
|
+
}
|
|
20283
20433
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
20284
20434
|
'config',
|
|
20285
20435
|
'method',
|
|
@@ -20339,6 +20489,52 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20339
20489
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
20340
20490
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
20341
20491
|
}
|
|
20492
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20493
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20494
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20495
|
+
}
|
|
20496
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20497
|
+
'compositeRewardConfig',
|
|
20498
|
+
]);
|
|
20499
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20500
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20501
|
+
}
|
|
20502
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20503
|
+
'samplesPerPrompt',
|
|
20504
|
+
]);
|
|
20505
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20506
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20507
|
+
}
|
|
20508
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20509
|
+
'evaluateInterval',
|
|
20510
|
+
]);
|
|
20511
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20512
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20513
|
+
}
|
|
20514
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20515
|
+
'checkpointInterval',
|
|
20516
|
+
]);
|
|
20517
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20518
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20519
|
+
}
|
|
20520
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20521
|
+
'maxOutputTokens',
|
|
20522
|
+
]);
|
|
20523
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20524
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20525
|
+
}
|
|
20526
|
+
const fromThinkingLevel = getValueByPath(fromObject, [
|
|
20527
|
+
'thinkingLevel',
|
|
20528
|
+
]);
|
|
20529
|
+
if (parentObject !== undefined && fromThinkingLevel != null) {
|
|
20530
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'thinkingLevel'], fromThinkingLevel);
|
|
20531
|
+
}
|
|
20532
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20533
|
+
'validationDatasetUri',
|
|
20534
|
+
]);
|
|
20535
|
+
if (parentObject !== undefined && fromValidationDatasetUri != null) {
|
|
20536
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'validationDatasetUri'], fromValidationDatasetUri);
|
|
20537
|
+
}
|
|
20342
20538
|
return toObject;
|
|
20343
20539
|
}
|
|
20344
20540
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20509,6 +20705,21 @@ function distillationSpecFromVertex(fromObject, rootObject) {
|
|
|
20509
20705
|
}
|
|
20510
20706
|
return toObject;
|
|
20511
20707
|
}
|
|
20708
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
20709
|
+
const toObject = {};
|
|
20710
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
20711
|
+
if (fromCode != null) {
|
|
20712
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
20713
|
+
}
|
|
20714
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
20715
|
+
if (fromLanguage != null) {
|
|
20716
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
20717
|
+
}
|
|
20718
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
20719
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20720
|
+
}
|
|
20721
|
+
return toObject;
|
|
20722
|
+
}
|
|
20512
20723
|
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20513
20724
|
const toObject = {};
|
|
20514
20725
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
@@ -20699,6 +20910,99 @@ function listTuningJobsResponseFromVertex(fromObject, rootObject) {
|
|
|
20699
20910
|
}
|
|
20700
20911
|
return toObject;
|
|
20701
20912
|
}
|
|
20913
|
+
function partToVertex(fromObject, rootObject) {
|
|
20914
|
+
const toObject = {};
|
|
20915
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20916
|
+
'mediaResolution',
|
|
20917
|
+
]);
|
|
20918
|
+
if (fromMediaResolution != null) {
|
|
20919
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20920
|
+
}
|
|
20921
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
20922
|
+
'codeExecutionResult',
|
|
20923
|
+
]);
|
|
20924
|
+
if (fromCodeExecutionResult != null) {
|
|
20925
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
20926
|
+
}
|
|
20927
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
20928
|
+
'executableCode',
|
|
20929
|
+
]);
|
|
20930
|
+
if (fromExecutableCode != null) {
|
|
20931
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
20932
|
+
}
|
|
20933
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
20934
|
+
if (fromFileData != null) {
|
|
20935
|
+
setValueByPath(toObject, ['fileData'], fromFileData);
|
|
20936
|
+
}
|
|
20937
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
20938
|
+
if (fromFunctionCall != null) {
|
|
20939
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
20940
|
+
}
|
|
20941
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
20942
|
+
'functionResponse',
|
|
20943
|
+
]);
|
|
20944
|
+
if (fromFunctionResponse != null) {
|
|
20945
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
20946
|
+
}
|
|
20947
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
20948
|
+
if (fromInlineData != null) {
|
|
20949
|
+
setValueByPath(toObject, ['inlineData'], fromInlineData);
|
|
20950
|
+
}
|
|
20951
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
20952
|
+
if (fromText != null) {
|
|
20953
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
20954
|
+
}
|
|
20955
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
20956
|
+
if (fromThought != null) {
|
|
20957
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
20958
|
+
}
|
|
20959
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
20960
|
+
'thoughtSignature',
|
|
20961
|
+
]);
|
|
20962
|
+
if (fromThoughtSignature != null) {
|
|
20963
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
20964
|
+
}
|
|
20965
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
20966
|
+
'videoMetadata',
|
|
20967
|
+
]);
|
|
20968
|
+
if (fromVideoMetadata != null) {
|
|
20969
|
+
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
20970
|
+
}
|
|
20971
|
+
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
20972
|
+
throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20973
|
+
}
|
|
20974
|
+
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
20975
|
+
throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20976
|
+
}
|
|
20977
|
+
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
20978
|
+
throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20979
|
+
}
|
|
20980
|
+
return toObject;
|
|
20981
|
+
}
|
|
20982
|
+
function reinforcementTuningExampleToVertex(fromObject, rootObject) {
|
|
20983
|
+
const toObject = {};
|
|
20984
|
+
const fromContents = getValueByPath(fromObject, ['contents']);
|
|
20985
|
+
if (fromContents != null) {
|
|
20986
|
+
let transformedList = fromContents;
|
|
20987
|
+
if (Array.isArray(transformedList)) {
|
|
20988
|
+
transformedList = transformedList.map((item) => {
|
|
20989
|
+
return contentToVertex(item);
|
|
20990
|
+
});
|
|
20991
|
+
}
|
|
20992
|
+
setValueByPath(toObject, ['contents'], transformedList);
|
|
20993
|
+
}
|
|
20994
|
+
const fromReferences = getValueByPath(fromObject, ['references']);
|
|
20995
|
+
if (fromReferences != null) {
|
|
20996
|
+
setValueByPath(toObject, ['references'], fromReferences);
|
|
20997
|
+
}
|
|
20998
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
20999
|
+
'systemInstruction',
|
|
21000
|
+
]);
|
|
21001
|
+
if (fromSystemInstruction != null) {
|
|
21002
|
+
setValueByPath(toObject, ['systemInstruction'], contentToVertex(fromSystemInstruction));
|
|
21003
|
+
}
|
|
21004
|
+
return toObject;
|
|
21005
|
+
}
|
|
20702
21006
|
function tunedModelFromMldev(fromObject, _rootObject) {
|
|
20703
21007
|
const toObject = {};
|
|
20704
21008
|
const fromModel = getValueByPath(fromObject, ['name']);
|
|
@@ -20758,6 +21062,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20758
21062
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20759
21063
|
}
|
|
20760
21064
|
}
|
|
21065
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
21066
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
21067
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
21068
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
21069
|
+
}
|
|
21070
|
+
}
|
|
20761
21071
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20762
21072
|
'config',
|
|
20763
21073
|
'method',
|
|
@@ -20789,6 +21099,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20789
21099
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20790
21100
|
}
|
|
20791
21101
|
}
|
|
21102
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
21103
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
21104
|
+
'vertexDatasetResource',
|
|
21105
|
+
]);
|
|
21106
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
21107
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
21108
|
+
}
|
|
21109
|
+
}
|
|
20792
21110
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20793
21111
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20794
21112
|
}
|
|
@@ -20918,6 +21236,12 @@ function tuningJobFromVertex(fromObject, rootObject) {
|
|
|
20918
21236
|
if (fromDistillationSpec != null) {
|
|
20919
21237
|
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20920
21238
|
}
|
|
21239
|
+
const fromReinforcementTuningSpec = getValueByPath(fromObject, [
|
|
21240
|
+
'reinforcementTuningSpec',
|
|
21241
|
+
]);
|
|
21242
|
+
if (fromReinforcementTuningSpec != null) {
|
|
21243
|
+
setValueByPath(toObject, ['reinforcementTuningSpec'], fromReinforcementTuningSpec);
|
|
21244
|
+
}
|
|
20921
21245
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20922
21246
|
'tuningDataStats',
|
|
20923
21247
|
]);
|
|
@@ -21060,6 +21384,62 @@ function tuningValidationDatasetToVertex(fromObject, _rootObject) {
|
|
|
21060
21384
|
}
|
|
21061
21385
|
return toObject;
|
|
21062
21386
|
}
|
|
21387
|
+
function validateRewardParametersToVertex(fromObject, rootObject) {
|
|
21388
|
+
const toObject = {};
|
|
21389
|
+
const fromParent = getValueByPath(fromObject, ['parent']);
|
|
21390
|
+
if (fromParent != null) {
|
|
21391
|
+
setValueByPath(toObject, ['_url', 'parent'], fromParent);
|
|
21392
|
+
}
|
|
21393
|
+
const fromSampleResponse = getValueByPath(fromObject, [
|
|
21394
|
+
'sampleResponse',
|
|
21395
|
+
]);
|
|
21396
|
+
if (fromSampleResponse != null) {
|
|
21397
|
+
setValueByPath(toObject, ['sampleResponse'], contentToVertex(fromSampleResponse));
|
|
21398
|
+
}
|
|
21399
|
+
const fromExample = getValueByPath(fromObject, ['example']);
|
|
21400
|
+
if (fromExample != null) {
|
|
21401
|
+
setValueByPath(toObject, ['example'], reinforcementTuningExampleToVertex(fromExample));
|
|
21402
|
+
}
|
|
21403
|
+
const fromSingleRewardConfig = getValueByPath(fromObject, [
|
|
21404
|
+
'singleRewardConfig',
|
|
21405
|
+
]);
|
|
21406
|
+
if (fromSingleRewardConfig != null) {
|
|
21407
|
+
setValueByPath(toObject, ['singleRewardConfig'], fromSingleRewardConfig);
|
|
21408
|
+
}
|
|
21409
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
21410
|
+
'compositeRewardConfig',
|
|
21411
|
+
]);
|
|
21412
|
+
if (fromCompositeRewardConfig != null) {
|
|
21413
|
+
setValueByPath(toObject, ['compositeRewardConfig'], fromCompositeRewardConfig);
|
|
21414
|
+
}
|
|
21415
|
+
return toObject;
|
|
21416
|
+
}
|
|
21417
|
+
function validateRewardResponseFromVertex(fromObject, _rootObject) {
|
|
21418
|
+
const toObject = {};
|
|
21419
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
21420
|
+
'sdkHttpResponse',
|
|
21421
|
+
]);
|
|
21422
|
+
if (fromSdkHttpResponse != null) {
|
|
21423
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
21424
|
+
}
|
|
21425
|
+
const fromOverallReward = getValueByPath(fromObject, [
|
|
21426
|
+
'overallReward',
|
|
21427
|
+
]);
|
|
21428
|
+
if (fromOverallReward != null) {
|
|
21429
|
+
setValueByPath(toObject, ['overallReward'], fromOverallReward);
|
|
21430
|
+
}
|
|
21431
|
+
const fromError = getValueByPath(fromObject, ['error']);
|
|
21432
|
+
if (fromError != null) {
|
|
21433
|
+
setValueByPath(toObject, ['error'], fromError);
|
|
21434
|
+
}
|
|
21435
|
+
const fromRewardInfoDetails = getValueByPath(fromObject, [
|
|
21436
|
+
'rewardInfoDetails',
|
|
21437
|
+
]);
|
|
21438
|
+
if (fromRewardInfoDetails != null) {
|
|
21439
|
+
setValueByPath(toObject, ['rewardInfoDetails'], fromRewardInfoDetails);
|
|
21440
|
+
}
|
|
21441
|
+
return toObject;
|
|
21442
|
+
}
|
|
21063
21443
|
|
|
21064
21444
|
/**
|
|
21065
21445
|
* @license
|
|
@@ -21406,6 +21786,46 @@ class Tunings extends BaseModule {
|
|
|
21406
21786
|
});
|
|
21407
21787
|
}
|
|
21408
21788
|
}
|
|
21789
|
+
async validateReward(params) {
|
|
21790
|
+
var _a, _b;
|
|
21791
|
+
let response;
|
|
21792
|
+
let path = '';
|
|
21793
|
+
let queryParams = {};
|
|
21794
|
+
if (this.apiClient.isVertexAI()) {
|
|
21795
|
+
const body = validateRewardParametersToVertex(params);
|
|
21796
|
+
path = formatMap('{parent}/tuningJobs:validateReinforcementTuningReward', body['_url']);
|
|
21797
|
+
queryParams = body['_query'];
|
|
21798
|
+
delete body['_url'];
|
|
21799
|
+
delete body['_query'];
|
|
21800
|
+
response = this.apiClient
|
|
21801
|
+
.request({
|
|
21802
|
+
path: path,
|
|
21803
|
+
queryParams: queryParams,
|
|
21804
|
+
body: JSON.stringify(body),
|
|
21805
|
+
httpMethod: 'POST',
|
|
21806
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
21807
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
21808
|
+
})
|
|
21809
|
+
.then((httpResponse) => {
|
|
21810
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
21811
|
+
const response = jsonResponse;
|
|
21812
|
+
response.sdkHttpResponse = {
|
|
21813
|
+
headers: httpResponse.headers,
|
|
21814
|
+
};
|
|
21815
|
+
return response;
|
|
21816
|
+
});
|
|
21817
|
+
});
|
|
21818
|
+
return response.then((apiResponse) => {
|
|
21819
|
+
const resp = validateRewardResponseFromVertex(apiResponse);
|
|
21820
|
+
const typedResp = new ValidateRewardResponse();
|
|
21821
|
+
Object.assign(typedResp, resp);
|
|
21822
|
+
return typedResp;
|
|
21823
|
+
});
|
|
21824
|
+
}
|
|
21825
|
+
else {
|
|
21826
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
21827
|
+
}
|
|
21828
|
+
}
|
|
21409
21829
|
}
|
|
21410
21830
|
|
|
21411
21831
|
const MAX_CHUNK_SIZE = 1024 * 1024 * 8; // bytes
|
|
@@ -21979,5 +22399,5 @@ function getApiKeyFromEnv() {
|
|
|
21979
22399
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
21980
22400
|
}
|
|
21981
22401
|
|
|
21982
|
-
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 };
|
|
22402
|
+
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 };
|
|
21983
22403
|
//# sourceMappingURL=index.mjs.map
|