@google/genai 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +151 -71
- package/dist/index.cjs +282 -251
- package/dist/index.mjs +283 -252
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +282 -251
- package/dist/node/index.mjs +283 -252
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +151 -71
- package/dist/tokenizer/node.cjs +5664 -0
- package/dist/tokenizer/node.d.ts +1145 -0
- package/dist/tokenizer/node.mjs +5640 -0
- package/dist/tokenizer/node.mjs.map +1 -0
- package/dist/web/index.mjs +283 -252
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +151 -71
- package/package.json +30 -3
package/dist/web/index.mjs
CHANGED
|
@@ -672,18 +672,6 @@ var Type;
|
|
|
672
672
|
*/
|
|
673
673
|
Type["NULL"] = "NULL";
|
|
674
674
|
})(Type || (Type = {}));
|
|
675
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
676
|
-
var Mode;
|
|
677
|
-
(function (Mode) {
|
|
678
|
-
/**
|
|
679
|
-
* Always trigger retrieval.
|
|
680
|
-
*/
|
|
681
|
-
Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
682
|
-
/**
|
|
683
|
-
* Run retrieval only when system decides it is necessary.
|
|
684
|
-
*/
|
|
685
|
-
Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
686
|
-
})(Mode || (Mode = {}));
|
|
687
675
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
688
676
|
var ApiSpec;
|
|
689
677
|
(function (ApiSpec) {
|
|
@@ -786,6 +774,58 @@ var PhishBlockThreshold;
|
|
|
786
774
|
*/
|
|
787
775
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
788
776
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
777
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
778
|
+
var Behavior;
|
|
779
|
+
(function (Behavior) {
|
|
780
|
+
/**
|
|
781
|
+
* This value is unused.
|
|
782
|
+
*/
|
|
783
|
+
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
784
|
+
/**
|
|
785
|
+
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
786
|
+
*/
|
|
787
|
+
Behavior["BLOCKING"] = "BLOCKING";
|
|
788
|
+
/**
|
|
789
|
+
* 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.
|
|
790
|
+
*/
|
|
791
|
+
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
792
|
+
})(Behavior || (Behavior = {}));
|
|
793
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
794
|
+
var DynamicRetrievalConfigMode;
|
|
795
|
+
(function (DynamicRetrievalConfigMode) {
|
|
796
|
+
/**
|
|
797
|
+
* Always trigger retrieval.
|
|
798
|
+
*/
|
|
799
|
+
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
800
|
+
/**
|
|
801
|
+
* Run retrieval only when system decides it is necessary.
|
|
802
|
+
*/
|
|
803
|
+
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
804
|
+
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
805
|
+
/** Function calling mode. */
|
|
806
|
+
var FunctionCallingConfigMode;
|
|
807
|
+
(function (FunctionCallingConfigMode) {
|
|
808
|
+
/**
|
|
809
|
+
* Unspecified function calling mode. This value should not be used.
|
|
810
|
+
*/
|
|
811
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
812
|
+
/**
|
|
813
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
814
|
+
*/
|
|
815
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
816
|
+
/**
|
|
817
|
+
* 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".
|
|
818
|
+
*/
|
|
819
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
820
|
+
/**
|
|
821
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
822
|
+
*/
|
|
823
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
824
|
+
/**
|
|
825
|
+
* 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".
|
|
826
|
+
*/
|
|
827
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
828
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
789
829
|
/** The number of thoughts tokens that the model should generate. */
|
|
790
830
|
var ThinkingLevel;
|
|
791
831
|
(function (ThinkingLevel) {
|
|
@@ -1292,34 +1332,6 @@ var FeatureSelectionPreference;
|
|
|
1292
1332
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1293
1333
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1294
1334
|
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1295
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1296
|
-
var Behavior;
|
|
1297
|
-
(function (Behavior) {
|
|
1298
|
-
/**
|
|
1299
|
-
* This value is unused.
|
|
1300
|
-
*/
|
|
1301
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1302
|
-
/**
|
|
1303
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1304
|
-
*/
|
|
1305
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1306
|
-
/**
|
|
1307
|
-
* 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.
|
|
1308
|
-
*/
|
|
1309
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1310
|
-
})(Behavior || (Behavior = {}));
|
|
1311
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1312
|
-
var DynamicRetrievalConfigMode;
|
|
1313
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1314
|
-
/**
|
|
1315
|
-
* Always trigger retrieval.
|
|
1316
|
-
*/
|
|
1317
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1318
|
-
/**
|
|
1319
|
-
* Run retrieval only when system decides it is necessary.
|
|
1320
|
-
*/
|
|
1321
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1322
|
-
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
1323
1335
|
/** The environment being operated. */
|
|
1324
1336
|
var Environment;
|
|
1325
1337
|
(function (Environment) {
|
|
@@ -1332,30 +1344,6 @@ var Environment;
|
|
|
1332
1344
|
*/
|
|
1333
1345
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1334
1346
|
})(Environment || (Environment = {}));
|
|
1335
|
-
/** Config for the function calling config mode. */
|
|
1336
|
-
var FunctionCallingConfigMode;
|
|
1337
|
-
(function (FunctionCallingConfigMode) {
|
|
1338
|
-
/**
|
|
1339
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1340
|
-
*/
|
|
1341
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1342
|
-
/**
|
|
1343
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1344
|
-
*/
|
|
1345
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1346
|
-
/**
|
|
1347
|
-
* 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".
|
|
1348
|
-
*/
|
|
1349
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1350
|
-
/**
|
|
1351
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1352
|
-
*/
|
|
1353
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1354
|
-
/**
|
|
1355
|
-
* 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".
|
|
1356
|
-
*/
|
|
1357
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1358
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
1359
1347
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1360
1348
|
var SafetyFilterLevel;
|
|
1361
1349
|
(function (SafetyFilterLevel) {
|
|
@@ -1552,6 +1540,7 @@ var FileSource;
|
|
|
1552
1540
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1553
1541
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1554
1542
|
FileSource["GENERATED"] = "GENERATED";
|
|
1543
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1555
1544
|
})(FileSource || (FileSource = {}));
|
|
1556
1545
|
/** The reason why the turn is complete. */
|
|
1557
1546
|
var TurnCompleteReason;
|
|
@@ -1617,6 +1606,22 @@ var VadSignalType;
|
|
|
1617
1606
|
*/
|
|
1618
1607
|
VadSignalType["VAD_SIGNAL_TYPE_EOS"] = "VAD_SIGNAL_TYPE_EOS";
|
|
1619
1608
|
})(VadSignalType || (VadSignalType = {}));
|
|
1609
|
+
/** The type of the voice activity signal. */
|
|
1610
|
+
var VoiceActivityType;
|
|
1611
|
+
(function (VoiceActivityType) {
|
|
1612
|
+
/**
|
|
1613
|
+
* The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
|
|
1614
|
+
*/
|
|
1615
|
+
VoiceActivityType["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
|
|
1616
|
+
/**
|
|
1617
|
+
* Start of sentence signal.
|
|
1618
|
+
*/
|
|
1619
|
+
VoiceActivityType["ACTIVITY_START"] = "ACTIVITY_START";
|
|
1620
|
+
/**
|
|
1621
|
+
* End of sentence signal.
|
|
1622
|
+
*/
|
|
1623
|
+
VoiceActivityType["ACTIVITY_END"] = "ACTIVITY_END";
|
|
1624
|
+
})(VoiceActivityType || (VoiceActivityType = {}));
|
|
1620
1625
|
/** Start of speech sensitivity. */
|
|
1621
1626
|
var StartSensitivity;
|
|
1622
1627
|
(function (StartSensitivity) {
|
|
@@ -3981,16 +3986,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
3981
3986
|
}
|
|
3982
3987
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
3983
3988
|
const toObject = {};
|
|
3984
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3985
|
-
if (fromMode != null) {
|
|
3986
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
3987
|
-
}
|
|
3988
3989
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
3989
3990
|
'allowedFunctionNames',
|
|
3990
3991
|
]);
|
|
3991
3992
|
if (fromAllowedFunctionNames != null) {
|
|
3992
3993
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
3993
3994
|
}
|
|
3995
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3996
|
+
if (fromMode != null) {
|
|
3997
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
3998
|
+
}
|
|
3994
3999
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
3995
4000
|
undefined) {
|
|
3996
4001
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4250,6 +4255,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4250
4255
|
if (fromImageSize != null) {
|
|
4251
4256
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4252
4257
|
}
|
|
4258
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4259
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4260
|
+
}
|
|
4253
4261
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4254
4262
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4255
4263
|
}
|
|
@@ -4475,43 +4483,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4475
4483
|
}
|
|
4476
4484
|
function toolConfigToMldev$2(fromObject) {
|
|
4477
4485
|
const toObject = {};
|
|
4478
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4479
|
-
'functionCallingConfig',
|
|
4480
|
-
]);
|
|
4481
|
-
if (fromFunctionCallingConfig != null) {
|
|
4482
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4483
|
-
}
|
|
4484
4486
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4485
4487
|
'retrievalConfig',
|
|
4486
4488
|
]);
|
|
4487
4489
|
if (fromRetrievalConfig != null) {
|
|
4488
4490
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4489
4491
|
}
|
|
4492
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4493
|
+
'functionCallingConfig',
|
|
4494
|
+
]);
|
|
4495
|
+
if (fromFunctionCallingConfig != null) {
|
|
4496
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4497
|
+
}
|
|
4490
4498
|
return toObject;
|
|
4491
4499
|
}
|
|
4492
4500
|
function toolToMldev$4(fromObject) {
|
|
4493
4501
|
const toObject = {};
|
|
4494
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4495
|
-
'functionDeclarations',
|
|
4496
|
-
]);
|
|
4497
|
-
if (fromFunctionDeclarations != null) {
|
|
4498
|
-
let transformedList = fromFunctionDeclarations;
|
|
4499
|
-
if (Array.isArray(transformedList)) {
|
|
4500
|
-
transformedList = transformedList.map((item) => {
|
|
4501
|
-
return item;
|
|
4502
|
-
});
|
|
4503
|
-
}
|
|
4504
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4505
|
-
}
|
|
4506
4502
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4507
4503
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4508
4504
|
}
|
|
4509
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4510
|
-
'googleSearchRetrieval',
|
|
4511
|
-
]);
|
|
4512
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4513
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4514
|
-
}
|
|
4515
4505
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4516
4506
|
if (fromComputerUse != null) {
|
|
4517
4507
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4529,6 +4519,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4529
4519
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4530
4520
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4531
4521
|
}
|
|
4522
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4523
|
+
'functionDeclarations',
|
|
4524
|
+
]);
|
|
4525
|
+
if (fromFunctionDeclarations != null) {
|
|
4526
|
+
let transformedList = fromFunctionDeclarations;
|
|
4527
|
+
if (Array.isArray(transformedList)) {
|
|
4528
|
+
transformedList = transformedList.map((item) => {
|
|
4529
|
+
return item;
|
|
4530
|
+
});
|
|
4531
|
+
}
|
|
4532
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4533
|
+
}
|
|
4532
4534
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4533
4535
|
if (fromGoogleMaps != null) {
|
|
4534
4536
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4537,6 +4539,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4537
4539
|
if (fromGoogleSearch != null) {
|
|
4538
4540
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4539
4541
|
}
|
|
4542
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4543
|
+
'googleSearchRetrieval',
|
|
4544
|
+
]);
|
|
4545
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4546
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4547
|
+
}
|
|
4540
4548
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4541
4549
|
if (fromUrlContext != null) {
|
|
4542
4550
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5467,16 +5475,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5467
5475
|
}
|
|
5468
5476
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5469
5477
|
const toObject = {};
|
|
5470
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5471
|
-
if (fromMode != null) {
|
|
5472
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5473
|
-
}
|
|
5474
5478
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5475
5479
|
'allowedFunctionNames',
|
|
5476
5480
|
]);
|
|
5477
5481
|
if (fromAllowedFunctionNames != null) {
|
|
5478
5482
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5479
5483
|
}
|
|
5484
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5485
|
+
if (fromMode != null) {
|
|
5486
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5487
|
+
}
|
|
5480
5488
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5481
5489
|
undefined) {
|
|
5482
5490
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5485,9 +5493,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5485
5493
|
}
|
|
5486
5494
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5487
5495
|
const toObject = {};
|
|
5488
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5489
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5490
|
-
}
|
|
5491
5496
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5492
5497
|
if (fromDescription != null) {
|
|
5493
5498
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5516,6 +5521,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5516
5521
|
if (fromResponseJsonSchema != null) {
|
|
5517
5522
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5518
5523
|
}
|
|
5524
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5525
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5526
|
+
}
|
|
5519
5527
|
return toObject;
|
|
5520
5528
|
}
|
|
5521
5529
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5719,43 +5727,25 @@ function partToMldev$3(fromObject) {
|
|
|
5719
5727
|
}
|
|
5720
5728
|
function toolConfigToMldev$1(fromObject) {
|
|
5721
5729
|
const toObject = {};
|
|
5722
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5723
|
-
'functionCallingConfig',
|
|
5724
|
-
]);
|
|
5725
|
-
if (fromFunctionCallingConfig != null) {
|
|
5726
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5727
|
-
}
|
|
5728
5730
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5729
5731
|
'retrievalConfig',
|
|
5730
5732
|
]);
|
|
5731
5733
|
if (fromRetrievalConfig != null) {
|
|
5732
5734
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5733
5735
|
}
|
|
5736
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5737
|
+
'functionCallingConfig',
|
|
5738
|
+
]);
|
|
5739
|
+
if (fromFunctionCallingConfig != null) {
|
|
5740
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5741
|
+
}
|
|
5734
5742
|
return toObject;
|
|
5735
5743
|
}
|
|
5736
5744
|
function toolToMldev$3(fromObject) {
|
|
5737
5745
|
const toObject = {};
|
|
5738
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5739
|
-
'functionDeclarations',
|
|
5740
|
-
]);
|
|
5741
|
-
if (fromFunctionDeclarations != null) {
|
|
5742
|
-
let transformedList = fromFunctionDeclarations;
|
|
5743
|
-
if (Array.isArray(transformedList)) {
|
|
5744
|
-
transformedList = transformedList.map((item) => {
|
|
5745
|
-
return item;
|
|
5746
|
-
});
|
|
5747
|
-
}
|
|
5748
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5749
|
-
}
|
|
5750
5746
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5751
5747
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5752
5748
|
}
|
|
5753
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5754
|
-
'googleSearchRetrieval',
|
|
5755
|
-
]);
|
|
5756
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5757
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5758
|
-
}
|
|
5759
5749
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5760
5750
|
if (fromComputerUse != null) {
|
|
5761
5751
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5773,6 +5763,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5773
5763
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5774
5764
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5775
5765
|
}
|
|
5766
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5767
|
+
'functionDeclarations',
|
|
5768
|
+
]);
|
|
5769
|
+
if (fromFunctionDeclarations != null) {
|
|
5770
|
+
let transformedList = fromFunctionDeclarations;
|
|
5771
|
+
if (Array.isArray(transformedList)) {
|
|
5772
|
+
transformedList = transformedList.map((item) => {
|
|
5773
|
+
return item;
|
|
5774
|
+
});
|
|
5775
|
+
}
|
|
5776
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5777
|
+
}
|
|
5776
5778
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5777
5779
|
if (fromGoogleMaps != null) {
|
|
5778
5780
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5781,6 +5783,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5781
5783
|
if (fromGoogleSearch != null) {
|
|
5782
5784
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5783
5785
|
}
|
|
5786
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5787
|
+
'googleSearchRetrieval',
|
|
5788
|
+
]);
|
|
5789
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5790
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5791
|
+
}
|
|
5784
5792
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5785
5793
|
if (fromUrlContext != null) {
|
|
5786
5794
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5789,28 +5797,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5789
5797
|
}
|
|
5790
5798
|
function toolToVertex$2(fromObject) {
|
|
5791
5799
|
const toObject = {};
|
|
5792
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5793
|
-
'functionDeclarations',
|
|
5794
|
-
]);
|
|
5795
|
-
if (fromFunctionDeclarations != null) {
|
|
5796
|
-
let transformedList = fromFunctionDeclarations;
|
|
5797
|
-
if (Array.isArray(transformedList)) {
|
|
5798
|
-
transformedList = transformedList.map((item) => {
|
|
5799
|
-
return functionDeclarationToVertex$2(item);
|
|
5800
|
-
});
|
|
5801
|
-
}
|
|
5802
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5803
|
-
}
|
|
5804
5800
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5805
5801
|
if (fromRetrieval != null) {
|
|
5806
5802
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5807
5803
|
}
|
|
5808
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5809
|
-
'googleSearchRetrieval',
|
|
5810
|
-
]);
|
|
5811
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5812
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5813
|
-
}
|
|
5814
5804
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5815
5805
|
if (fromComputerUse != null) {
|
|
5816
5806
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5830,6 +5820,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5830
5820
|
if (fromEnterpriseWebSearch != null) {
|
|
5831
5821
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5832
5822
|
}
|
|
5823
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5824
|
+
'functionDeclarations',
|
|
5825
|
+
]);
|
|
5826
|
+
if (fromFunctionDeclarations != null) {
|
|
5827
|
+
let transformedList = fromFunctionDeclarations;
|
|
5828
|
+
if (Array.isArray(transformedList)) {
|
|
5829
|
+
transformedList = transformedList.map((item) => {
|
|
5830
|
+
return functionDeclarationToVertex$2(item);
|
|
5831
|
+
});
|
|
5832
|
+
}
|
|
5833
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5834
|
+
}
|
|
5833
5835
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5834
5836
|
if (fromGoogleMaps != null) {
|
|
5835
5837
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5838,6 +5840,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5838
5840
|
if (fromGoogleSearch != null) {
|
|
5839
5841
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5840
5842
|
}
|
|
5843
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5844
|
+
'googleSearchRetrieval',
|
|
5845
|
+
]);
|
|
5846
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5847
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5848
|
+
}
|
|
5841
5849
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5842
5850
|
if (fromUrlContext != null) {
|
|
5843
5851
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7129,9 +7137,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
7129
7137
|
}
|
|
7130
7138
|
function functionDeclarationToVertex$1(fromObject) {
|
|
7131
7139
|
const toObject = {};
|
|
7132
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7133
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7134
|
-
}
|
|
7135
7140
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7136
7141
|
if (fromDescription != null) {
|
|
7137
7142
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -7160,6 +7165,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
7160
7165
|
if (fromResponseJsonSchema != null) {
|
|
7161
7166
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7162
7167
|
}
|
|
7168
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7169
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7170
|
+
}
|
|
7163
7171
|
return toObject;
|
|
7164
7172
|
}
|
|
7165
7173
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -7726,6 +7734,12 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
7726
7734
|
if (fromVoiceActivityDetectionSignal != null) {
|
|
7727
7735
|
setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
|
|
7728
7736
|
}
|
|
7737
|
+
const fromVoiceActivity = getValueByPath(fromObject, [
|
|
7738
|
+
'voiceActivity',
|
|
7739
|
+
]);
|
|
7740
|
+
if (fromVoiceActivity != null) {
|
|
7741
|
+
setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
|
|
7742
|
+
}
|
|
7729
7743
|
return toObject;
|
|
7730
7744
|
}
|
|
7731
7745
|
function partToMldev$2(fromObject) {
|
|
@@ -7801,27 +7815,9 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7801
7815
|
}
|
|
7802
7816
|
function toolToMldev$2(fromObject) {
|
|
7803
7817
|
const toObject = {};
|
|
7804
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7805
|
-
'functionDeclarations',
|
|
7806
|
-
]);
|
|
7807
|
-
if (fromFunctionDeclarations != null) {
|
|
7808
|
-
let transformedList = fromFunctionDeclarations;
|
|
7809
|
-
if (Array.isArray(transformedList)) {
|
|
7810
|
-
transformedList = transformedList.map((item) => {
|
|
7811
|
-
return item;
|
|
7812
|
-
});
|
|
7813
|
-
}
|
|
7814
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7815
|
-
}
|
|
7816
7818
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
7817
7819
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
7818
7820
|
}
|
|
7819
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7820
|
-
'googleSearchRetrieval',
|
|
7821
|
-
]);
|
|
7822
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7823
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7824
|
-
}
|
|
7825
7821
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7826
7822
|
if (fromComputerUse != null) {
|
|
7827
7823
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7839,6 +7835,18 @@ function toolToMldev$2(fromObject) {
|
|
|
7839
7835
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
7840
7836
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
7841
7837
|
}
|
|
7838
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7839
|
+
'functionDeclarations',
|
|
7840
|
+
]);
|
|
7841
|
+
if (fromFunctionDeclarations != null) {
|
|
7842
|
+
let transformedList = fromFunctionDeclarations;
|
|
7843
|
+
if (Array.isArray(transformedList)) {
|
|
7844
|
+
transformedList = transformedList.map((item) => {
|
|
7845
|
+
return item;
|
|
7846
|
+
});
|
|
7847
|
+
}
|
|
7848
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7849
|
+
}
|
|
7842
7850
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7843
7851
|
if (fromGoogleMaps != null) {
|
|
7844
7852
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -7847,6 +7855,12 @@ function toolToMldev$2(fromObject) {
|
|
|
7847
7855
|
if (fromGoogleSearch != null) {
|
|
7848
7856
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7849
7857
|
}
|
|
7858
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7859
|
+
'googleSearchRetrieval',
|
|
7860
|
+
]);
|
|
7861
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7862
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7863
|
+
}
|
|
7850
7864
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7851
7865
|
if (fromUrlContext != null) {
|
|
7852
7866
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -7855,28 +7869,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7855
7869
|
}
|
|
7856
7870
|
function toolToVertex$1(fromObject) {
|
|
7857
7871
|
const toObject = {};
|
|
7858
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7859
|
-
'functionDeclarations',
|
|
7860
|
-
]);
|
|
7861
|
-
if (fromFunctionDeclarations != null) {
|
|
7862
|
-
let transformedList = fromFunctionDeclarations;
|
|
7863
|
-
if (Array.isArray(transformedList)) {
|
|
7864
|
-
transformedList = transformedList.map((item) => {
|
|
7865
|
-
return functionDeclarationToVertex$1(item);
|
|
7866
|
-
});
|
|
7867
|
-
}
|
|
7868
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7869
|
-
}
|
|
7870
7872
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7871
7873
|
if (fromRetrieval != null) {
|
|
7872
7874
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7873
7875
|
}
|
|
7874
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7875
|
-
'googleSearchRetrieval',
|
|
7876
|
-
]);
|
|
7877
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7878
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7879
|
-
}
|
|
7880
7876
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7881
7877
|
if (fromComputerUse != null) {
|
|
7882
7878
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -7896,6 +7892,18 @@ function toolToVertex$1(fromObject) {
|
|
|
7896
7892
|
if (fromEnterpriseWebSearch != null) {
|
|
7897
7893
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
7898
7894
|
}
|
|
7895
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7896
|
+
'functionDeclarations',
|
|
7897
|
+
]);
|
|
7898
|
+
if (fromFunctionDeclarations != null) {
|
|
7899
|
+
let transformedList = fromFunctionDeclarations;
|
|
7900
|
+
if (Array.isArray(transformedList)) {
|
|
7901
|
+
transformedList = transformedList.map((item) => {
|
|
7902
|
+
return functionDeclarationToVertex$1(item);
|
|
7903
|
+
});
|
|
7904
|
+
}
|
|
7905
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7906
|
+
}
|
|
7899
7907
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7900
7908
|
if (fromGoogleMaps != null) {
|
|
7901
7909
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -7904,6 +7912,12 @@ function toolToVertex$1(fromObject) {
|
|
|
7904
7912
|
if (fromGoogleSearch != null) {
|
|
7905
7913
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
7906
7914
|
}
|
|
7915
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7916
|
+
'googleSearchRetrieval',
|
|
7917
|
+
]);
|
|
7918
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7919
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
7920
|
+
}
|
|
7907
7921
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7908
7922
|
if (fromUrlContext != null) {
|
|
7909
7923
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -8002,6 +8016,14 @@ function usageMetadataFromVertex(fromObject) {
|
|
|
8002
8016
|
}
|
|
8003
8017
|
return toObject;
|
|
8004
8018
|
}
|
|
8019
|
+
function voiceActivityFromVertex(fromObject) {
|
|
8020
|
+
const toObject = {};
|
|
8021
|
+
const fromVoiceActivityType = getValueByPath(fromObject, ['type']);
|
|
8022
|
+
if (fromVoiceActivityType != null) {
|
|
8023
|
+
setValueByPath(toObject, ['voiceActivityType'], fromVoiceActivityType);
|
|
8024
|
+
}
|
|
8025
|
+
return toObject;
|
|
8026
|
+
}
|
|
8005
8027
|
|
|
8006
8028
|
/**
|
|
8007
8029
|
* @license
|
|
@@ -8686,16 +8708,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
8686
8708
|
}
|
|
8687
8709
|
function functionCallingConfigToMldev(fromObject) {
|
|
8688
8710
|
const toObject = {};
|
|
8689
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8690
|
-
if (fromMode != null) {
|
|
8691
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
8692
|
-
}
|
|
8693
8711
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
8694
8712
|
'allowedFunctionNames',
|
|
8695
8713
|
]);
|
|
8696
8714
|
if (fromAllowedFunctionNames != null) {
|
|
8697
8715
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
8698
8716
|
}
|
|
8717
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
8718
|
+
if (fromMode != null) {
|
|
8719
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
8720
|
+
}
|
|
8699
8721
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
8700
8722
|
undefined) {
|
|
8701
8723
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -8704,9 +8726,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
8704
8726
|
}
|
|
8705
8727
|
function functionDeclarationToVertex(fromObject) {
|
|
8706
8728
|
const toObject = {};
|
|
8707
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8708
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8709
|
-
}
|
|
8710
8729
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
8711
8730
|
if (fromDescription != null) {
|
|
8712
8731
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -8735,6 +8754,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
8735
8754
|
if (fromResponseJsonSchema != null) {
|
|
8736
8755
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
8737
8756
|
}
|
|
8757
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
8758
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8759
|
+
}
|
|
8738
8760
|
return toObject;
|
|
8739
8761
|
}
|
|
8740
8762
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -10072,6 +10094,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
10072
10094
|
if (fromImageSize != null) {
|
|
10073
10095
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10074
10096
|
}
|
|
10097
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10098
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10099
|
+
}
|
|
10075
10100
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10076
10101
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10077
10102
|
}
|
|
@@ -10091,6 +10116,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
10091
10116
|
if (fromImageSize != null) {
|
|
10092
10117
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
10093
10118
|
}
|
|
10119
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
10120
|
+
'personGeneration',
|
|
10121
|
+
]);
|
|
10122
|
+
if (fromPersonGeneration != null) {
|
|
10123
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10124
|
+
}
|
|
10094
10125
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10095
10126
|
'outputMimeType',
|
|
10096
10127
|
]);
|
|
@@ -10791,43 +10822,25 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
10791
10822
|
}
|
|
10792
10823
|
function toolConfigToMldev(fromObject) {
|
|
10793
10824
|
const toObject = {};
|
|
10794
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10795
|
-
'functionCallingConfig',
|
|
10796
|
-
]);
|
|
10797
|
-
if (fromFunctionCallingConfig != null) {
|
|
10798
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10799
|
-
}
|
|
10800
10825
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
10801
10826
|
'retrievalConfig',
|
|
10802
10827
|
]);
|
|
10803
10828
|
if (fromRetrievalConfig != null) {
|
|
10804
10829
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
10805
10830
|
}
|
|
10831
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
10832
|
+
'functionCallingConfig',
|
|
10833
|
+
]);
|
|
10834
|
+
if (fromFunctionCallingConfig != null) {
|
|
10835
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
10836
|
+
}
|
|
10806
10837
|
return toObject;
|
|
10807
10838
|
}
|
|
10808
10839
|
function toolToMldev$1(fromObject) {
|
|
10809
10840
|
const toObject = {};
|
|
10810
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10811
|
-
'functionDeclarations',
|
|
10812
|
-
]);
|
|
10813
|
-
if (fromFunctionDeclarations != null) {
|
|
10814
|
-
let transformedList = fromFunctionDeclarations;
|
|
10815
|
-
if (Array.isArray(transformedList)) {
|
|
10816
|
-
transformedList = transformedList.map((item) => {
|
|
10817
|
-
return item;
|
|
10818
|
-
});
|
|
10819
|
-
}
|
|
10820
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10821
|
-
}
|
|
10822
10841
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
10823
10842
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
10824
10843
|
}
|
|
10825
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10826
|
-
'googleSearchRetrieval',
|
|
10827
|
-
]);
|
|
10828
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10829
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10830
|
-
}
|
|
10831
10844
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10832
10845
|
if (fromComputerUse != null) {
|
|
10833
10846
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10845,6 +10858,18 @@ function toolToMldev$1(fromObject) {
|
|
|
10845
10858
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
10846
10859
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
10847
10860
|
}
|
|
10861
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10862
|
+
'functionDeclarations',
|
|
10863
|
+
]);
|
|
10864
|
+
if (fromFunctionDeclarations != null) {
|
|
10865
|
+
let transformedList = fromFunctionDeclarations;
|
|
10866
|
+
if (Array.isArray(transformedList)) {
|
|
10867
|
+
transformedList = transformedList.map((item) => {
|
|
10868
|
+
return item;
|
|
10869
|
+
});
|
|
10870
|
+
}
|
|
10871
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10872
|
+
}
|
|
10848
10873
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10849
10874
|
if (fromGoogleMaps != null) {
|
|
10850
10875
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -10853,6 +10878,12 @@ function toolToMldev$1(fromObject) {
|
|
|
10853
10878
|
if (fromGoogleSearch != null) {
|
|
10854
10879
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
10855
10880
|
}
|
|
10881
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10882
|
+
'googleSearchRetrieval',
|
|
10883
|
+
]);
|
|
10884
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10885
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10886
|
+
}
|
|
10856
10887
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10857
10888
|
if (fromUrlContext != null) {
|
|
10858
10889
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -10861,28 +10892,10 @@ function toolToMldev$1(fromObject) {
|
|
|
10861
10892
|
}
|
|
10862
10893
|
function toolToVertex(fromObject) {
|
|
10863
10894
|
const toObject = {};
|
|
10864
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10865
|
-
'functionDeclarations',
|
|
10866
|
-
]);
|
|
10867
|
-
if (fromFunctionDeclarations != null) {
|
|
10868
|
-
let transformedList = fromFunctionDeclarations;
|
|
10869
|
-
if (Array.isArray(transformedList)) {
|
|
10870
|
-
transformedList = transformedList.map((item) => {
|
|
10871
|
-
return functionDeclarationToVertex(item);
|
|
10872
|
-
});
|
|
10873
|
-
}
|
|
10874
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10875
|
-
}
|
|
10876
10895
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
10877
10896
|
if (fromRetrieval != null) {
|
|
10878
10897
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
10879
10898
|
}
|
|
10880
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10881
|
-
'googleSearchRetrieval',
|
|
10882
|
-
]);
|
|
10883
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
10884
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10885
|
-
}
|
|
10886
10899
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
10887
10900
|
if (fromComputerUse != null) {
|
|
10888
10901
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -10902,6 +10915,18 @@ function toolToVertex(fromObject) {
|
|
|
10902
10915
|
if (fromEnterpriseWebSearch != null) {
|
|
10903
10916
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
10904
10917
|
}
|
|
10918
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
10919
|
+
'functionDeclarations',
|
|
10920
|
+
]);
|
|
10921
|
+
if (fromFunctionDeclarations != null) {
|
|
10922
|
+
let transformedList = fromFunctionDeclarations;
|
|
10923
|
+
if (Array.isArray(transformedList)) {
|
|
10924
|
+
transformedList = transformedList.map((item) => {
|
|
10925
|
+
return functionDeclarationToVertex(item);
|
|
10926
|
+
});
|
|
10927
|
+
}
|
|
10928
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
10929
|
+
}
|
|
10905
10930
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
10906
10931
|
if (fromGoogleMaps != null) {
|
|
10907
10932
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -10910,6 +10935,12 @@ function toolToVertex(fromObject) {
|
|
|
10910
10935
|
if (fromGoogleSearch != null) {
|
|
10911
10936
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
10912
10937
|
}
|
|
10938
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
10939
|
+
'googleSearchRetrieval',
|
|
10940
|
+
]);
|
|
10941
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
10942
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
10943
|
+
}
|
|
10913
10944
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
10914
10945
|
if (fromUrlContext != null) {
|
|
10915
10946
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11470,7 +11501,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11470
11501
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11471
11502
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11472
11503
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11473
|
-
const SDK_VERSION = '1.
|
|
11504
|
+
const SDK_VERSION = '1.36.0'; // x-release-please-version
|
|
11474
11505
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11475
11506
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11476
11507
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13184,7 +13215,7 @@ class Models extends BaseModule {
|
|
|
13184
13215
|
* @example
|
|
13185
13216
|
* ```ts
|
|
13186
13217
|
* const response = await client.models.generateImages({
|
|
13187
|
-
* model: 'imagen-
|
|
13218
|
+
* model: 'imagen-4.0-generate-001',
|
|
13188
13219
|
* prompt: 'Robot holding a red skateboard',
|
|
13189
13220
|
* config: {
|
|
13190
13221
|
* numberOfImages: 1,
|
|
@@ -13293,7 +13324,7 @@ class Models extends BaseModule {
|
|
|
13293
13324
|
* @example
|
|
13294
13325
|
* ```ts
|
|
13295
13326
|
* const response = await client.models.upscaleImage({
|
|
13296
|
-
* model: 'imagen-
|
|
13327
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
13297
13328
|
* image: image,
|
|
13298
13329
|
* upscaleFactor: 'x2',
|
|
13299
13330
|
* config: {
|
|
@@ -13955,7 +13986,7 @@ class Models extends BaseModule {
|
|
|
13955
13986
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
13956
13987
|
*
|
|
13957
13988
|
* const response2 = await ai.models.recontextImage({
|
|
13958
|
-
* model: 'virtual-try-on-
|
|
13989
|
+
* model: 'virtual-try-on-001',
|
|
13959
13990
|
* source: {
|
|
13960
13991
|
* personImage: personImage,
|
|
13961
13992
|
* productImages: [productImage],
|
|
@@ -15037,27 +15068,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
15037
15068
|
}
|
|
15038
15069
|
function toolToMldev(fromObject) {
|
|
15039
15070
|
const toObject = {};
|
|
15040
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15041
|
-
'functionDeclarations',
|
|
15042
|
-
]);
|
|
15043
|
-
if (fromFunctionDeclarations != null) {
|
|
15044
|
-
let transformedList = fromFunctionDeclarations;
|
|
15045
|
-
if (Array.isArray(transformedList)) {
|
|
15046
|
-
transformedList = transformedList.map((item) => {
|
|
15047
|
-
return item;
|
|
15048
|
-
});
|
|
15049
|
-
}
|
|
15050
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15051
|
-
}
|
|
15052
15071
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
15053
15072
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
15054
15073
|
}
|
|
15055
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15056
|
-
'googleSearchRetrieval',
|
|
15057
|
-
]);
|
|
15058
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
15059
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15060
|
-
}
|
|
15061
15074
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
15062
15075
|
if (fromComputerUse != null) {
|
|
15063
15076
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -15075,6 +15088,18 @@ function toolToMldev(fromObject) {
|
|
|
15075
15088
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
15076
15089
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
15077
15090
|
}
|
|
15091
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15092
|
+
'functionDeclarations',
|
|
15093
|
+
]);
|
|
15094
|
+
if (fromFunctionDeclarations != null) {
|
|
15095
|
+
let transformedList = fromFunctionDeclarations;
|
|
15096
|
+
if (Array.isArray(transformedList)) {
|
|
15097
|
+
transformedList = transformedList.map((item) => {
|
|
15098
|
+
return item;
|
|
15099
|
+
});
|
|
15100
|
+
}
|
|
15101
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
15102
|
+
}
|
|
15078
15103
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
15079
15104
|
if (fromGoogleMaps != null) {
|
|
15080
15105
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -15083,6 +15108,12 @@ function toolToMldev(fromObject) {
|
|
|
15083
15108
|
if (fromGoogleSearch != null) {
|
|
15084
15109
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15085
15110
|
}
|
|
15111
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15112
|
+
'googleSearchRetrieval',
|
|
15113
|
+
]);
|
|
15114
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
15115
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15116
|
+
}
|
|
15086
15117
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15087
15118
|
if (fromUrlContext != null) {
|
|
15088
15119
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -19212,5 +19243,5 @@ class GoogleGenAI {
|
|
|
19212
19243
|
}
|
|
19213
19244
|
}
|
|
19214
19245
|
|
|
19215
|
-
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,
|
|
19246
|
+
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, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19216
19247
|
//# sourceMappingURL=index.mjs.map
|