@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.mjs
CHANGED
|
@@ -642,18 +642,6 @@ var Type;
|
|
|
642
642
|
*/
|
|
643
643
|
Type["NULL"] = "NULL";
|
|
644
644
|
})(Type || (Type = {}));
|
|
645
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
646
|
-
var Mode;
|
|
647
|
-
(function (Mode) {
|
|
648
|
-
/**
|
|
649
|
-
* Always trigger retrieval.
|
|
650
|
-
*/
|
|
651
|
-
Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
652
|
-
/**
|
|
653
|
-
* Run retrieval only when system decides it is necessary.
|
|
654
|
-
*/
|
|
655
|
-
Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
656
|
-
})(Mode || (Mode = {}));
|
|
657
645
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
658
646
|
var ApiSpec;
|
|
659
647
|
(function (ApiSpec) {
|
|
@@ -756,6 +744,58 @@ var PhishBlockThreshold;
|
|
|
756
744
|
*/
|
|
757
745
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
758
746
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
747
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
748
|
+
var Behavior;
|
|
749
|
+
(function (Behavior) {
|
|
750
|
+
/**
|
|
751
|
+
* This value is unused.
|
|
752
|
+
*/
|
|
753
|
+
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
754
|
+
/**
|
|
755
|
+
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
756
|
+
*/
|
|
757
|
+
Behavior["BLOCKING"] = "BLOCKING";
|
|
758
|
+
/**
|
|
759
|
+
* 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.
|
|
760
|
+
*/
|
|
761
|
+
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
762
|
+
})(Behavior || (Behavior = {}));
|
|
763
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
764
|
+
var DynamicRetrievalConfigMode;
|
|
765
|
+
(function (DynamicRetrievalConfigMode) {
|
|
766
|
+
/**
|
|
767
|
+
* Always trigger retrieval.
|
|
768
|
+
*/
|
|
769
|
+
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
770
|
+
/**
|
|
771
|
+
* Run retrieval only when system decides it is necessary.
|
|
772
|
+
*/
|
|
773
|
+
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
774
|
+
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
775
|
+
/** Function calling mode. */
|
|
776
|
+
var FunctionCallingConfigMode;
|
|
777
|
+
(function (FunctionCallingConfigMode) {
|
|
778
|
+
/**
|
|
779
|
+
* Unspecified function calling mode. This value should not be used.
|
|
780
|
+
*/
|
|
781
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
782
|
+
/**
|
|
783
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
784
|
+
*/
|
|
785
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
786
|
+
/**
|
|
787
|
+
* 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".
|
|
788
|
+
*/
|
|
789
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
790
|
+
/**
|
|
791
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
792
|
+
*/
|
|
793
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
794
|
+
/**
|
|
795
|
+
* 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".
|
|
796
|
+
*/
|
|
797
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
798
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
759
799
|
/** The number of thoughts tokens that the model should generate. */
|
|
760
800
|
var ThinkingLevel;
|
|
761
801
|
(function (ThinkingLevel) {
|
|
@@ -1262,34 +1302,6 @@ var FeatureSelectionPreference;
|
|
|
1262
1302
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1263
1303
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1264
1304
|
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1265
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1266
|
-
var Behavior;
|
|
1267
|
-
(function (Behavior) {
|
|
1268
|
-
/**
|
|
1269
|
-
* This value is unused.
|
|
1270
|
-
*/
|
|
1271
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1272
|
-
/**
|
|
1273
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1274
|
-
*/
|
|
1275
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1276
|
-
/**
|
|
1277
|
-
* 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.
|
|
1278
|
-
*/
|
|
1279
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1280
|
-
})(Behavior || (Behavior = {}));
|
|
1281
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1282
|
-
var DynamicRetrievalConfigMode;
|
|
1283
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1284
|
-
/**
|
|
1285
|
-
* Always trigger retrieval.
|
|
1286
|
-
*/
|
|
1287
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1288
|
-
/**
|
|
1289
|
-
* Run retrieval only when system decides it is necessary.
|
|
1290
|
-
*/
|
|
1291
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1292
|
-
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
1293
1305
|
/** The environment being operated. */
|
|
1294
1306
|
var Environment;
|
|
1295
1307
|
(function (Environment) {
|
|
@@ -1302,30 +1314,6 @@ var Environment;
|
|
|
1302
1314
|
*/
|
|
1303
1315
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1304
1316
|
})(Environment || (Environment = {}));
|
|
1305
|
-
/** Config for the function calling config mode. */
|
|
1306
|
-
var FunctionCallingConfigMode;
|
|
1307
|
-
(function (FunctionCallingConfigMode) {
|
|
1308
|
-
/**
|
|
1309
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1310
|
-
*/
|
|
1311
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1312
|
-
/**
|
|
1313
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1314
|
-
*/
|
|
1315
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1316
|
-
/**
|
|
1317
|
-
* 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".
|
|
1318
|
-
*/
|
|
1319
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1320
|
-
/**
|
|
1321
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1322
|
-
*/
|
|
1323
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1324
|
-
/**
|
|
1325
|
-
* 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".
|
|
1326
|
-
*/
|
|
1327
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1328
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
1329
1317
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1330
1318
|
var SafetyFilterLevel;
|
|
1331
1319
|
(function (SafetyFilterLevel) {
|
|
@@ -1522,6 +1510,7 @@ var FileSource;
|
|
|
1522
1510
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1523
1511
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1524
1512
|
FileSource["GENERATED"] = "GENERATED";
|
|
1513
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1525
1514
|
})(FileSource || (FileSource = {}));
|
|
1526
1515
|
/** The reason why the turn is complete. */
|
|
1527
1516
|
var TurnCompleteReason;
|
|
@@ -3951,16 +3940,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
3951
3940
|
}
|
|
3952
3941
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
3953
3942
|
const toObject = {};
|
|
3954
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3955
|
-
if (fromMode != null) {
|
|
3956
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
3957
|
-
}
|
|
3958
3943
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
3959
3944
|
'allowedFunctionNames',
|
|
3960
3945
|
]);
|
|
3961
3946
|
if (fromAllowedFunctionNames != null) {
|
|
3962
3947
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
3963
3948
|
}
|
|
3949
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3950
|
+
if (fromMode != null) {
|
|
3951
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
3952
|
+
}
|
|
3964
3953
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
3965
3954
|
undefined) {
|
|
3966
3955
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4220,6 +4209,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4220
4209
|
if (fromImageSize != null) {
|
|
4221
4210
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4222
4211
|
}
|
|
4212
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4213
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4214
|
+
}
|
|
4223
4215
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4224
4216
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4225
4217
|
}
|
|
@@ -4445,43 +4437,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4445
4437
|
}
|
|
4446
4438
|
function toolConfigToMldev$2(fromObject) {
|
|
4447
4439
|
const toObject = {};
|
|
4448
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4449
|
-
'functionCallingConfig',
|
|
4450
|
-
]);
|
|
4451
|
-
if (fromFunctionCallingConfig != null) {
|
|
4452
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4453
|
-
}
|
|
4454
4440
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4455
4441
|
'retrievalConfig',
|
|
4456
4442
|
]);
|
|
4457
4443
|
if (fromRetrievalConfig != null) {
|
|
4458
4444
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4459
4445
|
}
|
|
4446
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4447
|
+
'functionCallingConfig',
|
|
4448
|
+
]);
|
|
4449
|
+
if (fromFunctionCallingConfig != null) {
|
|
4450
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4451
|
+
}
|
|
4460
4452
|
return toObject;
|
|
4461
4453
|
}
|
|
4462
4454
|
function toolToMldev$4(fromObject) {
|
|
4463
4455
|
const toObject = {};
|
|
4464
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4465
|
-
'functionDeclarations',
|
|
4466
|
-
]);
|
|
4467
|
-
if (fromFunctionDeclarations != null) {
|
|
4468
|
-
let transformedList = fromFunctionDeclarations;
|
|
4469
|
-
if (Array.isArray(transformedList)) {
|
|
4470
|
-
transformedList = transformedList.map((item) => {
|
|
4471
|
-
return item;
|
|
4472
|
-
});
|
|
4473
|
-
}
|
|
4474
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4475
|
-
}
|
|
4476
4456
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4477
4457
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4478
4458
|
}
|
|
4479
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4480
|
-
'googleSearchRetrieval',
|
|
4481
|
-
]);
|
|
4482
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4483
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4484
|
-
}
|
|
4485
4459
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4486
4460
|
if (fromComputerUse != null) {
|
|
4487
4461
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4499,6 +4473,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4499
4473
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4500
4474
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4501
4475
|
}
|
|
4476
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4477
|
+
'functionDeclarations',
|
|
4478
|
+
]);
|
|
4479
|
+
if (fromFunctionDeclarations != null) {
|
|
4480
|
+
let transformedList = fromFunctionDeclarations;
|
|
4481
|
+
if (Array.isArray(transformedList)) {
|
|
4482
|
+
transformedList = transformedList.map((item) => {
|
|
4483
|
+
return item;
|
|
4484
|
+
});
|
|
4485
|
+
}
|
|
4486
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4487
|
+
}
|
|
4502
4488
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4503
4489
|
if (fromGoogleMaps != null) {
|
|
4504
4490
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4507,6 +4493,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4507
4493
|
if (fromGoogleSearch != null) {
|
|
4508
4494
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4509
4495
|
}
|
|
4496
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4497
|
+
'googleSearchRetrieval',
|
|
4498
|
+
]);
|
|
4499
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4500
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4501
|
+
}
|
|
4510
4502
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4511
4503
|
if (fromUrlContext != null) {
|
|
4512
4504
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5437,16 +5429,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5437
5429
|
}
|
|
5438
5430
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5439
5431
|
const toObject = {};
|
|
5440
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5441
|
-
if (fromMode != null) {
|
|
5442
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5443
|
-
}
|
|
5444
5432
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5445
5433
|
'allowedFunctionNames',
|
|
5446
5434
|
]);
|
|
5447
5435
|
if (fromAllowedFunctionNames != null) {
|
|
5448
5436
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5449
5437
|
}
|
|
5438
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5439
|
+
if (fromMode != null) {
|
|
5440
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5441
|
+
}
|
|
5450
5442
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5451
5443
|
undefined) {
|
|
5452
5444
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5455,9 +5447,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5455
5447
|
}
|
|
5456
5448
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5457
5449
|
const toObject = {};
|
|
5458
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5459
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5460
|
-
}
|
|
5461
5450
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5462
5451
|
if (fromDescription != null) {
|
|
5463
5452
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5486,6 +5475,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5486
5475
|
if (fromResponseJsonSchema != null) {
|
|
5487
5476
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5488
5477
|
}
|
|
5478
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5479
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5480
|
+
}
|
|
5489
5481
|
return toObject;
|
|
5490
5482
|
}
|
|
5491
5483
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5689,43 +5681,25 @@ function partToMldev$3(fromObject) {
|
|
|
5689
5681
|
}
|
|
5690
5682
|
function toolConfigToMldev$1(fromObject) {
|
|
5691
5683
|
const toObject = {};
|
|
5692
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5693
|
-
'functionCallingConfig',
|
|
5694
|
-
]);
|
|
5695
|
-
if (fromFunctionCallingConfig != null) {
|
|
5696
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5697
|
-
}
|
|
5698
5684
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5699
5685
|
'retrievalConfig',
|
|
5700
5686
|
]);
|
|
5701
5687
|
if (fromRetrievalConfig != null) {
|
|
5702
5688
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5703
5689
|
}
|
|
5690
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5691
|
+
'functionCallingConfig',
|
|
5692
|
+
]);
|
|
5693
|
+
if (fromFunctionCallingConfig != null) {
|
|
5694
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5695
|
+
}
|
|
5704
5696
|
return toObject;
|
|
5705
5697
|
}
|
|
5706
5698
|
function toolToMldev$3(fromObject) {
|
|
5707
5699
|
const toObject = {};
|
|
5708
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5709
|
-
'functionDeclarations',
|
|
5710
|
-
]);
|
|
5711
|
-
if (fromFunctionDeclarations != null) {
|
|
5712
|
-
let transformedList = fromFunctionDeclarations;
|
|
5713
|
-
if (Array.isArray(transformedList)) {
|
|
5714
|
-
transformedList = transformedList.map((item) => {
|
|
5715
|
-
return item;
|
|
5716
|
-
});
|
|
5717
|
-
}
|
|
5718
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5719
|
-
}
|
|
5720
5700
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5721
5701
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5722
5702
|
}
|
|
5723
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5724
|
-
'googleSearchRetrieval',
|
|
5725
|
-
]);
|
|
5726
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5727
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5728
|
-
}
|
|
5729
5703
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5730
5704
|
if (fromComputerUse != null) {
|
|
5731
5705
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5743,6 +5717,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5743
5717
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5744
5718
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5745
5719
|
}
|
|
5720
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5721
|
+
'functionDeclarations',
|
|
5722
|
+
]);
|
|
5723
|
+
if (fromFunctionDeclarations != null) {
|
|
5724
|
+
let transformedList = fromFunctionDeclarations;
|
|
5725
|
+
if (Array.isArray(transformedList)) {
|
|
5726
|
+
transformedList = transformedList.map((item) => {
|
|
5727
|
+
return item;
|
|
5728
|
+
});
|
|
5729
|
+
}
|
|
5730
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5731
|
+
}
|
|
5746
5732
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5747
5733
|
if (fromGoogleMaps != null) {
|
|
5748
5734
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5751,6 +5737,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5751
5737
|
if (fromGoogleSearch != null) {
|
|
5752
5738
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5753
5739
|
}
|
|
5740
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5741
|
+
'googleSearchRetrieval',
|
|
5742
|
+
]);
|
|
5743
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5744
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5745
|
+
}
|
|
5754
5746
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5755
5747
|
if (fromUrlContext != null) {
|
|
5756
5748
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5759,28 +5751,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5759
5751
|
}
|
|
5760
5752
|
function toolToVertex$2(fromObject) {
|
|
5761
5753
|
const toObject = {};
|
|
5762
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5763
|
-
'functionDeclarations',
|
|
5764
|
-
]);
|
|
5765
|
-
if (fromFunctionDeclarations != null) {
|
|
5766
|
-
let transformedList = fromFunctionDeclarations;
|
|
5767
|
-
if (Array.isArray(transformedList)) {
|
|
5768
|
-
transformedList = transformedList.map((item) => {
|
|
5769
|
-
return functionDeclarationToVertex$2(item);
|
|
5770
|
-
});
|
|
5771
|
-
}
|
|
5772
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5773
|
-
}
|
|
5774
5754
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5775
5755
|
if (fromRetrieval != null) {
|
|
5776
5756
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5777
5757
|
}
|
|
5778
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5779
|
-
'googleSearchRetrieval',
|
|
5780
|
-
]);
|
|
5781
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5782
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5783
|
-
}
|
|
5784
5758
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5785
5759
|
if (fromComputerUse != null) {
|
|
5786
5760
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5800,6 +5774,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5800
5774
|
if (fromEnterpriseWebSearch != null) {
|
|
5801
5775
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5802
5776
|
}
|
|
5777
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5778
|
+
'functionDeclarations',
|
|
5779
|
+
]);
|
|
5780
|
+
if (fromFunctionDeclarations != null) {
|
|
5781
|
+
let transformedList = fromFunctionDeclarations;
|
|
5782
|
+
if (Array.isArray(transformedList)) {
|
|
5783
|
+
transformedList = transformedList.map((item) => {
|
|
5784
|
+
return functionDeclarationToVertex$2(item);
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5788
|
+
}
|
|
5803
5789
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5804
5790
|
if (fromGoogleMaps != null) {
|
|
5805
5791
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5808,6 +5794,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5808
5794
|
if (fromGoogleSearch != null) {
|
|
5809
5795
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5810
5796
|
}
|
|
5797
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5798
|
+
'googleSearchRetrieval',
|
|
5799
|
+
]);
|
|
5800
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5801
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5802
|
+
}
|
|
5811
5803
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5812
5804
|
if (fromUrlContext != null) {
|
|
5813
5805
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -6895,7 +6887,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6895
6887
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6896
6888
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6897
6889
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6898
|
-
const SDK_VERSION = '1.
|
|
6890
|
+
const SDK_VERSION = '1.35.0'; // x-release-please-version
|
|
6899
6891
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6900
6892
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6901
6893
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -10605,9 +10597,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
10605
10597
|
}
|
|
10606
10598
|
function functionDeclarationToVertex$1(fromObject) {
|
|
10607
10599
|
const toObject = {};
|
|
10608
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10609
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10610
|
-
}
|
|
10611
10600
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
10612
10601
|
if (fromDescription != null) {
|
|
10613
10602
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -10636,6 +10625,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
10636
10625
|
if (fromResponseJsonSchema != null) {
|
|
10637
10626
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
10638
10627
|
}
|
|
10628
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10629
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10630
|
+
}
|
|
10639
10631
|
return toObject;
|
|
10640
10632
|
}
|
|
10641
10633
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -11277,27 +11269,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
11277
11269
|
}
|
|
11278
11270
|
function toolToMldev$2(fromObject) {
|
|
11279
11271
|
const toObject = {};
|
|
11280
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11281
|
-
'functionDeclarations',
|
|
11282
|
-
]);
|
|
11283
|
-
if (fromFunctionDeclarations != null) {
|
|
11284
|
-
let transformedList = fromFunctionDeclarations;
|
|
11285
|
-
if (Array.isArray(transformedList)) {
|
|
11286
|
-
transformedList = transformedList.map((item) => {
|
|
11287
|
-
return item;
|
|
11288
|
-
});
|
|
11289
|
-
}
|
|
11290
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11291
|
-
}
|
|
11292
11272
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
11293
11273
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
11294
11274
|
}
|
|
11295
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11296
|
-
'googleSearchRetrieval',
|
|
11297
|
-
]);
|
|
11298
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11299
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11300
|
-
}
|
|
11301
11275
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11302
11276
|
if (fromComputerUse != null) {
|
|
11303
11277
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11315,6 +11289,18 @@ function toolToMldev$2(fromObject) {
|
|
|
11315
11289
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
11316
11290
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
11317
11291
|
}
|
|
11292
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11293
|
+
'functionDeclarations',
|
|
11294
|
+
]);
|
|
11295
|
+
if (fromFunctionDeclarations != null) {
|
|
11296
|
+
let transformedList = fromFunctionDeclarations;
|
|
11297
|
+
if (Array.isArray(transformedList)) {
|
|
11298
|
+
transformedList = transformedList.map((item) => {
|
|
11299
|
+
return item;
|
|
11300
|
+
});
|
|
11301
|
+
}
|
|
11302
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11303
|
+
}
|
|
11318
11304
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11319
11305
|
if (fromGoogleMaps != null) {
|
|
11320
11306
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -11323,6 +11309,12 @@ function toolToMldev$2(fromObject) {
|
|
|
11323
11309
|
if (fromGoogleSearch != null) {
|
|
11324
11310
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
11325
11311
|
}
|
|
11312
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11313
|
+
'googleSearchRetrieval',
|
|
11314
|
+
]);
|
|
11315
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11316
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11317
|
+
}
|
|
11326
11318
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11327
11319
|
if (fromUrlContext != null) {
|
|
11328
11320
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11331,28 +11323,10 @@ function toolToMldev$2(fromObject) {
|
|
|
11331
11323
|
}
|
|
11332
11324
|
function toolToVertex$1(fromObject) {
|
|
11333
11325
|
const toObject = {};
|
|
11334
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11335
|
-
'functionDeclarations',
|
|
11336
|
-
]);
|
|
11337
|
-
if (fromFunctionDeclarations != null) {
|
|
11338
|
-
let transformedList = fromFunctionDeclarations;
|
|
11339
|
-
if (Array.isArray(transformedList)) {
|
|
11340
|
-
transformedList = transformedList.map((item) => {
|
|
11341
|
-
return functionDeclarationToVertex$1(item);
|
|
11342
|
-
});
|
|
11343
|
-
}
|
|
11344
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11345
|
-
}
|
|
11346
11326
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
11347
11327
|
if (fromRetrieval != null) {
|
|
11348
11328
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
11349
11329
|
}
|
|
11350
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11351
|
-
'googleSearchRetrieval',
|
|
11352
|
-
]);
|
|
11353
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11354
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11355
|
-
}
|
|
11356
11330
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11357
11331
|
if (fromComputerUse != null) {
|
|
11358
11332
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11372,6 +11346,18 @@ function toolToVertex$1(fromObject) {
|
|
|
11372
11346
|
if (fromEnterpriseWebSearch != null) {
|
|
11373
11347
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
11374
11348
|
}
|
|
11349
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11350
|
+
'functionDeclarations',
|
|
11351
|
+
]);
|
|
11352
|
+
if (fromFunctionDeclarations != null) {
|
|
11353
|
+
let transformedList = fromFunctionDeclarations;
|
|
11354
|
+
if (Array.isArray(transformedList)) {
|
|
11355
|
+
transformedList = transformedList.map((item) => {
|
|
11356
|
+
return functionDeclarationToVertex$1(item);
|
|
11357
|
+
});
|
|
11358
|
+
}
|
|
11359
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11360
|
+
}
|
|
11375
11361
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11376
11362
|
if (fromGoogleMaps != null) {
|
|
11377
11363
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -11380,6 +11366,12 @@ function toolToVertex$1(fromObject) {
|
|
|
11380
11366
|
if (fromGoogleSearch != null) {
|
|
11381
11367
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11382
11368
|
}
|
|
11369
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11370
|
+
'googleSearchRetrieval',
|
|
11371
|
+
]);
|
|
11372
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11373
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11374
|
+
}
|
|
11383
11375
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11384
11376
|
if (fromUrlContext != null) {
|
|
11385
11377
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -12162,16 +12154,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
12162
12154
|
}
|
|
12163
12155
|
function functionCallingConfigToMldev(fromObject) {
|
|
12164
12156
|
const toObject = {};
|
|
12165
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12166
|
-
if (fromMode != null) {
|
|
12167
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
12168
|
-
}
|
|
12169
12157
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
12170
12158
|
'allowedFunctionNames',
|
|
12171
12159
|
]);
|
|
12172
12160
|
if (fromAllowedFunctionNames != null) {
|
|
12173
12161
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
12174
12162
|
}
|
|
12163
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12164
|
+
if (fromMode != null) {
|
|
12165
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
12166
|
+
}
|
|
12175
12167
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
12176
12168
|
undefined) {
|
|
12177
12169
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -12180,9 +12172,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
12180
12172
|
}
|
|
12181
12173
|
function functionDeclarationToVertex(fromObject) {
|
|
12182
12174
|
const toObject = {};
|
|
12183
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12184
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12185
|
-
}
|
|
12186
12175
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
12187
12176
|
if (fromDescription != null) {
|
|
12188
12177
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -12211,6 +12200,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
12211
12200
|
if (fromResponseJsonSchema != null) {
|
|
12212
12201
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
12213
12202
|
}
|
|
12203
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12204
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12205
|
+
}
|
|
12214
12206
|
return toObject;
|
|
12215
12207
|
}
|
|
12216
12208
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -13548,6 +13540,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
13548
13540
|
if (fromImageSize != null) {
|
|
13549
13541
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13550
13542
|
}
|
|
13543
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
13544
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
13545
|
+
}
|
|
13551
13546
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
13552
13547
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
13553
13548
|
}
|
|
@@ -13567,6 +13562,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
13567
13562
|
if (fromImageSize != null) {
|
|
13568
13563
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13569
13564
|
}
|
|
13565
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
13566
|
+
'personGeneration',
|
|
13567
|
+
]);
|
|
13568
|
+
if (fromPersonGeneration != null) {
|
|
13569
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
13570
|
+
}
|
|
13570
13571
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
13571
13572
|
'outputMimeType',
|
|
13572
13573
|
]);
|
|
@@ -14267,43 +14268,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
14267
14268
|
}
|
|
14268
14269
|
function toolConfigToMldev(fromObject) {
|
|
14269
14270
|
const toObject = {};
|
|
14270
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14271
|
-
'functionCallingConfig',
|
|
14272
|
-
]);
|
|
14273
|
-
if (fromFunctionCallingConfig != null) {
|
|
14274
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14275
|
-
}
|
|
14276
14271
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
14277
14272
|
'retrievalConfig',
|
|
14278
14273
|
]);
|
|
14279
14274
|
if (fromRetrievalConfig != null) {
|
|
14280
14275
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
14281
14276
|
}
|
|
14277
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14278
|
+
'functionCallingConfig',
|
|
14279
|
+
]);
|
|
14280
|
+
if (fromFunctionCallingConfig != null) {
|
|
14281
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14282
|
+
}
|
|
14282
14283
|
return toObject;
|
|
14283
14284
|
}
|
|
14284
14285
|
function toolToMldev$1(fromObject) {
|
|
14285
14286
|
const toObject = {};
|
|
14286
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14287
|
-
'functionDeclarations',
|
|
14288
|
-
]);
|
|
14289
|
-
if (fromFunctionDeclarations != null) {
|
|
14290
|
-
let transformedList = fromFunctionDeclarations;
|
|
14291
|
-
if (Array.isArray(transformedList)) {
|
|
14292
|
-
transformedList = transformedList.map((item) => {
|
|
14293
|
-
return item;
|
|
14294
|
-
});
|
|
14295
|
-
}
|
|
14296
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14297
|
-
}
|
|
14298
14287
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
14299
14288
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
14300
14289
|
}
|
|
14301
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14302
|
-
'googleSearchRetrieval',
|
|
14303
|
-
]);
|
|
14304
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14305
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14306
|
-
}
|
|
14307
14290
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14308
14291
|
if (fromComputerUse != null) {
|
|
14309
14292
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14321,6 +14304,18 @@ function toolToMldev$1(fromObject) {
|
|
|
14321
14304
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
14322
14305
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
14323
14306
|
}
|
|
14307
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14308
|
+
'functionDeclarations',
|
|
14309
|
+
]);
|
|
14310
|
+
if (fromFunctionDeclarations != null) {
|
|
14311
|
+
let transformedList = fromFunctionDeclarations;
|
|
14312
|
+
if (Array.isArray(transformedList)) {
|
|
14313
|
+
transformedList = transformedList.map((item) => {
|
|
14314
|
+
return item;
|
|
14315
|
+
});
|
|
14316
|
+
}
|
|
14317
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14318
|
+
}
|
|
14324
14319
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14325
14320
|
if (fromGoogleMaps != null) {
|
|
14326
14321
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -14329,6 +14324,12 @@ function toolToMldev$1(fromObject) {
|
|
|
14329
14324
|
if (fromGoogleSearch != null) {
|
|
14330
14325
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
14331
14326
|
}
|
|
14327
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14328
|
+
'googleSearchRetrieval',
|
|
14329
|
+
]);
|
|
14330
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14331
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14332
|
+
}
|
|
14332
14333
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14333
14334
|
if (fromUrlContext != null) {
|
|
14334
14335
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -14337,28 +14338,10 @@ function toolToMldev$1(fromObject) {
|
|
|
14337
14338
|
}
|
|
14338
14339
|
function toolToVertex(fromObject) {
|
|
14339
14340
|
const toObject = {};
|
|
14340
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14341
|
-
'functionDeclarations',
|
|
14342
|
-
]);
|
|
14343
|
-
if (fromFunctionDeclarations != null) {
|
|
14344
|
-
let transformedList = fromFunctionDeclarations;
|
|
14345
|
-
if (Array.isArray(transformedList)) {
|
|
14346
|
-
transformedList = transformedList.map((item) => {
|
|
14347
|
-
return functionDeclarationToVertex(item);
|
|
14348
|
-
});
|
|
14349
|
-
}
|
|
14350
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14351
|
-
}
|
|
14352
14341
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
14353
14342
|
if (fromRetrieval != null) {
|
|
14354
14343
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
14355
14344
|
}
|
|
14356
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14357
|
-
'googleSearchRetrieval',
|
|
14358
|
-
]);
|
|
14359
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14360
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14361
|
-
}
|
|
14362
14345
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14363
14346
|
if (fromComputerUse != null) {
|
|
14364
14347
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14378,6 +14361,18 @@ function toolToVertex(fromObject) {
|
|
|
14378
14361
|
if (fromEnterpriseWebSearch != null) {
|
|
14379
14362
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
14380
14363
|
}
|
|
14364
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14365
|
+
'functionDeclarations',
|
|
14366
|
+
]);
|
|
14367
|
+
if (fromFunctionDeclarations != null) {
|
|
14368
|
+
let transformedList = fromFunctionDeclarations;
|
|
14369
|
+
if (Array.isArray(transformedList)) {
|
|
14370
|
+
transformedList = transformedList.map((item) => {
|
|
14371
|
+
return functionDeclarationToVertex(item);
|
|
14372
|
+
});
|
|
14373
|
+
}
|
|
14374
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14375
|
+
}
|
|
14381
14376
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14382
14377
|
if (fromGoogleMaps != null) {
|
|
14383
14378
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -14386,6 +14381,12 @@ function toolToVertex(fromObject) {
|
|
|
14386
14381
|
if (fromGoogleSearch != null) {
|
|
14387
14382
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
14388
14383
|
}
|
|
14384
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14385
|
+
'googleSearchRetrieval',
|
|
14386
|
+
]);
|
|
14387
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14388
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14389
|
+
}
|
|
14389
14390
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14390
14391
|
if (fromUrlContext != null) {
|
|
14391
14392
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -15791,7 +15792,7 @@ class Models extends BaseModule {
|
|
|
15791
15792
|
* @example
|
|
15792
15793
|
* ```ts
|
|
15793
15794
|
* const response = await client.models.generateImages({
|
|
15794
|
-
* model: 'imagen-
|
|
15795
|
+
* model: 'imagen-4.0-generate-001',
|
|
15795
15796
|
* prompt: 'Robot holding a red skateboard',
|
|
15796
15797
|
* config: {
|
|
15797
15798
|
* numberOfImages: 1,
|
|
@@ -15900,7 +15901,7 @@ class Models extends BaseModule {
|
|
|
15900
15901
|
* @example
|
|
15901
15902
|
* ```ts
|
|
15902
15903
|
* const response = await client.models.upscaleImage({
|
|
15903
|
-
* model: 'imagen-
|
|
15904
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
15904
15905
|
* image: image,
|
|
15905
15906
|
* upscaleFactor: 'x2',
|
|
15906
15907
|
* config: {
|
|
@@ -16562,7 +16563,7 @@ class Models extends BaseModule {
|
|
|
16562
16563
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
16563
16564
|
*
|
|
16564
16565
|
* const response2 = await ai.models.recontextImage({
|
|
16565
|
-
* model: 'virtual-try-on-
|
|
16566
|
+
* model: 'virtual-try-on-001',
|
|
16566
16567
|
* source: {
|
|
16567
16568
|
* personImage: personImage,
|
|
16568
16569
|
* productImages: [productImage],
|
|
@@ -17644,27 +17645,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
17644
17645
|
}
|
|
17645
17646
|
function toolToMldev(fromObject) {
|
|
17646
17647
|
const toObject = {};
|
|
17647
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
17648
|
-
'functionDeclarations',
|
|
17649
|
-
]);
|
|
17650
|
-
if (fromFunctionDeclarations != null) {
|
|
17651
|
-
let transformedList = fromFunctionDeclarations;
|
|
17652
|
-
if (Array.isArray(transformedList)) {
|
|
17653
|
-
transformedList = transformedList.map((item) => {
|
|
17654
|
-
return item;
|
|
17655
|
-
});
|
|
17656
|
-
}
|
|
17657
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
17658
|
-
}
|
|
17659
17648
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
17660
17649
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
17661
17650
|
}
|
|
17662
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17663
|
-
'googleSearchRetrieval',
|
|
17664
|
-
]);
|
|
17665
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
17666
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17667
|
-
}
|
|
17668
17651
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
17669
17652
|
if (fromComputerUse != null) {
|
|
17670
17653
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -17682,6 +17665,18 @@ function toolToMldev(fromObject) {
|
|
|
17682
17665
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
17683
17666
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
17684
17667
|
}
|
|
17668
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
17669
|
+
'functionDeclarations',
|
|
17670
|
+
]);
|
|
17671
|
+
if (fromFunctionDeclarations != null) {
|
|
17672
|
+
let transformedList = fromFunctionDeclarations;
|
|
17673
|
+
if (Array.isArray(transformedList)) {
|
|
17674
|
+
transformedList = transformedList.map((item) => {
|
|
17675
|
+
return item;
|
|
17676
|
+
});
|
|
17677
|
+
}
|
|
17678
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
17679
|
+
}
|
|
17685
17680
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
17686
17681
|
if (fromGoogleMaps != null) {
|
|
17687
17682
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -17690,6 +17685,12 @@ function toolToMldev(fromObject) {
|
|
|
17690
17685
|
if (fromGoogleSearch != null) {
|
|
17691
17686
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
17692
17687
|
}
|
|
17688
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17689
|
+
'googleSearchRetrieval',
|
|
17690
|
+
]);
|
|
17691
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
17692
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17693
|
+
}
|
|
17693
17694
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
17694
17695
|
if (fromUrlContext != null) {
|
|
17695
17696
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -19157,5 +19158,5 @@ class GoogleGenAI {
|
|
|
19157
19158
|
}
|
|
19158
19159
|
}
|
|
19159
19160
|
|
|
19160
|
-
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality,
|
|
19161
|
+
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19161
19162
|
//# sourceMappingURL=index.mjs.map
|