@google/genai 1.33.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/README.md +233 -1
- package/dist/genai.d.ts +117 -201
- package/dist/index.cjs +304 -293
- package/dist/index.mjs +305 -294
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +304 -296
- package/dist/node/index.mjs +305 -297
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +117 -201
- package/dist/web/index.mjs +305 -297
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +117 -201
- 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,21 +744,81 @@ var PhishBlockThreshold;
|
|
|
756
744
|
*/
|
|
757
745
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
758
746
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
759
|
-
/**
|
|
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 = {}));
|
|
799
|
+
/** The number of thoughts tokens that the model should generate. */
|
|
760
800
|
var ThinkingLevel;
|
|
761
801
|
(function (ThinkingLevel) {
|
|
762
802
|
/**
|
|
763
|
-
*
|
|
803
|
+
* Unspecified thinking level.
|
|
764
804
|
*/
|
|
765
805
|
ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
|
|
766
806
|
/**
|
|
767
807
|
* Low thinking level.
|
|
768
808
|
*/
|
|
769
809
|
ThinkingLevel["LOW"] = "LOW";
|
|
810
|
+
/**
|
|
811
|
+
* Medium thinking level.
|
|
812
|
+
*/
|
|
813
|
+
ThinkingLevel["MEDIUM"] = "MEDIUM";
|
|
770
814
|
/**
|
|
771
815
|
* High thinking level.
|
|
772
816
|
*/
|
|
773
817
|
ThinkingLevel["HIGH"] = "HIGH";
|
|
818
|
+
/**
|
|
819
|
+
* MINIMAL thinking level.
|
|
820
|
+
*/
|
|
821
|
+
ThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
774
822
|
})(ThinkingLevel || (ThinkingLevel = {}));
|
|
775
823
|
/** Harm category. */
|
|
776
824
|
var HarmCategory;
|
|
@@ -1241,6 +1289,10 @@ var PartMediaResolutionLevel;
|
|
|
1241
1289
|
* Media resolution set to high.
|
|
1242
1290
|
*/
|
|
1243
1291
|
PartMediaResolutionLevel["MEDIA_RESOLUTION_HIGH"] = "MEDIA_RESOLUTION_HIGH";
|
|
1292
|
+
/**
|
|
1293
|
+
* Media resolution set to ultra high.
|
|
1294
|
+
*/
|
|
1295
|
+
PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
|
|
1244
1296
|
})(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
|
|
1245
1297
|
/** Options for feature selection preference. */
|
|
1246
1298
|
var FeatureSelectionPreference;
|
|
@@ -1250,34 +1302,6 @@ var FeatureSelectionPreference;
|
|
|
1250
1302
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1251
1303
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1252
1304
|
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1253
|
-
/** Defines the function behavior. Defaults to `BLOCKING`. */
|
|
1254
|
-
var Behavior;
|
|
1255
|
-
(function (Behavior) {
|
|
1256
|
-
/**
|
|
1257
|
-
* This value is unused.
|
|
1258
|
-
*/
|
|
1259
|
-
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1260
|
-
/**
|
|
1261
|
-
* If set, the system will wait to receive the function response before continuing the conversation.
|
|
1262
|
-
*/
|
|
1263
|
-
Behavior["BLOCKING"] = "BLOCKING";
|
|
1264
|
-
/**
|
|
1265
|
-
* 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.
|
|
1266
|
-
*/
|
|
1267
|
-
Behavior["NON_BLOCKING"] = "NON_BLOCKING";
|
|
1268
|
-
})(Behavior || (Behavior = {}));
|
|
1269
|
-
/** Config for the dynamic retrieval config mode. */
|
|
1270
|
-
var DynamicRetrievalConfigMode;
|
|
1271
|
-
(function (DynamicRetrievalConfigMode) {
|
|
1272
|
-
/**
|
|
1273
|
-
* Always trigger retrieval.
|
|
1274
|
-
*/
|
|
1275
|
-
DynamicRetrievalConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1276
|
-
/**
|
|
1277
|
-
* Run retrieval only when system decides it is necessary.
|
|
1278
|
-
*/
|
|
1279
|
-
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
1280
|
-
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
1281
1305
|
/** The environment being operated. */
|
|
1282
1306
|
var Environment;
|
|
1283
1307
|
(function (Environment) {
|
|
@@ -1290,30 +1314,6 @@ var Environment;
|
|
|
1290
1314
|
*/
|
|
1291
1315
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1292
1316
|
})(Environment || (Environment = {}));
|
|
1293
|
-
/** Config for the function calling config mode. */
|
|
1294
|
-
var FunctionCallingConfigMode;
|
|
1295
|
-
(function (FunctionCallingConfigMode) {
|
|
1296
|
-
/**
|
|
1297
|
-
* The function calling config mode is unspecified. Should not be used.
|
|
1298
|
-
*/
|
|
1299
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
1300
|
-
/**
|
|
1301
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
1302
|
-
*/
|
|
1303
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
1304
|
-
/**
|
|
1305
|
-
* 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".
|
|
1306
|
-
*/
|
|
1307
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
1308
|
-
/**
|
|
1309
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
1310
|
-
*/
|
|
1311
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
1312
|
-
/**
|
|
1313
|
-
* 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".
|
|
1314
|
-
*/
|
|
1315
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
1316
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
1317
1317
|
/** Enum that controls the safety filter level for objectionable content. */
|
|
1318
1318
|
var SafetyFilterLevel;
|
|
1319
1319
|
(function (SafetyFilterLevel) {
|
|
@@ -1510,6 +1510,7 @@ var FileSource;
|
|
|
1510
1510
|
FileSource["SOURCE_UNSPECIFIED"] = "SOURCE_UNSPECIFIED";
|
|
1511
1511
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1512
1512
|
FileSource["GENERATED"] = "GENERATED";
|
|
1513
|
+
FileSource["REGISTERED"] = "REGISTERED";
|
|
1513
1514
|
})(FileSource || (FileSource = {}));
|
|
1514
1515
|
/** The reason why the turn is complete. */
|
|
1515
1516
|
var TurnCompleteReason;
|
|
@@ -3939,16 +3940,16 @@ function functionCallToMldev$4(fromObject) {
|
|
|
3939
3940
|
}
|
|
3940
3941
|
function functionCallingConfigToMldev$2(fromObject) {
|
|
3941
3942
|
const toObject = {};
|
|
3942
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3943
|
-
if (fromMode != null) {
|
|
3944
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
3945
|
-
}
|
|
3946
3943
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
3947
3944
|
'allowedFunctionNames',
|
|
3948
3945
|
]);
|
|
3949
3946
|
if (fromAllowedFunctionNames != null) {
|
|
3950
3947
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
3951
3948
|
}
|
|
3949
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
3950
|
+
if (fromMode != null) {
|
|
3951
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
3952
|
+
}
|
|
3952
3953
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
3953
3954
|
undefined) {
|
|
3954
3955
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -4208,6 +4209,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4208
4209
|
if (fromImageSize != null) {
|
|
4209
4210
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4210
4211
|
}
|
|
4212
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4213
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4214
|
+
}
|
|
4211
4215
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4212
4216
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4213
4217
|
}
|
|
@@ -4433,43 +4437,25 @@ function safetySettingToMldev$1(fromObject) {
|
|
|
4433
4437
|
}
|
|
4434
4438
|
function toolConfigToMldev$2(fromObject) {
|
|
4435
4439
|
const toObject = {};
|
|
4436
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4437
|
-
'functionCallingConfig',
|
|
4438
|
-
]);
|
|
4439
|
-
if (fromFunctionCallingConfig != null) {
|
|
4440
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4441
|
-
}
|
|
4442
4440
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
4443
4441
|
'retrievalConfig',
|
|
4444
4442
|
]);
|
|
4445
4443
|
if (fromRetrievalConfig != null) {
|
|
4446
4444
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
4447
4445
|
}
|
|
4446
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
4447
|
+
'functionCallingConfig',
|
|
4448
|
+
]);
|
|
4449
|
+
if (fromFunctionCallingConfig != null) {
|
|
4450
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
|
|
4451
|
+
}
|
|
4448
4452
|
return toObject;
|
|
4449
4453
|
}
|
|
4450
4454
|
function toolToMldev$4(fromObject) {
|
|
4451
4455
|
const toObject = {};
|
|
4452
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
4453
|
-
'functionDeclarations',
|
|
4454
|
-
]);
|
|
4455
|
-
if (fromFunctionDeclarations != null) {
|
|
4456
|
-
let transformedList = fromFunctionDeclarations;
|
|
4457
|
-
if (Array.isArray(transformedList)) {
|
|
4458
|
-
transformedList = transformedList.map((item) => {
|
|
4459
|
-
return item;
|
|
4460
|
-
});
|
|
4461
|
-
}
|
|
4462
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
4463
|
-
}
|
|
4464
4456
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4465
4457
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
4466
4458
|
}
|
|
4467
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4468
|
-
'googleSearchRetrieval',
|
|
4469
|
-
]);
|
|
4470
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
4471
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4472
|
-
}
|
|
4473
4459
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4474
4460
|
if (fromComputerUse != null) {
|
|
4475
4461
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -4487,6 +4473,18 @@ function toolToMldev$4(fromObject) {
|
|
|
4487
4473
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
4488
4474
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
4489
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
|
+
}
|
|
4490
4488
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
4491
4489
|
if (fromGoogleMaps != null) {
|
|
4492
4490
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
@@ -4495,6 +4493,12 @@ function toolToMldev$4(fromObject) {
|
|
|
4495
4493
|
if (fromGoogleSearch != null) {
|
|
4496
4494
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4497
4495
|
}
|
|
4496
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4497
|
+
'googleSearchRetrieval',
|
|
4498
|
+
]);
|
|
4499
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
4500
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
4501
|
+
}
|
|
4498
4502
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
4499
4503
|
if (fromUrlContext != null) {
|
|
4500
4504
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5425,16 +5429,16 @@ function functionCallToMldev$3(fromObject) {
|
|
|
5425
5429
|
}
|
|
5426
5430
|
function functionCallingConfigToMldev$1(fromObject) {
|
|
5427
5431
|
const toObject = {};
|
|
5428
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5429
|
-
if (fromMode != null) {
|
|
5430
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
5431
|
-
}
|
|
5432
5432
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
5433
5433
|
'allowedFunctionNames',
|
|
5434
5434
|
]);
|
|
5435
5435
|
if (fromAllowedFunctionNames != null) {
|
|
5436
5436
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
5437
5437
|
}
|
|
5438
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
5439
|
+
if (fromMode != null) {
|
|
5440
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
5441
|
+
}
|
|
5438
5442
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
5439
5443
|
undefined) {
|
|
5440
5444
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -5443,9 +5447,6 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
5443
5447
|
}
|
|
5444
5448
|
function functionDeclarationToVertex$2(fromObject) {
|
|
5445
5449
|
const toObject = {};
|
|
5446
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5447
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5448
|
-
}
|
|
5449
5450
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
5450
5451
|
if (fromDescription != null) {
|
|
5451
5452
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -5474,6 +5475,9 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
5474
5475
|
if (fromResponseJsonSchema != null) {
|
|
5475
5476
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
5476
5477
|
}
|
|
5478
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
5479
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
5480
|
+
}
|
|
5477
5481
|
return toObject;
|
|
5478
5482
|
}
|
|
5479
5483
|
function getCachedContentParametersToMldev(apiClient, fromObject) {
|
|
@@ -5677,43 +5681,25 @@ function partToMldev$3(fromObject) {
|
|
|
5677
5681
|
}
|
|
5678
5682
|
function toolConfigToMldev$1(fromObject) {
|
|
5679
5683
|
const toObject = {};
|
|
5680
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5681
|
-
'functionCallingConfig',
|
|
5682
|
-
]);
|
|
5683
|
-
if (fromFunctionCallingConfig != null) {
|
|
5684
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5685
|
-
}
|
|
5686
5684
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
5687
5685
|
'retrievalConfig',
|
|
5688
5686
|
]);
|
|
5689
5687
|
if (fromRetrievalConfig != null) {
|
|
5690
5688
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
5691
5689
|
}
|
|
5690
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
5691
|
+
'functionCallingConfig',
|
|
5692
|
+
]);
|
|
5693
|
+
if (fromFunctionCallingConfig != null) {
|
|
5694
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
|
|
5695
|
+
}
|
|
5692
5696
|
return toObject;
|
|
5693
5697
|
}
|
|
5694
5698
|
function toolToMldev$3(fromObject) {
|
|
5695
5699
|
const toObject = {};
|
|
5696
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5697
|
-
'functionDeclarations',
|
|
5698
|
-
]);
|
|
5699
|
-
if (fromFunctionDeclarations != null) {
|
|
5700
|
-
let transformedList = fromFunctionDeclarations;
|
|
5701
|
-
if (Array.isArray(transformedList)) {
|
|
5702
|
-
transformedList = transformedList.map((item) => {
|
|
5703
|
-
return item;
|
|
5704
|
-
});
|
|
5705
|
-
}
|
|
5706
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5707
|
-
}
|
|
5708
5700
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
5709
5701
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
5710
5702
|
}
|
|
5711
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5712
|
-
'googleSearchRetrieval',
|
|
5713
|
-
]);
|
|
5714
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5715
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5716
|
-
}
|
|
5717
5703
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5718
5704
|
if (fromComputerUse != null) {
|
|
5719
5705
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5731,6 +5717,18 @@ function toolToMldev$3(fromObject) {
|
|
|
5731
5717
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5732
5718
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
5733
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
|
+
}
|
|
5734
5732
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5735
5733
|
if (fromGoogleMaps != null) {
|
|
5736
5734
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
@@ -5739,6 +5737,12 @@ function toolToMldev$3(fromObject) {
|
|
|
5739
5737
|
if (fromGoogleSearch != null) {
|
|
5740
5738
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5741
5739
|
}
|
|
5740
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5741
|
+
'googleSearchRetrieval',
|
|
5742
|
+
]);
|
|
5743
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5744
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5745
|
+
}
|
|
5742
5746
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5743
5747
|
if (fromUrlContext != null) {
|
|
5744
5748
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -5747,28 +5751,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5747
5751
|
}
|
|
5748
5752
|
function toolToVertex$2(fromObject) {
|
|
5749
5753
|
const toObject = {};
|
|
5750
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5751
|
-
'functionDeclarations',
|
|
5752
|
-
]);
|
|
5753
|
-
if (fromFunctionDeclarations != null) {
|
|
5754
|
-
let transformedList = fromFunctionDeclarations;
|
|
5755
|
-
if (Array.isArray(transformedList)) {
|
|
5756
|
-
transformedList = transformedList.map((item) => {
|
|
5757
|
-
return functionDeclarationToVertex$2(item);
|
|
5758
|
-
});
|
|
5759
|
-
}
|
|
5760
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
5761
|
-
}
|
|
5762
5754
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
5763
5755
|
if (fromRetrieval != null) {
|
|
5764
5756
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
5765
5757
|
}
|
|
5766
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5767
|
-
'googleSearchRetrieval',
|
|
5768
|
-
]);
|
|
5769
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
5770
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5771
|
-
}
|
|
5772
5758
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
5773
5759
|
if (fromComputerUse != null) {
|
|
5774
5760
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -5788,6 +5774,18 @@ function toolToVertex$2(fromObject) {
|
|
|
5788
5774
|
if (fromEnterpriseWebSearch != null) {
|
|
5789
5775
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
5790
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
|
+
}
|
|
5791
5789
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
5792
5790
|
if (fromGoogleMaps != null) {
|
|
5793
5791
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -5796,6 +5794,12 @@ function toolToVertex$2(fromObject) {
|
|
|
5796
5794
|
if (fromGoogleSearch != null) {
|
|
5797
5795
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5798
5796
|
}
|
|
5797
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5798
|
+
'googleSearchRetrieval',
|
|
5799
|
+
]);
|
|
5800
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
5801
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5802
|
+
}
|
|
5799
5803
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5800
5804
|
if (fromUrlContext != null) {
|
|
5801
5805
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -6883,7 +6887,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6883
6887
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6884
6888
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6885
6889
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6886
|
-
const SDK_VERSION = '1.
|
|
6890
|
+
const SDK_VERSION = '1.35.0'; // x-release-please-version
|
|
6887
6891
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6888
6892
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6889
6893
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -6957,6 +6961,11 @@ class ApiClient {
|
|
|
6957
6961
|
getLocation() {
|
|
6958
6962
|
return this.clientOptions.location;
|
|
6959
6963
|
}
|
|
6964
|
+
async getAuthHeaders() {
|
|
6965
|
+
const headers = new Headers();
|
|
6966
|
+
await this.clientOptions.auth.addAuthHeaders(headers);
|
|
6967
|
+
return headers;
|
|
6968
|
+
}
|
|
6960
6969
|
getApiVersion() {
|
|
6961
6970
|
if (this.clientOptions.httpOptions &&
|
|
6962
6971
|
this.clientOptions.httpOptions.apiVersion !== undefined) {
|
|
@@ -10083,7 +10092,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10083
10092
|
*/
|
|
10084
10093
|
constructor(_b) {
|
|
10085
10094
|
var _c, _d, _e, _f, _g, _h, _j;
|
|
10086
|
-
var
|
|
10095
|
+
var { baseURL = readEnv('GEMINI_NEXT_GEN_API_BASE_URL'), apiKey = (_c = readEnv('GEMINI_API_KEY')) !== null && _c !== void 0 ? _c : null, apiVersion = 'v1beta' } = _b, opts = __rest(_b, ["baseURL", "apiKey", "apiVersion"]);
|
|
10087
10096
|
const options = Object.assign(Object.assign({ apiKey,
|
|
10088
10097
|
apiVersion }, opts), { baseURL: baseURL || `https://generativelanguage.googleapis.com` });
|
|
10089
10098
|
this.baseURL = options.baseURL;
|
|
@@ -10101,6 +10110,7 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10101
10110
|
this._options = options;
|
|
10102
10111
|
this.apiKey = apiKey;
|
|
10103
10112
|
this.apiVersion = apiVersion;
|
|
10113
|
+
this.clientAdapter = options.clientAdapter;
|
|
10104
10114
|
}
|
|
10105
10115
|
/**
|
|
10106
10116
|
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
|
@@ -10119,6 +10129,10 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10119
10129
|
return this._options.defaultQuery;
|
|
10120
10130
|
}
|
|
10121
10131
|
validateHeaders({ values, nulls }) {
|
|
10132
|
+
// The headers object handles case insensitivity.
|
|
10133
|
+
if (values.has('authorization') || values.has('x-goog-api-key')) {
|
|
10134
|
+
return;
|
|
10135
|
+
}
|
|
10122
10136
|
if (this.apiKey && values.get('x-goog-api-key')) {
|
|
10123
10137
|
return;
|
|
10124
10138
|
}
|
|
@@ -10128,10 +10142,17 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10128
10142
|
throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted');
|
|
10129
10143
|
}
|
|
10130
10144
|
async authHeaders(opts) {
|
|
10131
|
-
|
|
10145
|
+
const existingHeaders = buildHeaders([opts.headers]);
|
|
10146
|
+
if (existingHeaders.values.has('authorization') || existingHeaders.values.has('x-goog-api-key')) {
|
|
10132
10147
|
return undefined;
|
|
10133
10148
|
}
|
|
10134
|
-
|
|
10149
|
+
if (this.apiKey) {
|
|
10150
|
+
return buildHeaders([{ 'x-goog-api-key': this.apiKey }]);
|
|
10151
|
+
}
|
|
10152
|
+
if (this.clientAdapter.isVertexAI()) {
|
|
10153
|
+
return buildHeaders([await this.clientAdapter.getAuthHeaders()]);
|
|
10154
|
+
}
|
|
10155
|
+
return undefined;
|
|
10135
10156
|
}
|
|
10136
10157
|
/**
|
|
10137
10158
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
@@ -10175,8 +10196,16 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10175
10196
|
}
|
|
10176
10197
|
/**
|
|
10177
10198
|
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
|
10199
|
+
|
|
10178
10200
|
*/
|
|
10179
|
-
async prepareOptions(options) {
|
|
10201
|
+
async prepareOptions(options) {
|
|
10202
|
+
if (this.clientAdapter &&
|
|
10203
|
+
this.clientAdapter.isVertexAI() &&
|
|
10204
|
+
!options.path.startsWith(`/${this.apiVersion}/projects/`)) {
|
|
10205
|
+
const oldPath = options.path.slice(this.apiVersion.length + 1);
|
|
10206
|
+
options.path = `/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${oldPath}`;
|
|
10207
|
+
}
|
|
10208
|
+
}
|
|
10180
10209
|
/**
|
|
10181
10210
|
* Used as a callback for mutating the given `RequestInit` object.
|
|
10182
10211
|
*
|
|
@@ -10418,13 +10447,14 @@ class BaseGeminiNextGenAPIClient {
|
|
|
10418
10447
|
options.idempotencyKey = this.defaultIdempotencyKey();
|
|
10419
10448
|
idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
|
|
10420
10449
|
}
|
|
10421
|
-
const
|
|
10450
|
+
const authHeaders = await this.authHeaders(options);
|
|
10451
|
+
let headers = buildHeaders([
|
|
10422
10452
|
idempotencyHeaders,
|
|
10423
10453
|
Object.assign(Object.assign({ Accept: 'application/json', 'User-Agent': this.getUserAgent(), 'X-Stainless-Retry-Count': String(retryCount) }, (options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {})), getPlatformHeaders()),
|
|
10424
|
-
await this.authHeaders(options),
|
|
10425
10454
|
this._options.defaultHeaders,
|
|
10426
10455
|
bodyHeaders,
|
|
10427
10456
|
options.headers,
|
|
10457
|
+
authHeaders,
|
|
10428
10458
|
]);
|
|
10429
10459
|
this.validateHeaders(headers);
|
|
10430
10460
|
return headers.values;
|
|
@@ -10567,9 +10597,6 @@ function functionCallToMldev$2(fromObject) {
|
|
|
10567
10597
|
}
|
|
10568
10598
|
function functionDeclarationToVertex$1(fromObject) {
|
|
10569
10599
|
const toObject = {};
|
|
10570
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10571
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10572
|
-
}
|
|
10573
10600
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
10574
10601
|
if (fromDescription != null) {
|
|
10575
10602
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -10598,6 +10625,9 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
10598
10625
|
if (fromResponseJsonSchema != null) {
|
|
10599
10626
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
10600
10627
|
}
|
|
10628
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
10629
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
10630
|
+
}
|
|
10601
10631
|
return toObject;
|
|
10602
10632
|
}
|
|
10603
10633
|
function generationConfigToVertex$1(fromObject) {
|
|
@@ -10696,7 +10726,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
10696
10726
|
}
|
|
10697
10727
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
10698
10728
|
if (fromSpeechConfig != null) {
|
|
10699
|
-
setValueByPath(toObject, ['speechConfig'],
|
|
10729
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
10700
10730
|
}
|
|
10701
10731
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
10702
10732
|
'stopSequences',
|
|
@@ -10912,7 +10942,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
10912
10942
|
}
|
|
10913
10943
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
10914
10944
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
10915
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'],
|
|
10945
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
10916
10946
|
}
|
|
10917
10947
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
10918
10948
|
'thinkingConfig',
|
|
@@ -11237,44 +11267,11 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
11237
11267
|
}
|
|
11238
11268
|
return toObject;
|
|
11239
11269
|
}
|
|
11240
|
-
function speechConfigToVertex$1(fromObject) {
|
|
11241
|
-
const toObject = {};
|
|
11242
|
-
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
11243
|
-
if (fromVoiceConfig != null) {
|
|
11244
|
-
setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
|
|
11245
|
-
}
|
|
11246
|
-
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
11247
|
-
if (fromLanguageCode != null) {
|
|
11248
|
-
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
11249
|
-
}
|
|
11250
|
-
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
11251
|
-
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
11252
|
-
}
|
|
11253
|
-
return toObject;
|
|
11254
|
-
}
|
|
11255
11270
|
function toolToMldev$2(fromObject) {
|
|
11256
11271
|
const toObject = {};
|
|
11257
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11258
|
-
'functionDeclarations',
|
|
11259
|
-
]);
|
|
11260
|
-
if (fromFunctionDeclarations != null) {
|
|
11261
|
-
let transformedList = fromFunctionDeclarations;
|
|
11262
|
-
if (Array.isArray(transformedList)) {
|
|
11263
|
-
transformedList = transformedList.map((item) => {
|
|
11264
|
-
return item;
|
|
11265
|
-
});
|
|
11266
|
-
}
|
|
11267
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11268
|
-
}
|
|
11269
11272
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
11270
11273
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
11271
11274
|
}
|
|
11272
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11273
|
-
'googleSearchRetrieval',
|
|
11274
|
-
]);
|
|
11275
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11276
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11277
|
-
}
|
|
11278
11275
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11279
11276
|
if (fromComputerUse != null) {
|
|
11280
11277
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11292,6 +11289,18 @@ function toolToMldev$2(fromObject) {
|
|
|
11292
11289
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
11293
11290
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
11294
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
|
+
}
|
|
11295
11304
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11296
11305
|
if (fromGoogleMaps != null) {
|
|
11297
11306
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
@@ -11300,6 +11309,12 @@ function toolToMldev$2(fromObject) {
|
|
|
11300
11309
|
if (fromGoogleSearch != null) {
|
|
11301
11310
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
11302
11311
|
}
|
|
11312
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11313
|
+
'googleSearchRetrieval',
|
|
11314
|
+
]);
|
|
11315
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11316
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11317
|
+
}
|
|
11303
11318
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11304
11319
|
if (fromUrlContext != null) {
|
|
11305
11320
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -11308,28 +11323,10 @@ function toolToMldev$2(fromObject) {
|
|
|
11308
11323
|
}
|
|
11309
11324
|
function toolToVertex$1(fromObject) {
|
|
11310
11325
|
const toObject = {};
|
|
11311
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
11312
|
-
'functionDeclarations',
|
|
11313
|
-
]);
|
|
11314
|
-
if (fromFunctionDeclarations != null) {
|
|
11315
|
-
let transformedList = fromFunctionDeclarations;
|
|
11316
|
-
if (Array.isArray(transformedList)) {
|
|
11317
|
-
transformedList = transformedList.map((item) => {
|
|
11318
|
-
return functionDeclarationToVertex$1(item);
|
|
11319
|
-
});
|
|
11320
|
-
}
|
|
11321
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
11322
|
-
}
|
|
11323
11326
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
11324
11327
|
if (fromRetrieval != null) {
|
|
11325
11328
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
11326
11329
|
}
|
|
11327
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11328
|
-
'googleSearchRetrieval',
|
|
11329
|
-
]);
|
|
11330
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
11331
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11332
|
-
}
|
|
11333
11330
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
11334
11331
|
if (fromComputerUse != null) {
|
|
11335
11332
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -11349,6 +11346,18 @@ function toolToVertex$1(fromObject) {
|
|
|
11349
11346
|
if (fromEnterpriseWebSearch != null) {
|
|
11350
11347
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
11351
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
|
+
}
|
|
11352
11361
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
11353
11362
|
if (fromGoogleMaps != null) {
|
|
11354
11363
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -11357,6 +11366,12 @@ function toolToVertex$1(fromObject) {
|
|
|
11357
11366
|
if (fromGoogleSearch != null) {
|
|
11358
11367
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11359
11368
|
}
|
|
11369
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11370
|
+
'googleSearchRetrieval',
|
|
11371
|
+
]);
|
|
11372
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
11373
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
11374
|
+
}
|
|
11360
11375
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
11361
11376
|
if (fromUrlContext != null) {
|
|
11362
11377
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -12139,16 +12154,16 @@ function functionCallToMldev$1(fromObject) {
|
|
|
12139
12154
|
}
|
|
12140
12155
|
function functionCallingConfigToMldev(fromObject) {
|
|
12141
12156
|
const toObject = {};
|
|
12142
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12143
|
-
if (fromMode != null) {
|
|
12144
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
12145
|
-
}
|
|
12146
12157
|
const fromAllowedFunctionNames = getValueByPath(fromObject, [
|
|
12147
12158
|
'allowedFunctionNames',
|
|
12148
12159
|
]);
|
|
12149
12160
|
if (fromAllowedFunctionNames != null) {
|
|
12150
12161
|
setValueByPath(toObject, ['allowedFunctionNames'], fromAllowedFunctionNames);
|
|
12151
12162
|
}
|
|
12163
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
12164
|
+
if (fromMode != null) {
|
|
12165
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
12166
|
+
}
|
|
12152
12167
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
12153
12168
|
undefined) {
|
|
12154
12169
|
throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
|
|
@@ -12157,9 +12172,6 @@ function functionCallingConfigToMldev(fromObject) {
|
|
|
12157
12172
|
}
|
|
12158
12173
|
function functionDeclarationToVertex(fromObject) {
|
|
12159
12174
|
const toObject = {};
|
|
12160
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12161
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12162
|
-
}
|
|
12163
12175
|
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
12164
12176
|
if (fromDescription != null) {
|
|
12165
12177
|
setValueByPath(toObject, ['description'], fromDescription);
|
|
@@ -12188,6 +12200,9 @@ function functionDeclarationToVertex(fromObject) {
|
|
|
12188
12200
|
if (fromResponseJsonSchema != null) {
|
|
12189
12201
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
12190
12202
|
}
|
|
12203
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
12204
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
12205
|
+
}
|
|
12191
12206
|
return toObject;
|
|
12192
12207
|
}
|
|
12193
12208
|
function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
|
|
@@ -12494,7 +12509,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
|
|
|
12494
12509
|
}
|
|
12495
12510
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
12496
12511
|
if (fromSpeechConfig != null) {
|
|
12497
|
-
setValueByPath(toObject, ['speechConfig'],
|
|
12512
|
+
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
12498
12513
|
}
|
|
12499
12514
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
12500
12515
|
'audioTimestamp',
|
|
@@ -13440,7 +13455,7 @@ function generationConfigToVertex(fromObject) {
|
|
|
13440
13455
|
}
|
|
13441
13456
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
13442
13457
|
if (fromSpeechConfig != null) {
|
|
13443
|
-
setValueByPath(toObject, ['speechConfig'],
|
|
13458
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
13444
13459
|
}
|
|
13445
13460
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
13446
13461
|
'stopSequences',
|
|
@@ -13525,6 +13540,9 @@ function imageConfigToMldev(fromObject) {
|
|
|
13525
13540
|
if (fromImageSize != null) {
|
|
13526
13541
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13527
13542
|
}
|
|
13543
|
+
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
13544
|
+
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
13545
|
+
}
|
|
13528
13546
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
13529
13547
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
13530
13548
|
}
|
|
@@ -13544,6 +13562,12 @@ function imageConfigToVertex(fromObject) {
|
|
|
13544
13562
|
if (fromImageSize != null) {
|
|
13545
13563
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
13546
13564
|
}
|
|
13565
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
13566
|
+
'personGeneration',
|
|
13567
|
+
]);
|
|
13568
|
+
if (fromPersonGeneration != null) {
|
|
13569
|
+
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
13570
|
+
}
|
|
13547
13571
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
13548
13572
|
'outputMimeType',
|
|
13549
13573
|
]);
|
|
@@ -14242,60 +14266,27 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
|
|
|
14242
14266
|
}
|
|
14243
14267
|
return toObject;
|
|
14244
14268
|
}
|
|
14245
|
-
function speechConfigToVertex(fromObject) {
|
|
14246
|
-
const toObject = {};
|
|
14247
|
-
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
14248
|
-
if (fromVoiceConfig != null) {
|
|
14249
|
-
setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
|
|
14250
|
-
}
|
|
14251
|
-
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
14252
|
-
if (fromLanguageCode != null) {
|
|
14253
|
-
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
14254
|
-
}
|
|
14255
|
-
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
14256
|
-
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
14257
|
-
}
|
|
14258
|
-
return toObject;
|
|
14259
|
-
}
|
|
14260
14269
|
function toolConfigToMldev(fromObject) {
|
|
14261
14270
|
const toObject = {};
|
|
14262
|
-
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14263
|
-
'functionCallingConfig',
|
|
14264
|
-
]);
|
|
14265
|
-
if (fromFunctionCallingConfig != null) {
|
|
14266
|
-
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14267
|
-
}
|
|
14268
14271
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
14269
14272
|
'retrievalConfig',
|
|
14270
14273
|
]);
|
|
14271
14274
|
if (fromRetrievalConfig != null) {
|
|
14272
14275
|
setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
|
|
14273
14276
|
}
|
|
14277
|
+
const fromFunctionCallingConfig = getValueByPath(fromObject, [
|
|
14278
|
+
'functionCallingConfig',
|
|
14279
|
+
]);
|
|
14280
|
+
if (fromFunctionCallingConfig != null) {
|
|
14281
|
+
setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
|
|
14282
|
+
}
|
|
14274
14283
|
return toObject;
|
|
14275
14284
|
}
|
|
14276
14285
|
function toolToMldev$1(fromObject) {
|
|
14277
14286
|
const toObject = {};
|
|
14278
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14279
|
-
'functionDeclarations',
|
|
14280
|
-
]);
|
|
14281
|
-
if (fromFunctionDeclarations != null) {
|
|
14282
|
-
let transformedList = fromFunctionDeclarations;
|
|
14283
|
-
if (Array.isArray(transformedList)) {
|
|
14284
|
-
transformedList = transformedList.map((item) => {
|
|
14285
|
-
return item;
|
|
14286
|
-
});
|
|
14287
|
-
}
|
|
14288
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14289
|
-
}
|
|
14290
14287
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
14291
14288
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
14292
14289
|
}
|
|
14293
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14294
|
-
'googleSearchRetrieval',
|
|
14295
|
-
]);
|
|
14296
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14297
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14298
|
-
}
|
|
14299
14290
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14300
14291
|
if (fromComputerUse != null) {
|
|
14301
14292
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14313,6 +14304,18 @@ function toolToMldev$1(fromObject) {
|
|
|
14313
14304
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
14314
14305
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
14315
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
|
+
}
|
|
14316
14319
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14317
14320
|
if (fromGoogleMaps != null) {
|
|
14318
14321
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
@@ -14321,6 +14324,12 @@ function toolToMldev$1(fromObject) {
|
|
|
14321
14324
|
if (fromGoogleSearch != null) {
|
|
14322
14325
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
14323
14326
|
}
|
|
14327
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14328
|
+
'googleSearchRetrieval',
|
|
14329
|
+
]);
|
|
14330
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14331
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14332
|
+
}
|
|
14324
14333
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14325
14334
|
if (fromUrlContext != null) {
|
|
14326
14335
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -14329,28 +14338,10 @@ function toolToMldev$1(fromObject) {
|
|
|
14329
14338
|
}
|
|
14330
14339
|
function toolToVertex(fromObject) {
|
|
14331
14340
|
const toObject = {};
|
|
14332
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
14333
|
-
'functionDeclarations',
|
|
14334
|
-
]);
|
|
14335
|
-
if (fromFunctionDeclarations != null) {
|
|
14336
|
-
let transformedList = fromFunctionDeclarations;
|
|
14337
|
-
if (Array.isArray(transformedList)) {
|
|
14338
|
-
transformedList = transformedList.map((item) => {
|
|
14339
|
-
return functionDeclarationToVertex(item);
|
|
14340
|
-
});
|
|
14341
|
-
}
|
|
14342
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
14343
|
-
}
|
|
14344
14341
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
14345
14342
|
if (fromRetrieval != null) {
|
|
14346
14343
|
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
14347
14344
|
}
|
|
14348
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14349
|
-
'googleSearchRetrieval',
|
|
14350
|
-
]);
|
|
14351
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
14352
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14353
|
-
}
|
|
14354
14345
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14355
14346
|
if (fromComputerUse != null) {
|
|
14356
14347
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -14370,6 +14361,18 @@ function toolToVertex(fromObject) {
|
|
|
14370
14361
|
if (fromEnterpriseWebSearch != null) {
|
|
14371
14362
|
setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
|
|
14372
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
|
+
}
|
|
14373
14376
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
14374
14377
|
if (fromGoogleMaps != null) {
|
|
14375
14378
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
@@ -14378,6 +14381,12 @@ function toolToVertex(fromObject) {
|
|
|
14378
14381
|
if (fromGoogleSearch != null) {
|
|
14379
14382
|
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
14380
14383
|
}
|
|
14384
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14385
|
+
'googleSearchRetrieval',
|
|
14386
|
+
]);
|
|
14387
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
14388
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
14389
|
+
}
|
|
14381
14390
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
14382
14391
|
if (fromUrlContext != null) {
|
|
14383
14392
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -15783,7 +15792,7 @@ class Models extends BaseModule {
|
|
|
15783
15792
|
* @example
|
|
15784
15793
|
* ```ts
|
|
15785
15794
|
* const response = await client.models.generateImages({
|
|
15786
|
-
* model: 'imagen-
|
|
15795
|
+
* model: 'imagen-4.0-generate-001',
|
|
15787
15796
|
* prompt: 'Robot holding a red skateboard',
|
|
15788
15797
|
* config: {
|
|
15789
15798
|
* numberOfImages: 1,
|
|
@@ -15892,7 +15901,7 @@ class Models extends BaseModule {
|
|
|
15892
15901
|
* @example
|
|
15893
15902
|
* ```ts
|
|
15894
15903
|
* const response = await client.models.upscaleImage({
|
|
15895
|
-
* model: 'imagen-
|
|
15904
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
15896
15905
|
* image: image,
|
|
15897
15906
|
* upscaleFactor: 'x2',
|
|
15898
15907
|
* config: {
|
|
@@ -16554,7 +16563,7 @@ class Models extends BaseModule {
|
|
|
16554
16563
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
16555
16564
|
*
|
|
16556
16565
|
* const response2 = await ai.models.recontextImage({
|
|
16557
|
-
* model: 'virtual-try-on-
|
|
16566
|
+
* model: 'virtual-try-on-001',
|
|
16558
16567
|
* source: {
|
|
16559
16568
|
* personImage: personImage,
|
|
16560
16569
|
* productImages: [productImage],
|
|
@@ -17636,27 +17645,9 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
17636
17645
|
}
|
|
17637
17646
|
function toolToMldev(fromObject) {
|
|
17638
17647
|
const toObject = {};
|
|
17639
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
17640
|
-
'functionDeclarations',
|
|
17641
|
-
]);
|
|
17642
|
-
if (fromFunctionDeclarations != null) {
|
|
17643
|
-
let transformedList = fromFunctionDeclarations;
|
|
17644
|
-
if (Array.isArray(transformedList)) {
|
|
17645
|
-
transformedList = transformedList.map((item) => {
|
|
17646
|
-
return item;
|
|
17647
|
-
});
|
|
17648
|
-
}
|
|
17649
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
17650
|
-
}
|
|
17651
17648
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
17652
17649
|
throw new Error('retrieval parameter is not supported in Gemini API.');
|
|
17653
17650
|
}
|
|
17654
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17655
|
-
'googleSearchRetrieval',
|
|
17656
|
-
]);
|
|
17657
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
17658
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17659
|
-
}
|
|
17660
17651
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
17661
17652
|
if (fromComputerUse != null) {
|
|
17662
17653
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
@@ -17674,6 +17665,18 @@ function toolToMldev(fromObject) {
|
|
|
17674
17665
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
17675
17666
|
throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
|
|
17676
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
|
+
}
|
|
17677
17680
|
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
17678
17681
|
if (fromGoogleMaps != null) {
|
|
17679
17682
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
@@ -17682,6 +17685,12 @@ function toolToMldev(fromObject) {
|
|
|
17682
17685
|
if (fromGoogleSearch != null) {
|
|
17683
17686
|
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
17684
17687
|
}
|
|
17688
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
17689
|
+
'googleSearchRetrieval',
|
|
17690
|
+
]);
|
|
17691
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
17692
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
17693
|
+
}
|
|
17685
17694
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
17686
17695
|
if (fromUrlContext != null) {
|
|
17687
17696
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
@@ -19108,6 +19117,8 @@ class GoogleGenAI {
|
|
|
19108
19117
|
const nextGenClient = new GeminiNextGenAPIClient({
|
|
19109
19118
|
baseURL: this.apiClient.getBaseUrl(),
|
|
19110
19119
|
apiKey: this.apiKey,
|
|
19120
|
+
apiVersion: this.apiClient.getApiVersion(),
|
|
19121
|
+
clientAdapter: this.apiClient,
|
|
19111
19122
|
defaultHeaders: this.apiClient.getDefaultHeaders(),
|
|
19112
19123
|
timeout: httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.timeout,
|
|
19113
19124
|
});
|
|
@@ -19147,5 +19158,5 @@ class GoogleGenAI {
|
|
|
19147
19158
|
}
|
|
19148
19159
|
}
|
|
19149
19160
|
|
|
19150
|
-
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 };
|
|
19151
19162
|
//# sourceMappingURL=index.mjs.map
|