@google/genai 2.7.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 +292 -47
- package/dist/index.cjs +432 -64
- package/dist/index.mjs +430 -65
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +432 -64
- package/dist/node/index.mjs +430 -65
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +292 -47
- package/dist/tokenizer/node.cjs +53 -1
- package/dist/tokenizer/node.d.ts +14 -28
- package/dist/tokenizer/node.mjs +53 -1
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +54 -2
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +291 -47
- package/dist/vertex_internal/index.js +54 -2
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +430 -65
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +292 -47
- 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
|
/**
|
|
@@ -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) {
|
|
@@ -2207,24 +2259,13 @@ the API in a subsequent turn within a `Content` message, along with the
|
|
|
2207
2259
|
corresponding `ToolCall`. */
|
|
2208
2260
|
class ToolResponse {
|
|
2209
2261
|
}
|
|
2210
|
-
/** Raw media bytes for function response.
|
|
2211
|
-
|
|
2212
|
-
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
2213
|
-
field. */
|
|
2262
|
+
/** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
|
|
2214
2263
|
class FunctionResponseBlob {
|
|
2215
2264
|
}
|
|
2216
|
-
/** URI based data for function response. */
|
|
2265
|
+
/** URI based data for function response. This data type is not supported in Gemini API. */
|
|
2217
2266
|
class FunctionResponseFileData {
|
|
2218
2267
|
}
|
|
2219
|
-
/** A datatype containing media that is part of a `FunctionResponse` message.
|
|
2220
|
-
|
|
2221
|
-
A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
2222
|
-
`FunctionResponsePart` can only contain one of the accepted types in
|
|
2223
|
-
`FunctionResponsePart.data`.
|
|
2224
|
-
|
|
2225
|
-
A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
2226
|
-
type and subtype of the media if the `inline_data` field is filled with raw
|
|
2227
|
-
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. */
|
|
2228
2269
|
class FunctionResponsePart {
|
|
2229
2270
|
}
|
|
2230
2271
|
/**
|
|
@@ -2249,7 +2290,7 @@ function createFunctionResponsePartFromUri(uri, mimeType) {
|
|
|
2249
2290
|
},
|
|
2250
2291
|
};
|
|
2251
2292
|
}
|
|
2252
|
-
/**
|
|
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. */
|
|
2253
2294
|
class FunctionResponse {
|
|
2254
2295
|
}
|
|
2255
2296
|
/**
|
|
@@ -2677,6 +2718,12 @@ class GenerateVideosOperation {
|
|
|
2677
2718
|
return operation;
|
|
2678
2719
|
}
|
|
2679
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
|
+
}
|
|
2680
2727
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
2681
2728
|
class EvaluateDatasetResponse {
|
|
2682
2729
|
}
|
|
@@ -2686,6 +2733,12 @@ class ListTuningJobsResponse {
|
|
|
2686
2733
|
/** Empty response for tunings.cancel method. */
|
|
2687
2734
|
class CancelTuningJobResponse {
|
|
2688
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
|
+
}
|
|
2689
2742
|
/** Empty response for caches.delete method. */
|
|
2690
2743
|
class DeleteCachedContentResponse {
|
|
2691
2744
|
}
|
|
@@ -5875,7 +5928,7 @@ function blobToMldev$3(fromObject) {
|
|
|
5875
5928
|
}
|
|
5876
5929
|
return toObject;
|
|
5877
5930
|
}
|
|
5878
|
-
function codeExecutionResultToVertex$
|
|
5931
|
+
function codeExecutionResultToVertex$3(fromObject) {
|
|
5879
5932
|
const toObject = {};
|
|
5880
5933
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5881
5934
|
if (fromOutcome != null) {
|
|
@@ -5908,14 +5961,14 @@ function contentToMldev$3(fromObject) {
|
|
|
5908
5961
|
}
|
|
5909
5962
|
return toObject;
|
|
5910
5963
|
}
|
|
5911
|
-
function contentToVertex$
|
|
5964
|
+
function contentToVertex$3(fromObject) {
|
|
5912
5965
|
const toObject = {};
|
|
5913
5966
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
5914
5967
|
if (fromParts != null) {
|
|
5915
5968
|
let transformedList = fromParts;
|
|
5916
5969
|
if (Array.isArray(transformedList)) {
|
|
5917
5970
|
transformedList = transformedList.map((item) => {
|
|
5918
|
-
return partToVertex$
|
|
5971
|
+
return partToVertex$3(item);
|
|
5919
5972
|
});
|
|
5920
5973
|
}
|
|
5921
5974
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -5994,7 +6047,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
5994
6047
|
let transformedList = tContents(fromContents);
|
|
5995
6048
|
if (Array.isArray(transformedList)) {
|
|
5996
6049
|
transformedList = transformedList.map((item) => {
|
|
5997
|
-
return contentToVertex$
|
|
6050
|
+
return contentToVertex$3(item);
|
|
5998
6051
|
});
|
|
5999
6052
|
}
|
|
6000
6053
|
setValueByPath(parentObject, ['contents'], transformedList);
|
|
@@ -6003,7 +6056,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
|
|
|
6003
6056
|
'systemInstruction',
|
|
6004
6057
|
]);
|
|
6005
6058
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
6006
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$
|
|
6059
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$3(tContent(fromSystemInstruction)));
|
|
6007
6060
|
}
|
|
6008
6061
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
6009
6062
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -6085,7 +6138,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6085
6138
|
}
|
|
6086
6139
|
return toObject;
|
|
6087
6140
|
}
|
|
6088
|
-
function executableCodeToVertex$
|
|
6141
|
+
function executableCodeToVertex$3(fromObject) {
|
|
6089
6142
|
const toObject = {};
|
|
6090
6143
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6091
6144
|
if (fromCode != null) {
|
|
@@ -6299,6 +6352,16 @@ function listCachedContentsResponseFromVertex(fromObject) {
|
|
|
6299
6352
|
}
|
|
6300
6353
|
return toObject;
|
|
6301
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
|
+
}
|
|
6302
6365
|
function partToMldev$3(fromObject) {
|
|
6303
6366
|
const toObject = {};
|
|
6304
6367
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -6371,7 +6434,7 @@ function partToMldev$3(fromObject) {
|
|
|
6371
6434
|
}
|
|
6372
6435
|
return toObject;
|
|
6373
6436
|
}
|
|
6374
|
-
function partToVertex$
|
|
6437
|
+
function partToVertex$3(fromObject) {
|
|
6375
6438
|
const toObject = {};
|
|
6376
6439
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
6377
6440
|
'mediaResolution',
|
|
@@ -6383,13 +6446,13 @@ function partToVertex$2(fromObject) {
|
|
|
6383
6446
|
'codeExecutionResult',
|
|
6384
6447
|
]);
|
|
6385
6448
|
if (fromCodeExecutionResult != null) {
|
|
6386
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
6449
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$3(fromCodeExecutionResult));
|
|
6387
6450
|
}
|
|
6388
6451
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6389
6452
|
'executableCode',
|
|
6390
6453
|
]);
|
|
6391
6454
|
if (fromExecutableCode != null) {
|
|
6392
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
6455
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$3(fromExecutableCode));
|
|
6393
6456
|
}
|
|
6394
6457
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6395
6458
|
if (fromFileData != null) {
|
|
@@ -6608,8 +6671,15 @@ function toolToVertex$2(fromObject) {
|
|
|
6608
6671
|
if (fromUrlContext != null) {
|
|
6609
6672
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
6610
6673
|
}
|
|
6611
|
-
|
|
6612
|
-
|
|
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);
|
|
6613
6683
|
}
|
|
6614
6684
|
return toObject;
|
|
6615
6685
|
}
|
|
@@ -7947,7 +8017,7 @@ function blobToMldev$2(fromObject) {
|
|
|
7947
8017
|
}
|
|
7948
8018
|
return toObject;
|
|
7949
8019
|
}
|
|
7950
|
-
function codeExecutionResultToVertex$
|
|
8020
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
7951
8021
|
const toObject = {};
|
|
7952
8022
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
7953
8023
|
if (fromOutcome != null) {
|
|
@@ -7980,14 +8050,14 @@ function contentToMldev$2(fromObject) {
|
|
|
7980
8050
|
}
|
|
7981
8051
|
return toObject;
|
|
7982
8052
|
}
|
|
7983
|
-
function contentToVertex$
|
|
8053
|
+
function contentToVertex$2(fromObject) {
|
|
7984
8054
|
const toObject = {};
|
|
7985
8055
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7986
8056
|
if (fromParts != null) {
|
|
7987
8057
|
let transformedList = fromParts;
|
|
7988
8058
|
if (Array.isArray(transformedList)) {
|
|
7989
8059
|
transformedList = transformedList.map((item) => {
|
|
7990
|
-
return partToVertex$
|
|
8060
|
+
return partToVertex$2(item);
|
|
7991
8061
|
});
|
|
7992
8062
|
}
|
|
7993
8063
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -7998,7 +8068,7 @@ function contentToVertex$1(fromObject) {
|
|
|
7998
8068
|
}
|
|
7999
8069
|
return toObject;
|
|
8000
8070
|
}
|
|
8001
|
-
function executableCodeToVertex$
|
|
8071
|
+
function executableCodeToVertex$2(fromObject) {
|
|
8002
8072
|
const toObject = {};
|
|
8003
8073
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
8004
8074
|
if (fromCode != null) {
|
|
@@ -8337,11 +8407,11 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
8337
8407
|
}
|
|
8338
8408
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8339
8409
|
}
|
|
8340
|
-
const
|
|
8341
|
-
'
|
|
8410
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
8411
|
+
'translationConfig',
|
|
8342
8412
|
]);
|
|
8343
|
-
if (parentObject !== undefined &&
|
|
8344
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
8413
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
8414
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
8345
8415
|
}
|
|
8346
8416
|
return toObject;
|
|
8347
8417
|
}
|
|
@@ -8407,7 +8477,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8407
8477
|
'systemInstruction',
|
|
8408
8478
|
]);
|
|
8409
8479
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8410
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$
|
|
8480
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
|
|
8411
8481
|
}
|
|
8412
8482
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8413
8483
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -8475,8 +8545,8 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8475
8545
|
}
|
|
8476
8546
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
8477
8547
|
}
|
|
8478
|
-
if (getValueByPath(fromObject, ['
|
|
8479
|
-
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.');
|
|
8480
8550
|
}
|
|
8481
8551
|
return toObject;
|
|
8482
8552
|
}
|
|
@@ -8668,6 +8738,16 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
8668
8738
|
}
|
|
8669
8739
|
return toObject;
|
|
8670
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
|
+
}
|
|
8671
8751
|
function partToMldev$2(fromObject) {
|
|
8672
8752
|
const toObject = {};
|
|
8673
8753
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -8740,7 +8820,7 @@ function partToMldev$2(fromObject) {
|
|
|
8740
8820
|
}
|
|
8741
8821
|
return toObject;
|
|
8742
8822
|
}
|
|
8743
|
-
function partToVertex$
|
|
8823
|
+
function partToVertex$2(fromObject) {
|
|
8744
8824
|
const toObject = {};
|
|
8745
8825
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8746
8826
|
'mediaResolution',
|
|
@@ -8752,13 +8832,13 @@ function partToVertex$1(fromObject) {
|
|
|
8752
8832
|
'codeExecutionResult',
|
|
8753
8833
|
]);
|
|
8754
8834
|
if (fromCodeExecutionResult != null) {
|
|
8755
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$
|
|
8835
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
8756
8836
|
}
|
|
8757
8837
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8758
8838
|
'executableCode',
|
|
8759
8839
|
]);
|
|
8760
8840
|
if (fromExecutableCode != null) {
|
|
8761
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$
|
|
8841
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
8762
8842
|
}
|
|
8763
8843
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8764
8844
|
if (fromFileData != null) {
|
|
@@ -8963,8 +9043,15 @@ function toolToVertex$1(fromObject) {
|
|
|
8963
9043
|
if (fromUrlContext != null) {
|
|
8964
9044
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8965
9045
|
}
|
|
8966
|
-
|
|
8967
|
-
|
|
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);
|
|
8968
9055
|
}
|
|
8969
9056
|
return toObject;
|
|
8970
9057
|
}
|
|
@@ -9190,7 +9277,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
9190
9277
|
}
|
|
9191
9278
|
return toObject;
|
|
9192
9279
|
}
|
|
9193
|
-
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
9280
|
+
function codeExecutionResultToVertex$1(fromObject, _rootObject) {
|
|
9194
9281
|
const toObject = {};
|
|
9195
9282
|
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
9196
9283
|
if (fromOutcome != null) {
|
|
@@ -9216,7 +9303,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9216
9303
|
let transformedList = tContents(fromContents);
|
|
9217
9304
|
if (Array.isArray(transformedList)) {
|
|
9218
9305
|
transformedList = transformedList.map((item) => {
|
|
9219
|
-
return contentToVertex(item);
|
|
9306
|
+
return contentToVertex$1(item);
|
|
9220
9307
|
});
|
|
9221
9308
|
}
|
|
9222
9309
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9285,14 +9372,14 @@ function contentToMldev$1(fromObject, rootObject) {
|
|
|
9285
9372
|
}
|
|
9286
9373
|
return toObject;
|
|
9287
9374
|
}
|
|
9288
|
-
function contentToVertex(fromObject, rootObject) {
|
|
9375
|
+
function contentToVertex$1(fromObject, rootObject) {
|
|
9289
9376
|
const toObject = {};
|
|
9290
9377
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
9291
9378
|
if (fromParts != null) {
|
|
9292
9379
|
let transformedList = fromParts;
|
|
9293
9380
|
if (Array.isArray(transformedList)) {
|
|
9294
9381
|
transformedList = transformedList.map((item) => {
|
|
9295
|
-
return partToVertex(item);
|
|
9382
|
+
return partToVertex$1(item);
|
|
9296
9383
|
});
|
|
9297
9384
|
}
|
|
9298
9385
|
setValueByPath(toObject, ['parts'], transformedList);
|
|
@@ -9336,7 +9423,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
9336
9423
|
'systemInstruction',
|
|
9337
9424
|
]);
|
|
9338
9425
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
9339
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
9426
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
9340
9427
|
}
|
|
9341
9428
|
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
9342
9429
|
if (parentObject !== undefined && fromTools != null) {
|
|
@@ -9389,7 +9476,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
9389
9476
|
let transformedList = tContents(fromContents);
|
|
9390
9477
|
if (Array.isArray(transformedList)) {
|
|
9391
9478
|
transformedList = transformedList.map((item) => {
|
|
9392
|
-
return contentToVertex(item);
|
|
9479
|
+
return contentToVertex$1(item);
|
|
9393
9480
|
});
|
|
9394
9481
|
}
|
|
9395
9482
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -9825,7 +9912,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
|
|
|
9825
9912
|
if (discriminatorContent === 'EMBED_CONTENT') {
|
|
9826
9913
|
const fromContent = getValueByPath(fromObject, ['content']);
|
|
9827
9914
|
if (fromContent != null) {
|
|
9828
|
-
setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
|
|
9915
|
+
setValueByPath(toObject, ['content'], contentToVertex$1(tContent(fromContent)));
|
|
9829
9916
|
}
|
|
9830
9917
|
}
|
|
9831
9918
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -9917,7 +10004,7 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
9917
10004
|
}
|
|
9918
10005
|
return toObject;
|
|
9919
10006
|
}
|
|
9920
|
-
function executableCodeToVertex(fromObject, _rootObject) {
|
|
10007
|
+
function executableCodeToVertex$1(fromObject, _rootObject) {
|
|
9921
10008
|
const toObject = {};
|
|
9922
10009
|
const fromCode = getValueByPath(fromObject, ['code']);
|
|
9923
10010
|
if (fromCode != null) {
|
|
@@ -10160,7 +10247,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
10160
10247
|
'systemInstruction',
|
|
10161
10248
|
]);
|
|
10162
10249
|
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
10163
|
-
setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
|
|
10250
|
+
setValueByPath(parentObject, ['systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
10164
10251
|
}
|
|
10165
10252
|
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
10166
10253
|
if (fromTemperature != null) {
|
|
@@ -10365,7 +10452,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
|
|
|
10365
10452
|
let transformedList = tContents(fromContents);
|
|
10366
10453
|
if (Array.isArray(transformedList)) {
|
|
10367
10454
|
transformedList = transformedList.map((item) => {
|
|
10368
|
-
return contentToVertex(item);
|
|
10455
|
+
return contentToVertex$1(item);
|
|
10369
10456
|
});
|
|
10370
10457
|
}
|
|
10371
10458
|
setValueByPath(toObject, ['contents'], transformedList);
|
|
@@ -11620,6 +11707,16 @@ function maskReferenceConfigToVertex(fromObject, _rootObject) {
|
|
|
11620
11707
|
}
|
|
11621
11708
|
return toObject;
|
|
11622
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
|
+
}
|
|
11623
11720
|
function modelFromMldev(fromObject, rootObject) {
|
|
11624
11721
|
const toObject = {};
|
|
11625
11722
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -11810,7 +11907,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
11810
11907
|
}
|
|
11811
11908
|
return toObject;
|
|
11812
11909
|
}
|
|
11813
|
-
function partToVertex(fromObject, rootObject) {
|
|
11910
|
+
function partToVertex$1(fromObject, rootObject) {
|
|
11814
11911
|
const toObject = {};
|
|
11815
11912
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
11816
11913
|
'mediaResolution',
|
|
@@ -11822,13 +11919,13 @@ function partToVertex(fromObject, rootObject) {
|
|
|
11822
11919
|
'codeExecutionResult',
|
|
11823
11920
|
]);
|
|
11824
11921
|
if (fromCodeExecutionResult != null) {
|
|
11825
|
-
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
11922
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
11826
11923
|
}
|
|
11827
11924
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
11828
11925
|
'executableCode',
|
|
11829
11926
|
]);
|
|
11830
11927
|
if (fromExecutableCode != null) {
|
|
11831
|
-
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
11928
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
11832
11929
|
}
|
|
11833
11930
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
11834
11931
|
if (fromFileData != null) {
|
|
@@ -12303,7 +12400,7 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
12303
12400
|
}
|
|
12304
12401
|
return toObject;
|
|
12305
12402
|
}
|
|
12306
|
-
function toolToVertex(fromObject,
|
|
12403
|
+
function toolToVertex(fromObject, rootObject) {
|
|
12307
12404
|
const toObject = {};
|
|
12308
12405
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
12309
12406
|
if (fromRetrieval != null) {
|
|
@@ -12364,8 +12461,15 @@ function toolToVertex(fromObject, _rootObject) {
|
|
|
12364
12461
|
if (fromUrlContext != null) {
|
|
12365
12462
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
12366
12463
|
}
|
|
12367
|
-
|
|
12368
|
-
|
|
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);
|
|
12369
12473
|
}
|
|
12370
12474
|
return toObject;
|
|
12371
12475
|
}
|
|
@@ -12928,7 +13032,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12928
13032
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12929
13033
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12930
13034
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12931
|
-
const SDK_VERSION = '2.
|
|
13035
|
+
const SDK_VERSION = '2.8.0'; // x-release-please-version
|
|
12932
13036
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12933
13037
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12934
13038
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -16578,11 +16682,11 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
16578
16682
|
}
|
|
16579
16683
|
setValueByPath(parentObject, ['setup', 'safetySettings'], transformedList);
|
|
16580
16684
|
}
|
|
16581
|
-
const
|
|
16582
|
-
'
|
|
16685
|
+
const fromTranslationConfig = getValueByPath(fromObject, [
|
|
16686
|
+
'translationConfig',
|
|
16583
16687
|
]);
|
|
16584
|
-
if (parentObject !== undefined &&
|
|
16585
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', '
|
|
16688
|
+
if (parentObject !== undefined && fromTranslationConfig != null) {
|
|
16689
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'translationConfig'], fromTranslationConfig);
|
|
16586
16690
|
}
|
|
16587
16691
|
return toObject;
|
|
16588
16692
|
}
|
|
@@ -19772,6 +19876,39 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
|
|
|
19772
19876
|
}
|
|
19773
19877
|
return toObject;
|
|
19774
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
|
+
}
|
|
19775
19912
|
function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
19776
19913
|
const toObject = {};
|
|
19777
19914
|
if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
|
|
@@ -19860,6 +19997,12 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19860
19997
|
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
19861
19998
|
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19862
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
|
+
}
|
|
19863
20006
|
return toObject;
|
|
19864
20007
|
}
|
|
19865
20008
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -20193,6 +20336,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20193
20336
|
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20194
20337
|
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20195
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
|
+
}
|
|
20196
20351
|
return toObject;
|
|
20197
20352
|
}
|
|
20198
20353
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20363,6 +20518,21 @@ function distillationSpecFromVertex(fromObject, rootObject) {
|
|
|
20363
20518
|
}
|
|
20364
20519
|
return toObject;
|
|
20365
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
|
+
}
|
|
20366
20536
|
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20367
20537
|
const toObject = {};
|
|
20368
20538
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
@@ -20553,6 +20723,99 @@ function listTuningJobsResponseFromVertex(fromObject, rootObject) {
|
|
|
20553
20723
|
}
|
|
20554
20724
|
return toObject;
|
|
20555
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
|
+
}
|
|
20556
20819
|
function tunedModelFromMldev(fromObject, _rootObject) {
|
|
20557
20820
|
const toObject = {};
|
|
20558
20821
|
const fromModel = getValueByPath(fromObject, ['name']);
|
|
@@ -20786,6 +21049,12 @@ function tuningJobFromVertex(fromObject, rootObject) {
|
|
|
20786
21049
|
if (fromDistillationSpec != null) {
|
|
20787
21050
|
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20788
21051
|
}
|
|
21052
|
+
const fromReinforcementTuningSpec = getValueByPath(fromObject, [
|
|
21053
|
+
'reinforcementTuningSpec',
|
|
21054
|
+
]);
|
|
21055
|
+
if (fromReinforcementTuningSpec != null) {
|
|
21056
|
+
setValueByPath(toObject, ['reinforcementTuningSpec'], fromReinforcementTuningSpec);
|
|
21057
|
+
}
|
|
20789
21058
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20790
21059
|
'tuningDataStats',
|
|
20791
21060
|
]);
|
|
@@ -20928,6 +21197,62 @@ function tuningValidationDatasetToVertex(fromObject, _rootObject) {
|
|
|
20928
21197
|
}
|
|
20929
21198
|
return toObject;
|
|
20930
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
|
+
}
|
|
20931
21256
|
|
|
20932
21257
|
/**
|
|
20933
21258
|
* @license
|
|
@@ -21274,6 +21599,46 @@ class Tunings extends BaseModule {
|
|
|
21274
21599
|
});
|
|
21275
21600
|
}
|
|
21276
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
|
+
}
|
|
21277
21642
|
}
|
|
21278
21643
|
|
|
21279
21644
|
/**
|
|
@@ -21597,5 +21962,5 @@ class GoogleGenAI {
|
|
|
21597
21962
|
}
|
|
21598
21963
|
}
|
|
21599
21964
|
|
|
21600
|
-
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
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 };
|
|
21601
21966
|
//# sourceMappingURL=index.mjs.map
|