@google/genai 1.34.0 → 1.36.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 +151 -71
- package/dist/index.cjs +282 -251
- package/dist/index.mjs +283 -252
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +282 -251
- package/dist/node/index.mjs +283 -252
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +151 -71
- package/dist/tokenizer/node.cjs +5664 -0
- package/dist/tokenizer/node.d.ts +1145 -0
- package/dist/tokenizer/node.mjs +5640 -0
- package/dist/tokenizer/node.mjs.map +1 -0
- package/dist/web/index.mjs +283 -252
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +151 -71
- package/package.json +30 -3
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;
|
|
@@ -1648,6 +1637,22 @@ exports.VadSignalType = void 0;
|
|
|
1648
1637
|
*/
|
|
1649
1638
|
VadSignalType["VAD_SIGNAL_TYPE_EOS"] = "VAD_SIGNAL_TYPE_EOS";
|
|
1650
1639
|
})(exports.VadSignalType || (exports.VadSignalType = {}));
|
|
1640
|
+
/** The type of the voice activity signal. */
|
|
1641
|
+
exports.VoiceActivityType = void 0;
|
|
1642
|
+
(function (VoiceActivityType) {
|
|
1643
|
+
/**
|
|
1644
|
+
* The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
|
|
1645
|
+
*/
|
|
1646
|
+
VoiceActivityType["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
1647
|
+
/**
|
|
1648
|
+
* Start of sentence signal.
|
|
1649
|
+
*/
|
|
1650
|
+
VoiceActivityType["ACTIVITY_START"] = "ACTIVITY_START";
|
|
1651
|
+
/**
|
|
1652
|
+
* End of sentence signal.
|
|
1653
|
+
*/
|
|
1654
|
+
VoiceActivityType["ACTIVITY_END"] = "ACTIVITY_END";
|
|
1655
|
+
})(exports.VoiceActivityType || (exports.VoiceActivityType = {}));
|
|
1651
1656
|
/** Start of speech sensitivity. */
|
|
1652
1657
|
exports.StartSensitivity = void 0;
|
|
1653
1658
|
(function (StartSensitivity) {
|
|
@@ -4012,16 +4017,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
4012
4017
|
}
|
|
4013
4018
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
4014
4019
|
const toObject = {};
|
|
4015
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
4016
|
-
if (fromMode != null) {
|
|
4017
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
4018
|
-
}
|
|
4019
4020
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
4020
4021
|
'allowedFunctionNames',
|
|
4021
4022
|
]);
|
|
4022
4023
|
if (fromAllowedFunctionNames != null) {
|
|
4023
4024
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
4024
4025
|
}
|
|
4026
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
4027
|
+
if (fromMode != null) {
|
|
4028
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
4029
|
+
}
|
|
4025
4030
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
4026
4031
|
undefined) {
|
|
4027
4032
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4281,6 +4286,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4281
4286
|
if (fromImageSize != null) {
|
|
4282
4287
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4283
4288
|
}
|
|
4289
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4290
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4291
|
+
}
|
|
4284
4292
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4285
4293
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4286
4294
|
}
|
|
@@ -4506,43 +4514,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4506
4514
|
}
|
|
4507
4515
|
function toolConfigToMldev$2(fromObject) {
|
|
4508
4516
|
const toObject = {};
|
|
4509
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4510
|
-
'functionCallingConfig',
|
|
4511
|
-
]);
|
|
4512
|
-
if (fromFunctionCallingConfig != null) {
|
|
4513
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4514
|
-
}
|
|
4515
4517
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4516
4518
|
'retrievalConfig',
|
|
4517
4519
|
]);
|
|
4518
4520
|
if (fromRetrievalConfig != null) {
|
|
4519
4521
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4520
4522
|
}
|
|
4523
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4524
|
+
'functionCallingConfig',
|
|
4525
|
+
]);
|
|
4526
|
+
if (fromFunctionCallingConfig != null) {
|
|
4527
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4528
|
+
}
|
|
4521
4529
|
return toObject;
|
|
4522
4530
|
}
|
|
4523
4531
|
function toolToMldev$4(fromObject) {
|
|
4524
4532
|
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
4533
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4538
4534
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4539
4535
|
}
|
|
4540
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4541
|
-
'googleSearchRetrieval',
|
|
4542
|
-
]);
|
|
4543
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4544
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4545
|
-
}
|
|
4546
4536
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4547
4537
|
if (fromComputerUse != null) {
|
|
4548
4538
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4560,6 +4550,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4560
4550
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4561
4551
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4562
4552
|
}
|
|
4553
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4554
|
+
'functionDeclarations',
|
|
4555
|
+
]);
|
|
4556
|
+
if (fromFunctionDeclarations != null) {
|
|
4557
|
+
let transformedList = fromFunctionDeclarations;
|
|
4558
|
+
if (Array.isArray(transformedList)) {
|
|
4559
|
+
transformedList = transformedList.map((item) => {
|
|
4560
|
+
return item;
|
|
4561
|
+
});
|
|
4562
|
+
}
|
|
4563
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4564
|
+
}
|
|
4563
4565
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4564
4566
|
if (fromGoogleMaps != null) {
|
|
4565
4567
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4568,6 +4570,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4568
4570
|
if (fromGoogleSearch != null) {
|
|
4569
4571
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4570
4572
|
}
|
|
4573
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4574
|
+
'googleSearchRetrieval',
|
|
4575
|
+
]);
|
|
4576
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4577
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4578
|
+
}
|
|
4571
4579
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4572
4580
|
if (fromUrlContext != null) {
|
|
4573
4581
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5498,16 +5506,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5498
5506
|
}
|
|
5499
5507
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5500
5508
|
const toObject = {};
|
|
5501
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5502
|
-
if (fromMode != null) {
|
|
5503
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5504
|
-
}
|
|
5505
5509
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5506
5510
|
'allowedFunctionNames',
|
|
5507
5511
|
]);
|
|
5508
5512
|
if (fromAllowedFunctionNames != null) {
|
|
5509
5513
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5510
5514
|
}
|
|
5515
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5516
|
+
if (fromMode != null) {
|
|
5517
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5518
|
+
}
|
|
5511
5519
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5512
5520
|
undefined) {
|
|
5513
5521
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5516,9 +5524,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5516
5524
|
}
|
|
5517
5525
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5518
5526
|
const toObject = {};
|
|
5519
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5520
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5521
|
-
}
|
|
5522
5527
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5523
5528
|
if (fromDescription != null) {
|
|
5524
5529
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5547,6 +5552,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5547
5552
|
if (fromResponseJsonSchema != null) {
|
|
5548
5553
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5549
5554
|
}
|
|
5555
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5556
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5557
|
+
}
|
|
5550
5558
|
return toObject;
|
|
5551
5559
|
}
|
|
5552
5560
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5750,43 +5758,25 @@ function partToMldev$3(fromObject) {
|
|
|
5750
5758
|
}
|
|
5751
5759
|
function toolConfigToMldev$1(fromObject) {
|
|
5752
5760
|
const toObject = {};
|
|
5753
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5754
|
-
'functionCallingConfig',
|
|
5755
|
-
]);
|
|
5756
|
-
if (fromFunctionCallingConfig != null) {
|
|
5757
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5758
|
-
}
|
|
5759
5761
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5760
5762
|
'retrievalConfig',
|
|
5761
5763
|
]);
|
|
5762
5764
|
if (fromRetrievalConfig != null) {
|
|
5763
5765
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5764
5766
|
}
|
|
5767
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5768
|
+
'functionCallingConfig',
|
|
5769
|
+
]);
|
|
5770
|
+
if (fromFunctionCallingConfig != null) {
|
|
5771
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5772
|
+
}
|
|
5765
5773
|
return toObject;
|
|
5766
5774
|
}
|
|
5767
5775
|
function toolToMldev$3(fromObject) {
|
|
5768
5776
|
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
5777
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5782
5778
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5783
5779
|
}
|
|
5784
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5785
|
-
'googleSearchRetrieval',
|
|
5786
|
-
]);
|
|
5787
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5788
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5789
|
-
}
|
|
5790
5780
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5791
5781
|
if (fromComputerUse != null) {
|
|
5792
5782
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5804,6 +5794,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5804
5794
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5805
5795
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5806
5796
|
}
|
|
5797
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5798
|
+
'functionDeclarations',
|
|
5799
|
+
]);
|
|
5800
|
+
if (fromFunctionDeclarations != null) {
|
|
5801
|
+
let transformedList = fromFunctionDeclarations;
|
|
5802
|
+
if (Array.isArray(transformedList)) {
|
|
5803
|
+
transformedList = transformedList.map((item) => {
|
|
5804
|
+
return item;
|
|
5805
|
+
});
|
|
5806
|
+
}
|
|
5807
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5808
|
+
}
|
|
5807
5809
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5808
5810
|
if (fromGoogleMaps != null) {
|
|
5809
5811
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5812,6 +5814,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5812
5814
|
if (fromGoogleSearch != null) {
|
|
5813
5815
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5814
5816
|
}
|
|
5817
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5818
|
+
'googleSearchRetrieval',
|
|
5819
|
+
]);
|
|
5820
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5821
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5822
|
+
}
|
|
5815
5823
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5816
5824
|
if (fromUrlContext != null) {
|
|
5817
5825
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5820,28 +5828,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5820
5828
|
}
|
|
5821
5829
|
function toolToVertex$2(fromObject) {
|
|
5822
5830
|
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
5831
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5836
5832
|
if (fromRetrieval != null) {
|
|
5837
5833
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5838
5834
|
}
|
|
5839
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5840
|
-
'googleSearchRetrieval',
|
|
5841
|
-
]);
|
|
5842
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5843
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5844
|
-
}
|
|
5845
5835
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5846
5836
|
if (fromComputerUse != null) {
|
|
5847
5837
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5861,6 +5851,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5861
5851
|
if (fromEnterpriseWebSearch != null) {
|
|
5862
5852
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5863
5853
|
}
|
|
5854
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5855
|
+
'functionDeclarations',
|
|
5856
|
+
]);
|
|
5857
|
+
if (fromFunctionDeclarations != null) {
|
|
5858
|
+
let transformedList = fromFunctionDeclarations;
|
|
5859
|
+
if (Array.isArray(transformedList)) {
|
|
5860
|
+
transformedList = transformedList.map((item) => {
|
|
5861
|
+
return functionDeclarationToVertex$2(item);
|
|
5862
|
+
});
|
|
5863
|
+
}
|
|
5864
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5865
|
+
}
|
|
5864
5866
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5865
5867
|
if (fromGoogleMaps != null) {
|
|
5866
5868
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5869,6 +5871,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5869
5871
|
if (fromGoogleSearch != null) {
|
|
5870
5872
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5871
5873
|
}
|
|
5874
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5875
|
+
'googleSearchRetrieval',
|
|
5876
|
+
]);
|
|
5877
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5878
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5879
|
+
}
|
|
5872
5880
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5873
5881
|
if (fromUrlContext != null) {
|
|
5874
5882
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7160,9 +7168,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
7160
7168
|
}
|
|
7161
7169
|
function functionDeclarationToVertex$1(fromObject) {
|
|
7162
7170
|
const toObject = {};
|
|
7163
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7164
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7165
|
-
}
|
|
7166
7171
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7167
7172
|
if (fromDescription != null) {
|
|
7168
7173
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -7191,6 +7196,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
7191
7196
|
if (fromResponseJsonSchema != null) {
|
|
7192
7197
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7193
7198
|
}
|
|
7199
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7200
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7201
|
+
}
|
|
7194
7202
|
return toObject;
|
|
7195
7203
|
}
|
|
7196
7204
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -7757,6 +7765,12 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
7757
7765
|
if (fromVoiceActivityDetectionSignal != null) {
|
|
7758
7766
|
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
7759
7767
|
}
|
|
7768
|
+
const fromVoiceActivity = getValueByPath(fromObject, [
|
|
7769
|
+
'voiceActivity',
|
|
7770
|
+
]);
|
|
7771
|
+
if (fromVoiceActivity != null) {
|
|
7772
|
+
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
7773
|
+
}
|
|
7760
7774
|
return toObject;
|
|
7761
7775
|
}
|
|
7762
7776
|
function partToMldev$2(fromObject) {
|
|
@@ -7832,27 +7846,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7832
7846
|
}
|
|
7833
7847
|
function toolToMldev$2(fromObject) {
|
|
7834
7848
|
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
7849
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
7848
7850
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
7849
7851
|
}
|
|
7850
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7851
|
-
'googleSearchRetrieval',
|
|
7852
|
-
]);
|
|
7853
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7854
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7855
|
-
}
|
|
7856
7852
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7857
7853
|
if (fromComputerUse != null) {
|
|
7858
7854
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7870,6 +7866,18 @@ function toolToMldev$2(fromObject) {
|
|
|
7870
7866
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7871
7867
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
7872
7868
|
}
|
|
7869
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7870
|
+
'functionDeclarations',
|
|
7871
|
+
]);
|
|
7872
|
+
if (fromFunctionDeclarations != null) {
|
|
7873
|
+
let transformedList = fromFunctionDeclarations;
|
|
7874
|
+
if (Array.isArray(transformedList)) {
|
|
7875
|
+
transformedList = transformedList.map((item) => {
|
|
7876
|
+
return item;
|
|
7877
|
+
});
|
|
7878
|
+
}
|
|
7879
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7880
|
+
}
|
|
7873
7881
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7874
7882
|
if (fromGoogleMaps != null) {
|
|
7875
7883
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -7878,6 +7886,12 @@ function toolToMldev$2(fromObject) {
|
|
|
7878
7886
|
if (fromGoogleSearch != null) {
|
|
7879
7887
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7880
7888
|
}
|
|
7889
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7890
|
+
'googleSearchRetrieval',
|
|
7891
|
+
]);
|
|
7892
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7893
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7894
|
+
}
|
|
7881
7895
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7882
7896
|
if (fromUrlContext != null) {
|
|
7883
7897
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7886,28 +7900,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7886
7900
|
}
|
|
7887
7901
|
function toolToVertex$1(fromObject) {
|
|
7888
7902
|
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
7903
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7902
7904
|
if (fromRetrieval != null) {
|
|
7903
7905
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7904
7906
|
}
|
|
7905
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7906
|
-
'googleSearchRetrieval',
|
|
7907
|
-
]);
|
|
7908
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7909
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7910
|
-
}
|
|
7911
7907
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7912
7908
|
if (fromComputerUse != null) {
|
|
7913
7909
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7927,6 +7923,18 @@ function toolToVertex$1(fromObject) {
|
|
|
7927
7923
|
if (fromEnterpriseWebSearch != null) {
|
|
7928
7924
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
7929
7925
|
}
|
|
7926
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7927
|
+
'functionDeclarations',
|
|
7928
|
+
]);
|
|
7929
|
+
if (fromFunctionDeclarations != null) {
|
|
7930
|
+
let transformedList = fromFunctionDeclarations;
|
|
7931
|
+
if (Array.isArray(transformedList)) {
|
|
7932
|
+
transformedList = transformedList.map((item) => {
|
|
7933
|
+
return functionDeclarationToVertex$1(item);
|
|
7934
|
+
});
|
|
7935
|
+
}
|
|
7936
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7937
|
+
}
|
|
7930
7938
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7931
7939
|
if (fromGoogleMaps != null) {
|
|
7932
7940
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -7935,6 +7943,12 @@ function toolToVertex$1(fromObject) {
|
|
|
7935
7943
|
if (fromGoogleSearch != null) {
|
|
7936
7944
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
7937
7945
|
}
|
|
7946
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7947
|
+
'googleSearchRetrieval',
|
|
7948
|
+
]);
|
|
7949
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7950
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7951
|
+
}
|
|
7938
7952
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7939
7953
|
if (fromUrlContext != null) {
|
|
7940
7954
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8033,6 +8047,14 @@ function usageMetadataFromVertex(fromObject) {
|
|
|
8033
8047
|
}
|
|
8034
8048
|
return toObject;
|
|
8035
8049
|
}
|
|
8050
|
+
function voiceActivityFromVertex(fromObject) {
|
|
8051
|
+
const toObject = {};
|
|
8052
|
+
const fromVoiceActivityType = getValueByPath(fromObject, ['type']);
|
|
8053
|
+
if (fromVoiceActivityType != null) {
|
|
8054
|
+
setValueByPath(toObject, ['voiceActivityType'], fromVoiceActivityType);
|
|
8055
|
+
}
|
|
8056
|
+
return toObject;
|
|
8057
|
+
}
|
|
8036
8058
|
|
|
8037
8059
|
/**
|
|
8038
8060
|
* @license
|
|
@@ -8717,16 +8739,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
8717
8739
|
}
|
|
8718
8740
|
function functionCallingConfigToMldev(fromObject) {
|
|
8719
8741
|
const toObject = {};
|
|
8720
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8721
|
-
if (fromMode != null) {
|
|
8722
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
8723
|
-
}
|
|
8724
8742
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
8725
8743
|
'allowedFunctionNames',
|
|
8726
8744
|
]);
|
|
8727
8745
|
if (fromAllowedFunctionNames != null) {
|
|
8728
8746
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
8729
8747
|
}
|
|
8748
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8749
|
+
if (fromMode != null) {
|
|
8750
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
8751
|
+
}
|
|
8730
8752
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
8731
8753
|
undefined) {
|
|
8732
8754
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -8735,9 +8757,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
8735
8757
|
}
|
|
8736
8758
|
function functionDeclarationToVertex(fromObject) {
|
|
8737
8759
|
const toObject = {};
|
|
8738
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8739
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8740
|
-
}
|
|
8741
8760
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8742
8761
|
if (fromDescription != null) {
|
|
8743
8762
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -8766,6 +8785,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
8766
8785
|
if (fromResponseJsonSchema != null) {
|
|
8767
8786
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
8768
8787
|
}
|
|
8788
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8789
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8790
|
+
}
|
|
8769
8791
|
return toObject;
|
|
8770
8792
|
}
|
|
8771
8793
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -10103,6 +10125,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
10103
10125
|
if (fromImageSize != null) {
|
|
10104
10126
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10105
10127
|
}
|
|
10128
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10129
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10130
|
+
}
|
|
10106
10131
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10107
10132
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10108
10133
|
}
|
|
@@ -10122,6 +10147,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
10122
10147
|
if (fromImageSize != null) {
|
|
10123
10148
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10124
10149
|
}
|
|
10150
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
10151
|
+
'personGeneration',
|
|
10152
|
+
]);
|
|
10153
|
+
if (fromPersonGeneration != null) {
|
|
10154
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10155
|
+
}
|
|
10125
10156
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10126
10157
|
'outputMimeType',
|
|
10127
10158
|
]);
|
|
@@ -10822,43 +10853,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
10822
10853
|
}
|
|
10823
10854
|
function toolConfigToMldev(fromObject) {
|
|
10824
10855
|
const toObject = {};
|
|
10825
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10826
|
-
'functionCallingConfig',
|
|
10827
|
-
]);
|
|
10828
|
-
if (fromFunctionCallingConfig != null) {
|
|
10829
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10830
|
-
}
|
|
10831
10856
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
10832
10857
|
'retrievalConfig',
|
|
10833
10858
|
]);
|
|
10834
10859
|
if (fromRetrievalConfig != null) {
|
|
10835
10860
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
10836
10861
|
}
|
|
10862
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10863
|
+
'functionCallingConfig',
|
|
10864
|
+
]);
|
|
10865
|
+
if (fromFunctionCallingConfig != null) {
|
|
10866
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10867
|
+
}
|
|
10837
10868
|
return toObject;
|
|
10838
10869
|
}
|
|
10839
10870
|
function toolToMldev$1(fromObject) {
|
|
10840
10871
|
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
10872
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
10854
10873
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
10855
10874
|
}
|
|
10856
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10857
|
-
'googleSearchRetrieval',
|
|
10858
|
-
]);
|
|
10859
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10860
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10861
|
-
}
|
|
10862
10875
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10863
10876
|
if (fromComputerUse != null) {
|
|
10864
10877
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10876,6 +10889,18 @@ function toolToMldev$1(fromObject) {
|
|
|
10876
10889
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
10877
10890
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
10878
10891
|
}
|
|
10892
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10893
|
+
'functionDeclarations',
|
|
10894
|
+
]);
|
|
10895
|
+
if (fromFunctionDeclarations != null) {
|
|
10896
|
+
let transformedList = fromFunctionDeclarations;
|
|
10897
|
+
if (Array.isArray(transformedList)) {
|
|
10898
|
+
transformedList = transformedList.map((item) => {
|
|
10899
|
+
return item;
|
|
10900
|
+
});
|
|
10901
|
+
}
|
|
10902
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10903
|
+
}
|
|
10879
10904
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10880
10905
|
if (fromGoogleMaps != null) {
|
|
10881
10906
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -10884,6 +10909,12 @@ function toolToMldev$1(fromObject) {
|
|
|
10884
10909
|
if (fromGoogleSearch != null) {
|
|
10885
10910
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
10886
10911
|
}
|
|
10912
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10913
|
+
'googleSearchRetrieval',
|
|
10914
|
+
]);
|
|
10915
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10916
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10917
|
+
}
|
|
10887
10918
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10888
10919
|
if (fromUrlContext != null) {
|
|
10889
10920
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -10892,28 +10923,10 @@ function toolToMldev$1(fromObject) {
|
|
|
10892
10923
|
}
|
|
10893
10924
|
function toolToVertex(fromObject) {
|
|
10894
10925
|
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
10926
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
10908
10927
|
if (fromRetrieval != null) {
|
|
10909
10928
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
10910
10929
|
}
|
|
10911
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10912
|
-
'googleSearchRetrieval',
|
|
10913
|
-
]);
|
|
10914
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10915
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10916
|
-
}
|
|
10917
10930
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10918
10931
|
if (fromComputerUse != null) {
|
|
10919
10932
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10933,6 +10946,18 @@ function toolToVertex(fromObject) {
|
|
|
10933
10946
|
if (fromEnterpriseWebSearch != null) {
|
|
10934
10947
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
10935
10948
|
}
|
|
10949
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10950
|
+
'functionDeclarations',
|
|
10951
|
+
]);
|
|
10952
|
+
if (fromFunctionDeclarations != null) {
|
|
10953
|
+
let transformedList = fromFunctionDeclarations;
|
|
10954
|
+
if (Array.isArray(transformedList)) {
|
|
10955
|
+
transformedList = transformedList.map((item) => {
|
|
10956
|
+
return functionDeclarationToVertex(item);
|
|
10957
|
+
});
|
|
10958
|
+
}
|
|
10959
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10960
|
+
}
|
|
10936
10961
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10937
10962
|
if (fromGoogleMaps != null) {
|
|
10938
10963
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -10941,6 +10966,12 @@ function toolToVertex(fromObject) {
|
|
|
10941
10966
|
if (fromGoogleSearch != null) {
|
|
10942
10967
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
10943
10968
|
}
|
|
10969
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10970
|
+
'googleSearchRetrieval',
|
|
10971
|
+
]);
|
|
10972
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10973
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10974
|
+
}
|
|
10944
10975
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10945
10976
|
if (fromUrlContext != null) {
|
|
10946
10977
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11501,7 +11532,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11501
11532
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11502
11533
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11503
11534
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11504
|
-
const SDK_VERSION = '1.
|
|
11535
|
+
const SDK_VERSION = '1.36.0'; // x-release-please-version
|
|
11505
11536
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11506
11537
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11507
11538
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13215,7 +13246,7 @@ class Models extends BaseModule {
|
|
|
13215
13246
|
* @example
|
|
13216
13247
|
* ```ts
|
|
13217
13248
|
* const response = await client.models.generateImages({
|
|
13218
|
-
* model: 'imagen-
|
|
13249
|
+
* model: 'imagen-4.0-generate-001',
|
|
13219
13250
|
* prompt: 'Robot holding a red skateboard',
|
|
13220
13251
|
* config: {
|
|
13221
13252
|
* numberOfImages: 1,
|
|
@@ -13324,7 +13355,7 @@ class Models extends BaseModule {
|
|
|
13324
13355
|
* @example
|
|
13325
13356
|
* ```ts
|
|
13326
13357
|
* const response = await client.models.upscaleImage({
|
|
13327
|
-
* model: 'imagen-
|
|
13358
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
13328
13359
|
* image: image,
|
|
13329
13360
|
* upscaleFactor: 'x2',
|
|
13330
13361
|
* config: {
|
|
@@ -13986,7 +14017,7 @@ class Models extends BaseModule {
|
|
|
13986
14017
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
13987
14018
|
*
|
|
13988
14019
|
* const response2 = await ai.models.recontextImage({
|
|
13989
|
-
* model: 'virtual-try-on-
|
|
14020
|
+
* model: 'virtual-try-on-001',
|
|
13990
14021
|
* source: {
|
|
13991
14022
|
* personImage: personImage,
|
|
13992
14023
|
* productImages: [productImage],
|
|
@@ -15068,27 +15099,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
15068
15099
|
}
|
|
15069
15100
|
function toolToMldev(fromObject) {
|
|
15070
15101
|
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
15102
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
15084
15103
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
15085
15104
|
}
|
|
15086
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15087
|
-
'googleSearchRetrieval',
|
|
15088
|
-
]);
|
|
15089
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
15090
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15091
|
-
}
|
|
15092
15105
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
15093
15106
|
if (fromComputerUse != null) {
|
|
15094
15107
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -15106,6 +15119,18 @@ function toolToMldev(fromObject) {
|
|
|
15106
15119
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
15107
15120
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
15108
15121
|
}
|
|
15122
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15123
|
+
'functionDeclarations',
|
|
15124
|
+
]);
|
|
15125
|
+
if (fromFunctionDeclarations != null) {
|
|
15126
|
+
let transformedList = fromFunctionDeclarations;
|
|
15127
|
+
if (Array.isArray(transformedList)) {
|
|
15128
|
+
transformedList = transformedList.map((item) => {
|
|
15129
|
+
return item;
|
|
15130
|
+
});
|
|
15131
|
+
}
|
|
15132
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15133
|
+
}
|
|
15109
15134
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15110
15135
|
if (fromGoogleMaps != null) {
|
|
15111
15136
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -15114,6 +15139,12 @@ function toolToMldev(fromObject) {
|
|
|
15114
15139
|
if (fromGoogleSearch != null) {
|
|
15115
15140
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15116
15141
|
}
|
|
15142
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15143
|
+
'googleSearchRetrieval',
|
|
15144
|
+
]);
|
|
15145
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
15146
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15147
|
+
}
|
|
15117
15148
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15118
15149
|
if (fromUrlContext != null) {
|
|
15119
15150
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|