@google/genai 1.42.0 → 1.43.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 +270 -160
- package/dist/index.cjs +187 -77
- package/dist/index.mjs +188 -78
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +187 -77
- package/dist/node/index.mjs +188 -78
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +270 -160
- package/dist/tokenizer/node.cjs +48 -32
- package/dist/tokenizer/node.d.ts +48 -3
- package/dist/tokenizer/node.mjs +48 -32
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/web/index.mjs +188 -78
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +270 -160
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -682,6 +682,38 @@ var Type;
|
|
|
682
682
|
*/
|
|
683
683
|
Type["NULL"] = "NULL";
|
|
684
684
|
})(Type || (Type = {}));
|
|
685
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
686
|
+
var PhishBlockThreshold;
|
|
687
|
+
(function (PhishBlockThreshold) {
|
|
688
|
+
/**
|
|
689
|
+
* Defaults to unspecified.
|
|
690
|
+
*/
|
|
691
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
692
|
+
/**
|
|
693
|
+
* Blocks Low and above confidence URL that is risky.
|
|
694
|
+
*/
|
|
695
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
696
|
+
/**
|
|
697
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
698
|
+
*/
|
|
699
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
700
|
+
/**
|
|
701
|
+
* Blocks High and above confidence URL that is risky.
|
|
702
|
+
*/
|
|
703
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
704
|
+
/**
|
|
705
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
706
|
+
*/
|
|
707
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
708
|
+
/**
|
|
709
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
710
|
+
*/
|
|
711
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
712
|
+
/**
|
|
713
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
714
|
+
*/
|
|
715
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
716
|
+
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
685
717
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
686
718
|
var ApiSpec;
|
|
687
719
|
(function (ApiSpec) {
|
|
@@ -752,38 +784,6 @@ var HttpElementLocation;
|
|
|
752
784
|
*/
|
|
753
785
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
754
786
|
})(HttpElementLocation || (HttpElementLocation = {}));
|
|
755
|
-
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
756
|
-
var PhishBlockThreshold;
|
|
757
|
-
(function (PhishBlockThreshold) {
|
|
758
|
-
/**
|
|
759
|
-
* Defaults to unspecified.
|
|
760
|
-
*/
|
|
761
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
762
|
-
/**
|
|
763
|
-
* Blocks Low and above confidence URL that is risky.
|
|
764
|
-
*/
|
|
765
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
766
|
-
/**
|
|
767
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
768
|
-
*/
|
|
769
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
770
|
-
/**
|
|
771
|
-
* Blocks High and above confidence URL that is risky.
|
|
772
|
-
*/
|
|
773
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
774
|
-
/**
|
|
775
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
776
|
-
*/
|
|
777
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
778
|
-
/**
|
|
779
|
-
* Blocks Very high and above confidence URL that is risky.
|
|
780
|
-
*/
|
|
781
|
-
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
782
|
-
/**
|
|
783
|
-
* Blocks Extremely high confidence URL that is risky.
|
|
784
|
-
*/
|
|
785
|
-
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
786
|
-
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
787
787
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
788
788
|
var Behavior;
|
|
789
789
|
(function (Behavior) {
|
|
@@ -1366,6 +1366,22 @@ var Environment;
|
|
|
1366
1366
|
*/
|
|
1367
1367
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1368
1368
|
})(Environment || (Environment = {}));
|
|
1369
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1370
|
+
var ProminentPeople;
|
|
1371
|
+
(function (ProminentPeople) {
|
|
1372
|
+
/**
|
|
1373
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
1374
|
+
*/
|
|
1375
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
1376
|
+
/**
|
|
1377
|
+
* Allows the model to generate images of prominent people.
|
|
1378
|
+
*/
|
|
1379
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
1380
|
+
/**
|
|
1381
|
+
* Prevents the model from generating images of prominent people.
|
|
1382
|
+
*/
|
|
1383
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
1384
|
+
})(ProminentPeople || (ProminentPeople = {}));
|
|
1369
1385
|
/** Enum representing the Vertex embedding API to use. */
|
|
1370
1386
|
var EmbeddingApiType;
|
|
1371
1387
|
(function (EmbeddingApiType) {
|
|
@@ -3724,16 +3740,16 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3724
3740
|
if (fromFinishReason != null) {
|
|
3725
3741
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
3726
3742
|
}
|
|
3727
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3728
|
-
if (fromAvgLogprobs != null) {
|
|
3729
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3730
|
-
}
|
|
3731
3743
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
3732
3744
|
'groundingMetadata',
|
|
3733
3745
|
]);
|
|
3734
3746
|
if (fromGroundingMetadata != null) {
|
|
3735
3747
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
3736
3748
|
}
|
|
3749
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3750
|
+
if (fromAvgLogprobs != null) {
|
|
3751
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3752
|
+
}
|
|
3737
3753
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
3738
3754
|
if (fromIndex != null) {
|
|
3739
3755
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -4279,6 +4295,10 @@ function googleMapsToMldev$4(fromObject) {
|
|
|
4279
4295
|
}
|
|
4280
4296
|
function googleSearchToMldev$4(fromObject) {
|
|
4281
4297
|
const toObject = {};
|
|
4298
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
4299
|
+
if (fromSearchTypes != null) {
|
|
4300
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4301
|
+
}
|
|
4282
4302
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4283
4303
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4284
4304
|
}
|
|
@@ -4306,6 +4326,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4306
4326
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4307
4327
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4308
4328
|
}
|
|
4329
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4330
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
4331
|
+
}
|
|
4309
4332
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4310
4333
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4311
4334
|
}
|
|
@@ -4562,6 +4585,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4562
4585
|
if (fromFileSearch != null) {
|
|
4563
4586
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
4564
4587
|
}
|
|
4588
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4589
|
+
if (fromGoogleSearch != null) {
|
|
4590
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4591
|
+
}
|
|
4565
4592
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4566
4593
|
'codeExecution',
|
|
4567
4594
|
]);
|
|
@@ -4587,10 +4614,6 @@ function toolToMldev$4(fromObject) {
|
|
|
4587
4614
|
if (fromGoogleMaps != null) {
|
|
4588
4615
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4589
4616
|
}
|
|
4590
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4591
|
-
if (fromGoogleSearch != null) {
|
|
4592
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4593
|
-
}
|
|
4594
4617
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4595
4618
|
'googleSearchRetrieval',
|
|
4596
4619
|
]);
|
|
@@ -4601,6 +4624,16 @@ function toolToMldev$4(fromObject) {
|
|
|
4601
4624
|
if (fromUrlContext != null) {
|
|
4602
4625
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
4603
4626
|
}
|
|
4627
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
4628
|
+
if (fromMcpServers != null) {
|
|
4629
|
+
let transformedList = fromMcpServers;
|
|
4630
|
+
if (Array.isArray(transformedList)) {
|
|
4631
|
+
transformedList = transformedList.map((item) => {
|
|
4632
|
+
return item;
|
|
4633
|
+
});
|
|
4634
|
+
}
|
|
4635
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
4636
|
+
}
|
|
4604
4637
|
return toObject;
|
|
4605
4638
|
}
|
|
4606
4639
|
|
|
@@ -5607,6 +5640,10 @@ function googleMapsToMldev$3(fromObject) {
|
|
|
5607
5640
|
}
|
|
5608
5641
|
function googleSearchToMldev$3(fromObject) {
|
|
5609
5642
|
const toObject = {};
|
|
5643
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
5644
|
+
if (fromSearchTypes != null) {
|
|
5645
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5646
|
+
}
|
|
5610
5647
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5611
5648
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5612
5649
|
}
|
|
@@ -5806,6 +5843,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5806
5843
|
if (fromFileSearch != null) {
|
|
5807
5844
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
5808
5845
|
}
|
|
5846
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5847
|
+
if (fromGoogleSearch != null) {
|
|
5848
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5849
|
+
}
|
|
5809
5850
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5810
5851
|
'codeExecution',
|
|
5811
5852
|
]);
|
|
@@ -5831,10 +5872,6 @@ function toolToMldev$3(fromObject) {
|
|
|
5831
5872
|
if (fromGoogleMaps != null) {
|
|
5832
5873
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5833
5874
|
}
|
|
5834
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5835
|
-
if (fromGoogleSearch != null) {
|
|
5836
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5837
|
-
}
|
|
5838
5875
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5839
5876
|
'googleSearchRetrieval',
|
|
5840
5877
|
]);
|
|
@@ -5845,6 +5882,16 @@ function toolToMldev$3(fromObject) {
|
|
|
5845
5882
|
if (fromUrlContext != null) {
|
|
5846
5883
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5847
5884
|
}
|
|
5885
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
5886
|
+
if (fromMcpServers != null) {
|
|
5887
|
+
let transformedList = fromMcpServers;
|
|
5888
|
+
if (Array.isArray(transformedList)) {
|
|
5889
|
+
transformedList = transformedList.map((item) => {
|
|
5890
|
+
return item;
|
|
5891
|
+
});
|
|
5892
|
+
}
|
|
5893
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5894
|
+
}
|
|
5848
5895
|
return toObject;
|
|
5849
5896
|
}
|
|
5850
5897
|
function toolToVertex$2(fromObject) {
|
|
@@ -5860,6 +5907,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5860
5907
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
5861
5908
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
5862
5909
|
}
|
|
5910
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5911
|
+
if (fromGoogleSearch != null) {
|
|
5912
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5913
|
+
}
|
|
5863
5914
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5864
5915
|
'codeExecution',
|
|
5865
5916
|
]);
|
|
@@ -5888,10 +5939,6 @@ function toolToVertex$2(fromObject) {
|
|
|
5888
5939
|
if (fromGoogleMaps != null) {
|
|
5889
5940
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5890
5941
|
}
|
|
5891
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5892
|
-
if (fromGoogleSearch != null) {
|
|
5893
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5894
|
-
}
|
|
5895
5942
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5896
5943
|
'googleSearchRetrieval',
|
|
5897
5944
|
]);
|
|
@@ -5902,6 +5949,9 @@ function toolToVertex$2(fromObject) {
|
|
|
5902
5949
|
if (fromUrlContext != null) {
|
|
5903
5950
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5904
5951
|
}
|
|
5952
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
5953
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
5954
|
+
}
|
|
5905
5955
|
return toObject;
|
|
5906
5956
|
}
|
|
5907
5957
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7435,6 +7485,10 @@ function googleMapsToMldev$2(fromObject) {
|
|
|
7435
7485
|
}
|
|
7436
7486
|
function googleSearchToMldev$2(fromObject) {
|
|
7437
7487
|
const toObject = {};
|
|
7488
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
7489
|
+
if (fromSearchTypes != null) {
|
|
7490
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7491
|
+
}
|
|
7438
7492
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7439
7493
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7440
7494
|
}
|
|
@@ -7950,6 +8004,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7950
8004
|
if (fromFileSearch != null) {
|
|
7951
8005
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
7952
8006
|
}
|
|
8007
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8008
|
+
if (fromGoogleSearch != null) {
|
|
8009
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8010
|
+
}
|
|
7953
8011
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7954
8012
|
'codeExecution',
|
|
7955
8013
|
]);
|
|
@@ -7975,10 +8033,6 @@ function toolToMldev$2(fromObject) {
|
|
|
7975
8033
|
if (fromGoogleMaps != null) {
|
|
7976
8034
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
7977
8035
|
}
|
|
7978
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7979
|
-
if (fromGoogleSearch != null) {
|
|
7980
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7981
|
-
}
|
|
7982
8036
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7983
8037
|
'googleSearchRetrieval',
|
|
7984
8038
|
]);
|
|
@@ -7989,6 +8043,16 @@ function toolToMldev$2(fromObject) {
|
|
|
7989
8043
|
if (fromUrlContext != null) {
|
|
7990
8044
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
7991
8045
|
}
|
|
8046
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
8047
|
+
if (fromMcpServers != null) {
|
|
8048
|
+
let transformedList = fromMcpServers;
|
|
8049
|
+
if (Array.isArray(transformedList)) {
|
|
8050
|
+
transformedList = transformedList.map((item) => {
|
|
8051
|
+
return item;
|
|
8052
|
+
});
|
|
8053
|
+
}
|
|
8054
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
8055
|
+
}
|
|
7992
8056
|
return toObject;
|
|
7993
8057
|
}
|
|
7994
8058
|
function toolToVertex$1(fromObject) {
|
|
@@ -8004,6 +8068,10 @@ function toolToVertex$1(fromObject) {
|
|
|
8004
8068
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8005
8069
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
8006
8070
|
}
|
|
8071
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8072
|
+
if (fromGoogleSearch != null) {
|
|
8073
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8074
|
+
}
|
|
8007
8075
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8008
8076
|
'codeExecution',
|
|
8009
8077
|
]);
|
|
@@ -8032,10 +8100,6 @@ function toolToVertex$1(fromObject) {
|
|
|
8032
8100
|
if (fromGoogleMaps != null) {
|
|
8033
8101
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8034
8102
|
}
|
|
8035
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8036
|
-
if (fromGoogleSearch != null) {
|
|
8037
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8038
|
-
}
|
|
8039
8103
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8040
8104
|
'googleSearchRetrieval',
|
|
8041
8105
|
]);
|
|
@@ -8046,6 +8110,9 @@ function toolToVertex$1(fromObject) {
|
|
|
8046
8110
|
if (fromUrlContext != null) {
|
|
8047
8111
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8048
8112
|
}
|
|
8113
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
8114
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
8115
|
+
}
|
|
8049
8116
|
return toObject;
|
|
8050
8117
|
}
|
|
8051
8118
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -8189,16 +8256,16 @@ function candidateFromMldev(fromObject, rootObject) {
|
|
|
8189
8256
|
if (fromFinishReason != null) {
|
|
8190
8257
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
8191
8258
|
}
|
|
8192
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8193
|
-
if (fromAvgLogprobs != null) {
|
|
8194
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8195
|
-
}
|
|
8196
8259
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8197
8260
|
'groundingMetadata',
|
|
8198
8261
|
]);
|
|
8199
8262
|
if (fromGroundingMetadata != null) {
|
|
8200
8263
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8201
8264
|
}
|
|
8265
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8266
|
+
if (fromAvgLogprobs != null) {
|
|
8267
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8268
|
+
}
|
|
8202
8269
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
8203
8270
|
if (fromIndex != null) {
|
|
8204
8271
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -10315,6 +10382,10 @@ function googleMapsToMldev$1(fromObject, _rootObject) {
|
|
|
10315
10382
|
}
|
|
10316
10383
|
function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
10317
10384
|
const toObject = {};
|
|
10385
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
10386
|
+
if (fromSearchTypes != null) {
|
|
10387
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10388
|
+
}
|
|
10318
10389
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10319
10390
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10320
10391
|
}
|
|
@@ -10342,6 +10413,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10342
10413
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10343
10414
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10344
10415
|
}
|
|
10416
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
10417
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
10418
|
+
}
|
|
10345
10419
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10346
10420
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10347
10421
|
}
|
|
@@ -10367,6 +10441,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10367
10441
|
if (fromPersonGeneration != null) {
|
|
10368
10442
|
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10369
10443
|
}
|
|
10444
|
+
const fromProminentPeople = getValueByPath(fromObject, [
|
|
10445
|
+
'prominentPeople',
|
|
10446
|
+
]);
|
|
10447
|
+
if (fromProminentPeople != null) {
|
|
10448
|
+
setValueByPath(toObject, ['prominentPeople'], fromProminentPeople);
|
|
10449
|
+
}
|
|
10370
10450
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10371
10451
|
'outputMimeType',
|
|
10372
10452
|
]);
|
|
@@ -11094,6 +11174,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11094
11174
|
if (fromFileSearch != null) {
|
|
11095
11175
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
11096
11176
|
}
|
|
11177
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11178
|
+
if (fromGoogleSearch != null) {
|
|
11179
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11180
|
+
}
|
|
11097
11181
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11098
11182
|
'codeExecution',
|
|
11099
11183
|
]);
|
|
@@ -11119,10 +11203,6 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11119
11203
|
if (fromGoogleMaps != null) {
|
|
11120
11204
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11121
11205
|
}
|
|
11122
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11123
|
-
if (fromGoogleSearch != null) {
|
|
11124
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11125
|
-
}
|
|
11126
11206
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11127
11207
|
'googleSearchRetrieval',
|
|
11128
11208
|
]);
|
|
@@ -11133,6 +11213,16 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11133
11213
|
if (fromUrlContext != null) {
|
|
11134
11214
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11135
11215
|
}
|
|
11216
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
11217
|
+
if (fromMcpServers != null) {
|
|
11218
|
+
let transformedList = fromMcpServers;
|
|
11219
|
+
if (Array.isArray(transformedList)) {
|
|
11220
|
+
transformedList = transformedList.map((item) => {
|
|
11221
|
+
return item;
|
|
11222
|
+
});
|
|
11223
|
+
}
|
|
11224
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
11225
|
+
}
|
|
11136
11226
|
return toObject;
|
|
11137
11227
|
}
|
|
11138
11228
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -11148,6 +11238,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11148
11238
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
11149
11239
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
11150
11240
|
}
|
|
11241
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11242
|
+
if (fromGoogleSearch != null) {
|
|
11243
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11244
|
+
}
|
|
11151
11245
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11152
11246
|
'codeExecution',
|
|
11153
11247
|
]);
|
|
@@ -11176,10 +11270,6 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11176
11270
|
if (fromGoogleMaps != null) {
|
|
11177
11271
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11178
11272
|
}
|
|
11179
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11180
|
-
if (fromGoogleSearch != null) {
|
|
11181
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11182
|
-
}
|
|
11183
11273
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11184
11274
|
'googleSearchRetrieval',
|
|
11185
11275
|
]);
|
|
@@ -11190,6 +11280,9 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11190
11280
|
if (fromUrlContext != null) {
|
|
11191
11281
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11192
11282
|
}
|
|
11283
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
11284
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
11285
|
+
}
|
|
11193
11286
|
return toObject;
|
|
11194
11287
|
}
|
|
11195
11288
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -11746,7 +11839,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11746
11839
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11747
11840
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11748
11841
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11749
|
-
const SDK_VERSION = '1.
|
|
11842
|
+
const SDK_VERSION = '1.43.0'; // x-release-please-version
|
|
11750
11843
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11751
11844
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11752
11845
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -15199,6 +15292,10 @@ function googleMapsToMldev(fromObject) {
|
|
|
15199
15292
|
}
|
|
15200
15293
|
function googleSearchToMldev(fromObject) {
|
|
15201
15294
|
const toObject = {};
|
|
15295
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
15296
|
+
if (fromSearchTypes != null) {
|
|
15297
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15298
|
+
}
|
|
15202
15299
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15203
15300
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15204
15301
|
}
|
|
@@ -15422,6 +15519,10 @@ function toolToMldev(fromObject) {
|
|
|
15422
15519
|
if (fromFileSearch != null) {
|
|
15423
15520
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
15424
15521
|
}
|
|
15522
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15523
|
+
if (fromGoogleSearch != null) {
|
|
15524
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15525
|
+
}
|
|
15425
15526
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15426
15527
|
'codeExecution',
|
|
15427
15528
|
]);
|
|
@@ -15447,10 +15548,6 @@ function toolToMldev(fromObject) {
|
|
|
15447
15548
|
if (fromGoogleMaps != null) {
|
|
15448
15549
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15449
15550
|
}
|
|
15450
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15451
|
-
if (fromGoogleSearch != null) {
|
|
15452
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15453
|
-
}
|
|
15454
15551
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15455
15552
|
'googleSearchRetrieval',
|
|
15456
15553
|
]);
|
|
@@ -15461,6 +15558,16 @@ function toolToMldev(fromObject) {
|
|
|
15461
15558
|
if (fromUrlContext != null) {
|
|
15462
15559
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
15463
15560
|
}
|
|
15561
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
15562
|
+
if (fromMcpServers != null) {
|
|
15563
|
+
let transformedList = fromMcpServers;
|
|
15564
|
+
if (Array.isArray(transformedList)) {
|
|
15565
|
+
transformedList = transformedList.map((item) => {
|
|
15566
|
+
return item;
|
|
15567
|
+
});
|
|
15568
|
+
}
|
|
15569
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15570
|
+
}
|
|
15464
15571
|
return toObject;
|
|
15465
15572
|
}
|
|
15466
15573
|
|
|
@@ -16918,14 +17025,17 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(st
|
|
|
16918
17025
|
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
16919
17026
|
}, '');
|
|
16920
17027
|
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
16921
|
-
const invalidSegmentPattern = /(
|
|
17028
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
16922
17029
|
let match;
|
|
16923
17030
|
// Find all invalid segments
|
|
16924
17031
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
17032
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
17033
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
17034
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
16925
17035
|
invalidSegments.push({
|
|
16926
|
-
start: match.index,
|
|
16927
|
-
length:
|
|
16928
|
-
error: `Value "${
|
|
17036
|
+
start: match.index + offset,
|
|
17037
|
+
length: cleanMatch.length,
|
|
17038
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
16929
17039
|
});
|
|
16930
17040
|
}
|
|
16931
17041
|
invalidSegments.sort((a, b) => a.start - b.start);
|
|
@@ -20161,5 +20271,5 @@ function getApiKeyFromEnv() {
|
|
|
20161
20271
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
20162
20272
|
}
|
|
20163
20273
|
|
|
20164
|
-
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, EmbeddingApiType, 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, RegisterFilesResponse, ReplayResponse, ResourceScope, 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 };
|
|
20274
|
+
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, EmbeddingApiType, 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, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, 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 };
|
|
20165
20275
|
//# sourceMappingURL=index.mjs.map
|