@google/genai 1.34.0 → 1.35.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 +53 -69
- package/dist/index.cjs +252 -251
- package/dist/index.mjs +253 -252
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +252 -251
- package/dist/node/index.mjs +253 -252
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +53 -69
- package/dist/web/index.mjs +253 -252
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +53 -69
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -681,18 +681,6 @@ var Type;
|
|
|
681
681
|
*/
|
|
682
682
|
Type["NULL"] = "NULL";
|
|
683
683
|
})(Type || (Type = {}));
|
|
684
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
685
|
-
var Mode;
|
|
686
|
-
(function (Mode) {
|
|
687
|
-
/**
|
|
688
|
-
* Always trigger retrieval.
|
|
689
|
-
*/
|
|
690
|
-
Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
691
|
-
/**
|
|
692
|
-
* Run retrieval only when system decides it is necessary.
|
|
693
|
-
*/
|
|
694
|
-
Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
695
|
-
})(Mode || (Mode = {}));
|
|
696
684
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
697
685
|
var ApiSpec;
|
|
698
686
|
(function (ApiSpec) {
|
|
@@ -795,6 +783,58 @@ var PhishBlockThreshold;
|
|
|
795
783
|
*/
|
|
796
784
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
797
785
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
786
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
787
|
+
var Behavior;
|
|
788
|
+
(function (Behavior) {
|
|
789
|
+
/**
|
|
790
|
+
* This value is unused.
|
|
791
|
+
*/
|
|
792
|
+
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
793
|
+
/**
|
|
794
|
+
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
795
|
+
*/
|
|
796
|
+
Behavior["BLOCKING"] = "BLOCKING";
|
|
797
|
+
/**
|
|
798
|
+
* If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
|
|
799
|
+
*/
|
|
800
|
+
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
801
|
+
})(Behavior || (Behavior = {}));
|
|
802
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
803
|
+
var DynamicRetrievalConfigMode;
|
|
804
|
+
(function (DynamicRetrievalConfigMode) {
|
|
805
|
+
/**
|
|
806
|
+
* Always trigger retrieval.
|
|
807
|
+
*/
|
|
808
|
+
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
809
|
+
/**
|
|
810
|
+
* Run retrieval only when system decides it is necessary.
|
|
811
|
+
*/
|
|
812
|
+
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
813
|
+
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
814
|
+
/** Function calling mode. */
|
|
815
|
+
var FunctionCallingConfigMode;
|
|
816
|
+
(function (FunctionCallingConfigMode) {
|
|
817
|
+
/**
|
|
818
|
+
* Unspecified function calling mode. This value should not be used.
|
|
819
|
+
*/
|
|
820
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
821
|
+
/**
|
|
822
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
823
|
+
*/
|
|
824
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
825
|
+
/**
|
|
826
|
+
* 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".
|
|
827
|
+
*/
|
|
828
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
829
|
+
/**
|
|
830
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
831
|
+
*/
|
|
832
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
833
|
+
/**
|
|
834
|
+
* 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".
|
|
835
|
+
*/
|
|
836
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
837
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
798
838
|
/** The number of thoughts tokens that the model should generate. */
|
|
799
839
|
var ThinkingLevel;
|
|
800
840
|
(function (ThinkingLevel) {
|
|
@@ -1301,34 +1341,6 @@ var FeatureSelectionPreference;
|
|
|
1301
1341
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1302
1342
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1303
1343
|
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1304
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1305
|
-
var Behavior;
|
|
1306
|
-
(function (Behavior) {
|
|
1307
|
-
/**
|
|
1308
|
-
* This value is unused.
|
|
1309
|
-
*/
|
|
1310
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1311
|
-
/**
|
|
1312
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1313
|
-
*/
|
|
1314
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1315
|
-
/**
|
|
1316
|
-
* If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
|
|
1317
|
-
*/
|
|
1318
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1319
|
-
})(Behavior || (Behavior = {}));
|
|
1320
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1321
|
-
var DynamicRetrievalConfigMode;
|
|
1322
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1323
|
-
/**
|
|
1324
|
-
* Always trigger retrieval.
|
|
1325
|
-
*/
|
|
1326
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1327
|
-
/**
|
|
1328
|
-
* Run retrieval only when system decides it is necessary.
|
|
1329
|
-
*/
|
|
1330
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1331
|
-
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
1332
1344
|
/** The environment being operated. */
|
|
1333
1345
|
var Environment;
|
|
1334
1346
|
(function (Environment) {
|
|
@@ -1341,30 +1353,6 @@ var Environment;
|
|
|
1341
1353
|
*/
|
|
1342
1354
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1343
1355
|
})(Environment || (Environment = {}));
|
|
1344
|
-
/** Config for the function calling config mode. */
|
|
1345
|
-
var FunctionCallingConfigMode;
|
|
1346
|
-
(function (FunctionCallingConfigMode) {
|
|
1347
|
-
/**
|
|
1348
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1349
|
-
*/
|
|
1350
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1351
|
-
/**
|
|
1352
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1353
|
-
*/
|
|
1354
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1355
|
-
/**
|
|
1356
|
-
* 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".
|
|
1357
|
-
*/
|
|
1358
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1359
|
-
/**
|
|
1360
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1361
|
-
*/
|
|
1362
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1363
|
-
/**
|
|
1364
|
-
* Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations".
|
|
1365
|
-
*/
|
|
1366
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1367
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
1368
1356
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1369
1357
|
var SafetyFilterLevel;
|
|
1370
1358
|
(function (SafetyFilterLevel) {
|
|
@@ -1561,6 +1549,7 @@ var FileSource;
|
|
|
1561
1549
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1562
1550
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1563
1551
|
FileSource["GENERATED"] = "GENERATED";
|
|
1552
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1564
1553
|
})(FileSource || (FileSource = {}));
|
|
1565
1554
|
/** The reason why the turn is complete. */
|
|
1566
1555
|
var TurnCompleteReason;
|
|
@@ -3990,16 +3979,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
3990
3979
|
}
|
|
3991
3980
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
3992
3981
|
const toObject = {};
|
|
3993
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3994
|
-
if (fromMode != null) {
|
|
3995
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
3996
|
-
}
|
|
3997
3982
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
3998
3983
|
'allowedFunctionNames',
|
|
3999
3984
|
]);
|
|
4000
3985
|
if (fromAllowedFunctionNames != null) {
|
|
4001
3986
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
4002
3987
|
}
|
|
3988
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3989
|
+
if (fromMode != null) {
|
|
3990
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
3991
|
+
}
|
|
4003
3992
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
4004
3993
|
undefined) {
|
|
4005
3994
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4259,6 +4248,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4259
4248
|
if (fromImageSize != null) {
|
|
4260
4249
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4261
4250
|
}
|
|
4251
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4252
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4253
|
+
}
|
|
4262
4254
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4263
4255
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4264
4256
|
}
|
|
@@ -4484,43 +4476,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4484
4476
|
}
|
|
4485
4477
|
function toolConfigToMldev$2(fromObject) {
|
|
4486
4478
|
const toObject = {};
|
|
4487
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4488
|
-
'functionCallingConfig',
|
|
4489
|
-
]);
|
|
4490
|
-
if (fromFunctionCallingConfig != null) {
|
|
4491
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4492
|
-
}
|
|
4493
4479
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4494
4480
|
'retrievalConfig',
|
|
4495
4481
|
]);
|
|
4496
4482
|
if (fromRetrievalConfig != null) {
|
|
4497
4483
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4498
4484
|
}
|
|
4485
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4486
|
+
'functionCallingConfig',
|
|
4487
|
+
]);
|
|
4488
|
+
if (fromFunctionCallingConfig != null) {
|
|
4489
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4490
|
+
}
|
|
4499
4491
|
return toObject;
|
|
4500
4492
|
}
|
|
4501
4493
|
function toolToMldev$4(fromObject) {
|
|
4502
4494
|
const toObject = {};
|
|
4503
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4504
|
-
'functionDeclarations',
|
|
4505
|
-
]);
|
|
4506
|
-
if (fromFunctionDeclarations != null) {
|
|
4507
|
-
let transformedList = fromFunctionDeclarations;
|
|
4508
|
-
if (Array.isArray(transformedList)) {
|
|
4509
|
-
transformedList = transformedList.map((item) => {
|
|
4510
|
-
return item;
|
|
4511
|
-
});
|
|
4512
|
-
}
|
|
4513
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4514
|
-
}
|
|
4515
4495
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4516
4496
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4517
4497
|
}
|
|
4518
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4519
|
-
'googleSearchRetrieval',
|
|
4520
|
-
]);
|
|
4521
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4522
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4523
|
-
}
|
|
4524
4498
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4525
4499
|
if (fromComputerUse != null) {
|
|
4526
4500
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4538,6 +4512,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4538
4512
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4539
4513
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4540
4514
|
}
|
|
4515
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4516
|
+
'functionDeclarations',
|
|
4517
|
+
]);
|
|
4518
|
+
if (fromFunctionDeclarations != null) {
|
|
4519
|
+
let transformedList = fromFunctionDeclarations;
|
|
4520
|
+
if (Array.isArray(transformedList)) {
|
|
4521
|
+
transformedList = transformedList.map((item) => {
|
|
4522
|
+
return item;
|
|
4523
|
+
});
|
|
4524
|
+
}
|
|
4525
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4526
|
+
}
|
|
4541
4527
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4542
4528
|
if (fromGoogleMaps != null) {
|
|
4543
4529
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4546,6 +4532,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4546
4532
|
if (fromGoogleSearch != null) {
|
|
4547
4533
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4548
4534
|
}
|
|
4535
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4536
|
+
'googleSearchRetrieval',
|
|
4537
|
+
]);
|
|
4538
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4539
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4540
|
+
}
|
|
4549
4541
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4550
4542
|
if (fromUrlContext != null) {
|
|
4551
4543
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5476,16 +5468,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5476
5468
|
}
|
|
5477
5469
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5478
5470
|
const toObject = {};
|
|
5479
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5480
|
-
if (fromMode != null) {
|
|
5481
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5482
|
-
}
|
|
5483
5471
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5484
5472
|
'allowedFunctionNames',
|
|
5485
5473
|
]);
|
|
5486
5474
|
if (fromAllowedFunctionNames != null) {
|
|
5487
5475
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5488
5476
|
}
|
|
5477
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5478
|
+
if (fromMode != null) {
|
|
5479
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5480
|
+
}
|
|
5489
5481
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5490
5482
|
undefined) {
|
|
5491
5483
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5494,9 +5486,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5494
5486
|
}
|
|
5495
5487
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5496
5488
|
const toObject = {};
|
|
5497
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5498
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5499
|
-
}
|
|
5500
5489
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5501
5490
|
if (fromDescription != null) {
|
|
5502
5491
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5525,6 +5514,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5525
5514
|
if (fromResponseJsonSchema != null) {
|
|
5526
5515
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5527
5516
|
}
|
|
5517
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5518
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5519
|
+
}
|
|
5528
5520
|
return toObject;
|
|
5529
5521
|
}
|
|
5530
5522
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5728,43 +5720,25 @@ function partToMldev$3(fromObject) {
|
|
|
5728
5720
|
}
|
|
5729
5721
|
function toolConfigToMldev$1(fromObject) {
|
|
5730
5722
|
const toObject = {};
|
|
5731
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5732
|
-
'functionCallingConfig',
|
|
5733
|
-
]);
|
|
5734
|
-
if (fromFunctionCallingConfig != null) {
|
|
5735
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5736
|
-
}
|
|
5737
5723
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5738
5724
|
'retrievalConfig',
|
|
5739
5725
|
]);
|
|
5740
5726
|
if (fromRetrievalConfig != null) {
|
|
5741
5727
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5742
5728
|
}
|
|
5729
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5730
|
+
'functionCallingConfig',
|
|
5731
|
+
]);
|
|
5732
|
+
if (fromFunctionCallingConfig != null) {
|
|
5733
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5734
|
+
}
|
|
5743
5735
|
return toObject;
|
|
5744
5736
|
}
|
|
5745
5737
|
function toolToMldev$3(fromObject) {
|
|
5746
5738
|
const toObject = {};
|
|
5747
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5748
|
-
'functionDeclarations',
|
|
5749
|
-
]);
|
|
5750
|
-
if (fromFunctionDeclarations != null) {
|
|
5751
|
-
let transformedList = fromFunctionDeclarations;
|
|
5752
|
-
if (Array.isArray(transformedList)) {
|
|
5753
|
-
transformedList = transformedList.map((item) => {
|
|
5754
|
-
return item;
|
|
5755
|
-
});
|
|
5756
|
-
}
|
|
5757
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5758
|
-
}
|
|
5759
5739
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5760
5740
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5761
5741
|
}
|
|
5762
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5763
|
-
'googleSearchRetrieval',
|
|
5764
|
-
]);
|
|
5765
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5766
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5767
|
-
}
|
|
5768
5742
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5769
5743
|
if (fromComputerUse != null) {
|
|
5770
5744
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5782,6 +5756,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5782
5756
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5783
5757
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5784
5758
|
}
|
|
5759
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5760
|
+
'functionDeclarations',
|
|
5761
|
+
]);
|
|
5762
|
+
if (fromFunctionDeclarations != null) {
|
|
5763
|
+
let transformedList = fromFunctionDeclarations;
|
|
5764
|
+
if (Array.isArray(transformedList)) {
|
|
5765
|
+
transformedList = transformedList.map((item) => {
|
|
5766
|
+
return item;
|
|
5767
|
+
});
|
|
5768
|
+
}
|
|
5769
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5770
|
+
}
|
|
5785
5771
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5786
5772
|
if (fromGoogleMaps != null) {
|
|
5787
5773
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5790,6 +5776,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5790
5776
|
if (fromGoogleSearch != null) {
|
|
5791
5777
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5792
5778
|
}
|
|
5779
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5780
|
+
'googleSearchRetrieval',
|
|
5781
|
+
]);
|
|
5782
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5783
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5784
|
+
}
|
|
5793
5785
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5794
5786
|
if (fromUrlContext != null) {
|
|
5795
5787
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5798,28 +5790,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5798
5790
|
}
|
|
5799
5791
|
function toolToVertex$2(fromObject) {
|
|
5800
5792
|
const toObject = {};
|
|
5801
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5802
|
-
'functionDeclarations',
|
|
5803
|
-
]);
|
|
5804
|
-
if (fromFunctionDeclarations != null) {
|
|
5805
|
-
let transformedList = fromFunctionDeclarations;
|
|
5806
|
-
if (Array.isArray(transformedList)) {
|
|
5807
|
-
transformedList = transformedList.map((item) => {
|
|
5808
|
-
return functionDeclarationToVertex$2(item);
|
|
5809
|
-
});
|
|
5810
|
-
}
|
|
5811
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5812
|
-
}
|
|
5813
5793
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5814
5794
|
if (fromRetrieval != null) {
|
|
5815
5795
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5816
5796
|
}
|
|
5817
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5818
|
-
'googleSearchRetrieval',
|
|
5819
|
-
]);
|
|
5820
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5821
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5822
|
-
}
|
|
5823
5797
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5824
5798
|
if (fromComputerUse != null) {
|
|
5825
5799
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5839,6 +5813,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5839
5813
|
if (fromEnterpriseWebSearch != null) {
|
|
5840
5814
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5841
5815
|
}
|
|
5816
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5817
|
+
'functionDeclarations',
|
|
5818
|
+
]);
|
|
5819
|
+
if (fromFunctionDeclarations != null) {
|
|
5820
|
+
let transformedList = fromFunctionDeclarations;
|
|
5821
|
+
if (Array.isArray(transformedList)) {
|
|
5822
|
+
transformedList = transformedList.map((item) => {
|
|
5823
|
+
return functionDeclarationToVertex$2(item);
|
|
5824
|
+
});
|
|
5825
|
+
}
|
|
5826
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5827
|
+
}
|
|
5842
5828
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5843
5829
|
if (fromGoogleMaps != null) {
|
|
5844
5830
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5847,6 +5833,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5847
5833
|
if (fromGoogleSearch != null) {
|
|
5848
5834
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5849
5835
|
}
|
|
5836
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5837
|
+
'googleSearchRetrieval',
|
|
5838
|
+
]);
|
|
5839
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5840
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5841
|
+
}
|
|
5850
5842
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5851
5843
|
if (fromUrlContext != null) {
|
|
5852
5844
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7138,9 +7130,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
7138
7130
|
}
|
|
7139
7131
|
function functionDeclarationToVertex$1(fromObject) {
|
|
7140
7132
|
const toObject = {};
|
|
7141
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7142
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7143
|
-
}
|
|
7144
7133
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7145
7134
|
if (fromDescription != null) {
|
|
7146
7135
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -7169,6 +7158,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
7169
7158
|
if (fromResponseJsonSchema != null) {
|
|
7170
7159
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7171
7160
|
}
|
|
7161
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7162
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7163
|
+
}
|
|
7172
7164
|
return toObject;
|
|
7173
7165
|
}
|
|
7174
7166
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -7810,27 +7802,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7810
7802
|
}
|
|
7811
7803
|
function toolToMldev$2(fromObject) {
|
|
7812
7804
|
const toObject = {};
|
|
7813
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7814
|
-
'functionDeclarations',
|
|
7815
|
-
]);
|
|
7816
|
-
if (fromFunctionDeclarations != null) {
|
|
7817
|
-
let transformedList = fromFunctionDeclarations;
|
|
7818
|
-
if (Array.isArray(transformedList)) {
|
|
7819
|
-
transformedList = transformedList.map((item) => {
|
|
7820
|
-
return item;
|
|
7821
|
-
});
|
|
7822
|
-
}
|
|
7823
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7824
|
-
}
|
|
7825
7805
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
7826
7806
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
7827
7807
|
}
|
|
7828
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7829
|
-
'googleSearchRetrieval',
|
|
7830
|
-
]);
|
|
7831
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7832
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7833
|
-
}
|
|
7834
7808
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7835
7809
|
if (fromComputerUse != null) {
|
|
7836
7810
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7848,6 +7822,18 @@ function toolToMldev$2(fromObject) {
|
|
|
7848
7822
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7849
7823
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
7850
7824
|
}
|
|
7825
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7826
|
+
'functionDeclarations',
|
|
7827
|
+
]);
|
|
7828
|
+
if (fromFunctionDeclarations != null) {
|
|
7829
|
+
let transformedList = fromFunctionDeclarations;
|
|
7830
|
+
if (Array.isArray(transformedList)) {
|
|
7831
|
+
transformedList = transformedList.map((item) => {
|
|
7832
|
+
return item;
|
|
7833
|
+
});
|
|
7834
|
+
}
|
|
7835
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7836
|
+
}
|
|
7851
7837
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7852
7838
|
if (fromGoogleMaps != null) {
|
|
7853
7839
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -7856,6 +7842,12 @@ function toolToMldev$2(fromObject) {
|
|
|
7856
7842
|
if (fromGoogleSearch != null) {
|
|
7857
7843
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7858
7844
|
}
|
|
7845
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7846
|
+
'googleSearchRetrieval',
|
|
7847
|
+
]);
|
|
7848
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7849
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7850
|
+
}
|
|
7859
7851
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7860
7852
|
if (fromUrlContext != null) {
|
|
7861
7853
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7864,28 +7856,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7864
7856
|
}
|
|
7865
7857
|
function toolToVertex$1(fromObject) {
|
|
7866
7858
|
const toObject = {};
|
|
7867
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7868
|
-
'functionDeclarations',
|
|
7869
|
-
]);
|
|
7870
|
-
if (fromFunctionDeclarations != null) {
|
|
7871
|
-
let transformedList = fromFunctionDeclarations;
|
|
7872
|
-
if (Array.isArray(transformedList)) {
|
|
7873
|
-
transformedList = transformedList.map((item) => {
|
|
7874
|
-
return functionDeclarationToVertex$1(item);
|
|
7875
|
-
});
|
|
7876
|
-
}
|
|
7877
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7878
|
-
}
|
|
7879
7859
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7880
7860
|
if (fromRetrieval != null) {
|
|
7881
7861
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7882
7862
|
}
|
|
7883
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7884
|
-
'googleSearchRetrieval',
|
|
7885
|
-
]);
|
|
7886
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7887
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7888
|
-
}
|
|
7889
7863
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7890
7864
|
if (fromComputerUse != null) {
|
|
7891
7865
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7905,6 +7879,18 @@ function toolToVertex$1(fromObject) {
|
|
|
7905
7879
|
if (fromEnterpriseWebSearch != null) {
|
|
7906
7880
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
7907
7881
|
}
|
|
7882
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7883
|
+
'functionDeclarations',
|
|
7884
|
+
]);
|
|
7885
|
+
if (fromFunctionDeclarations != null) {
|
|
7886
|
+
let transformedList = fromFunctionDeclarations;
|
|
7887
|
+
if (Array.isArray(transformedList)) {
|
|
7888
|
+
transformedList = transformedList.map((item) => {
|
|
7889
|
+
return functionDeclarationToVertex$1(item);
|
|
7890
|
+
});
|
|
7891
|
+
}
|
|
7892
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7893
|
+
}
|
|
7908
7894
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7909
7895
|
if (fromGoogleMaps != null) {
|
|
7910
7896
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -7913,6 +7899,12 @@ function toolToVertex$1(fromObject) {
|
|
|
7913
7899
|
if (fromGoogleSearch != null) {
|
|
7914
7900
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
7915
7901
|
}
|
|
7902
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7903
|
+
'googleSearchRetrieval',
|
|
7904
|
+
]);
|
|
7905
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7906
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7907
|
+
}
|
|
7916
7908
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7917
7909
|
if (fromUrlContext != null) {
|
|
7918
7910
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8695,16 +8687,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
8695
8687
|
}
|
|
8696
8688
|
function functionCallingConfigToMldev(fromObject) {
|
|
8697
8689
|
const toObject = {};
|
|
8698
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8699
|
-
if (fromMode != null) {
|
|
8700
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
8701
|
-
}
|
|
8702
8690
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
8703
8691
|
'allowedFunctionNames',
|
|
8704
8692
|
]);
|
|
8705
8693
|
if (fromAllowedFunctionNames != null) {
|
|
8706
8694
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
8707
8695
|
}
|
|
8696
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8697
|
+
if (fromMode != null) {
|
|
8698
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
8699
|
+
}
|
|
8708
8700
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
8709
8701
|
undefined) {
|
|
8710
8702
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -8713,9 +8705,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
8713
8705
|
}
|
|
8714
8706
|
function functionDeclarationToVertex(fromObject) {
|
|
8715
8707
|
const toObject = {};
|
|
8716
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8717
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8718
|
-
}
|
|
8719
8708
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8720
8709
|
if (fromDescription != null) {
|
|
8721
8710
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -8744,6 +8733,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
8744
8733
|
if (fromResponseJsonSchema != null) {
|
|
8745
8734
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
8746
8735
|
}
|
|
8736
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8737
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8738
|
+
}
|
|
8747
8739
|
return toObject;
|
|
8748
8740
|
}
|
|
8749
8741
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -10081,6 +10073,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
10081
10073
|
if (fromImageSize != null) {
|
|
10082
10074
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10083
10075
|
}
|
|
10076
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10077
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10078
|
+
}
|
|
10084
10079
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10085
10080
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10086
10081
|
}
|
|
@@ -10100,6 +10095,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
10100
10095
|
if (fromImageSize != null) {
|
|
10101
10096
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10102
10097
|
}
|
|
10098
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
10099
|
+
'personGeneration',
|
|
10100
|
+
]);
|
|
10101
|
+
if (fromPersonGeneration != null) {
|
|
10102
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10103
|
+
}
|
|
10103
10104
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10104
10105
|
'outputMimeType',
|
|
10105
10106
|
]);
|
|
@@ -10800,43 +10801,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
10800
10801
|
}
|
|
10801
10802
|
function toolConfigToMldev(fromObject) {
|
|
10802
10803
|
const toObject = {};
|
|
10803
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10804
|
-
'functionCallingConfig',
|
|
10805
|
-
]);
|
|
10806
|
-
if (fromFunctionCallingConfig != null) {
|
|
10807
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10808
|
-
}
|
|
10809
10804
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
10810
10805
|
'retrievalConfig',
|
|
10811
10806
|
]);
|
|
10812
10807
|
if (fromRetrievalConfig != null) {
|
|
10813
10808
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
10814
10809
|
}
|
|
10810
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10811
|
+
'functionCallingConfig',
|
|
10812
|
+
]);
|
|
10813
|
+
if (fromFunctionCallingConfig != null) {
|
|
10814
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10815
|
+
}
|
|
10815
10816
|
return toObject;
|
|
10816
10817
|
}
|
|
10817
10818
|
function toolToMldev$1(fromObject) {
|
|
10818
10819
|
const toObject = {};
|
|
10819
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10820
|
-
'functionDeclarations',
|
|
10821
|
-
]);
|
|
10822
|
-
if (fromFunctionDeclarations != null) {
|
|
10823
|
-
let transformedList = fromFunctionDeclarations;
|
|
10824
|
-
if (Array.isArray(transformedList)) {
|
|
10825
|
-
transformedList = transformedList.map((item) => {
|
|
10826
|
-
return item;
|
|
10827
|
-
});
|
|
10828
|
-
}
|
|
10829
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10830
|
-
}
|
|
10831
10820
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
10832
10821
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
10833
10822
|
}
|
|
10834
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10835
|
-
'googleSearchRetrieval',
|
|
10836
|
-
]);
|
|
10837
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10838
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10839
|
-
}
|
|
10840
10823
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10841
10824
|
if (fromComputerUse != null) {
|
|
10842
10825
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10854,6 +10837,18 @@ function toolToMldev$1(fromObject) {
|
|
|
10854
10837
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
10855
10838
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
10856
10839
|
}
|
|
10840
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10841
|
+
'functionDeclarations',
|
|
10842
|
+
]);
|
|
10843
|
+
if (fromFunctionDeclarations != null) {
|
|
10844
|
+
let transformedList = fromFunctionDeclarations;
|
|
10845
|
+
if (Array.isArray(transformedList)) {
|
|
10846
|
+
transformedList = transformedList.map((item) => {
|
|
10847
|
+
return item;
|
|
10848
|
+
});
|
|
10849
|
+
}
|
|
10850
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10851
|
+
}
|
|
10857
10852
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10858
10853
|
if (fromGoogleMaps != null) {
|
|
10859
10854
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -10862,6 +10857,12 @@ function toolToMldev$1(fromObject) {
|
|
|
10862
10857
|
if (fromGoogleSearch != null) {
|
|
10863
10858
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
10864
10859
|
}
|
|
10860
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10861
|
+
'googleSearchRetrieval',
|
|
10862
|
+
]);
|
|
10863
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10864
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10865
|
+
}
|
|
10865
10866
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10866
10867
|
if (fromUrlContext != null) {
|
|
10867
10868
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -10870,28 +10871,10 @@ function toolToMldev$1(fromObject) {
|
|
|
10870
10871
|
}
|
|
10871
10872
|
function toolToVertex(fromObject) {
|
|
10872
10873
|
const toObject = {};
|
|
10873
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10874
|
-
'functionDeclarations',
|
|
10875
|
-
]);
|
|
10876
|
-
if (fromFunctionDeclarations != null) {
|
|
10877
|
-
let transformedList = fromFunctionDeclarations;
|
|
10878
|
-
if (Array.isArray(transformedList)) {
|
|
10879
|
-
transformedList = transformedList.map((item) => {
|
|
10880
|
-
return functionDeclarationToVertex(item);
|
|
10881
|
-
});
|
|
10882
|
-
}
|
|
10883
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10884
|
-
}
|
|
10885
10874
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
10886
10875
|
if (fromRetrieval != null) {
|
|
10887
10876
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
10888
10877
|
}
|
|
10889
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10890
|
-
'googleSearchRetrieval',
|
|
10891
|
-
]);
|
|
10892
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10893
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10894
|
-
}
|
|
10895
10878
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10896
10879
|
if (fromComputerUse != null) {
|
|
10897
10880
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10911,6 +10894,18 @@ function toolToVertex(fromObject) {
|
|
|
10911
10894
|
if (fromEnterpriseWebSearch != null) {
|
|
10912
10895
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
10913
10896
|
}
|
|
10897
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10898
|
+
'functionDeclarations',
|
|
10899
|
+
]);
|
|
10900
|
+
if (fromFunctionDeclarations != null) {
|
|
10901
|
+
let transformedList = fromFunctionDeclarations;
|
|
10902
|
+
if (Array.isArray(transformedList)) {
|
|
10903
|
+
transformedList = transformedList.map((item) => {
|
|
10904
|
+
return functionDeclarationToVertex(item);
|
|
10905
|
+
});
|
|
10906
|
+
}
|
|
10907
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10908
|
+
}
|
|
10914
10909
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10915
10910
|
if (fromGoogleMaps != null) {
|
|
10916
10911
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -10919,6 +10914,12 @@ function toolToVertex(fromObject) {
|
|
|
10919
10914
|
if (fromGoogleSearch != null) {
|
|
10920
10915
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
10921
10916
|
}
|
|
10917
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10918
|
+
'googleSearchRetrieval',
|
|
10919
|
+
]);
|
|
10920
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10921
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10922
|
+
}
|
|
10922
10923
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10923
10924
|
if (fromUrlContext != null) {
|
|
10924
10925
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11479,7 +11480,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11479
11480
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11480
11481
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11481
11482
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11482
|
-
const SDK_VERSION = '1.
|
|
11483
|
+
const SDK_VERSION = '1.35.0'; // x-release-please-version
|
|
11483
11484
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11484
11485
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11485
11486
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13193,7 +13194,7 @@ class Models extends BaseModule {
|
|
|
13193
13194
|
* @example
|
|
13194
13195
|
* ```ts
|
|
13195
13196
|
* const response = await client.models.generateImages({
|
|
13196
|
-
* model: 'imagen-
|
|
13197
|
+
* model: 'imagen-4.0-generate-001',
|
|
13197
13198
|
* prompt: 'Robot holding a red skateboard',
|
|
13198
13199
|
* config: {
|
|
13199
13200
|
* numberOfImages: 1,
|
|
@@ -13302,7 +13303,7 @@ class Models extends BaseModule {
|
|
|
13302
13303
|
* @example
|
|
13303
13304
|
* ```ts
|
|
13304
13305
|
* const response = await client.models.upscaleImage({
|
|
13305
|
-
* model: 'imagen-
|
|
13306
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
13306
13307
|
* image: image,
|
|
13307
13308
|
* upscaleFactor: 'x2',
|
|
13308
13309
|
* config: {
|
|
@@ -13964,7 +13965,7 @@ class Models extends BaseModule {
|
|
|
13964
13965
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
13965
13966
|
*
|
|
13966
13967
|
* const response2 = await ai.models.recontextImage({
|
|
13967
|
-
* model: 'virtual-try-on-
|
|
13968
|
+
* model: 'virtual-try-on-001',
|
|
13968
13969
|
* source: {
|
|
13969
13970
|
* personImage: personImage,
|
|
13970
13971
|
* productImages: [productImage],
|
|
@@ -15046,27 +15047,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
15046
15047
|
}
|
|
15047
15048
|
function toolToMldev(fromObject) {
|
|
15048
15049
|
const toObject = {};
|
|
15049
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15050
|
-
'functionDeclarations',
|
|
15051
|
-
]);
|
|
15052
|
-
if (fromFunctionDeclarations != null) {
|
|
15053
|
-
let transformedList = fromFunctionDeclarations;
|
|
15054
|
-
if (Array.isArray(transformedList)) {
|
|
15055
|
-
transformedList = transformedList.map((item) => {
|
|
15056
|
-
return item;
|
|
15057
|
-
});
|
|
15058
|
-
}
|
|
15059
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15060
|
-
}
|
|
15061
15050
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
15062
15051
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
15063
15052
|
}
|
|
15064
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15065
|
-
'googleSearchRetrieval',
|
|
15066
|
-
]);
|
|
15067
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
15068
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15069
|
-
}
|
|
15070
15053
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
15071
15054
|
if (fromComputerUse != null) {
|
|
15072
15055
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -15084,6 +15067,18 @@ function toolToMldev(fromObject) {
|
|
|
15084
15067
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
15085
15068
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
15086
15069
|
}
|
|
15070
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15071
|
+
'functionDeclarations',
|
|
15072
|
+
]);
|
|
15073
|
+
if (fromFunctionDeclarations != null) {
|
|
15074
|
+
let transformedList = fromFunctionDeclarations;
|
|
15075
|
+
if (Array.isArray(transformedList)) {
|
|
15076
|
+
transformedList = transformedList.map((item) => {
|
|
15077
|
+
return item;
|
|
15078
|
+
});
|
|
15079
|
+
}
|
|
15080
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15081
|
+
}
|
|
15087
15082
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15088
15083
|
if (fromGoogleMaps != null) {
|
|
15089
15084
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -15092,6 +15087,12 @@ function toolToMldev(fromObject) {
|
|
|
15092
15087
|
if (fromGoogleSearch != null) {
|
|
15093
15088
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15094
15089
|
}
|
|
15090
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15091
|
+
'googleSearchRetrieval',
|
|
15092
|
+
]);
|
|
15093
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
15094
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15095
|
+
}
|
|
15095
15096
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15096
15097
|
if (fromUrlContext != null) {
|
|
15097
15098
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -19581,5 +19582,5 @@ function getApiKeyFromEnv() {
|
|
|
19581
19582
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
19582
19583
|
}
|
|
19583
19584
|
|
|
19584
|
-
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, 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, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality,
|
|
19585
|
+
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, 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, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19585
19586
|
//# sourceMappingURL=index.mjs.map
|