@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/index.cjs
CHANGED
|
@@ -644,18 +644,6 @@ exports.Type = void 0;
|
|
|
644
644
|
*/
|
|
645
645
|
Type["NULL"] = "NULL";
|
|
646
646
|
})(exports.Type || (exports.Type = {}));
|
|
647
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
648
|
-
exports.Mode = void 0;
|
|
649
|
-
(function (Mode) {
|
|
650
|
-
/**
|
|
651
|
-
* Always trigger retrieval.
|
|
652
|
-
*/
|
|
653
|
-
Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
654
|
-
/**
|
|
655
|
-
* Run retrieval only when system decides it is necessary.
|
|
656
|
-
*/
|
|
657
|
-
Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
658
|
-
})(exports.Mode || (exports.Mode = {}));
|
|
659
647
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
660
648
|
exports.ApiSpec = void 0;
|
|
661
649
|
(function (ApiSpec) {
|
|
@@ -758,6 +746,58 @@ exports.PhishBlockThreshold = void 0;
|
|
|
758
746
|
*/
|
|
759
747
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
760
748
|
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
749
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
750
|
+
exports.Behavior = void 0;
|
|
751
|
+
(function (Behavior) {
|
|
752
|
+
/**
|
|
753
|
+
* This value is unused.
|
|
754
|
+
*/
|
|
755
|
+
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
756
|
+
/**
|
|
757
|
+
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
758
|
+
*/
|
|
759
|
+
Behavior["BLOCKING"] = "BLOCKING";
|
|
760
|
+
/**
|
|
761
|
+
* 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.
|
|
762
|
+
*/
|
|
763
|
+
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
764
|
+
})(exports.Behavior || (exports.Behavior = {}));
|
|
765
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
766
|
+
exports.DynamicRetrievalConfigMode = void 0;
|
|
767
|
+
(function (DynamicRetrievalConfigMode) {
|
|
768
|
+
/**
|
|
769
|
+
* Always trigger retrieval.
|
|
770
|
+
*/
|
|
771
|
+
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
772
|
+
/**
|
|
773
|
+
* Run retrieval only when system decides it is necessary.
|
|
774
|
+
*/
|
|
775
|
+
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
776
|
+
})(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
|
|
777
|
+
/** Function calling mode. */
|
|
778
|
+
exports.FunctionCallingConfigMode = void 0;
|
|
779
|
+
(function (FunctionCallingConfigMode) {
|
|
780
|
+
/**
|
|
781
|
+
* Unspecified function calling mode. This value should not be used.
|
|
782
|
+
*/
|
|
783
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
784
|
+
/**
|
|
785
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
786
|
+
*/
|
|
787
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
788
|
+
/**
|
|
789
|
+
* 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".
|
|
790
|
+
*/
|
|
791
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
792
|
+
/**
|
|
793
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
794
|
+
*/
|
|
795
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
796
|
+
/**
|
|
797
|
+
* 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".
|
|
798
|
+
*/
|
|
799
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
800
|
+
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
761
801
|
/** The number of thoughts tokens that the model should generate. */
|
|
762
802
|
exports.ThinkingLevel = void 0;
|
|
763
803
|
(function (ThinkingLevel) {
|
|
@@ -1264,34 +1304,6 @@ exports.FeatureSelectionPreference = void 0;
|
|
|
1264
1304
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1265
1305
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1266
1306
|
})(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
|
|
1267
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1268
|
-
exports.Behavior = void 0;
|
|
1269
|
-
(function (Behavior) {
|
|
1270
|
-
/**
|
|
1271
|
-
* This value is unused.
|
|
1272
|
-
*/
|
|
1273
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1274
|
-
/**
|
|
1275
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1276
|
-
*/
|
|
1277
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1278
|
-
/**
|
|
1279
|
-
* 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.
|
|
1280
|
-
*/
|
|
1281
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1282
|
-
})(exports.Behavior || (exports.Behavior = {}));
|
|
1283
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1284
|
-
exports.DynamicRetrievalConfigMode = void 0;
|
|
1285
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1286
|
-
/**
|
|
1287
|
-
* Always trigger retrieval.
|
|
1288
|
-
*/
|
|
1289
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1290
|
-
/**
|
|
1291
|
-
* Run retrieval only when system decides it is necessary.
|
|
1292
|
-
*/
|
|
1293
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1294
|
-
})(exports.DynamicRetrievalConfigMode || (exports.DynamicRetrievalConfigMode = {}));
|
|
1295
1307
|
/** The environment being operated. */
|
|
1296
1308
|
exports.Environment = void 0;
|
|
1297
1309
|
(function (Environment) {
|
|
@@ -1304,30 +1316,6 @@ exports.Environment = void 0;
|
|
|
1304
1316
|
*/
|
|
1305
1317
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1306
1318
|
})(exports.Environment || (exports.Environment = {}));
|
|
1307
|
-
/** Config for the function calling config mode. */
|
|
1308
|
-
exports.FunctionCallingConfigMode = void 0;
|
|
1309
|
-
(function (FunctionCallingConfigMode) {
|
|
1310
|
-
/**
|
|
1311
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1312
|
-
*/
|
|
1313
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1314
|
-
/**
|
|
1315
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1316
|
-
*/
|
|
1317
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1318
|
-
/**
|
|
1319
|
-
* 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".
|
|
1320
|
-
*/
|
|
1321
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1322
|
-
/**
|
|
1323
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1324
|
-
*/
|
|
1325
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1326
|
-
/**
|
|
1327
|
-
* 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".
|
|
1328
|
-
*/
|
|
1329
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1330
|
-
})(exports.FunctionCallingConfigMode || (exports.FunctionCallingConfigMode = {}));
|
|
1331
1319
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1332
1320
|
exports.SafetyFilterLevel = void 0;
|
|
1333
1321
|
(function (SafetyFilterLevel) {
|
|
@@ -1524,6 +1512,7 @@ exports.FileSource = void 0;
|
|
|
1524
1512
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1525
1513
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1526
1514
|
FileSource["GENERATED"] = "GENERATED";
|
|
1515
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1527
1516
|
})(exports.FileSource || (exports.FileSource = {}));
|
|
1528
1517
|
/** The reason why the turn is complete. */
|
|
1529
1518
|
exports.TurnCompleteReason = void 0;
|
|
@@ -3953,16 +3942,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
3953
3942
|
}
|
|
3954
3943
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
3955
3944
|
const toObject = {};
|
|
3956
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3957
|
-
if (fromMode != null) {
|
|
3958
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
3959
|
-
}
|
|
3960
3945
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
3961
3946
|
'allowedFunctionNames',
|
|
3962
3947
|
]);
|
|
3963
3948
|
if (fromAllowedFunctionNames != null) {
|
|
3964
3949
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
3965
3950
|
}
|
|
3951
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3952
|
+
if (fromMode != null) {
|
|
3953
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
3954
|
+
}
|
|
3966
3955
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
3967
3956
|
undefined) {
|
|
3968
3957
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4222,6 +4211,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4222
4211
|
if (fromImageSize != null) {
|
|
4223
4212
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4224
4213
|
}
|
|
4214
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4215
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4216
|
+
}
|
|
4225
4217
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4226
4218
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4227
4219
|
}
|
|
@@ -4447,43 +4439,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4447
4439
|
}
|
|
4448
4440
|
function toolConfigToMldev$2(fromObject) {
|
|
4449
4441
|
const toObject = {};
|
|
4450
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4451
|
-
'functionCallingConfig',
|
|
4452
|
-
]);
|
|
4453
|
-
if (fromFunctionCallingConfig != null) {
|
|
4454
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4455
|
-
}
|
|
4456
4442
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4457
4443
|
'retrievalConfig',
|
|
4458
4444
|
]);
|
|
4459
4445
|
if (fromRetrievalConfig != null) {
|
|
4460
4446
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4461
4447
|
}
|
|
4448
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4449
|
+
'functionCallingConfig',
|
|
4450
|
+
]);
|
|
4451
|
+
if (fromFunctionCallingConfig != null) {
|
|
4452
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4453
|
+
}
|
|
4462
4454
|
return toObject;
|
|
4463
4455
|
}
|
|
4464
4456
|
function toolToMldev$4(fromObject) {
|
|
4465
4457
|
const toObject = {};
|
|
4466
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4467
|
-
'functionDeclarations',
|
|
4468
|
-
]);
|
|
4469
|
-
if (fromFunctionDeclarations != null) {
|
|
4470
|
-
let transformedList = fromFunctionDeclarations;
|
|
4471
|
-
if (Array.isArray(transformedList)) {
|
|
4472
|
-
transformedList = transformedList.map((item) => {
|
|
4473
|
-
return item;
|
|
4474
|
-
});
|
|
4475
|
-
}
|
|
4476
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4477
|
-
}
|
|
4478
4458
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4479
4459
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4480
4460
|
}
|
|
4481
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4482
|
-
'googleSearchRetrieval',
|
|
4483
|
-
]);
|
|
4484
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4485
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4486
|
-
}
|
|
4487
4461
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4488
4462
|
if (fromComputerUse != null) {
|
|
4489
4463
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4501,6 +4475,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4501
4475
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4502
4476
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4503
4477
|
}
|
|
4478
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4479
|
+
'functionDeclarations',
|
|
4480
|
+
]);
|
|
4481
|
+
if (fromFunctionDeclarations != null) {
|
|
4482
|
+
let transformedList = fromFunctionDeclarations;
|
|
4483
|
+
if (Array.isArray(transformedList)) {
|
|
4484
|
+
transformedList = transformedList.map((item) => {
|
|
4485
|
+
return item;
|
|
4486
|
+
});
|
|
4487
|
+
}
|
|
4488
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4489
|
+
}
|
|
4504
4490
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4505
4491
|
if (fromGoogleMaps != null) {
|
|
4506
4492
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4509,6 +4495,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4509
4495
|
if (fromGoogleSearch != null) {
|
|
4510
4496
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4511
4497
|
}
|
|
4498
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4499
|
+
'googleSearchRetrieval',
|
|
4500
|
+
]);
|
|
4501
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4502
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4503
|
+
}
|
|
4512
4504
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4513
4505
|
if (fromUrlContext != null) {
|
|
4514
4506
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5439,16 +5431,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5439
5431
|
}
|
|
5440
5432
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5441
5433
|
const toObject = {};
|
|
5442
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5443
|
-
if (fromMode != null) {
|
|
5444
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5445
|
-
}
|
|
5446
5434
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5447
5435
|
'allowedFunctionNames',
|
|
5448
5436
|
]);
|
|
5449
5437
|
if (fromAllowedFunctionNames != null) {
|
|
5450
5438
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5451
5439
|
}
|
|
5440
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5441
|
+
if (fromMode != null) {
|
|
5442
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5443
|
+
}
|
|
5452
5444
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5453
5445
|
undefined) {
|
|
5454
5446
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5457,9 +5449,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5457
5449
|
}
|
|
5458
5450
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5459
5451
|
const toObject = {};
|
|
5460
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5461
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5462
|
-
}
|
|
5463
5452
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5464
5453
|
if (fromDescription != null) {
|
|
5465
5454
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5488,6 +5477,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5488
5477
|
if (fromResponseJsonSchema != null) {
|
|
5489
5478
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5490
5479
|
}
|
|
5480
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5481
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5482
|
+
}
|
|
5491
5483
|
return toObject;
|
|
5492
5484
|
}
|
|
5493
5485
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5691,43 +5683,25 @@ function partToMldev$3(fromObject) {
|
|
|
5691
5683
|
}
|
|
5692
5684
|
function toolConfigToMldev$1(fromObject) {
|
|
5693
5685
|
const toObject = {};
|
|
5694
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5695
|
-
'functionCallingConfig',
|
|
5696
|
-
]);
|
|
5697
|
-
if (fromFunctionCallingConfig != null) {
|
|
5698
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5699
|
-
}
|
|
5700
5686
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5701
5687
|
'retrievalConfig',
|
|
5702
5688
|
]);
|
|
5703
5689
|
if (fromRetrievalConfig != null) {
|
|
5704
5690
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5705
5691
|
}
|
|
5692
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5693
|
+
'functionCallingConfig',
|
|
5694
|
+
]);
|
|
5695
|
+
if (fromFunctionCallingConfig != null) {
|
|
5696
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5697
|
+
}
|
|
5706
5698
|
return toObject;
|
|
5707
5699
|
}
|
|
5708
5700
|
function toolToMldev$3(fromObject) {
|
|
5709
5701
|
const toObject = {};
|
|
5710
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5711
|
-
'functionDeclarations',
|
|
5712
|
-
]);
|
|
5713
|
-
if (fromFunctionDeclarations != null) {
|
|
5714
|
-
let transformedList = fromFunctionDeclarations;
|
|
5715
|
-
if (Array.isArray(transformedList)) {
|
|
5716
|
-
transformedList = transformedList.map((item) => {
|
|
5717
|
-
return item;
|
|
5718
|
-
});
|
|
5719
|
-
}
|
|
5720
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5721
|
-
}
|
|
5722
5702
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5723
5703
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5724
5704
|
}
|
|
5725
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5726
|
-
'googleSearchRetrieval',
|
|
5727
|
-
]);
|
|
5728
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5729
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5730
|
-
}
|
|
5731
5705
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5732
5706
|
if (fromComputerUse != null) {
|
|
5733
5707
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5745,6 +5719,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5745
5719
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5746
5720
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5747
5721
|
}
|
|
5722
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5723
|
+
'functionDeclarations',
|
|
5724
|
+
]);
|
|
5725
|
+
if (fromFunctionDeclarations != null) {
|
|
5726
|
+
let transformedList = fromFunctionDeclarations;
|
|
5727
|
+
if (Array.isArray(transformedList)) {
|
|
5728
|
+
transformedList = transformedList.map((item) => {
|
|
5729
|
+
return item;
|
|
5730
|
+
});
|
|
5731
|
+
}
|
|
5732
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5733
|
+
}
|
|
5748
5734
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5749
5735
|
if (fromGoogleMaps != null) {
|
|
5750
5736
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5753,6 +5739,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5753
5739
|
if (fromGoogleSearch != null) {
|
|
5754
5740
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5755
5741
|
}
|
|
5742
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5743
|
+
'googleSearchRetrieval',
|
|
5744
|
+
]);
|
|
5745
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5746
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5747
|
+
}
|
|
5756
5748
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5757
5749
|
if (fromUrlContext != null) {
|
|
5758
5750
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5761,28 +5753,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5761
5753
|
}
|
|
5762
5754
|
function toolToVertex$2(fromObject) {
|
|
5763
5755
|
const toObject = {};
|
|
5764
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5765
|
-
'functionDeclarations',
|
|
5766
|
-
]);
|
|
5767
|
-
if (fromFunctionDeclarations != null) {
|
|
5768
|
-
let transformedList = fromFunctionDeclarations;
|
|
5769
|
-
if (Array.isArray(transformedList)) {
|
|
5770
|
-
transformedList = transformedList.map((item) => {
|
|
5771
|
-
return functionDeclarationToVertex$2(item);
|
|
5772
|
-
});
|
|
5773
|
-
}
|
|
5774
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5775
|
-
}
|
|
5776
5756
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5777
5757
|
if (fromRetrieval != null) {
|
|
5778
5758
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5779
5759
|
}
|
|
5780
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5781
|
-
'googleSearchRetrieval',
|
|
5782
|
-
]);
|
|
5783
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5784
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5785
|
-
}
|
|
5786
5760
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5787
5761
|
if (fromComputerUse != null) {
|
|
5788
5762
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5802,6 +5776,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5802
5776
|
if (fromEnterpriseWebSearch != null) {
|
|
5803
5777
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5804
5778
|
}
|
|
5779
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5780
|
+
'functionDeclarations',
|
|
5781
|
+
]);
|
|
5782
|
+
if (fromFunctionDeclarations != null) {
|
|
5783
|
+
let transformedList = fromFunctionDeclarations;
|
|
5784
|
+
if (Array.isArray(transformedList)) {
|
|
5785
|
+
transformedList = transformedList.map((item) => {
|
|
5786
|
+
return functionDeclarationToVertex$2(item);
|
|
5787
|
+
});
|
|
5788
|
+
}
|
|
5789
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5790
|
+
}
|
|
5805
5791
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5806
5792
|
if (fromGoogleMaps != null) {
|
|
5807
5793
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5810,6 +5796,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5810
5796
|
if (fromGoogleSearch != null) {
|
|
5811
5797
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5812
5798
|
}
|
|
5799
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5800
|
+
'googleSearchRetrieval',
|
|
5801
|
+
]);
|
|
5802
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5803
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5804
|
+
}
|
|
5813
5805
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5814
5806
|
if (fromUrlContext != null) {
|
|
5815
5807
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -6897,7 +6889,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6897
6889
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6898
6890
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6899
6891
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6900
|
-
const SDK_VERSION = '1.
|
|
6892
|
+
const SDK_VERSION = '1.35.0'; // x-release-please-version
|
|
6901
6893
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6902
6894
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6903
6895
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -10607,9 +10599,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
10607
10599
|
}
|
|
10608
10600
|
function functionDeclarationToVertex$1(fromObject) {
|
|
10609
10601
|
const toObject = {};
|
|
10610
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10611
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10612
|
-
}
|
|
10613
10602
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
10614
10603
|
if (fromDescription != null) {
|
|
10615
10604
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -10638,6 +10627,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
10638
10627
|
if (fromResponseJsonSchema != null) {
|
|
10639
10628
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
10640
10629
|
}
|
|
10630
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10631
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10632
|
+
}
|
|
10641
10633
|
return toObject;
|
|
10642
10634
|
}
|
|
10643
10635
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -11279,27 +11271,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
11279
11271
|
}
|
|
11280
11272
|
function toolToMldev$2(fromObject) {
|
|
11281
11273
|
const toObject = {};
|
|
11282
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11283
|
-
'functionDeclarations',
|
|
11284
|
-
]);
|
|
11285
|
-
if (fromFunctionDeclarations != null) {
|
|
11286
|
-
let transformedList = fromFunctionDeclarations;
|
|
11287
|
-
if (Array.isArray(transformedList)) {
|
|
11288
|
-
transformedList = transformedList.map((item) => {
|
|
11289
|
-
return item;
|
|
11290
|
-
});
|
|
11291
|
-
}
|
|
11292
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11293
|
-
}
|
|
11294
11274
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
11295
11275
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
11296
11276
|
}
|
|
11297
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11298
|
-
'googleSearchRetrieval',
|
|
11299
|
-
]);
|
|
11300
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11301
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11302
|
-
}
|
|
11303
11277
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11304
11278
|
if (fromComputerUse != null) {
|
|
11305
11279
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11317,6 +11291,18 @@ function toolToMldev$2(fromObject) {
|
|
|
11317
11291
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
11318
11292
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
11319
11293
|
}
|
|
11294
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11295
|
+
'functionDeclarations',
|
|
11296
|
+
]);
|
|
11297
|
+
if (fromFunctionDeclarations != null) {
|
|
11298
|
+
let transformedList = fromFunctionDeclarations;
|
|
11299
|
+
if (Array.isArray(transformedList)) {
|
|
11300
|
+
transformedList = transformedList.map((item) => {
|
|
11301
|
+
return item;
|
|
11302
|
+
});
|
|
11303
|
+
}
|
|
11304
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11305
|
+
}
|
|
11320
11306
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11321
11307
|
if (fromGoogleMaps != null) {
|
|
11322
11308
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -11325,6 +11311,12 @@ function toolToMldev$2(fromObject) {
|
|
|
11325
11311
|
if (fromGoogleSearch != null) {
|
|
11326
11312
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
11327
11313
|
}
|
|
11314
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11315
|
+
'googleSearchRetrieval',
|
|
11316
|
+
]);
|
|
11317
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11318
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11319
|
+
}
|
|
11328
11320
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11329
11321
|
if (fromUrlContext != null) {
|
|
11330
11322
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11333,28 +11325,10 @@ function toolToMldev$2(fromObject) {
|
|
|
11333
11325
|
}
|
|
11334
11326
|
function toolToVertex$1(fromObject) {
|
|
11335
11327
|
const toObject = {};
|
|
11336
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11337
|
-
'functionDeclarations',
|
|
11338
|
-
]);
|
|
11339
|
-
if (fromFunctionDeclarations != null) {
|
|
11340
|
-
let transformedList = fromFunctionDeclarations;
|
|
11341
|
-
if (Array.isArray(transformedList)) {
|
|
11342
|
-
transformedList = transformedList.map((item) => {
|
|
11343
|
-
return functionDeclarationToVertex$1(item);
|
|
11344
|
-
});
|
|
11345
|
-
}
|
|
11346
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11347
|
-
}
|
|
11348
11328
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
11349
11329
|
if (fromRetrieval != null) {
|
|
11350
11330
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
11351
11331
|
}
|
|
11352
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11353
|
-
'googleSearchRetrieval',
|
|
11354
|
-
]);
|
|
11355
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11356
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11357
|
-
}
|
|
11358
11332
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11359
11333
|
if (fromComputerUse != null) {
|
|
11360
11334
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11374,6 +11348,18 @@ function toolToVertex$1(fromObject) {
|
|
|
11374
11348
|
if (fromEnterpriseWebSearch != null) {
|
|
11375
11349
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
11376
11350
|
}
|
|
11351
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11352
|
+
'functionDeclarations',
|
|
11353
|
+
]);
|
|
11354
|
+
if (fromFunctionDeclarations != null) {
|
|
11355
|
+
let transformedList = fromFunctionDeclarations;
|
|
11356
|
+
if (Array.isArray(transformedList)) {
|
|
11357
|
+
transformedList = transformedList.map((item) => {
|
|
11358
|
+
return functionDeclarationToVertex$1(item);
|
|
11359
|
+
});
|
|
11360
|
+
}
|
|
11361
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11362
|
+
}
|
|
11377
11363
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11378
11364
|
if (fromGoogleMaps != null) {
|
|
11379
11365
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -11382,6 +11368,12 @@ function toolToVertex$1(fromObject) {
|
|
|
11382
11368
|
if (fromGoogleSearch != null) {
|
|
11383
11369
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11384
11370
|
}
|
|
11371
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11372
|
+
'googleSearchRetrieval',
|
|
11373
|
+
]);
|
|
11374
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11375
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11376
|
+
}
|
|
11385
11377
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11386
11378
|
if (fromUrlContext != null) {
|
|
11387
11379
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -12164,16 +12156,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
12164
12156
|
}
|
|
12165
12157
|
function functionCallingConfigToMldev(fromObject) {
|
|
12166
12158
|
const toObject = {};
|
|
12167
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12168
|
-
if (fromMode != null) {
|
|
12169
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
12170
|
-
}
|
|
12171
12159
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
12172
12160
|
'allowedFunctionNames',
|
|
12173
12161
|
]);
|
|
12174
12162
|
if (fromAllowedFunctionNames != null) {
|
|
12175
12163
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
12176
12164
|
}
|
|
12165
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12166
|
+
if (fromMode != null) {
|
|
12167
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
12168
|
+
}
|
|
12177
12169
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
12178
12170
|
undefined) {
|
|
12179
12171
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -12182,9 +12174,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
12182
12174
|
}
|
|
12183
12175
|
function functionDeclarationToVertex(fromObject) {
|
|
12184
12176
|
const toObject = {};
|
|
12185
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12186
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12187
|
-
}
|
|
12188
12177
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
12189
12178
|
if (fromDescription != null) {
|
|
12190
12179
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -12213,6 +12202,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
12213
12202
|
if (fromResponseJsonSchema != null) {
|
|
12214
12203
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
12215
12204
|
}
|
|
12205
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12206
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12207
|
+
}
|
|
12216
12208
|
return toObject;
|
|
12217
12209
|
}
|
|
12218
12210
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -13550,6 +13542,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
13550
13542
|
if (fromImageSize != null) {
|
|
13551
13543
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13552
13544
|
}
|
|
13545
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
13546
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
13547
|
+
}
|
|
13553
13548
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
13554
13549
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
13555
13550
|
}
|
|
@@ -13569,6 +13564,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
13569
13564
|
if (fromImageSize != null) {
|
|
13570
13565
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13571
13566
|
}
|
|
13567
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
13568
|
+
'personGeneration',
|
|
13569
|
+
]);
|
|
13570
|
+
if (fromPersonGeneration != null) {
|
|
13571
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
13572
|
+
}
|
|
13572
13573
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
13573
13574
|
'outputMimeType',
|
|
13574
13575
|
]);
|
|
@@ -14269,43 +14270,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
14269
14270
|
}
|
|
14270
14271
|
function toolConfigToMldev(fromObject) {
|
|
14271
14272
|
const toObject = {};
|
|
14272
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14273
|
-
'functionCallingConfig',
|
|
14274
|
-
]);
|
|
14275
|
-
if (fromFunctionCallingConfig != null) {
|
|
14276
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14277
|
-
}
|
|
14278
14273
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
14279
14274
|
'retrievalConfig',
|
|
14280
14275
|
]);
|
|
14281
14276
|
if (fromRetrievalConfig != null) {
|
|
14282
14277
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
14283
14278
|
}
|
|
14279
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14280
|
+
'functionCallingConfig',
|
|
14281
|
+
]);
|
|
14282
|
+
if (fromFunctionCallingConfig != null) {
|
|
14283
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14284
|
+
}
|
|
14284
14285
|
return toObject;
|
|
14285
14286
|
}
|
|
14286
14287
|
function toolToMldev$1(fromObject) {
|
|
14287
14288
|
const toObject = {};
|
|
14288
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14289
|
-
'functionDeclarations',
|
|
14290
|
-
]);
|
|
14291
|
-
if (fromFunctionDeclarations != null) {
|
|
14292
|
-
let transformedList = fromFunctionDeclarations;
|
|
14293
|
-
if (Array.isArray(transformedList)) {
|
|
14294
|
-
transformedList = transformedList.map((item) => {
|
|
14295
|
-
return item;
|
|
14296
|
-
});
|
|
14297
|
-
}
|
|
14298
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14299
|
-
}
|
|
14300
14289
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
14301
14290
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
14302
14291
|
}
|
|
14303
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14304
|
-
'googleSearchRetrieval',
|
|
14305
|
-
]);
|
|
14306
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14307
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14308
|
-
}
|
|
14309
14292
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14310
14293
|
if (fromComputerUse != null) {
|
|
14311
14294
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14323,6 +14306,18 @@ function toolToMldev$1(fromObject) {
|
|
|
14323
14306
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
14324
14307
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
14325
14308
|
}
|
|
14309
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14310
|
+
'functionDeclarations',
|
|
14311
|
+
]);
|
|
14312
|
+
if (fromFunctionDeclarations != null) {
|
|
14313
|
+
let transformedList = fromFunctionDeclarations;
|
|
14314
|
+
if (Array.isArray(transformedList)) {
|
|
14315
|
+
transformedList = transformedList.map((item) => {
|
|
14316
|
+
return item;
|
|
14317
|
+
});
|
|
14318
|
+
}
|
|
14319
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14320
|
+
}
|
|
14326
14321
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14327
14322
|
if (fromGoogleMaps != null) {
|
|
14328
14323
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -14331,6 +14326,12 @@ function toolToMldev$1(fromObject) {
|
|
|
14331
14326
|
if (fromGoogleSearch != null) {
|
|
14332
14327
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
14333
14328
|
}
|
|
14329
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14330
|
+
'googleSearchRetrieval',
|
|
14331
|
+
]);
|
|
14332
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14333
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14334
|
+
}
|
|
14334
14335
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14335
14336
|
if (fromUrlContext != null) {
|
|
14336
14337
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -14339,28 +14340,10 @@ function toolToMldev$1(fromObject) {
|
|
|
14339
14340
|
}
|
|
14340
14341
|
function toolToVertex(fromObject) {
|
|
14341
14342
|
const toObject = {};
|
|
14342
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14343
|
-
'functionDeclarations',
|
|
14344
|
-
]);
|
|
14345
|
-
if (fromFunctionDeclarations != null) {
|
|
14346
|
-
let transformedList = fromFunctionDeclarations;
|
|
14347
|
-
if (Array.isArray(transformedList)) {
|
|
14348
|
-
transformedList = transformedList.map((item) => {
|
|
14349
|
-
return functionDeclarationToVertex(item);
|
|
14350
|
-
});
|
|
14351
|
-
}
|
|
14352
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14353
|
-
}
|
|
14354
14343
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
14355
14344
|
if (fromRetrieval != null) {
|
|
14356
14345
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
14357
14346
|
}
|
|
14358
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14359
|
-
'googleSearchRetrieval',
|
|
14360
|
-
]);
|
|
14361
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14362
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14363
|
-
}
|
|
14364
14347
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14365
14348
|
if (fromComputerUse != null) {
|
|
14366
14349
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14380,6 +14363,18 @@ function toolToVertex(fromObject) {
|
|
|
14380
14363
|
if (fromEnterpriseWebSearch != null) {
|
|
14381
14364
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
14382
14365
|
}
|
|
14366
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14367
|
+
'functionDeclarations',
|
|
14368
|
+
]);
|
|
14369
|
+
if (fromFunctionDeclarations != null) {
|
|
14370
|
+
let transformedList = fromFunctionDeclarations;
|
|
14371
|
+
if (Array.isArray(transformedList)) {
|
|
14372
|
+
transformedList = transformedList.map((item) => {
|
|
14373
|
+
return functionDeclarationToVertex(item);
|
|
14374
|
+
});
|
|
14375
|
+
}
|
|
14376
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14377
|
+
}
|
|
14383
14378
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14384
14379
|
if (fromGoogleMaps != null) {
|
|
14385
14380
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -14388,6 +14383,12 @@ function toolToVertex(fromObject) {
|
|
|
14388
14383
|
if (fromGoogleSearch != null) {
|
|
14389
14384
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
14390
14385
|
}
|
|
14386
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14387
|
+
'googleSearchRetrieval',
|
|
14388
|
+
]);
|
|
14389
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14390
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14391
|
+
}
|
|
14391
14392
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14392
14393
|
if (fromUrlContext != null) {
|
|
14393
14394
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -15793,7 +15794,7 @@ class Models extends BaseModule {
|
|
|
15793
15794
|
* @example
|
|
15794
15795
|
* ```ts
|
|
15795
15796
|
* const response = await client.models.generateImages({
|
|
15796
|
-
* model: 'imagen-
|
|
15797
|
+
* model: 'imagen-4.0-generate-001',
|
|
15797
15798
|
* prompt: 'Robot holding a red skateboard',
|
|
15798
15799
|
* config: {
|
|
15799
15800
|
* numberOfImages: 1,
|
|
@@ -15902,7 +15903,7 @@ class Models extends BaseModule {
|
|
|
15902
15903
|
* @example
|
|
15903
15904
|
* ```ts
|
|
15904
15905
|
* const response = await client.models.upscaleImage({
|
|
15905
|
-
* model: 'imagen-
|
|
15906
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
15906
15907
|
* image: image,
|
|
15907
15908
|
* upscaleFactor: 'x2',
|
|
15908
15909
|
* config: {
|
|
@@ -16564,7 +16565,7 @@ class Models extends BaseModule {
|
|
|
16564
16565
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
16565
16566
|
*
|
|
16566
16567
|
* const response2 = await ai.models.recontextImage({
|
|
16567
|
-
* model: 'virtual-try-on-
|
|
16568
|
+
* model: 'virtual-try-on-001',
|
|
16568
16569
|
* source: {
|
|
16569
16570
|
* personImage: personImage,
|
|
16570
16571
|
* productImages: [productImage],
|
|
@@ -17646,27 +17647,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
17646
17647
|
}
|
|
17647
17648
|
function toolToMldev(fromObject) {
|
|
17648
17649
|
const toObject = {};
|
|
17649
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
17650
|
-
'functionDeclarations',
|
|
17651
|
-
]);
|
|
17652
|
-
if (fromFunctionDeclarations != null) {
|
|
17653
|
-
let transformedList = fromFunctionDeclarations;
|
|
17654
|
-
if (Array.isArray(transformedList)) {
|
|
17655
|
-
transformedList = transformedList.map((item) => {
|
|
17656
|
-
return item;
|
|
17657
|
-
});
|
|
17658
|
-
}
|
|
17659
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
17660
|
-
}
|
|
17661
17650
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
17662
17651
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
17663
17652
|
}
|
|
17664
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17665
|
-
'googleSearchRetrieval',
|
|
17666
|
-
]);
|
|
17667
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
17668
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17669
|
-
}
|
|
17670
17653
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
17671
17654
|
if (fromComputerUse != null) {
|
|
17672
17655
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -17684,6 +17667,18 @@ function toolToMldev(fromObject) {
|
|
|
17684
17667
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
17685
17668
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
17686
17669
|
}
|
|
17670
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
17671
|
+
'functionDeclarations',
|
|
17672
|
+
]);
|
|
17673
|
+
if (fromFunctionDeclarations != null) {
|
|
17674
|
+
let transformedList = fromFunctionDeclarations;
|
|
17675
|
+
if (Array.isArray(transformedList)) {
|
|
17676
|
+
transformedList = transformedList.map((item) => {
|
|
17677
|
+
return item;
|
|
17678
|
+
});
|
|
17679
|
+
}
|
|
17680
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
17681
|
+
}
|
|
17687
17682
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
17688
17683
|
if (fromGoogleMaps != null) {
|
|
17689
17684
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -17692,6 +17687,12 @@ function toolToMldev(fromObject) {
|
|
|
17692
17687
|
if (fromGoogleSearch != null) {
|
|
17693
17688
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
17694
17689
|
}
|
|
17690
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17691
|
+
'googleSearchRetrieval',
|
|
17692
|
+
]);
|
|
17693
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
17694
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17695
|
+
}
|
|
17695
17696
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
17696
17697
|
if (fromUrlContext != null) {
|
|
17697
17698
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|