@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/web/index.mjs
CHANGED
|
@@ -674,6 +674,38 @@ var Type;
|
|
|
674
674
|
*/
|
|
675
675
|
Type["NULL"] = "NULL";
|
|
676
676
|
})(Type || (Type = {}));
|
|
677
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
678
|
+
var PhishBlockThreshold;
|
|
679
|
+
(function (PhishBlockThreshold) {
|
|
680
|
+
/**
|
|
681
|
+
* Defaults to unspecified.
|
|
682
|
+
*/
|
|
683
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
684
|
+
/**
|
|
685
|
+
* Blocks Low and above confidence URL that is risky.
|
|
686
|
+
*/
|
|
687
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
688
|
+
/**
|
|
689
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
690
|
+
*/
|
|
691
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
692
|
+
/**
|
|
693
|
+
* Blocks High and above confidence URL that is risky.
|
|
694
|
+
*/
|
|
695
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
696
|
+
/**
|
|
697
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
698
|
+
*/
|
|
699
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
700
|
+
/**
|
|
701
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
702
|
+
*/
|
|
703
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
704
|
+
/**
|
|
705
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
706
|
+
*/
|
|
707
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
708
|
+
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
677
709
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
678
710
|
var ApiSpec;
|
|
679
711
|
(function (ApiSpec) {
|
|
@@ -744,38 +776,6 @@ var HttpElementLocation;
|
|
|
744
776
|
*/
|
|
745
777
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
746
778
|
})(HttpElementLocation || (HttpElementLocation = {}));
|
|
747
|
-
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
748
|
-
var PhishBlockThreshold;
|
|
749
|
-
(function (PhishBlockThreshold) {
|
|
750
|
-
/**
|
|
751
|
-
* Defaults to unspecified.
|
|
752
|
-
*/
|
|
753
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
754
|
-
/**
|
|
755
|
-
* Blocks Low and above confidence URL that is risky.
|
|
756
|
-
*/
|
|
757
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
758
|
-
/**
|
|
759
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
760
|
-
*/
|
|
761
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
762
|
-
/**
|
|
763
|
-
* Blocks High and above confidence URL that is risky.
|
|
764
|
-
*/
|
|
765
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
766
|
-
/**
|
|
767
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
768
|
-
*/
|
|
769
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
770
|
-
/**
|
|
771
|
-
* Blocks Very high and above confidence URL that is risky.
|
|
772
|
-
*/
|
|
773
|
-
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
774
|
-
/**
|
|
775
|
-
* Blocks Extremely high confidence URL that is risky.
|
|
776
|
-
*/
|
|
777
|
-
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
778
|
-
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
779
779
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
780
780
|
var Behavior;
|
|
781
781
|
(function (Behavior) {
|
|
@@ -1358,6 +1358,22 @@ var Environment;
|
|
|
1358
1358
|
*/
|
|
1359
1359
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1360
1360
|
})(Environment || (Environment = {}));
|
|
1361
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1362
|
+
var ProminentPeople;
|
|
1363
|
+
(function (ProminentPeople) {
|
|
1364
|
+
/**
|
|
1365
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
1366
|
+
*/
|
|
1367
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
1368
|
+
/**
|
|
1369
|
+
* Allows the model to generate images of prominent people.
|
|
1370
|
+
*/
|
|
1371
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
1372
|
+
/**
|
|
1373
|
+
* Prevents the model from generating images of prominent people.
|
|
1374
|
+
*/
|
|
1375
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
1376
|
+
})(ProminentPeople || (ProminentPeople = {}));
|
|
1361
1377
|
/** Enum representing the Vertex embedding API to use. */
|
|
1362
1378
|
var EmbeddingApiType;
|
|
1363
1379
|
(function (EmbeddingApiType) {
|
|
@@ -3716,16 +3732,16 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3716
3732
|
if (fromFinishReason != null) {
|
|
3717
3733
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
3718
3734
|
}
|
|
3719
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3720
|
-
if (fromAvgLogprobs != null) {
|
|
3721
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3722
|
-
}
|
|
3723
3735
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
3724
3736
|
'groundingMetadata',
|
|
3725
3737
|
]);
|
|
3726
3738
|
if (fromGroundingMetadata != null) {
|
|
3727
3739
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
3728
3740
|
}
|
|
3741
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3742
|
+
if (fromAvgLogprobs != null) {
|
|
3743
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3744
|
+
}
|
|
3729
3745
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
3730
3746
|
if (fromIndex != null) {
|
|
3731
3747
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -4271,6 +4287,10 @@ function googleMapsToMldev$4(fromObject) {
|
|
|
4271
4287
|
}
|
|
4272
4288
|
function googleSearchToMldev$4(fromObject) {
|
|
4273
4289
|
const toObject = {};
|
|
4290
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
4291
|
+
if (fromSearchTypes != null) {
|
|
4292
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4293
|
+
}
|
|
4274
4294
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4275
4295
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4276
4296
|
}
|
|
@@ -4298,6 +4318,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4298
4318
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4299
4319
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4300
4320
|
}
|
|
4321
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4322
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
4323
|
+
}
|
|
4301
4324
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4302
4325
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4303
4326
|
}
|
|
@@ -4554,6 +4577,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4554
4577
|
if (fromFileSearch != null) {
|
|
4555
4578
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
4556
4579
|
}
|
|
4580
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4581
|
+
if (fromGoogleSearch != null) {
|
|
4582
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4583
|
+
}
|
|
4557
4584
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4558
4585
|
'codeExecution',
|
|
4559
4586
|
]);
|
|
@@ -4579,10 +4606,6 @@ function toolToMldev$4(fromObject) {
|
|
|
4579
4606
|
if (fromGoogleMaps != null) {
|
|
4580
4607
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4581
4608
|
}
|
|
4582
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4583
|
-
if (fromGoogleSearch != null) {
|
|
4584
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4585
|
-
}
|
|
4586
4609
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4587
4610
|
'googleSearchRetrieval',
|
|
4588
4611
|
]);
|
|
@@ -4593,6 +4616,16 @@ function toolToMldev$4(fromObject) {
|
|
|
4593
4616
|
if (fromUrlContext != null) {
|
|
4594
4617
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
4595
4618
|
}
|
|
4619
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
4620
|
+
if (fromMcpServers != null) {
|
|
4621
|
+
let transformedList = fromMcpServers;
|
|
4622
|
+
if (Array.isArray(transformedList)) {
|
|
4623
|
+
transformedList = transformedList.map((item) => {
|
|
4624
|
+
return item;
|
|
4625
|
+
});
|
|
4626
|
+
}
|
|
4627
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
4628
|
+
}
|
|
4596
4629
|
return toObject;
|
|
4597
4630
|
}
|
|
4598
4631
|
|
|
@@ -5599,6 +5632,10 @@ function googleMapsToMldev$3(fromObject) {
|
|
|
5599
5632
|
}
|
|
5600
5633
|
function googleSearchToMldev$3(fromObject) {
|
|
5601
5634
|
const toObject = {};
|
|
5635
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
5636
|
+
if (fromSearchTypes != null) {
|
|
5637
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5638
|
+
}
|
|
5602
5639
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5603
5640
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5604
5641
|
}
|
|
@@ -5798,6 +5835,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5798
5835
|
if (fromFileSearch != null) {
|
|
5799
5836
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
5800
5837
|
}
|
|
5838
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5839
|
+
if (fromGoogleSearch != null) {
|
|
5840
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5841
|
+
}
|
|
5801
5842
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5802
5843
|
'codeExecution',
|
|
5803
5844
|
]);
|
|
@@ -5823,10 +5864,6 @@ function toolToMldev$3(fromObject) {
|
|
|
5823
5864
|
if (fromGoogleMaps != null) {
|
|
5824
5865
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5825
5866
|
}
|
|
5826
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5827
|
-
if (fromGoogleSearch != null) {
|
|
5828
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5829
|
-
}
|
|
5830
5867
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5831
5868
|
'googleSearchRetrieval',
|
|
5832
5869
|
]);
|
|
@@ -5837,6 +5874,16 @@ function toolToMldev$3(fromObject) {
|
|
|
5837
5874
|
if (fromUrlContext != null) {
|
|
5838
5875
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5839
5876
|
}
|
|
5877
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
5878
|
+
if (fromMcpServers != null) {
|
|
5879
|
+
let transformedList = fromMcpServers;
|
|
5880
|
+
if (Array.isArray(transformedList)) {
|
|
5881
|
+
transformedList = transformedList.map((item) => {
|
|
5882
|
+
return item;
|
|
5883
|
+
});
|
|
5884
|
+
}
|
|
5885
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5886
|
+
}
|
|
5840
5887
|
return toObject;
|
|
5841
5888
|
}
|
|
5842
5889
|
function toolToVertex$2(fromObject) {
|
|
@@ -5852,6 +5899,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5852
5899
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
5853
5900
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
5854
5901
|
}
|
|
5902
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5903
|
+
if (fromGoogleSearch != null) {
|
|
5904
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5905
|
+
}
|
|
5855
5906
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5856
5907
|
'codeExecution',
|
|
5857
5908
|
]);
|
|
@@ -5880,10 +5931,6 @@ function toolToVertex$2(fromObject) {
|
|
|
5880
5931
|
if (fromGoogleMaps != null) {
|
|
5881
5932
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5882
5933
|
}
|
|
5883
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5884
|
-
if (fromGoogleSearch != null) {
|
|
5885
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5886
|
-
}
|
|
5887
5934
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5888
5935
|
'googleSearchRetrieval',
|
|
5889
5936
|
]);
|
|
@@ -5894,6 +5941,9 @@ function toolToVertex$2(fromObject) {
|
|
|
5894
5941
|
if (fromUrlContext != null) {
|
|
5895
5942
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5896
5943
|
}
|
|
5944
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
5945
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
5946
|
+
}
|
|
5897
5947
|
return toObject;
|
|
5898
5948
|
}
|
|
5899
5949
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7427,6 +7477,10 @@ function googleMapsToMldev$2(fromObject) {
|
|
|
7427
7477
|
}
|
|
7428
7478
|
function googleSearchToMldev$2(fromObject) {
|
|
7429
7479
|
const toObject = {};
|
|
7480
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
7481
|
+
if (fromSearchTypes != null) {
|
|
7482
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7483
|
+
}
|
|
7430
7484
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7431
7485
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7432
7486
|
}
|
|
@@ -7942,6 +7996,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7942
7996
|
if (fromFileSearch != null) {
|
|
7943
7997
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
7944
7998
|
}
|
|
7999
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8000
|
+
if (fromGoogleSearch != null) {
|
|
8001
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8002
|
+
}
|
|
7945
8003
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7946
8004
|
'codeExecution',
|
|
7947
8005
|
]);
|
|
@@ -7967,10 +8025,6 @@ function toolToMldev$2(fromObject) {
|
|
|
7967
8025
|
if (fromGoogleMaps != null) {
|
|
7968
8026
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
7969
8027
|
}
|
|
7970
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7971
|
-
if (fromGoogleSearch != null) {
|
|
7972
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
7973
|
-
}
|
|
7974
8028
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7975
8029
|
'googleSearchRetrieval',
|
|
7976
8030
|
]);
|
|
@@ -7981,6 +8035,16 @@ function toolToMldev$2(fromObject) {
|
|
|
7981
8035
|
if (fromUrlContext != null) {
|
|
7982
8036
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
7983
8037
|
}
|
|
8038
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
8039
|
+
if (fromMcpServers != null) {
|
|
8040
|
+
let transformedList = fromMcpServers;
|
|
8041
|
+
if (Array.isArray(transformedList)) {
|
|
8042
|
+
transformedList = transformedList.map((item) => {
|
|
8043
|
+
return item;
|
|
8044
|
+
});
|
|
8045
|
+
}
|
|
8046
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
8047
|
+
}
|
|
7984
8048
|
return toObject;
|
|
7985
8049
|
}
|
|
7986
8050
|
function toolToVertex$1(fromObject) {
|
|
@@ -7996,6 +8060,10 @@ function toolToVertex$1(fromObject) {
|
|
|
7996
8060
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
7997
8061
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
7998
8062
|
}
|
|
8063
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8064
|
+
if (fromGoogleSearch != null) {
|
|
8065
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8066
|
+
}
|
|
7999
8067
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8000
8068
|
'codeExecution',
|
|
8001
8069
|
]);
|
|
@@ -8024,10 +8092,6 @@ function toolToVertex$1(fromObject) {
|
|
|
8024
8092
|
if (fromGoogleMaps != null) {
|
|
8025
8093
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8026
8094
|
}
|
|
8027
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8028
|
-
if (fromGoogleSearch != null) {
|
|
8029
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8030
|
-
}
|
|
8031
8095
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8032
8096
|
'googleSearchRetrieval',
|
|
8033
8097
|
]);
|
|
@@ -8038,6 +8102,9 @@ function toolToVertex$1(fromObject) {
|
|
|
8038
8102
|
if (fromUrlContext != null) {
|
|
8039
8103
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8040
8104
|
}
|
|
8105
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
8106
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
8107
|
+
}
|
|
8041
8108
|
return toObject;
|
|
8042
8109
|
}
|
|
8043
8110
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -8181,16 +8248,16 @@ function candidateFromMldev(fromObject, rootObject) {
|
|
|
8181
8248
|
if (fromFinishReason != null) {
|
|
8182
8249
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
8183
8250
|
}
|
|
8184
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8185
|
-
if (fromAvgLogprobs != null) {
|
|
8186
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8187
|
-
}
|
|
8188
8251
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8189
8252
|
'groundingMetadata',
|
|
8190
8253
|
]);
|
|
8191
8254
|
if (fromGroundingMetadata != null) {
|
|
8192
8255
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8193
8256
|
}
|
|
8257
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8258
|
+
if (fromAvgLogprobs != null) {
|
|
8259
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8260
|
+
}
|
|
8194
8261
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
8195
8262
|
if (fromIndex != null) {
|
|
8196
8263
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -10307,6 +10374,10 @@ function googleMapsToMldev$1(fromObject, _rootObject) {
|
|
|
10307
10374
|
}
|
|
10308
10375
|
function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
10309
10376
|
const toObject = {};
|
|
10377
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
10378
|
+
if (fromSearchTypes != null) {
|
|
10379
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10380
|
+
}
|
|
10310
10381
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10311
10382
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10312
10383
|
}
|
|
@@ -10334,6 +10405,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10334
10405
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10335
10406
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10336
10407
|
}
|
|
10408
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
10409
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
10410
|
+
}
|
|
10337
10411
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10338
10412
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10339
10413
|
}
|
|
@@ -10359,6 +10433,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10359
10433
|
if (fromPersonGeneration != null) {
|
|
10360
10434
|
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10361
10435
|
}
|
|
10436
|
+
const fromProminentPeople = getValueByPath(fromObject, [
|
|
10437
|
+
'prominentPeople',
|
|
10438
|
+
]);
|
|
10439
|
+
if (fromProminentPeople != null) {
|
|
10440
|
+
setValueByPath(toObject, ['prominentPeople'], fromProminentPeople);
|
|
10441
|
+
}
|
|
10362
10442
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10363
10443
|
'outputMimeType',
|
|
10364
10444
|
]);
|
|
@@ -11086,6 +11166,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11086
11166
|
if (fromFileSearch != null) {
|
|
11087
11167
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
11088
11168
|
}
|
|
11169
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11170
|
+
if (fromGoogleSearch != null) {
|
|
11171
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11172
|
+
}
|
|
11089
11173
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11090
11174
|
'codeExecution',
|
|
11091
11175
|
]);
|
|
@@ -11111,10 +11195,6 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11111
11195
|
if (fromGoogleMaps != null) {
|
|
11112
11196
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11113
11197
|
}
|
|
11114
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11115
|
-
if (fromGoogleSearch != null) {
|
|
11116
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11117
|
-
}
|
|
11118
11198
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11119
11199
|
'googleSearchRetrieval',
|
|
11120
11200
|
]);
|
|
@@ -11125,6 +11205,16 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11125
11205
|
if (fromUrlContext != null) {
|
|
11126
11206
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11127
11207
|
}
|
|
11208
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
11209
|
+
if (fromMcpServers != null) {
|
|
11210
|
+
let transformedList = fromMcpServers;
|
|
11211
|
+
if (Array.isArray(transformedList)) {
|
|
11212
|
+
transformedList = transformedList.map((item) => {
|
|
11213
|
+
return item;
|
|
11214
|
+
});
|
|
11215
|
+
}
|
|
11216
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
11217
|
+
}
|
|
11128
11218
|
return toObject;
|
|
11129
11219
|
}
|
|
11130
11220
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -11140,6 +11230,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11140
11230
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
11141
11231
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
11142
11232
|
}
|
|
11233
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11234
|
+
if (fromGoogleSearch != null) {
|
|
11235
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11236
|
+
}
|
|
11143
11237
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11144
11238
|
'codeExecution',
|
|
11145
11239
|
]);
|
|
@@ -11168,10 +11262,6 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11168
11262
|
if (fromGoogleMaps != null) {
|
|
11169
11263
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11170
11264
|
}
|
|
11171
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11172
|
-
if (fromGoogleSearch != null) {
|
|
11173
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11174
|
-
}
|
|
11175
11265
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11176
11266
|
'googleSearchRetrieval',
|
|
11177
11267
|
]);
|
|
@@ -11182,6 +11272,9 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11182
11272
|
if (fromUrlContext != null) {
|
|
11183
11273
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11184
11274
|
}
|
|
11275
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
11276
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
11277
|
+
}
|
|
11185
11278
|
return toObject;
|
|
11186
11279
|
}
|
|
11187
11280
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -11738,7 +11831,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11738
11831
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11739
11832
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11740
11833
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11741
|
-
const SDK_VERSION = '1.
|
|
11834
|
+
const SDK_VERSION = '1.43.0'; // x-release-please-version
|
|
11742
11835
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11743
11836
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11744
11837
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -15191,6 +15284,10 @@ function googleMapsToMldev(fromObject) {
|
|
|
15191
15284
|
}
|
|
15192
15285
|
function googleSearchToMldev(fromObject) {
|
|
15193
15286
|
const toObject = {};
|
|
15287
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
15288
|
+
if (fromSearchTypes != null) {
|
|
15289
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15290
|
+
}
|
|
15194
15291
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15195
15292
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15196
15293
|
}
|
|
@@ -15414,6 +15511,10 @@ function toolToMldev(fromObject) {
|
|
|
15414
15511
|
if (fromFileSearch != null) {
|
|
15415
15512
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
15416
15513
|
}
|
|
15514
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15515
|
+
if (fromGoogleSearch != null) {
|
|
15516
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15517
|
+
}
|
|
15417
15518
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15418
15519
|
'codeExecution',
|
|
15419
15520
|
]);
|
|
@@ -15439,10 +15540,6 @@ function toolToMldev(fromObject) {
|
|
|
15439
15540
|
if (fromGoogleMaps != null) {
|
|
15440
15541
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15441
15542
|
}
|
|
15442
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15443
|
-
if (fromGoogleSearch != null) {
|
|
15444
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15445
|
-
}
|
|
15446
15543
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15447
15544
|
'googleSearchRetrieval',
|
|
15448
15545
|
]);
|
|
@@ -15453,6 +15550,16 @@ function toolToMldev(fromObject) {
|
|
|
15453
15550
|
if (fromUrlContext != null) {
|
|
15454
15551
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
15455
15552
|
}
|
|
15553
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
15554
|
+
if (fromMcpServers != null) {
|
|
15555
|
+
let transformedList = fromMcpServers;
|
|
15556
|
+
if (Array.isArray(transformedList)) {
|
|
15557
|
+
transformedList = transformedList.map((item) => {
|
|
15558
|
+
return item;
|
|
15559
|
+
});
|
|
15560
|
+
}
|
|
15561
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15562
|
+
}
|
|
15456
15563
|
return toObject;
|
|
15457
15564
|
}
|
|
15458
15565
|
|
|
@@ -16910,14 +17017,17 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(st
|
|
|
16910
17017
|
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
16911
17018
|
}, '');
|
|
16912
17019
|
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
16913
|
-
const invalidSegmentPattern = /(
|
|
17020
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
16914
17021
|
let match;
|
|
16915
17022
|
// Find all invalid segments
|
|
16916
17023
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
17024
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
17025
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
17026
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
16917
17027
|
invalidSegments.push({
|
|
16918
|
-
start: match.index,
|
|
16919
|
-
length:
|
|
16920
|
-
error: `Value "${
|
|
17028
|
+
start: match.index + offset,
|
|
17029
|
+
length: cleanMatch.length,
|
|
17030
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
16921
17031
|
});
|
|
16922
17032
|
}
|
|
16923
17033
|
invalidSegments.sort((a, b) => a.start - b.start);
|
|
@@ -19748,5 +19858,5 @@ class GoogleGenAI {
|
|
|
19748
19858
|
}
|
|
19749
19859
|
}
|
|
19750
19860
|
|
|
19751
|
-
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 };
|
|
19861
|
+
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 };
|
|
19752
19862
|
//# sourceMappingURL=index.mjs.map
|