@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.cjs
CHANGED
|
@@ -703,18 +703,6 @@ exports.Type = void 0;
|
|
|
703
703
|
*/
|
|
704
704
|
Type["NULL"] = "NULL";
|
|
705
705
|
})(exports.Type || (exports.Type = {}));
|
|
706
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
707
|
-
exports.Mode = void 0;
|
|
708
|
-
(function (Mode) {
|
|
709
|
-
/**
|
|
710
|
-
* Always trigger retrieval.
|
|
711
|
-
*/
|
|
712
|
-
Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
713
|
-
/**
|
|
714
|
-
* Run retrieval only when system decides it is necessary.
|
|
715
|
-
*/
|
|
716
|
-
Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
717
|
-
})(exports.Mode || (exports.Mode = {}));
|
|
718
706
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
719
707
|
exports.ApiSpec = void 0;
|
|
720
708
|
(function (ApiSpec) {
|
|
@@ -817,6 +805,58 @@ exports.PhishBlockThreshold = void 0;
|
|
|
817
805
|
*/
|
|
818
806
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
819
807
|
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
808
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
809
|
+
exports.Behavior = void 0;
|
|
810
|
+
(function (Behavior) {
|
|
811
|
+
/**
|
|
812
|
+
* This value is unused.
|
|
813
|
+
*/
|
|
814
|
+
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
815
|
+
/**
|
|
816
|
+
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
817
|
+
*/
|
|
818
|
+
Behavior["BLOCKING"] = "BLOCKING";
|
|
819
|
+
/**
|
|
820
|
+
* 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.
|
|
821
|
+
*/
|
|
822
|
+
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
823
|
+
})(exports.Behavior || (exports.Behavior = {}));
|
|
824
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
825
|
+
exports.DynamicRetrievalConfigMode = void 0;
|
|
826
|
+
(function (DynamicRetrievalConfigMode) {
|
|
827
|
+
/**
|
|
828
|
+
* Always trigger retrieval.
|
|
829
|
+
*/
|
|
830
|
+
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
831
|
+
/**
|
|
832
|
+
* Run retrieval only when system decides it is necessary.
|
|
833
|
+
*/
|
|
834
|
+
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
835
|
+
})(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
|
|
836
|
+
/** Function calling mode. */
|
|
837
|
+
exports.FunctionCallingConfigMode = void 0;
|
|
838
|
+
(function (FunctionCallingConfigMode) {
|
|
839
|
+
/**
|
|
840
|
+
* Unspecified function calling mode. This value should not be used.
|
|
841
|
+
*/
|
|
842
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
843
|
+
/**
|
|
844
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
845
|
+
*/
|
|
846
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
847
|
+
/**
|
|
848
|
+
* 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".
|
|
849
|
+
*/
|
|
850
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
851
|
+
/**
|
|
852
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
853
|
+
*/
|
|
854
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
855
|
+
/**
|
|
856
|
+
* 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".
|
|
857
|
+
*/
|
|
858
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
859
|
+
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
820
860
|
/** The number of thoughts tokens that the model should generate. */
|
|
821
861
|
exports.ThinkingLevel = void 0;
|
|
822
862
|
(function (ThinkingLevel) {
|
|
@@ -1323,34 +1363,6 @@ exports.FeatureSelectionPreference = void 0;
|
|
|
1323
1363
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1324
1364
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1325
1365
|
})(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
|
|
1326
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1327
|
-
exports.Behavior = void 0;
|
|
1328
|
-
(function (Behavior) {
|
|
1329
|
-
/**
|
|
1330
|
-
* This value is unused.
|
|
1331
|
-
*/
|
|
1332
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1333
|
-
/**
|
|
1334
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1335
|
-
*/
|
|
1336
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1337
|
-
/**
|
|
1338
|
-
* 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.
|
|
1339
|
-
*/
|
|
1340
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1341
|
-
})(exports.Behavior || (exports.Behavior = {}));
|
|
1342
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1343
|
-
exports.DynamicRetrievalConfigMode = void 0;
|
|
1344
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1345
|
-
/**
|
|
1346
|
-
* Always trigger retrieval.
|
|
1347
|
-
*/
|
|
1348
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1349
|
-
/**
|
|
1350
|
-
* Run retrieval only when system decides it is necessary.
|
|
1351
|
-
*/
|
|
1352
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1353
|
-
})(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
|
|
1354
1366
|
/** The environment being operated. */
|
|
1355
1367
|
exports.Environment = void 0;
|
|
1356
1368
|
(function (Environment) {
|
|
@@ -1363,30 +1375,6 @@ exports.Environment = void 0;
|
|
|
1363
1375
|
*/
|
|
1364
1376
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1365
1377
|
})(exports.Environment || (exports.Environment = {}));
|
|
1366
|
-
/** Config for the function calling config mode. */
|
|
1367
|
-
exports.FunctionCallingConfigMode = void 0;
|
|
1368
|
-
(function (FunctionCallingConfigMode) {
|
|
1369
|
-
/**
|
|
1370
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1371
|
-
*/
|
|
1372
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1373
|
-
/**
|
|
1374
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1375
|
-
*/
|
|
1376
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1377
|
-
/**
|
|
1378
|
-
* 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".
|
|
1379
|
-
*/
|
|
1380
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1381
|
-
/**
|
|
1382
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1383
|
-
*/
|
|
1384
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1385
|
-
/**
|
|
1386
|
-
* 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".
|
|
1387
|
-
*/
|
|
1388
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1389
|
-
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
1390
1378
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1391
1379
|
exports.SafetyFilterLevel = void 0;
|
|
1392
1380
|
(function (SafetyFilterLevel) {
|
|
@@ -1583,6 +1571,7 @@ exports.FileSource = void 0;
|
|
|
1583
1571
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1584
1572
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1585
1573
|
FileSource["GENERATED"] = "GENERATED";
|
|
1574
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1586
1575
|
})(exports.FileSource || (exports.FileSource = {}));
|
|
1587
1576
|
/** The reason why the turn is complete. */
|
|
1588
1577
|
exports.TurnCompleteReason = void 0;
|
|
@@ -4012,16 +4001,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
4012
4001
|
}
|
|
4013
4002
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
4014
4003
|
const toObject = {};
|
|
4015
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
4016
|
-
if (fromMode != null) {
|
|
4017
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
4018
|
-
}
|
|
4019
4004
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
4020
4005
|
'allowedFunctionNames',
|
|
4021
4006
|
]);
|
|
4022
4007
|
if (fromAllowedFunctionNames != null) {
|
|
4023
4008
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
4024
4009
|
}
|
|
4010
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
4011
|
+
if (fromMode != null) {
|
|
4012
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
4013
|
+
}
|
|
4025
4014
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
4026
4015
|
undefined) {
|
|
4027
4016
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4281,6 +4270,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4281
4270
|
if (fromImageSize != null) {
|
|
4282
4271
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4283
4272
|
}
|
|
4273
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4274
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4275
|
+
}
|
|
4284
4276
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4285
4277
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4286
4278
|
}
|
|
@@ -4506,43 +4498,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4506
4498
|
}
|
|
4507
4499
|
function toolConfigToMldev$2(fromObject) {
|
|
4508
4500
|
const toObject = {};
|
|
4509
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4510
|
-
'functionCallingConfig',
|
|
4511
|
-
]);
|
|
4512
|
-
if (fromFunctionCallingConfig != null) {
|
|
4513
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4514
|
-
}
|
|
4515
4501
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4516
4502
|
'retrievalConfig',
|
|
4517
4503
|
]);
|
|
4518
4504
|
if (fromRetrievalConfig != null) {
|
|
4519
4505
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4520
4506
|
}
|
|
4507
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4508
|
+
'functionCallingConfig',
|
|
4509
|
+
]);
|
|
4510
|
+
if (fromFunctionCallingConfig != null) {
|
|
4511
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4512
|
+
}
|
|
4521
4513
|
return toObject;
|
|
4522
4514
|
}
|
|
4523
4515
|
function toolToMldev$4(fromObject) {
|
|
4524
4516
|
const toObject = {};
|
|
4525
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4526
|
-
'functionDeclarations',
|
|
4527
|
-
]);
|
|
4528
|
-
if (fromFunctionDeclarations != null) {
|
|
4529
|
-
let transformedList = fromFunctionDeclarations;
|
|
4530
|
-
if (Array.isArray(transformedList)) {
|
|
4531
|
-
transformedList = transformedList.map((item) => {
|
|
4532
|
-
return item;
|
|
4533
|
-
});
|
|
4534
|
-
}
|
|
4535
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4536
|
-
}
|
|
4537
4517
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4538
4518
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4539
4519
|
}
|
|
4540
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4541
|
-
'googleSearchRetrieval',
|
|
4542
|
-
]);
|
|
4543
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4544
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4545
|
-
}
|
|
4546
4520
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4547
4521
|
if (fromComputerUse != null) {
|
|
4548
4522
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4560,6 +4534,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4560
4534
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4561
4535
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4562
4536
|
}
|
|
4537
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4538
|
+
'functionDeclarations',
|
|
4539
|
+
]);
|
|
4540
|
+
if (fromFunctionDeclarations != null) {
|
|
4541
|
+
let transformedList = fromFunctionDeclarations;
|
|
4542
|
+
if (Array.isArray(transformedList)) {
|
|
4543
|
+
transformedList = transformedList.map((item) => {
|
|
4544
|
+
return item;
|
|
4545
|
+
});
|
|
4546
|
+
}
|
|
4547
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4548
|
+
}
|
|
4563
4549
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4564
4550
|
if (fromGoogleMaps != null) {
|
|
4565
4551
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4568,6 +4554,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4568
4554
|
if (fromGoogleSearch != null) {
|
|
4569
4555
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4570
4556
|
}
|
|
4557
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4558
|
+
'googleSearchRetrieval',
|
|
4559
|
+
]);
|
|
4560
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4561
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4562
|
+
}
|
|
4571
4563
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4572
4564
|
if (fromUrlContext != null) {
|
|
4573
4565
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5498,16 +5490,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5498
5490
|
}
|
|
5499
5491
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5500
5492
|
const toObject = {};
|
|
5501
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5502
|
-
if (fromMode != null) {
|
|
5503
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5504
|
-
}
|
|
5505
5493
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5506
5494
|
'allowedFunctionNames',
|
|
5507
5495
|
]);
|
|
5508
5496
|
if (fromAllowedFunctionNames != null) {
|
|
5509
5497
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5510
5498
|
}
|
|
5499
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5500
|
+
if (fromMode != null) {
|
|
5501
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5502
|
+
}
|
|
5511
5503
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5512
5504
|
undefined) {
|
|
5513
5505
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5516,9 +5508,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5516
5508
|
}
|
|
5517
5509
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5518
5510
|
const toObject = {};
|
|
5519
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5520
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5521
|
-
}
|
|
5522
5511
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5523
5512
|
if (fromDescription != null) {
|
|
5524
5513
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5547,6 +5536,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5547
5536
|
if (fromResponseJsonSchema != null) {
|
|
5548
5537
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5549
5538
|
}
|
|
5539
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5540
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5541
|
+
}
|
|
5550
5542
|
return toObject;
|
|
5551
5543
|
}
|
|
5552
5544
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5750,43 +5742,25 @@ function partToMldev$3(fromObject) {
|
|
|
5750
5742
|
}
|
|
5751
5743
|
function toolConfigToMldev$1(fromObject) {
|
|
5752
5744
|
const toObject = {};
|
|
5753
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5754
|
-
'functionCallingConfig',
|
|
5755
|
-
]);
|
|
5756
|
-
if (fromFunctionCallingConfig != null) {
|
|
5757
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5758
|
-
}
|
|
5759
5745
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5760
5746
|
'retrievalConfig',
|
|
5761
5747
|
]);
|
|
5762
5748
|
if (fromRetrievalConfig != null) {
|
|
5763
5749
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5764
5750
|
}
|
|
5751
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5752
|
+
'functionCallingConfig',
|
|
5753
|
+
]);
|
|
5754
|
+
if (fromFunctionCallingConfig != null) {
|
|
5755
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5756
|
+
}
|
|
5765
5757
|
return toObject;
|
|
5766
5758
|
}
|
|
5767
5759
|
function toolToMldev$3(fromObject) {
|
|
5768
5760
|
const toObject = {};
|
|
5769
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5770
|
-
'functionDeclarations',
|
|
5771
|
-
]);
|
|
5772
|
-
if (fromFunctionDeclarations != null) {
|
|
5773
|
-
let transformedList = fromFunctionDeclarations;
|
|
5774
|
-
if (Array.isArray(transformedList)) {
|
|
5775
|
-
transformedList = transformedList.map((item) => {
|
|
5776
|
-
return item;
|
|
5777
|
-
});
|
|
5778
|
-
}
|
|
5779
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5780
|
-
}
|
|
5781
5761
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5782
5762
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5783
5763
|
}
|
|
5784
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5785
|
-
'googleSearchRetrieval',
|
|
5786
|
-
]);
|
|
5787
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5788
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5789
|
-
}
|
|
5790
5764
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5791
5765
|
if (fromComputerUse != null) {
|
|
5792
5766
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5804,6 +5778,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5804
5778
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5805
5779
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5806
5780
|
}
|
|
5781
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5782
|
+
'functionDeclarations',
|
|
5783
|
+
]);
|
|
5784
|
+
if (fromFunctionDeclarations != null) {
|
|
5785
|
+
let transformedList = fromFunctionDeclarations;
|
|
5786
|
+
if (Array.isArray(transformedList)) {
|
|
5787
|
+
transformedList = transformedList.map((item) => {
|
|
5788
|
+
return item;
|
|
5789
|
+
});
|
|
5790
|
+
}
|
|
5791
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5792
|
+
}
|
|
5807
5793
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5808
5794
|
if (fromGoogleMaps != null) {
|
|
5809
5795
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5812,6 +5798,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5812
5798
|
if (fromGoogleSearch != null) {
|
|
5813
5799
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5814
5800
|
}
|
|
5801
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5802
|
+
'googleSearchRetrieval',
|
|
5803
|
+
]);
|
|
5804
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5805
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5806
|
+
}
|
|
5815
5807
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5816
5808
|
if (fromUrlContext != null) {
|
|
5817
5809
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5820,28 +5812,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5820
5812
|
}
|
|
5821
5813
|
function toolToVertex$2(fromObject) {
|
|
5822
5814
|
const toObject = {};
|
|
5823
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5824
|
-
'functionDeclarations',
|
|
5825
|
-
]);
|
|
5826
|
-
if (fromFunctionDeclarations != null) {
|
|
5827
|
-
let transformedList = fromFunctionDeclarations;
|
|
5828
|
-
if (Array.isArray(transformedList)) {
|
|
5829
|
-
transformedList = transformedList.map((item) => {
|
|
5830
|
-
return functionDeclarationToVertex$2(item);
|
|
5831
|
-
});
|
|
5832
|
-
}
|
|
5833
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5834
|
-
}
|
|
5835
5815
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5836
5816
|
if (fromRetrieval != null) {
|
|
5837
5817
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5838
5818
|
}
|
|
5839
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5840
|
-
'googleSearchRetrieval',
|
|
5841
|
-
]);
|
|
5842
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5843
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5844
|
-
}
|
|
5845
5819
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5846
5820
|
if (fromComputerUse != null) {
|
|
5847
5821
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5861,6 +5835,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5861
5835
|
if (fromEnterpriseWebSearch != null) {
|
|
5862
5836
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5863
5837
|
}
|
|
5838
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5839
|
+
'functionDeclarations',
|
|
5840
|
+
]);
|
|
5841
|
+
if (fromFunctionDeclarations != null) {
|
|
5842
|
+
let transformedList = fromFunctionDeclarations;
|
|
5843
|
+
if (Array.isArray(transformedList)) {
|
|
5844
|
+
transformedList = transformedList.map((item) => {
|
|
5845
|
+
return functionDeclarationToVertex$2(item);
|
|
5846
|
+
});
|
|
5847
|
+
}
|
|
5848
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5849
|
+
}
|
|
5864
5850
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5865
5851
|
if (fromGoogleMaps != null) {
|
|
5866
5852
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5869,6 +5855,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5869
5855
|
if (fromGoogleSearch != null) {
|
|
5870
5856
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5871
5857
|
}
|
|
5858
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5859
|
+
'googleSearchRetrieval',
|
|
5860
|
+
]);
|
|
5861
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5862
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5863
|
+
}
|
|
5872
5864
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5873
5865
|
if (fromUrlContext != null) {
|
|
5874
5866
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7160,9 +7152,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
7160
7152
|
}
|
|
7161
7153
|
function functionDeclarationToVertex$1(fromObject) {
|
|
7162
7154
|
const toObject = {};
|
|
7163
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7164
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7165
|
-
}
|
|
7166
7155
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7167
7156
|
if (fromDescription != null) {
|
|
7168
7157
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -7191,6 +7180,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
7191
7180
|
if (fromResponseJsonSchema != null) {
|
|
7192
7181
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7193
7182
|
}
|
|
7183
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7184
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7185
|
+
}
|
|
7194
7186
|
return toObject;
|
|
7195
7187
|
}
|
|
7196
7188
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -7832,27 +7824,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7832
7824
|
}
|
|
7833
7825
|
function toolToMldev$2(fromObject) {
|
|
7834
7826
|
const toObject = {};
|
|
7835
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7836
|
-
'functionDeclarations',
|
|
7837
|
-
]);
|
|
7838
|
-
if (fromFunctionDeclarations != null) {
|
|
7839
|
-
let transformedList = fromFunctionDeclarations;
|
|
7840
|
-
if (Array.isArray(transformedList)) {
|
|
7841
|
-
transformedList = transformedList.map((item) => {
|
|
7842
|
-
return item;
|
|
7843
|
-
});
|
|
7844
|
-
}
|
|
7845
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7846
|
-
}
|
|
7847
7827
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
7848
7828
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
7849
7829
|
}
|
|
7850
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7851
|
-
'googleSearchRetrieval',
|
|
7852
|
-
]);
|
|
7853
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7854
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7855
|
-
}
|
|
7856
7830
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7857
7831
|
if (fromComputerUse != null) {
|
|
7858
7832
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7870,6 +7844,18 @@ function toolToMldev$2(fromObject) {
|
|
|
7870
7844
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7871
7845
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
7872
7846
|
}
|
|
7847
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7848
|
+
'functionDeclarations',
|
|
7849
|
+
]);
|
|
7850
|
+
if (fromFunctionDeclarations != null) {
|
|
7851
|
+
let transformedList = fromFunctionDeclarations;
|
|
7852
|
+
if (Array.isArray(transformedList)) {
|
|
7853
|
+
transformedList = transformedList.map((item) => {
|
|
7854
|
+
return item;
|
|
7855
|
+
});
|
|
7856
|
+
}
|
|
7857
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7858
|
+
}
|
|
7873
7859
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7874
7860
|
if (fromGoogleMaps != null) {
|
|
7875
7861
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -7878,6 +7864,12 @@ function toolToMldev$2(fromObject) {
|
|
|
7878
7864
|
if (fromGoogleSearch != null) {
|
|
7879
7865
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7880
7866
|
}
|
|
7867
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7868
|
+
'googleSearchRetrieval',
|
|
7869
|
+
]);
|
|
7870
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7871
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7872
|
+
}
|
|
7881
7873
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7882
7874
|
if (fromUrlContext != null) {
|
|
7883
7875
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7886,28 +7878,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7886
7878
|
}
|
|
7887
7879
|
function toolToVertex$1(fromObject) {
|
|
7888
7880
|
const toObject = {};
|
|
7889
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7890
|
-
'functionDeclarations',
|
|
7891
|
-
]);
|
|
7892
|
-
if (fromFunctionDeclarations != null) {
|
|
7893
|
-
let transformedList = fromFunctionDeclarations;
|
|
7894
|
-
if (Array.isArray(transformedList)) {
|
|
7895
|
-
transformedList = transformedList.map((item) => {
|
|
7896
|
-
return functionDeclarationToVertex$1(item);
|
|
7897
|
-
});
|
|
7898
|
-
}
|
|
7899
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7900
|
-
}
|
|
7901
7881
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7902
7882
|
if (fromRetrieval != null) {
|
|
7903
7883
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7904
7884
|
}
|
|
7905
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7906
|
-
'googleSearchRetrieval',
|
|
7907
|
-
]);
|
|
7908
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7909
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7910
|
-
}
|
|
7911
7885
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7912
7886
|
if (fromComputerUse != null) {
|
|
7913
7887
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7927,6 +7901,18 @@ function toolToVertex$1(fromObject) {
|
|
|
7927
7901
|
if (fromEnterpriseWebSearch != null) {
|
|
7928
7902
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
7929
7903
|
}
|
|
7904
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7905
|
+
'functionDeclarations',
|
|
7906
|
+
]);
|
|
7907
|
+
if (fromFunctionDeclarations != null) {
|
|
7908
|
+
let transformedList = fromFunctionDeclarations;
|
|
7909
|
+
if (Array.isArray(transformedList)) {
|
|
7910
|
+
transformedList = transformedList.map((item) => {
|
|
7911
|
+
return functionDeclarationToVertex$1(item);
|
|
7912
|
+
});
|
|
7913
|
+
}
|
|
7914
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7915
|
+
}
|
|
7930
7916
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7931
7917
|
if (fromGoogleMaps != null) {
|
|
7932
7918
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -7935,6 +7921,12 @@ function toolToVertex$1(fromObject) {
|
|
|
7935
7921
|
if (fromGoogleSearch != null) {
|
|
7936
7922
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
7937
7923
|
}
|
|
7924
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7925
|
+
'googleSearchRetrieval',
|
|
7926
|
+
]);
|
|
7927
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7928
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7929
|
+
}
|
|
7938
7930
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7939
7931
|
if (fromUrlContext != null) {
|
|
7940
7932
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8717,16 +8709,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
8717
8709
|
}
|
|
8718
8710
|
function functionCallingConfigToMldev(fromObject) {
|
|
8719
8711
|
const toObject = {};
|
|
8720
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8721
|
-
if (fromMode != null) {
|
|
8722
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
8723
|
-
}
|
|
8724
8712
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
8725
8713
|
'allowedFunctionNames',
|
|
8726
8714
|
]);
|
|
8727
8715
|
if (fromAllowedFunctionNames != null) {
|
|
8728
8716
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
8729
8717
|
}
|
|
8718
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8719
|
+
if (fromMode != null) {
|
|
8720
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
8721
|
+
}
|
|
8730
8722
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
8731
8723
|
undefined) {
|
|
8732
8724
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -8735,9 +8727,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
8735
8727
|
}
|
|
8736
8728
|
function functionDeclarationToVertex(fromObject) {
|
|
8737
8729
|
const toObject = {};
|
|
8738
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8739
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8740
|
-
}
|
|
8741
8730
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8742
8731
|
if (fromDescription != null) {
|
|
8743
8732
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -8766,6 +8755,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
8766
8755
|
if (fromResponseJsonSchema != null) {
|
|
8767
8756
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
8768
8757
|
}
|
|
8758
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8759
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8760
|
+
}
|
|
8769
8761
|
return toObject;
|
|
8770
8762
|
}
|
|
8771
8763
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -10103,6 +10095,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
10103
10095
|
if (fromImageSize != null) {
|
|
10104
10096
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10105
10097
|
}
|
|
10098
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10099
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10100
|
+
}
|
|
10106
10101
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10107
10102
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10108
10103
|
}
|
|
@@ -10122,6 +10117,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
10122
10117
|
if (fromImageSize != null) {
|
|
10123
10118
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10124
10119
|
}
|
|
10120
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
10121
|
+
'personGeneration',
|
|
10122
|
+
]);
|
|
10123
|
+
if (fromPersonGeneration != null) {
|
|
10124
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10125
|
+
}
|
|
10125
10126
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10126
10127
|
'outputMimeType',
|
|
10127
10128
|
]);
|
|
@@ -10822,43 +10823,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
10822
10823
|
}
|
|
10823
10824
|
function toolConfigToMldev(fromObject) {
|
|
10824
10825
|
const toObject = {};
|
|
10825
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10826
|
-
'functionCallingConfig',
|
|
10827
|
-
]);
|
|
10828
|
-
if (fromFunctionCallingConfig != null) {
|
|
10829
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10830
|
-
}
|
|
10831
10826
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
10832
10827
|
'retrievalConfig',
|
|
10833
10828
|
]);
|
|
10834
10829
|
if (fromRetrievalConfig != null) {
|
|
10835
10830
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
10836
10831
|
}
|
|
10832
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10833
|
+
'functionCallingConfig',
|
|
10834
|
+
]);
|
|
10835
|
+
if (fromFunctionCallingConfig != null) {
|
|
10836
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10837
|
+
}
|
|
10837
10838
|
return toObject;
|
|
10838
10839
|
}
|
|
10839
10840
|
function toolToMldev$1(fromObject) {
|
|
10840
10841
|
const toObject = {};
|
|
10841
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10842
|
-
'functionDeclarations',
|
|
10843
|
-
]);
|
|
10844
|
-
if (fromFunctionDeclarations != null) {
|
|
10845
|
-
let transformedList = fromFunctionDeclarations;
|
|
10846
|
-
if (Array.isArray(transformedList)) {
|
|
10847
|
-
transformedList = transformedList.map((item) => {
|
|
10848
|
-
return item;
|
|
10849
|
-
});
|
|
10850
|
-
}
|
|
10851
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10852
|
-
}
|
|
10853
10842
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
10854
10843
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
10855
10844
|
}
|
|
10856
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10857
|
-
'googleSearchRetrieval',
|
|
10858
|
-
]);
|
|
10859
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10860
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10861
|
-
}
|
|
10862
10845
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10863
10846
|
if (fromComputerUse != null) {
|
|
10864
10847
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10876,6 +10859,18 @@ function toolToMldev$1(fromObject) {
|
|
|
10876
10859
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
10877
10860
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
10878
10861
|
}
|
|
10862
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10863
|
+
'functionDeclarations',
|
|
10864
|
+
]);
|
|
10865
|
+
if (fromFunctionDeclarations != null) {
|
|
10866
|
+
let transformedList = fromFunctionDeclarations;
|
|
10867
|
+
if (Array.isArray(transformedList)) {
|
|
10868
|
+
transformedList = transformedList.map((item) => {
|
|
10869
|
+
return item;
|
|
10870
|
+
});
|
|
10871
|
+
}
|
|
10872
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10873
|
+
}
|
|
10879
10874
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10880
10875
|
if (fromGoogleMaps != null) {
|
|
10881
10876
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -10884,6 +10879,12 @@ function toolToMldev$1(fromObject) {
|
|
|
10884
10879
|
if (fromGoogleSearch != null) {
|
|
10885
10880
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
10886
10881
|
}
|
|
10882
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10883
|
+
'googleSearchRetrieval',
|
|
10884
|
+
]);
|
|
10885
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10886
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10887
|
+
}
|
|
10887
10888
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10888
10889
|
if (fromUrlContext != null) {
|
|
10889
10890
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -10892,28 +10893,10 @@ function toolToMldev$1(fromObject) {
|
|
|
10892
10893
|
}
|
|
10893
10894
|
function toolToVertex(fromObject) {
|
|
10894
10895
|
const toObject = {};
|
|
10895
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10896
|
-
'functionDeclarations',
|
|
10897
|
-
]);
|
|
10898
|
-
if (fromFunctionDeclarations != null) {
|
|
10899
|
-
let transformedList = fromFunctionDeclarations;
|
|
10900
|
-
if (Array.isArray(transformedList)) {
|
|
10901
|
-
transformedList = transformedList.map((item) => {
|
|
10902
|
-
return functionDeclarationToVertex(item);
|
|
10903
|
-
});
|
|
10904
|
-
}
|
|
10905
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10906
|
-
}
|
|
10907
10896
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
10908
10897
|
if (fromRetrieval != null) {
|
|
10909
10898
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
10910
10899
|
}
|
|
10911
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10912
|
-
'googleSearchRetrieval',
|
|
10913
|
-
]);
|
|
10914
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10915
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10916
|
-
}
|
|
10917
10900
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10918
10901
|
if (fromComputerUse != null) {
|
|
10919
10902
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10933,6 +10916,18 @@ function toolToVertex(fromObject) {
|
|
|
10933
10916
|
if (fromEnterpriseWebSearch != null) {
|
|
10934
10917
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
10935
10918
|
}
|
|
10919
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10920
|
+
'functionDeclarations',
|
|
10921
|
+
]);
|
|
10922
|
+
if (fromFunctionDeclarations != null) {
|
|
10923
|
+
let transformedList = fromFunctionDeclarations;
|
|
10924
|
+
if (Array.isArray(transformedList)) {
|
|
10925
|
+
transformedList = transformedList.map((item) => {
|
|
10926
|
+
return functionDeclarationToVertex(item);
|
|
10927
|
+
});
|
|
10928
|
+
}
|
|
10929
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10930
|
+
}
|
|
10936
10931
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10937
10932
|
if (fromGoogleMaps != null) {
|
|
10938
10933
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -10941,6 +10936,12 @@ function toolToVertex(fromObject) {
|
|
|
10941
10936
|
if (fromGoogleSearch != null) {
|
|
10942
10937
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
10943
10938
|
}
|
|
10939
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10940
|
+
'googleSearchRetrieval',
|
|
10941
|
+
]);
|
|
10942
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10943
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10944
|
+
}
|
|
10944
10945
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10945
10946
|
if (fromUrlContext != null) {
|
|
10946
10947
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11501,7 +11502,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11501
11502
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11502
11503
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11503
11504
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11504
|
-
const SDK_VERSION = '1.
|
|
11505
|
+
const SDK_VERSION = '1.35.0'; // x-release-please-version
|
|
11505
11506
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11506
11507
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11507
11508
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13215,7 +13216,7 @@ class Models extends BaseModule {
|
|
|
13215
13216
|
* @example
|
|
13216
13217
|
* ```ts
|
|
13217
13218
|
* const response = await client.models.generateImages({
|
|
13218
|
-
* model: 'imagen-
|
|
13219
|
+
* model: 'imagen-4.0-generate-001',
|
|
13219
13220
|
* prompt: 'Robot holding a red skateboard',
|
|
13220
13221
|
* config: {
|
|
13221
13222
|
* numberOfImages: 1,
|
|
@@ -13324,7 +13325,7 @@ class Models extends BaseModule {
|
|
|
13324
13325
|
* @example
|
|
13325
13326
|
* ```ts
|
|
13326
13327
|
* const response = await client.models.upscaleImage({
|
|
13327
|
-
* model: 'imagen-
|
|
13328
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
13328
13329
|
* image: image,
|
|
13329
13330
|
* upscaleFactor: 'x2',
|
|
13330
13331
|
* config: {
|
|
@@ -13986,7 +13987,7 @@ class Models extends BaseModule {
|
|
|
13986
13987
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
13987
13988
|
*
|
|
13988
13989
|
* const response2 = await ai.models.recontextImage({
|
|
13989
|
-
* model: 'virtual-try-on-
|
|
13990
|
+
* model: 'virtual-try-on-001',
|
|
13990
13991
|
* source: {
|
|
13991
13992
|
* personImage: personImage,
|
|
13992
13993
|
* productImages: [productImage],
|
|
@@ -15068,27 +15069,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
15068
15069
|
}
|
|
15069
15070
|
function toolToMldev(fromObject) {
|
|
15070
15071
|
const toObject = {};
|
|
15071
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15072
|
-
'functionDeclarations',
|
|
15073
|
-
]);
|
|
15074
|
-
if (fromFunctionDeclarations != null) {
|
|
15075
|
-
let transformedList = fromFunctionDeclarations;
|
|
15076
|
-
if (Array.isArray(transformedList)) {
|
|
15077
|
-
transformedList = transformedList.map((item) => {
|
|
15078
|
-
return item;
|
|
15079
|
-
});
|
|
15080
|
-
}
|
|
15081
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15082
|
-
}
|
|
15083
15072
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
15084
15073
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
15085
15074
|
}
|
|
15086
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15087
|
-
'googleSearchRetrieval',
|
|
15088
|
-
]);
|
|
15089
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
15090
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15091
|
-
}
|
|
15092
15075
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
15093
15076
|
if (fromComputerUse != null) {
|
|
15094
15077
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -15106,6 +15089,18 @@ function toolToMldev(fromObject) {
|
|
|
15106
15089
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
15107
15090
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
15108
15091
|
}
|
|
15092
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15093
|
+
'functionDeclarations',
|
|
15094
|
+
]);
|
|
15095
|
+
if (fromFunctionDeclarations != null) {
|
|
15096
|
+
let transformedList = fromFunctionDeclarations;
|
|
15097
|
+
if (Array.isArray(transformedList)) {
|
|
15098
|
+
transformedList = transformedList.map((item) => {
|
|
15099
|
+
return item;
|
|
15100
|
+
});
|
|
15101
|
+
}
|
|
15102
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15103
|
+
}
|
|
15109
15104
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15110
15105
|
if (fromGoogleMaps != null) {
|
|
15111
15106
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -15114,6 +15109,12 @@ function toolToMldev(fromObject) {
|
|
|
15114
15109
|
if (fromGoogleSearch != null) {
|
|
15115
15110
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15116
15111
|
}
|
|
15112
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15113
|
+
'googleSearchRetrieval',
|
|
15114
|
+
]);
|
|
15115
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
15116
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15117
|
+
}
|
|
15117
15118
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15118
15119
|
if (fromUrlContext != null) {
|
|
15119
15120
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|