@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/index.mjs
CHANGED
|
@@ -644,6 +644,38 @@ var Type;
|
|
|
644
644
|
*/
|
|
645
645
|
Type["NULL"] = "NULL";
|
|
646
646
|
})(Type || (Type = {}));
|
|
647
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
648
|
+
var PhishBlockThreshold;
|
|
649
|
+
(function (PhishBlockThreshold) {
|
|
650
|
+
/**
|
|
651
|
+
* Defaults to unspecified.
|
|
652
|
+
*/
|
|
653
|
+
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
654
|
+
/**
|
|
655
|
+
* Blocks Low and above confidence URL that is risky.
|
|
656
|
+
*/
|
|
657
|
+
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
658
|
+
/**
|
|
659
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
660
|
+
*/
|
|
661
|
+
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
662
|
+
/**
|
|
663
|
+
* Blocks High and above confidence URL that is risky.
|
|
664
|
+
*/
|
|
665
|
+
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
666
|
+
/**
|
|
667
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
668
|
+
*/
|
|
669
|
+
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
670
|
+
/**
|
|
671
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
672
|
+
*/
|
|
673
|
+
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
674
|
+
/**
|
|
675
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
676
|
+
*/
|
|
677
|
+
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
678
|
+
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
647
679
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
648
680
|
var ApiSpec;
|
|
649
681
|
(function (ApiSpec) {
|
|
@@ -714,38 +746,6 @@ var HttpElementLocation;
|
|
|
714
746
|
*/
|
|
715
747
|
HttpElementLocation["HTTP_IN_COOKIE"] = "HTTP_IN_COOKIE";
|
|
716
748
|
})(HttpElementLocation || (HttpElementLocation = {}));
|
|
717
|
-
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
718
|
-
var PhishBlockThreshold;
|
|
719
|
-
(function (PhishBlockThreshold) {
|
|
720
|
-
/**
|
|
721
|
-
* Defaults to unspecified.
|
|
722
|
-
*/
|
|
723
|
-
PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
|
|
724
|
-
/**
|
|
725
|
-
* Blocks Low and above confidence URL that is risky.
|
|
726
|
-
*/
|
|
727
|
-
PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
|
|
728
|
-
/**
|
|
729
|
-
* Blocks Medium and above confidence URL that is risky.
|
|
730
|
-
*/
|
|
731
|
-
PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
|
|
732
|
-
/**
|
|
733
|
-
* Blocks High and above confidence URL that is risky.
|
|
734
|
-
*/
|
|
735
|
-
PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
|
|
736
|
-
/**
|
|
737
|
-
* Blocks Higher and above confidence URL that is risky.
|
|
738
|
-
*/
|
|
739
|
-
PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
|
|
740
|
-
/**
|
|
741
|
-
* Blocks Very high and above confidence URL that is risky.
|
|
742
|
-
*/
|
|
743
|
-
PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
|
|
744
|
-
/**
|
|
745
|
-
* Blocks Extremely high confidence URL that is risky.
|
|
746
|
-
*/
|
|
747
|
-
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
748
|
-
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
749
749
|
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
750
750
|
var Behavior;
|
|
751
751
|
(function (Behavior) {
|
|
@@ -1328,6 +1328,22 @@ var Environment;
|
|
|
1328
1328
|
*/
|
|
1329
1329
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
1330
1330
|
})(Environment || (Environment = {}));
|
|
1331
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
1332
|
+
var ProminentPeople;
|
|
1333
|
+
(function (ProminentPeople) {
|
|
1334
|
+
/**
|
|
1335
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
1336
|
+
*/
|
|
1337
|
+
ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
|
|
1338
|
+
/**
|
|
1339
|
+
* Allows the model to generate images of prominent people.
|
|
1340
|
+
*/
|
|
1341
|
+
ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
|
|
1342
|
+
/**
|
|
1343
|
+
* Prevents the model from generating images of prominent people.
|
|
1344
|
+
*/
|
|
1345
|
+
ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
|
|
1346
|
+
})(ProminentPeople || (ProminentPeople = {}));
|
|
1331
1347
|
/** Enum representing the Vertex embedding API to use. */
|
|
1332
1348
|
var EmbeddingApiType;
|
|
1333
1349
|
(function (EmbeddingApiType) {
|
|
@@ -3686,16 +3702,16 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3686
3702
|
if (fromFinishReason != null) {
|
|
3687
3703
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
3688
3704
|
}
|
|
3689
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3690
|
-
if (fromAvgLogprobs != null) {
|
|
3691
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3692
|
-
}
|
|
3693
3705
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
3694
3706
|
'groundingMetadata',
|
|
3695
3707
|
]);
|
|
3696
3708
|
if (fromGroundingMetadata != null) {
|
|
3697
3709
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
3698
3710
|
}
|
|
3711
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
3712
|
+
if (fromAvgLogprobs != null) {
|
|
3713
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
3714
|
+
}
|
|
3699
3715
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
3700
3716
|
if (fromIndex != null) {
|
|
3701
3717
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -4241,6 +4257,10 @@ function googleMapsToMldev$4(fromObject) {
|
|
|
4241
4257
|
}
|
|
4242
4258
|
function googleSearchToMldev$4(fromObject) {
|
|
4243
4259
|
const toObject = {};
|
|
4260
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
4261
|
+
if (fromSearchTypes != null) {
|
|
4262
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4263
|
+
}
|
|
4244
4264
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4245
4265
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
4246
4266
|
}
|
|
@@ -4268,6 +4288,9 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4268
4288
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4269
4289
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
4270
4290
|
}
|
|
4291
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4292
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
4293
|
+
}
|
|
4271
4294
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4272
4295
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
4273
4296
|
}
|
|
@@ -4524,6 +4547,10 @@ function toolToMldev$4(fromObject) {
|
|
|
4524
4547
|
if (fromFileSearch != null) {
|
|
4525
4548
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
4526
4549
|
}
|
|
4550
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4551
|
+
if (fromGoogleSearch != null) {
|
|
4552
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4553
|
+
}
|
|
4527
4554
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
4528
4555
|
'codeExecution',
|
|
4529
4556
|
]);
|
|
@@ -4549,10 +4576,6 @@ function toolToMldev$4(fromObject) {
|
|
|
4549
4576
|
if (fromGoogleMaps != null) {
|
|
4550
4577
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
|
|
4551
4578
|
}
|
|
4552
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
4553
|
-
if (fromGoogleSearch != null) {
|
|
4554
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
|
|
4555
|
-
}
|
|
4556
4579
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
4557
4580
|
'googleSearchRetrieval',
|
|
4558
4581
|
]);
|
|
@@ -4563,6 +4586,16 @@ function toolToMldev$4(fromObject) {
|
|
|
4563
4586
|
if (fromUrlContext != null) {
|
|
4564
4587
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
4565
4588
|
}
|
|
4589
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
4590
|
+
if (fromMcpServers != null) {
|
|
4591
|
+
let transformedList = fromMcpServers;
|
|
4592
|
+
if (Array.isArray(transformedList)) {
|
|
4593
|
+
transformedList = transformedList.map((item) => {
|
|
4594
|
+
return item;
|
|
4595
|
+
});
|
|
4596
|
+
}
|
|
4597
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
4598
|
+
}
|
|
4566
4599
|
return toObject;
|
|
4567
4600
|
}
|
|
4568
4601
|
|
|
@@ -5569,6 +5602,10 @@ function googleMapsToMldev$3(fromObject) {
|
|
|
5569
5602
|
}
|
|
5570
5603
|
function googleSearchToMldev$3(fromObject) {
|
|
5571
5604
|
const toObject = {};
|
|
5605
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
5606
|
+
if (fromSearchTypes != null) {
|
|
5607
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
5608
|
+
}
|
|
5572
5609
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
5573
5610
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
5574
5611
|
}
|
|
@@ -5768,6 +5805,10 @@ function toolToMldev$3(fromObject) {
|
|
|
5768
5805
|
if (fromFileSearch != null) {
|
|
5769
5806
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
5770
5807
|
}
|
|
5808
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5809
|
+
if (fromGoogleSearch != null) {
|
|
5810
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5811
|
+
}
|
|
5771
5812
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5772
5813
|
'codeExecution',
|
|
5773
5814
|
]);
|
|
@@ -5793,10 +5834,6 @@ function toolToMldev$3(fromObject) {
|
|
|
5793
5834
|
if (fromGoogleMaps != null) {
|
|
5794
5835
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
|
|
5795
5836
|
}
|
|
5796
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5797
|
-
if (fromGoogleSearch != null) {
|
|
5798
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
|
|
5799
|
-
}
|
|
5800
5837
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5801
5838
|
'googleSearchRetrieval',
|
|
5802
5839
|
]);
|
|
@@ -5807,6 +5844,16 @@ function toolToMldev$3(fromObject) {
|
|
|
5807
5844
|
if (fromUrlContext != null) {
|
|
5808
5845
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5809
5846
|
}
|
|
5847
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
5848
|
+
if (fromMcpServers != null) {
|
|
5849
|
+
let transformedList = fromMcpServers;
|
|
5850
|
+
if (Array.isArray(transformedList)) {
|
|
5851
|
+
transformedList = transformedList.map((item) => {
|
|
5852
|
+
return item;
|
|
5853
|
+
});
|
|
5854
|
+
}
|
|
5855
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5856
|
+
}
|
|
5810
5857
|
return toObject;
|
|
5811
5858
|
}
|
|
5812
5859
|
function toolToVertex$2(fromObject) {
|
|
@@ -5822,6 +5869,10 @@ function toolToVertex$2(fromObject) {
|
|
|
5822
5869
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
5823
5870
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
5824
5871
|
}
|
|
5872
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5873
|
+
if (fromGoogleSearch != null) {
|
|
5874
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5875
|
+
}
|
|
5825
5876
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
5826
5877
|
'codeExecution',
|
|
5827
5878
|
]);
|
|
@@ -5850,10 +5901,6 @@ function toolToVertex$2(fromObject) {
|
|
|
5850
5901
|
if (fromGoogleMaps != null) {
|
|
5851
5902
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
5852
5903
|
}
|
|
5853
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
5854
|
-
if (fromGoogleSearch != null) {
|
|
5855
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
5856
|
-
}
|
|
5857
5904
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
5858
5905
|
'googleSearchRetrieval',
|
|
5859
5906
|
]);
|
|
@@ -5864,6 +5911,9 @@ function toolToVertex$2(fromObject) {
|
|
|
5864
5911
|
if (fromUrlContext != null) {
|
|
5865
5912
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
5866
5913
|
}
|
|
5914
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
5915
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
5916
|
+
}
|
|
5867
5917
|
return toObject;
|
|
5868
5918
|
}
|
|
5869
5919
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -6947,7 +6997,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6947
6997
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6948
6998
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6949
6999
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6950
|
-
const SDK_VERSION = '1.
|
|
7000
|
+
const SDK_VERSION = '1.43.0'; // x-release-please-version
|
|
6951
7001
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6952
7002
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6953
7003
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -9388,14 +9438,17 @@ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(st
|
|
|
9388
9438
|
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
9389
9439
|
}, '');
|
|
9390
9440
|
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
9391
|
-
const invalidSegmentPattern = /(
|
|
9441
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
9392
9442
|
let match;
|
|
9393
9443
|
// Find all invalid segments
|
|
9394
9444
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
9445
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
9446
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
9447
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
9395
9448
|
invalidSegments.push({
|
|
9396
|
-
start: match.index,
|
|
9397
|
-
length:
|
|
9398
|
-
error: `Value "${
|
|
9449
|
+
start: match.index + offset,
|
|
9450
|
+
length: cleanMatch.length,
|
|
9451
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
9399
9452
|
});
|
|
9400
9453
|
}
|
|
9401
9454
|
invalidSegments.sort((a, b) => a.start - b.start);
|
|
@@ -10966,6 +11019,10 @@ function googleMapsToMldev$2(fromObject) {
|
|
|
10966
11019
|
}
|
|
10967
11020
|
function googleSearchToMldev$2(fromObject) {
|
|
10968
11021
|
const toObject = {};
|
|
11022
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
11023
|
+
if (fromSearchTypes != null) {
|
|
11024
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
11025
|
+
}
|
|
10969
11026
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
10970
11027
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
10971
11028
|
}
|
|
@@ -11481,6 +11538,10 @@ function toolToMldev$2(fromObject) {
|
|
|
11481
11538
|
if (fromFileSearch != null) {
|
|
11482
11539
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
11483
11540
|
}
|
|
11541
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11542
|
+
if (fromGoogleSearch != null) {
|
|
11543
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
11544
|
+
}
|
|
11484
11545
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11485
11546
|
'codeExecution',
|
|
11486
11547
|
]);
|
|
@@ -11506,10 +11567,6 @@ function toolToMldev$2(fromObject) {
|
|
|
11506
11567
|
if (fromGoogleMaps != null) {
|
|
11507
11568
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
|
|
11508
11569
|
}
|
|
11509
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11510
|
-
if (fromGoogleSearch != null) {
|
|
11511
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
|
|
11512
|
-
}
|
|
11513
11570
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11514
11571
|
'googleSearchRetrieval',
|
|
11515
11572
|
]);
|
|
@@ -11520,6 +11577,16 @@ function toolToMldev$2(fromObject) {
|
|
|
11520
11577
|
if (fromUrlContext != null) {
|
|
11521
11578
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11522
11579
|
}
|
|
11580
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
11581
|
+
if (fromMcpServers != null) {
|
|
11582
|
+
let transformedList = fromMcpServers;
|
|
11583
|
+
if (Array.isArray(transformedList)) {
|
|
11584
|
+
transformedList = transformedList.map((item) => {
|
|
11585
|
+
return item;
|
|
11586
|
+
});
|
|
11587
|
+
}
|
|
11588
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
11589
|
+
}
|
|
11523
11590
|
return toObject;
|
|
11524
11591
|
}
|
|
11525
11592
|
function toolToVertex$1(fromObject) {
|
|
@@ -11535,6 +11602,10 @@ function toolToVertex$1(fromObject) {
|
|
|
11535
11602
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
11536
11603
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
11537
11604
|
}
|
|
11605
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11606
|
+
if (fromGoogleSearch != null) {
|
|
11607
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11608
|
+
}
|
|
11538
11609
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
11539
11610
|
'codeExecution',
|
|
11540
11611
|
]);
|
|
@@ -11563,10 +11634,6 @@ function toolToVertex$1(fromObject) {
|
|
|
11563
11634
|
if (fromGoogleMaps != null) {
|
|
11564
11635
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
11565
11636
|
}
|
|
11566
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
11567
|
-
if (fromGoogleSearch != null) {
|
|
11568
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
11569
|
-
}
|
|
11570
11637
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
11571
11638
|
'googleSearchRetrieval',
|
|
11572
11639
|
]);
|
|
@@ -11577,6 +11644,9 @@ function toolToVertex$1(fromObject) {
|
|
|
11577
11644
|
if (fromUrlContext != null) {
|
|
11578
11645
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
11579
11646
|
}
|
|
11647
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
11648
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
11649
|
+
}
|
|
11580
11650
|
return toObject;
|
|
11581
11651
|
}
|
|
11582
11652
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -11720,16 +11790,16 @@ function candidateFromMldev(fromObject, rootObject) {
|
|
|
11720
11790
|
if (fromFinishReason != null) {
|
|
11721
11791
|
setValueByPath(toObject, ['finishReason'], fromFinishReason);
|
|
11722
11792
|
}
|
|
11723
|
-
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
11724
|
-
if (fromAvgLogprobs != null) {
|
|
11725
|
-
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
11726
|
-
}
|
|
11727
11793
|
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
11728
11794
|
'groundingMetadata',
|
|
11729
11795
|
]);
|
|
11730
11796
|
if (fromGroundingMetadata != null) {
|
|
11731
11797
|
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
11732
11798
|
}
|
|
11799
|
+
const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
|
|
11800
|
+
if (fromAvgLogprobs != null) {
|
|
11801
|
+
setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
|
|
11802
|
+
}
|
|
11733
11803
|
const fromIndex = getValueByPath(fromObject, ['index']);
|
|
11734
11804
|
if (fromIndex != null) {
|
|
11735
11805
|
setValueByPath(toObject, ['index'], fromIndex);
|
|
@@ -13846,6 +13916,10 @@ function googleMapsToMldev$1(fromObject, _rootObject) {
|
|
|
13846
13916
|
}
|
|
13847
13917
|
function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
13848
13918
|
const toObject = {};
|
|
13919
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
13920
|
+
if (fromSearchTypes != null) {
|
|
13921
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
13922
|
+
}
|
|
13849
13923
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
13850
13924
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
13851
13925
|
}
|
|
@@ -13873,6 +13947,9 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
13873
13947
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
13874
13948
|
throw new Error('personGeneration parameter is not supported in Gemini API.');
|
|
13875
13949
|
}
|
|
13950
|
+
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
13951
|
+
throw new Error('prominentPeople parameter is not supported in Gemini API.');
|
|
13952
|
+
}
|
|
13876
13953
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
13877
13954
|
throw new Error('outputMimeType parameter is not supported in Gemini API.');
|
|
13878
13955
|
}
|
|
@@ -13898,6 +13975,12 @@ function imageConfigToVertex(fromObject, _rootObject) {
|
|
|
13898
13975
|
if (fromPersonGeneration != null) {
|
|
13899
13976
|
setValueByPath(toObject, ['personGeneration'], fromPersonGeneration);
|
|
13900
13977
|
}
|
|
13978
|
+
const fromProminentPeople = getValueByPath(fromObject, [
|
|
13979
|
+
'prominentPeople',
|
|
13980
|
+
]);
|
|
13981
|
+
if (fromProminentPeople != null) {
|
|
13982
|
+
setValueByPath(toObject, ['prominentPeople'], fromProminentPeople);
|
|
13983
|
+
}
|
|
13901
13984
|
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
13902
13985
|
'outputMimeType',
|
|
13903
13986
|
]);
|
|
@@ -14625,6 +14708,10 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
14625
14708
|
if (fromFileSearch != null) {
|
|
14626
14709
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
14627
14710
|
}
|
|
14711
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
14712
|
+
if (fromGoogleSearch != null) {
|
|
14713
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
14714
|
+
}
|
|
14628
14715
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
14629
14716
|
'codeExecution',
|
|
14630
14717
|
]);
|
|
@@ -14650,10 +14737,6 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
14650
14737
|
if (fromGoogleMaps != null) {
|
|
14651
14738
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
|
|
14652
14739
|
}
|
|
14653
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
14654
|
-
if (fromGoogleSearch != null) {
|
|
14655
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
|
|
14656
|
-
}
|
|
14657
14740
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14658
14741
|
'googleSearchRetrieval',
|
|
14659
14742
|
]);
|
|
@@ -14664,6 +14747,16 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
14664
14747
|
if (fromUrlContext != null) {
|
|
14665
14748
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
14666
14749
|
}
|
|
14750
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
14751
|
+
if (fromMcpServers != null) {
|
|
14752
|
+
let transformedList = fromMcpServers;
|
|
14753
|
+
if (Array.isArray(transformedList)) {
|
|
14754
|
+
transformedList = transformedList.map((item) => {
|
|
14755
|
+
return item;
|
|
14756
|
+
});
|
|
14757
|
+
}
|
|
14758
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
14759
|
+
}
|
|
14667
14760
|
return toObject;
|
|
14668
14761
|
}
|
|
14669
14762
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -14679,6 +14772,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
14679
14772
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
14680
14773
|
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
14681
14774
|
}
|
|
14775
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
14776
|
+
if (fromGoogleSearch != null) {
|
|
14777
|
+
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
14778
|
+
}
|
|
14682
14779
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
14683
14780
|
'codeExecution',
|
|
14684
14781
|
]);
|
|
@@ -14707,10 +14804,6 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
14707
14804
|
if (fromGoogleMaps != null) {
|
|
14708
14805
|
setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
|
|
14709
14806
|
}
|
|
14710
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
14711
|
-
if (fromGoogleSearch != null) {
|
|
14712
|
-
setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
|
|
14713
|
-
}
|
|
14714
14807
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
14715
14808
|
'googleSearchRetrieval',
|
|
14716
14809
|
]);
|
|
@@ -14721,6 +14814,9 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
14721
14814
|
if (fromUrlContext != null) {
|
|
14722
14815
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
14723
14816
|
}
|
|
14817
|
+
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
14818
|
+
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
14819
|
+
}
|
|
14724
14820
|
return toObject;
|
|
14725
14821
|
}
|
|
14726
14822
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -17820,6 +17916,10 @@ function googleMapsToMldev(fromObject) {
|
|
|
17820
17916
|
}
|
|
17821
17917
|
function googleSearchToMldev(fromObject) {
|
|
17822
17918
|
const toObject = {};
|
|
17919
|
+
const fromSearchTypes = getValueByPath(fromObject, ['searchTypes']);
|
|
17920
|
+
if (fromSearchTypes != null) {
|
|
17921
|
+
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
17922
|
+
}
|
|
17823
17923
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
17824
17924
|
throw new Error('excludeDomains parameter is not supported in Gemini API.');
|
|
17825
17925
|
}
|
|
@@ -18043,6 +18143,10 @@ function toolToMldev(fromObject) {
|
|
|
18043
18143
|
if (fromFileSearch != null) {
|
|
18044
18144
|
setValueByPath(toObject, ['fileSearch'], fromFileSearch);
|
|
18045
18145
|
}
|
|
18146
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
18147
|
+
if (fromGoogleSearch != null) {
|
|
18148
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
18149
|
+
}
|
|
18046
18150
|
const fromCodeExecution = getValueByPath(fromObject, [
|
|
18047
18151
|
'codeExecution',
|
|
18048
18152
|
]);
|
|
@@ -18068,10 +18172,6 @@ function toolToMldev(fromObject) {
|
|
|
18068
18172
|
if (fromGoogleMaps != null) {
|
|
18069
18173
|
setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
|
|
18070
18174
|
}
|
|
18071
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
18072
|
-
if (fromGoogleSearch != null) {
|
|
18073
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
|
|
18074
|
-
}
|
|
18075
18175
|
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
18076
18176
|
'googleSearchRetrieval',
|
|
18077
18177
|
]);
|
|
@@ -18082,6 +18182,16 @@ function toolToMldev(fromObject) {
|
|
|
18082
18182
|
if (fromUrlContext != null) {
|
|
18083
18183
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
18084
18184
|
}
|
|
18185
|
+
const fromMcpServers = getValueByPath(fromObject, ['mcpServers']);
|
|
18186
|
+
if (fromMcpServers != null) {
|
|
18187
|
+
let transformedList = fromMcpServers;
|
|
18188
|
+
if (Array.isArray(transformedList)) {
|
|
18189
|
+
transformedList = transformedList.map((item) => {
|
|
18190
|
+
return item;
|
|
18191
|
+
});
|
|
18192
|
+
}
|
|
18193
|
+
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
18194
|
+
}
|
|
18085
18195
|
return toObject;
|
|
18086
18196
|
}
|
|
18087
18197
|
|
|
@@ -19693,5 +19803,5 @@ class GoogleGenAI {
|
|
|
19693
19803
|
}
|
|
19694
19804
|
}
|
|
19695
19805
|
|
|
19696
|
-
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 };
|
|
19806
|
+
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 };
|
|
19697
19807
|
//# sourceMappingURL=index.mjs.map
|