@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.cjs
CHANGED
|
@@ -704,6 +704,38 @@ exports.Type = void 0;
|
|
|
704
704
|
*/
|
|
705
705
|
Type["NULL"] = "NULL";
|
|
706
706
|
})(exports.Type || (exports.Type = {}));
|
|
707
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
708
|
+
exports.PhishBlockThreshold = void 0;
|
|
709
|
+
(function (PhishBlockThreshold) {
|
|
710
|
+
/**
|
|
711
|
+
* Defaults to unspecified.
|
|
712
|
+
*/
|
|
713
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
714
|
+
/**
|
|
715
|
+
* Blocks Low and above confidence URL that is risky.
|
|
716
|
+
*/
|
|
717
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
718
|
+
/**
|
|
719
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
720
|
+
*/
|
|
721
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
722
|
+
/**
|
|
723
|
+
* Blocks High and above confidence URL that is risky.
|
|
724
|
+
*/
|
|
725
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
726
|
+
/**
|
|
727
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
728
|
+
*/
|
|
729
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
730
|
+
/**
|
|
731
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
732
|
+
*/
|
|
733
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
734
|
+
/**
|
|
735
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
736
|
+
*/
|
|
737
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
738
|
+
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
707
739
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
708
740
|
exports.ApiSpec = void 0;
|
|
709
741
|
(function (ApiSpec) {
|
|
@@ -774,38 +806,6 @@ exports.HttpElementLocation = void 0;
|
|
|
774
806
|
*/
|
|
775
807
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
776
808
|
})(exports.HttpElementLocation || (exports.HttpElementLocation = {}));
|
|
777
|
-
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
778
|
-
exports.PhishBlockThreshold = void 0;
|
|
779
|
-
(function (PhishBlockThreshold) {
|
|
780
|
-
/**
|
|
781
|
-
* Defaults to unspecified.
|
|
782
|
-
*/
|
|
783
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
784
|
-
/**
|
|
785
|
-
* Blocks Low and above confidence URL that is risky.
|
|
786
|
-
*/
|
|
787
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
788
|
-
/**
|
|
789
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
790
|
-
*/
|
|
791
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
792
|
-
/**
|
|
793
|
-
* Blocks High and above confidence URL that is risky.
|
|
794
|
-
*/
|
|
795
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
796
|
-
/**
|
|
797
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
798
|
-
*/
|
|
799
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
800
|
-
/**
|
|
801
|
-
* Blocks Very high and above confidence URL that is risky.
|
|
802
|
-
*/
|
|
803
|
-
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
804
|
-
/**
|
|
805
|
-
* Blocks Extremely high confidence URL that is risky.
|
|
806
|
-
*/
|
|
807
|
-
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
808
|
-
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
809
809
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
810
810
|
exports.Behavior = void 0;
|
|
811
811
|
(function (Behavior) {
|
|
@@ -1388,6 +1388,22 @@ exports.Environment = void 0;
|
|
|
1388
1388
|
*/
|
|
1389
1389
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1390
1390
|
})(exports.Environment || (exports.Environment = {}));
|
|
1391
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1392
|
+
exports.ProminentPeople = void 0;
|
|
1393
|
+
(function (ProminentPeople) {
|
|
1394
|
+
/**
|
|
1395
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
1396
|
+
*/
|
|
1397
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
1398
|
+
/**
|
|
1399
|
+
* Allows the model to generate images of prominent people.
|
|
1400
|
+
*/
|
|
1401
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
1402
|
+
/**
|
|
1403
|
+
* Prevents the model from generating images of prominent people.
|
|
1404
|
+
*/
|
|
1405
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
1406
|
+
})(exports.ProminentPeople || (exports.ProminentPeople = {}));
|
|
1391
1407
|
/** Enum representing the Vertex embedding API to use. */
|
|
1392
1408
|
exports.EmbeddingApiType = void 0;
|
|
1393
1409
|
(function (EmbeddingApiType) {
|
|
@@ -3746,16 +3762,16 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3746
3762
|
if (fromFinishReason != null) {
|
|
3747
3763
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
3748
3764
|
}
|
|
3749
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3750
|
-
if (fromAvgLogprobs != null) {
|
|
3751
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3752
|
-
}
|
|
3753
3765
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
3754
3766
|
'groundingMetadata',
|
|
3755
3767
|
]);
|
|
3756
3768
|
if (fromGroundingMetadata != null) {
|
|
3757
3769
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
3758
3770
|
}
|
|
3771
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3772
|
+
if (fromAvgLogprobs != null) {
|
|
3773
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3774
|
+
}
|
|
3759
3775
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
3760
3776
|
if (fromIndex != null) {
|
|
3761
3777
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -4301,6 +4317,10 @@ function googleMapsToMldev$4(fromObject) {
|
|
|
4301
4317
|
}
|
|
4302
4318
|
function googleSearchToMldev$4(fromObject) {
|
|
4303
4319
|
const toObject = {};
|
|
4320
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
4321
|
+
if (fromSearchTypes != null) {
|
|
4322
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4323
|
+
}
|
|
4304
4324
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4305
4325
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4306
4326
|
}
|
|
@@ -4328,6 +4348,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4328
4348
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4329
4349
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4330
4350
|
}
|
|
4351
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4352
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
4353
|
+
}
|
|
4331
4354
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4332
4355
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4333
4356
|
}
|
|
@@ -4584,6 +4607,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4584
4607
|
if (fromFileSearch != null) {
|
|
4585
4608
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
4586
4609
|
}
|
|
4610
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4611
|
+
if (fromGoogleSearch != null) {
|
|
4612
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4613
|
+
}
|
|
4587
4614
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4588
4615
|
'codeExecution',
|
|
4589
4616
|
]);
|
|
@@ -4609,10 +4636,6 @@ function toolToMldev$4(fromObject) {
|
|
|
4609
4636
|
if (fromGoogleMaps != null) {
|
|
4610
4637
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4611
4638
|
}
|
|
4612
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4613
|
-
if (fromGoogleSearch != null) {
|
|
4614
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4615
|
-
}
|
|
4616
4639
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4617
4640
|
'googleSearchRetrieval',
|
|
4618
4641
|
]);
|
|
@@ -4623,6 +4646,16 @@ function toolToMldev$4(fromObject) {
|
|
|
4623
4646
|
if (fromUrlContext != null) {
|
|
4624
4647
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
4625
4648
|
}
|
|
4649
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
4650
|
+
if (fromMcpServers != null) {
|
|
4651
|
+
let transformedList = fromMcpServers;
|
|
4652
|
+
if (Array.isArray(transformedList)) {
|
|
4653
|
+
transformedList = transformedList.map((item) => {
|
|
4654
|
+
return item;
|
|
4655
|
+
});
|
|
4656
|
+
}
|
|
4657
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
4658
|
+
}
|
|
4626
4659
|
return toObject;
|
|
4627
4660
|
}
|
|
4628
4661
|
|
|
@@ -5629,6 +5662,10 @@ function googleMapsToMldev$3(fromObject) {
|
|
|
5629
5662
|
}
|
|
5630
5663
|
function googleSearchToMldev$3(fromObject) {
|
|
5631
5664
|
const toObject = {};
|
|
5665
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
5666
|
+
if (fromSearchTypes != null) {
|
|
5667
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5668
|
+
}
|
|
5632
5669
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5633
5670
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5634
5671
|
}
|
|
@@ -5828,6 +5865,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5828
5865
|
if (fromFileSearch != null) {
|
|
5829
5866
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
5830
5867
|
}
|
|
5868
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5869
|
+
if (fromGoogleSearch != null) {
|
|
5870
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5871
|
+
}
|
|
5831
5872
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5832
5873
|
'codeExecution',
|
|
5833
5874
|
]);
|
|
@@ -5853,10 +5894,6 @@ function toolToMldev$3(fromObject) {
|
|
|
5853
5894
|
if (fromGoogleMaps != null) {
|
|
5854
5895
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5855
5896
|
}
|
|
5856
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5857
|
-
if (fromGoogleSearch != null) {
|
|
5858
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5859
|
-
}
|
|
5860
5897
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5861
5898
|
'googleSearchRetrieval',
|
|
5862
5899
|
]);
|
|
@@ -5867,6 +5904,16 @@ function toolToMldev$3(fromObject) {
|
|
|
5867
5904
|
if (fromUrlContext != null) {
|
|
5868
5905
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5869
5906
|
}
|
|
5907
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
5908
|
+
if (fromMcpServers != null) {
|
|
5909
|
+
let transformedList = fromMcpServers;
|
|
5910
|
+
if (Array.isArray(transformedList)) {
|
|
5911
|
+
transformedList = transformedList.map((item) => {
|
|
5912
|
+
return item;
|
|
5913
|
+
});
|
|
5914
|
+
}
|
|
5915
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5916
|
+
}
|
|
5870
5917
|
return toObject;
|
|
5871
5918
|
}
|
|
5872
5919
|
function toolToVertex$2(fromObject) {
|
|
@@ -5882,6 +5929,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5882
5929
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
5883
5930
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
5884
5931
|
}
|
|
5932
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5933
|
+
if (fromGoogleSearch != null) {
|
|
5934
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5935
|
+
}
|
|
5885
5936
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5886
5937
|
'codeExecution',
|
|
5887
5938
|
]);
|
|
@@ -5910,10 +5961,6 @@ function toolToVertex$2(fromObject) {
|
|
|
5910
5961
|
if (fromGoogleMaps != null) {
|
|
5911
5962
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5912
5963
|
}
|
|
5913
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5914
|
-
if (fromGoogleSearch != null) {
|
|
5915
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5916
|
-
}
|
|
5917
5964
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5918
5965
|
'googleSearchRetrieval',
|
|
5919
5966
|
]);
|
|
@@ -5924,6 +5971,9 @@ function toolToVertex$2(fromObject) {
|
|
|
5924
5971
|
if (fromUrlContext != null) {
|
|
5925
5972
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5926
5973
|
}
|
|
5974
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
5975
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
5976
|
+
}
|
|
5927
5977
|
return toObject;
|
|
5928
5978
|
}
|
|
5929
5979
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7457,6 +7507,10 @@ function googleMapsToMldev$2(fromObject) {
|
|
|
7457
7507
|
}
|
|
7458
7508
|
function googleSearchToMldev$2(fromObject) {
|
|
7459
7509
|
const toObject = {};
|
|
7510
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
7511
|
+
if (fromSearchTypes != null) {
|
|
7512
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
7513
|
+
}
|
|
7460
7514
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
7461
7515
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
7462
7516
|
}
|
|
@@ -7972,6 +8026,10 @@ function toolToMldev$2(fromObject) {
|
|
|
7972
8026
|
if (fromFileSearch != null) {
|
|
7973
8027
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
7974
8028
|
}
|
|
8029
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8030
|
+
if (fromGoogleSearch != null) {
|
|
8031
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8032
|
+
}
|
|
7975
8033
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7976
8034
|
'codeExecution',
|
|
7977
8035
|
]);
|
|
@@ -7997,10 +8055,6 @@ function toolToMldev$2(fromObject) {
|
|
|
7997
8055
|
if (fromGoogleMaps != null) {
|
|
7998
8056
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
7999
8057
|
}
|
|
8000
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8001
|
-
if (fromGoogleSearch != null) {
|
|
8002
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
8003
|
-
}
|
|
8004
8058
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8005
8059
|
'googleSearchRetrieval',
|
|
8006
8060
|
]);
|
|
@@ -8011,6 +8065,16 @@ function toolToMldev$2(fromObject) {
|
|
|
8011
8065
|
if (fromUrlContext != null) {
|
|
8012
8066
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8013
8067
|
}
|
|
8068
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
8069
|
+
if (fromMcpServers != null) {
|
|
8070
|
+
let transformedList = fromMcpServers;
|
|
8071
|
+
if (Array.isArray(transformedList)) {
|
|
8072
|
+
transformedList = transformedList.map((item) => {
|
|
8073
|
+
return item;
|
|
8074
|
+
});
|
|
8075
|
+
}
|
|
8076
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
8077
|
+
}
|
|
8014
8078
|
return toObject;
|
|
8015
8079
|
}
|
|
8016
8080
|
function toolToVertex$1(fromObject) {
|
|
@@ -8026,6 +8090,10 @@ function toolToVertex$1(fromObject) {
|
|
|
8026
8090
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8027
8091
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
8028
8092
|
}
|
|
8093
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8094
|
+
if (fromGoogleSearch != null) {
|
|
8095
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8096
|
+
}
|
|
8029
8097
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
8030
8098
|
'codeExecution',
|
|
8031
8099
|
]);
|
|
@@ -8054,10 +8122,6 @@ function toolToVertex$1(fromObject) {
|
|
|
8054
8122
|
if (fromGoogleMaps != null) {
|
|
8055
8123
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
8056
8124
|
}
|
|
8057
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8058
|
-
if (fromGoogleSearch != null) {
|
|
8059
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
8060
|
-
}
|
|
8061
8125
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
8062
8126
|
'googleSearchRetrieval',
|
|
8063
8127
|
]);
|
|
@@ -8068,6 +8132,9 @@ function toolToVertex$1(fromObject) {
|
|
|
8068
8132
|
if (fromUrlContext != null) {
|
|
8069
8133
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8070
8134
|
}
|
|
8135
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
8136
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
8137
|
+
}
|
|
8071
8138
|
return toObject;
|
|
8072
8139
|
}
|
|
8073
8140
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -8211,16 +8278,16 @@ function candidateFromMldev(fromObject, rootObject) {
|
|
|
8211
8278
|
if (fromFinishReason != null) {
|
|
8212
8279
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
8213
8280
|
}
|
|
8214
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8215
|
-
if (fromAvgLogprobs != null) {
|
|
8216
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8217
|
-
}
|
|
8218
8281
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8219
8282
|
'groundingMetadata',
|
|
8220
8283
|
]);
|
|
8221
8284
|
if (fromGroundingMetadata != null) {
|
|
8222
8285
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8223
8286
|
}
|
|
8287
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
8288
|
+
if (fromAvgLogprobs != null) {
|
|
8289
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
8290
|
+
}
|
|
8224
8291
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
8225
8292
|
if (fromIndex != null) {
|
|
8226
8293
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -10337,6 +10404,10 @@ function googleMapsToMldev$1(fromObject, _rootObject) {
|
|
|
10337
10404
|
}
|
|
10338
10405
|
function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
10339
10406
|
const toObject = {};
|
|
10407
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
10408
|
+
if (fromSearchTypes != null) {
|
|
10409
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
10410
|
+
}
|
|
10340
10411
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10341
10412
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10342
10413
|
}
|
|
@@ -10364,6 +10435,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
10364
10435
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
10365
10436
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
10366
10437
|
}
|
|
10438
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
10439
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
10440
|
+
}
|
|
10367
10441
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
10368
10442
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
10369
10443
|
}
|
|
@@ -10389,6 +10463,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
10389
10463
|
if (fromPersonGeneration != null) {
|
|
10390
10464
|
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
10391
10465
|
}
|
|
10466
|
+
const fromProminentPeople = getValueByPath(fromObject, [
|
|
10467
|
+
'prominentPeople',
|
|
10468
|
+
]);
|
|
10469
|
+
if (fromProminentPeople != null) {
|
|
10470
|
+
setValueByPath(toObject, ['prominentPeople'], fromProminentPeople);
|
|
10471
|
+
}
|
|
10392
10472
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
10393
10473
|
'outputMimeType',
|
|
10394
10474
|
]);
|
|
@@ -11116,6 +11196,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11116
11196
|
if (fromFileSearch != null) {
|
|
11117
11197
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
11118
11198
|
}
|
|
11199
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11200
|
+
if (fromGoogleSearch != null) {
|
|
11201
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11202
|
+
}
|
|
11119
11203
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11120
11204
|
'codeExecution',
|
|
11121
11205
|
]);
|
|
@@ -11141,10 +11225,6 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11141
11225
|
if (fromGoogleMaps != null) {
|
|
11142
11226
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
11143
11227
|
}
|
|
11144
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11145
|
-
if (fromGoogleSearch != null) {
|
|
11146
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
11147
|
-
}
|
|
11148
11228
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11149
11229
|
'googleSearchRetrieval',
|
|
11150
11230
|
]);
|
|
@@ -11155,6 +11235,16 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
11155
11235
|
if (fromUrlContext != null) {
|
|
11156
11236
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11157
11237
|
}
|
|
11238
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
11239
|
+
if (fromMcpServers != null) {
|
|
11240
|
+
let transformedList = fromMcpServers;
|
|
11241
|
+
if (Array.isArray(transformedList)) {
|
|
11242
|
+
transformedList = transformedList.map((item) => {
|
|
11243
|
+
return item;
|
|
11244
|
+
});
|
|
11245
|
+
}
|
|
11246
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
11247
|
+
}
|
|
11158
11248
|
return toObject;
|
|
11159
11249
|
}
|
|
11160
11250
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -11170,6 +11260,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11170
11260
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
11171
11261
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
11172
11262
|
}
|
|
11263
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11264
|
+
if (fromGoogleSearch != null) {
|
|
11265
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11266
|
+
}
|
|
11173
11267
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11174
11268
|
'codeExecution',
|
|
11175
11269
|
]);
|
|
@@ -11198,10 +11292,6 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11198
11292
|
if (fromGoogleMaps != null) {
|
|
11199
11293
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11200
11294
|
}
|
|
11201
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11202
|
-
if (fromGoogleSearch != null) {
|
|
11203
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11204
|
-
}
|
|
11205
11295
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11206
11296
|
'googleSearchRetrieval',
|
|
11207
11297
|
]);
|
|
@@ -11212,6 +11302,9 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
11212
11302
|
if (fromUrlContext != null) {
|
|
11213
11303
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11214
11304
|
}
|
|
11305
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
11306
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
11307
|
+
}
|
|
11215
11308
|
return toObject;
|
|
11216
11309
|
}
|
|
11217
11310
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -11768,7 +11861,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
11768
11861
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
11769
11862
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
11770
11863
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
11771
|
-
const SDK_VERSION = '1.
|
|
11864
|
+
const SDK_VERSION = '1.43.0'; // x-release-please-version
|
|
11772
11865
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
11773
11866
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
11774
11867
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -15221,6 +15314,10 @@ function googleMapsToMldev(fromObject) {
|
|
|
15221
15314
|
}
|
|
15222
15315
|
function googleSearchToMldev(fromObject) {
|
|
15223
15316
|
const toObject = {};
|
|
15317
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
15318
|
+
if (fromSearchTypes != null) {
|
|
15319
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
15320
|
+
}
|
|
15224
15321
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
15225
15322
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
15226
15323
|
}
|
|
@@ -15444,6 +15541,10 @@ function toolToMldev(fromObject) {
|
|
|
15444
15541
|
if (fromFileSearch != null) {
|
|
15445
15542
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
15446
15543
|
}
|
|
15544
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15545
|
+
if (fromGoogleSearch != null) {
|
|
15546
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15547
|
+
}
|
|
15447
15548
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
15448
15549
|
'codeExecution',
|
|
15449
15550
|
]);
|
|
@@ -15469,10 +15570,6 @@ function toolToMldev(fromObject) {
|
|
|
15469
15570
|
if (fromGoogleMaps != null) {
|
|
15470
15571
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
15471
15572
|
}
|
|
15472
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15473
|
-
if (fromGoogleSearch != null) {
|
|
15474
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
15475
|
-
}
|
|
15476
15573
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
15477
15574
|
'googleSearchRetrieval',
|
|
15478
15575
|
]);
|
|
@@ -15483,6 +15580,16 @@ function toolToMldev(fromObject) {
|
|
|
15483
15580
|
if (fromUrlContext != null) {
|
|
15484
15581
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
15485
15582
|
}
|
|
15583
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
15584
|
+
if (fromMcpServers != null) {
|
|
15585
|
+
let transformedList = fromMcpServers;
|
|
15586
|
+
if (Array.isArray(transformedList)) {
|
|
15587
|
+
transformedList = transformedList.map((item) => {
|
|
15588
|
+
return item;
|
|
15589
|
+
});
|
|
15590
|
+
}
|
|
15591
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15592
|
+
}
|
|
15486
15593
|
return toObject;
|
|
15487
15594
|
}
|
|
15488
15595
|
|
|
@@ -16940,14 +17047,17 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(st
|
|
|
16940
17047
|
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
16941
17048
|
}, '');
|
|
16942
17049
|
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
16943
|
-
const invalidSegmentPattern = /(
|
|
17050
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
16944
17051
|
let match;
|
|
16945
17052
|
// Find all invalid segments
|
|
16946
17053
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
17054
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
17055
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
17056
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
16947
17057
|
invalidSegments.push({
|
|
16948
|
-
start: match.index,
|
|
16949
|
-
length:
|
|
16950
|
-
error: `Value "${
|
|
17058
|
+
start: match.index + offset,
|
|
17059
|
+
length: cleanMatch.length,
|
|
17060
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
16951
17061
|
});
|
|
16952
17062
|
}
|
|
16953
17063
|
invalidSegments.sort((a, b) => a.start - b.start);
|