@google/genai 2.0.1 → 2.2.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 +158 -12
- package/dist/index.cjs +539 -509
- package/dist/index.mjs +539 -509
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +634 -604
- package/dist/node/index.mjs +634 -604
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +158 -12
- package/dist/tokenizer/node.cjs +2 -2
- package/dist/tokenizer/node.d.ts +3 -3
- package/dist/tokenizer/node.mjs +2 -2
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +3 -3
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +3 -3
- package/dist/vertex_internal/index.js +3 -3
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +634 -604
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +158 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -760,11 +760,11 @@ exports.PhishBlockThreshold = void 0;
|
|
|
760
760
|
*/
|
|
761
761
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
762
762
|
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
763
|
-
/** Specifies the function Behavior. Currently only supported
|
|
763
|
+
/** Specifies the function Behavior. Currently only non-blocking functions are supported. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
764
764
|
exports.Behavior = void 0;
|
|
765
765
|
(function (Behavior) {
|
|
766
766
|
/**
|
|
767
|
-
* This value is
|
|
767
|
+
* This value is unspecified.
|
|
768
768
|
*/
|
|
769
769
|
Behavior["UNSPECIFIED"] = "UNSPECIFIED";
|
|
770
770
|
/**
|
|
@@ -3739,23 +3739,23 @@ function authConfigToMldev$4(fromObject) {
|
|
|
3739
3739
|
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
3740
3740
|
}
|
|
3741
3741
|
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
3742
|
-
throw new Error('apiKeyConfig parameter is
|
|
3742
|
+
throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3743
3743
|
}
|
|
3744
3744
|
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
3745
|
-
throw new Error('authType parameter is
|
|
3745
|
+
throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3746
3746
|
}
|
|
3747
3747
|
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
3748
3748
|
undefined) {
|
|
3749
|
-
throw new Error('googleServiceAccountConfig parameter is
|
|
3749
|
+
throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3750
3750
|
}
|
|
3751
3751
|
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
3752
|
-
throw new Error('httpBasicAuthConfig parameter is
|
|
3752
|
+
throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3753
3753
|
}
|
|
3754
3754
|
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
3755
|
-
throw new Error('oauthConfig parameter is
|
|
3755
|
+
throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3756
3756
|
}
|
|
3757
3757
|
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
3758
|
-
throw new Error('oidcConfig parameter is
|
|
3758
|
+
throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3759
3759
|
}
|
|
3760
3760
|
return toObject;
|
|
3761
3761
|
}
|
|
@@ -3836,14 +3836,14 @@ function batchJobDestinationToVertex(fromObject) {
|
|
|
3836
3836
|
setValueByPath(toObject, ['bigqueryDestination', 'outputUri'], fromBigqueryUri);
|
|
3837
3837
|
}
|
|
3838
3838
|
if (getValueByPath(fromObject, ['fileName']) !== undefined) {
|
|
3839
|
-
throw new Error('fileName parameter is
|
|
3839
|
+
throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
3840
3840
|
}
|
|
3841
3841
|
if (getValueByPath(fromObject, ['inlinedResponses']) !== undefined) {
|
|
3842
|
-
throw new Error('inlinedResponses parameter is
|
|
3842
|
+
throw new Error('inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
3843
3843
|
}
|
|
3844
3844
|
if (getValueByPath(fromObject, ['inlinedEmbedContentResponses']) !==
|
|
3845
3845
|
undefined) {
|
|
3846
|
-
throw new Error('inlinedEmbedContentResponses parameter is
|
|
3846
|
+
throw new Error('inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
3847
3847
|
}
|
|
3848
3848
|
const fromVertexDataset = getValueByPath(fromObject, [
|
|
3849
3849
|
'vertexDataset',
|
|
@@ -3988,13 +3988,13 @@ function batchJobSourceFromVertex(fromObject) {
|
|
|
3988
3988
|
function batchJobSourceToMldev(apiClient, fromObject) {
|
|
3989
3989
|
const toObject = {};
|
|
3990
3990
|
if (getValueByPath(fromObject, ['format']) !== undefined) {
|
|
3991
|
-
throw new Error('format parameter is
|
|
3991
|
+
throw new Error('format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3992
3992
|
}
|
|
3993
3993
|
if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
|
|
3994
|
-
throw new Error('gcsUri parameter is
|
|
3994
|
+
throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3995
3995
|
}
|
|
3996
3996
|
if (getValueByPath(fromObject, ['bigqueryUri']) !== undefined) {
|
|
3997
|
-
throw new Error('bigqueryUri parameter is
|
|
3997
|
+
throw new Error('bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
3998
3998
|
}
|
|
3999
3999
|
const fromFileName = getValueByPath(fromObject, ['fileName']);
|
|
4000
4000
|
if (fromFileName != null) {
|
|
@@ -4013,7 +4013,7 @@ function batchJobSourceToMldev(apiClient, fromObject) {
|
|
|
4013
4013
|
setValueByPath(toObject, ['requests', 'requests'], transformedList);
|
|
4014
4014
|
}
|
|
4015
4015
|
if (getValueByPath(fromObject, ['vertexDatasetName']) !== undefined) {
|
|
4016
|
-
throw new Error('vertexDatasetName parameter is
|
|
4016
|
+
throw new Error('vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4017
4017
|
}
|
|
4018
4018
|
return toObject;
|
|
4019
4019
|
}
|
|
@@ -4032,10 +4032,10 @@ function batchJobSourceToVertex(fromObject) {
|
|
|
4032
4032
|
setValueByPath(toObject, ['bigquerySource', 'inputUri'], fromBigqueryUri);
|
|
4033
4033
|
}
|
|
4034
4034
|
if (getValueByPath(fromObject, ['fileName']) !== undefined) {
|
|
4035
|
-
throw new Error('fileName parameter is
|
|
4035
|
+
throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
4036
4036
|
}
|
|
4037
4037
|
if (getValueByPath(fromObject, ['inlinedRequests']) !== undefined) {
|
|
4038
|
-
throw new Error('inlinedRequests parameter is
|
|
4038
|
+
throw new Error('inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
4039
4039
|
}
|
|
4040
4040
|
const fromVertexDatasetName = getValueByPath(fromObject, [
|
|
4041
4041
|
'vertexDatasetName',
|
|
@@ -4052,7 +4052,7 @@ function blobToMldev$4(fromObject) {
|
|
|
4052
4052
|
setValueByPath(toObject, ['data'], fromData);
|
|
4053
4053
|
}
|
|
4054
4054
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
4055
|
-
throw new Error('displayName parameter is
|
|
4055
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4056
4056
|
}
|
|
4057
4057
|
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
4058
4058
|
if (fromMimeType != null) {
|
|
@@ -4175,7 +4175,7 @@ function createBatchJobConfigToMldev(fromObject, parentObject) {
|
|
|
4175
4175
|
setValueByPath(parentObject, ['batch', 'displayName'], fromDisplayName);
|
|
4176
4176
|
}
|
|
4177
4177
|
if (getValueByPath(fromObject, ['dest']) !== undefined) {
|
|
4178
|
-
throw new Error('dest parameter is
|
|
4178
|
+
throw new Error('dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4179
4179
|
}
|
|
4180
4180
|
const fromWebhookConfig = getValueByPath(fromObject, [
|
|
4181
4181
|
'webhookConfig',
|
|
@@ -4196,7 +4196,7 @@ function createBatchJobConfigToVertex(fromObject, parentObject) {
|
|
|
4196
4196
|
setValueByPath(parentObject, ['outputConfig'], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
|
|
4197
4197
|
}
|
|
4198
4198
|
if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
|
|
4199
|
-
throw new Error('webhookConfig parameter is
|
|
4199
|
+
throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
4200
4200
|
}
|
|
4201
4201
|
return toObject;
|
|
4202
4202
|
}
|
|
@@ -4352,16 +4352,16 @@ function embedContentConfigToMldev$1(fromObject, parentObject) {
|
|
|
4352
4352
|
setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
|
|
4353
4353
|
}
|
|
4354
4354
|
if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
|
|
4355
|
-
throw new Error('mimeType parameter is
|
|
4355
|
+
throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4356
4356
|
}
|
|
4357
4357
|
if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
|
|
4358
|
-
throw new Error('autoTruncate parameter is
|
|
4358
|
+
throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4359
4359
|
}
|
|
4360
4360
|
if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
|
|
4361
|
-
throw new Error('documentOcr parameter is
|
|
4361
|
+
throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4362
4362
|
}
|
|
4363
4363
|
if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
|
|
4364
|
-
throw new Error('audioTrackExtraction parameter is
|
|
4364
|
+
throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4365
4365
|
}
|
|
4366
4366
|
return toObject;
|
|
4367
4367
|
}
|
|
@@ -4382,7 +4382,7 @@ function embeddingsBatchJobSourceToMldev(apiClient, fromObject) {
|
|
|
4382
4382
|
function fileDataToMldev$4(fromObject) {
|
|
4383
4383
|
const toObject = {};
|
|
4384
4384
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
4385
|
-
throw new Error('displayName parameter is
|
|
4385
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4386
4386
|
}
|
|
4387
4387
|
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
4388
4388
|
if (fromFileUri != null) {
|
|
@@ -4409,10 +4409,10 @@ function functionCallToMldev$4(fromObject) {
|
|
|
4409
4409
|
setValueByPath(toObject, ['name'], fromName);
|
|
4410
4410
|
}
|
|
4411
4411
|
if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
|
|
4412
|
-
throw new Error('partialArgs parameter is
|
|
4412
|
+
throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4413
4413
|
}
|
|
4414
4414
|
if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
|
|
4415
|
-
throw new Error('willContinue parameter is
|
|
4415
|
+
throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4416
4416
|
}
|
|
4417
4417
|
return toObject;
|
|
4418
4418
|
}
|
|
@@ -4430,7 +4430,7 @@ function functionCallingConfigToMldev$2(fromObject) {
|
|
|
4430
4430
|
}
|
|
4431
4431
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
4432
4432
|
undefined) {
|
|
4433
|
-
throw new Error('streamFunctionCallArguments parameter is
|
|
4433
|
+
throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4434
4434
|
}
|
|
4435
4435
|
return toObject;
|
|
4436
4436
|
}
|
|
@@ -4517,10 +4517,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4517
4517
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
4518
4518
|
}
|
|
4519
4519
|
if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
|
|
4520
|
-
throw new Error('routingConfig parameter is
|
|
4520
|
+
throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4521
4521
|
}
|
|
4522
4522
|
if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
|
|
4523
|
-
throw new Error('modelSelectionConfig parameter is
|
|
4523
|
+
throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4524
4524
|
}
|
|
4525
4525
|
const fromSafetySettings = getValueByPath(fromObject, [
|
|
4526
4526
|
'safetySettings',
|
|
@@ -4549,7 +4549,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4549
4549
|
setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$2(fromToolConfig));
|
|
4550
4550
|
}
|
|
4551
4551
|
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
4552
|
-
throw new Error('labels parameter is
|
|
4552
|
+
throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4553
4553
|
}
|
|
4554
4554
|
const fromCachedContent = getValueByPath(fromObject, [
|
|
4555
4555
|
'cachedContent',
|
|
@@ -4574,7 +4574,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4574
4574
|
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
4575
4575
|
}
|
|
4576
4576
|
if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
|
|
4577
|
-
throw new Error('audioTimestamp parameter is
|
|
4577
|
+
throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4578
4578
|
}
|
|
4579
4579
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
4580
4580
|
'thinkingConfig',
|
|
@@ -4593,7 +4593,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
|
|
|
4593
4593
|
setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
|
|
4594
4594
|
}
|
|
4595
4595
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
4596
|
-
throw new Error('modelArmorConfig parameter is
|
|
4596
|
+
throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4597
4597
|
}
|
|
4598
4598
|
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
4599
4599
|
if (parentObject !== undefined && fromServiceTier != null) {
|
|
@@ -4680,10 +4680,10 @@ function googleSearchToMldev$4(fromObject) {
|
|
|
4680
4680
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
4681
4681
|
}
|
|
4682
4682
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
4683
|
-
throw new Error('blockingConfidence parameter is
|
|
4683
|
+
throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4684
4684
|
}
|
|
4685
4685
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
4686
|
-
throw new Error('excludeDomains parameter is
|
|
4686
|
+
throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4687
4687
|
}
|
|
4688
4688
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
4689
4689
|
'timeRangeFilter',
|
|
@@ -4704,20 +4704,20 @@ function imageConfigToMldev$1(fromObject) {
|
|
|
4704
4704
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
4705
4705
|
}
|
|
4706
4706
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
4707
|
-
throw new Error('personGeneration parameter is
|
|
4707
|
+
throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4708
4708
|
}
|
|
4709
4709
|
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
4710
|
-
throw new Error('prominentPeople parameter is
|
|
4710
|
+
throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4711
4711
|
}
|
|
4712
4712
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
4713
|
-
throw new Error('outputMimeType parameter is
|
|
4713
|
+
throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4714
4714
|
}
|
|
4715
4715
|
if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
|
|
4716
4716
|
undefined) {
|
|
4717
|
-
throw new Error('outputCompressionQuality parameter is
|
|
4717
|
+
throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4718
4718
|
}
|
|
4719
4719
|
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
4720
|
-
throw new Error('imageOutputOptions parameter is
|
|
4720
|
+
throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4721
4721
|
}
|
|
4722
4722
|
return toObject;
|
|
4723
4723
|
}
|
|
@@ -4774,7 +4774,7 @@ function listBatchJobsConfigToMldev(fromObject, parentObject) {
|
|
|
4774
4774
|
setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
|
|
4775
4775
|
}
|
|
4776
4776
|
if (getValueByPath(fromObject, ['filter']) !== undefined) {
|
|
4777
|
-
throw new Error('filter parameter is
|
|
4777
|
+
throw new Error('filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4778
4778
|
}
|
|
4779
4779
|
return toObject;
|
|
4780
4780
|
}
|
|
@@ -4943,7 +4943,7 @@ function safetySettingToMldev$3(fromObject) {
|
|
|
4943
4943
|
setValueByPath(toObject, ['category'], fromCategory);
|
|
4944
4944
|
}
|
|
4945
4945
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
4946
|
-
throw new Error('method parameter is
|
|
4946
|
+
throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4947
4947
|
}
|
|
4948
4948
|
const fromThreshold = getValueByPath(fromObject, ['threshold']);
|
|
4949
4949
|
if (fromThreshold != null) {
|
|
@@ -4974,7 +4974,7 @@ function toolConfigToMldev$2(fromObject) {
|
|
|
4974
4974
|
function toolToMldev$4(fromObject) {
|
|
4975
4975
|
const toObject = {};
|
|
4976
4976
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
4977
|
-
throw new Error('retrieval parameter is
|
|
4977
|
+
throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
4978
4978
|
}
|
|
4979
4979
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
4980
4980
|
if (fromComputerUse != null) {
|
|
@@ -4999,7 +4999,7 @@ function toolToMldev$4(fromObject) {
|
|
|
4999
4999
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
5000
5000
|
}
|
|
5001
5001
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
5002
|
-
throw new Error('enterpriseWebSearch parameter is
|
|
5002
|
+
throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5003
5003
|
}
|
|
5004
5004
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
5005
5005
|
'functionDeclarations',
|
|
@@ -5020,7 +5020,7 @@ function toolToMldev$4(fromObject) {
|
|
|
5020
5020
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
5021
5021
|
}
|
|
5022
5022
|
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
5023
|
-
throw new Error('parallelAiSearch parameter is
|
|
5023
|
+
throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5024
5024
|
}
|
|
5025
5025
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
5026
5026
|
if (fromUrlContext != null) {
|
|
@@ -5767,23 +5767,23 @@ function authConfigToMldev$3(fromObject) {
|
|
|
5767
5767
|
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
5768
5768
|
}
|
|
5769
5769
|
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
5770
|
-
throw new Error('apiKeyConfig parameter is
|
|
5770
|
+
throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5771
5771
|
}
|
|
5772
5772
|
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
5773
|
-
throw new Error('authType parameter is
|
|
5773
|
+
throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5774
5774
|
}
|
|
5775
5775
|
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
5776
5776
|
undefined) {
|
|
5777
|
-
throw new Error('googleServiceAccountConfig parameter is
|
|
5777
|
+
throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5778
5778
|
}
|
|
5779
5779
|
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
5780
|
-
throw new Error('httpBasicAuthConfig parameter is
|
|
5780
|
+
throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5781
5781
|
}
|
|
5782
5782
|
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
5783
|
-
throw new Error('oauthConfig parameter is
|
|
5783
|
+
throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5784
5784
|
}
|
|
5785
5785
|
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
5786
|
-
throw new Error('oidcConfig parameter is
|
|
5786
|
+
throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5787
5787
|
}
|
|
5788
5788
|
return toObject;
|
|
5789
5789
|
}
|
|
@@ -5794,7 +5794,7 @@ function blobToMldev$3(fromObject) {
|
|
|
5794
5794
|
setValueByPath(toObject, ['data'], fromData);
|
|
5795
5795
|
}
|
|
5796
5796
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
5797
|
-
throw new Error('displayName parameter is
|
|
5797
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5798
5798
|
}
|
|
5799
5799
|
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
5800
5800
|
if (fromMimeType != null) {
|
|
@@ -5883,7 +5883,7 @@ function createCachedContentConfigToMldev(fromObject, parentObject) {
|
|
|
5883
5883
|
setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$1(fromToolConfig));
|
|
5884
5884
|
}
|
|
5885
5885
|
if (getValueByPath(fromObject, ['kmsKeyName']) !== undefined) {
|
|
5886
|
-
throw new Error('kmsKeyName parameter is
|
|
5886
|
+
throw new Error('kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5887
5887
|
}
|
|
5888
5888
|
return toObject;
|
|
5889
5889
|
}
|
|
@@ -6000,7 +6000,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
6000
6000
|
function fileDataToMldev$3(fromObject) {
|
|
6001
6001
|
const toObject = {};
|
|
6002
6002
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
6003
|
-
throw new Error('displayName parameter is
|
|
6003
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6004
6004
|
}
|
|
6005
6005
|
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
6006
6006
|
if (fromFileUri != null) {
|
|
@@ -6027,10 +6027,10 @@ function functionCallToMldev$3(fromObject) {
|
|
|
6027
6027
|
setValueByPath(toObject, ['name'], fromName);
|
|
6028
6028
|
}
|
|
6029
6029
|
if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
|
|
6030
|
-
throw new Error('partialArgs parameter is
|
|
6030
|
+
throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6031
6031
|
}
|
|
6032
6032
|
if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
|
|
6033
|
-
throw new Error('willContinue parameter is
|
|
6033
|
+
throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6034
6034
|
}
|
|
6035
6035
|
return toObject;
|
|
6036
6036
|
}
|
|
@@ -6048,42 +6048,7 @@ function functionCallingConfigToMldev$1(fromObject) {
|
|
|
6048
6048
|
}
|
|
6049
6049
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
6050
6050
|
undefined) {
|
|
6051
|
-
throw new Error('streamFunctionCallArguments parameter is
|
|
6052
|
-
}
|
|
6053
|
-
return toObject;
|
|
6054
|
-
}
|
|
6055
|
-
function functionDeclarationToVertex$2(fromObject) {
|
|
6056
|
-
const toObject = {};
|
|
6057
|
-
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
6058
|
-
if (fromDescription != null) {
|
|
6059
|
-
setValueByPath(toObject, ['description'], fromDescription);
|
|
6060
|
-
}
|
|
6061
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
6062
|
-
if (fromName != null) {
|
|
6063
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
6064
|
-
}
|
|
6065
|
-
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
6066
|
-
if (fromParameters != null) {
|
|
6067
|
-
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
6068
|
-
}
|
|
6069
|
-
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
6070
|
-
'parametersJsonSchema',
|
|
6071
|
-
]);
|
|
6072
|
-
if (fromParametersJsonSchema != null) {
|
|
6073
|
-
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
6074
|
-
}
|
|
6075
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
6076
|
-
if (fromResponse != null) {
|
|
6077
|
-
setValueByPath(toObject, ['response'], fromResponse);
|
|
6078
|
-
}
|
|
6079
|
-
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
6080
|
-
'responseJsonSchema',
|
|
6081
|
-
]);
|
|
6082
|
-
if (fromResponseJsonSchema != null) {
|
|
6083
|
-
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
6084
|
-
}
|
|
6085
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
6086
|
-
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6051
|
+
throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6087
6052
|
}
|
|
6088
6053
|
return toObject;
|
|
6089
6054
|
}
|
|
@@ -6122,10 +6087,10 @@ function googleSearchToMldev$3(fromObject) {
|
|
|
6122
6087
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
6123
6088
|
}
|
|
6124
6089
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
6125
|
-
throw new Error('blockingConfidence parameter is
|
|
6090
|
+
throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6126
6091
|
}
|
|
6127
6092
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
6128
|
-
throw new Error('excludeDomains parameter is
|
|
6093
|
+
throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6129
6094
|
}
|
|
6130
6095
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
6131
6096
|
'timeRangeFilter',
|
|
@@ -6362,13 +6327,13 @@ function partToVertex$2(fromObject) {
|
|
|
6362
6327
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
6363
6328
|
}
|
|
6364
6329
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
6365
|
-
throw new Error('toolCall parameter is
|
|
6330
|
+
throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6366
6331
|
}
|
|
6367
6332
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
6368
|
-
throw new Error('toolResponse parameter is
|
|
6333
|
+
throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6369
6334
|
}
|
|
6370
6335
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
6371
|
-
throw new Error('partMetadata parameter is
|
|
6336
|
+
throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6372
6337
|
}
|
|
6373
6338
|
return toObject;
|
|
6374
6339
|
}
|
|
@@ -6408,14 +6373,14 @@ function toolConfigToVertex$1(fromObject) {
|
|
|
6408
6373
|
}
|
|
6409
6374
|
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
6410
6375
|
undefined) {
|
|
6411
|
-
throw new Error('includeServerSideToolInvocations parameter is
|
|
6376
|
+
throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6412
6377
|
}
|
|
6413
6378
|
return toObject;
|
|
6414
6379
|
}
|
|
6415
6380
|
function toolToMldev$3(fromObject) {
|
|
6416
6381
|
const toObject = {};
|
|
6417
6382
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
6418
|
-
throw new Error('retrieval parameter is
|
|
6383
|
+
throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6419
6384
|
}
|
|
6420
6385
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
6421
6386
|
if (fromComputerUse != null) {
|
|
@@ -6440,7 +6405,7 @@ function toolToMldev$3(fromObject) {
|
|
|
6440
6405
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
6441
6406
|
}
|
|
6442
6407
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
6443
|
-
throw new Error('enterpriseWebSearch parameter is
|
|
6408
|
+
throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6444
6409
|
}
|
|
6445
6410
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
6446
6411
|
'functionDeclarations',
|
|
@@ -6461,7 +6426,7 @@ function toolToMldev$3(fromObject) {
|
|
|
6461
6426
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
6462
6427
|
}
|
|
6463
6428
|
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
6464
|
-
throw new Error('parallelAiSearch parameter is
|
|
6429
|
+
throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6465
6430
|
}
|
|
6466
6431
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
6467
6432
|
if (fromUrlContext != null) {
|
|
@@ -6490,7 +6455,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6490
6455
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
6491
6456
|
}
|
|
6492
6457
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
6493
|
-
throw new Error('fileSearch parameter is
|
|
6458
|
+
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6494
6459
|
}
|
|
6495
6460
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
6496
6461
|
if (fromGoogleSearch != null) {
|
|
@@ -6519,7 +6484,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6519
6484
|
let transformedList = fromFunctionDeclarations;
|
|
6520
6485
|
if (Array.isArray(transformedList)) {
|
|
6521
6486
|
transformedList = transformedList.map((item) => {
|
|
6522
|
-
return
|
|
6487
|
+
return item;
|
|
6523
6488
|
});
|
|
6524
6489
|
}
|
|
6525
6490
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -6541,7 +6506,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6541
6506
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
6542
6507
|
}
|
|
6543
6508
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
6544
|
-
throw new Error('mcpServers parameter is
|
|
6509
|
+
throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6545
6510
|
}
|
|
6546
6511
|
return toObject;
|
|
6547
6512
|
}
|
|
@@ -7631,7 +7596,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7631
7596
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7632
7597
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7633
7598
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7634
|
-
const SDK_VERSION = '2.0
|
|
7599
|
+
const SDK_VERSION = '2.2.0'; // x-release-please-version
|
|
7635
7600
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7636
7601
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7637
7602
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -9965,203 +9930,6 @@ class APIResource {
|
|
|
9965
9930
|
*/
|
|
9966
9931
|
APIResource._key = [];
|
|
9967
9932
|
|
|
9968
|
-
/**
|
|
9969
|
-
* @license
|
|
9970
|
-
* Copyright 2025 Google LLC
|
|
9971
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
9972
|
-
*/
|
|
9973
|
-
/**
|
|
9974
|
-
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
9975
|
-
*
|
|
9976
|
-
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
9977
|
-
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
9978
|
-
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
9979
|
-
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
9980
|
-
*/
|
|
9981
|
-
function encodeURIPath(str) {
|
|
9982
|
-
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
9983
|
-
}
|
|
9984
|
-
const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
9985
|
-
const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
|
|
9986
|
-
// If there are no params, no processing is needed.
|
|
9987
|
-
if (statics.length === 1)
|
|
9988
|
-
return statics[0];
|
|
9989
|
-
let postPath = false;
|
|
9990
|
-
const invalidSegments = [];
|
|
9991
|
-
const path = statics.reduce((previousValue, currentValue, index) => {
|
|
9992
|
-
var _a, _b, _c;
|
|
9993
|
-
if (/[?#]/.test(currentValue)) {
|
|
9994
|
-
postPath = true;
|
|
9995
|
-
}
|
|
9996
|
-
const value = params[index];
|
|
9997
|
-
let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
|
|
9998
|
-
if (index !== params.length &&
|
|
9999
|
-
(value == null ||
|
|
10000
|
-
(typeof value === 'object' &&
|
|
10001
|
-
// handle values from other realms
|
|
10002
|
-
value.toString ===
|
|
10003
|
-
((_c = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a = value.hasOwnProperty) !== null && _a !== void 0 ? _a : EMPTY)) !== null && _b !== void 0 ? _b : EMPTY)) === null || _c === void 0 ? void 0 : _c.toString)))) {
|
|
10004
|
-
encoded = value + '';
|
|
10005
|
-
invalidSegments.push({
|
|
10006
|
-
start: previousValue.length + currentValue.length,
|
|
10007
|
-
length: encoded.length,
|
|
10008
|
-
error: `Value of type ${Object.prototype.toString
|
|
10009
|
-
.call(value)
|
|
10010
|
-
.slice(8, -1)} is not a valid path parameter`,
|
|
10011
|
-
});
|
|
10012
|
-
}
|
|
10013
|
-
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
10014
|
-
}, '');
|
|
10015
|
-
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
10016
|
-
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
10017
|
-
let match;
|
|
10018
|
-
// Find all invalid segments
|
|
10019
|
-
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
10020
|
-
const hasLeadingSlash = match[0].startsWith('/');
|
|
10021
|
-
const offset = hasLeadingSlash ? 1 : 0;
|
|
10022
|
-
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
10023
|
-
invalidSegments.push({
|
|
10024
|
-
start: match.index + offset,
|
|
10025
|
-
length: cleanMatch.length,
|
|
10026
|
-
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
10027
|
-
});
|
|
10028
|
-
}
|
|
10029
|
-
invalidSegments.sort((a, b) => a.start - b.start);
|
|
10030
|
-
if (invalidSegments.length > 0) {
|
|
10031
|
-
let lastEnd = 0;
|
|
10032
|
-
const underline = invalidSegments.reduce((acc, segment) => {
|
|
10033
|
-
const spaces = ' '.repeat(segment.start - lastEnd);
|
|
10034
|
-
const arrows = '^'.repeat(segment.length);
|
|
10035
|
-
lastEnd = segment.start + segment.length;
|
|
10036
|
-
return acc + spaces + arrows;
|
|
10037
|
-
}, '');
|
|
10038
|
-
throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
|
|
10039
|
-
.map((e) => e.error)
|
|
10040
|
-
.join('\n')}\n${path}\n${underline}`);
|
|
10041
|
-
}
|
|
10042
|
-
return path;
|
|
10043
|
-
});
|
|
10044
|
-
/**
|
|
10045
|
-
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
10046
|
-
*/
|
|
10047
|
-
const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
10048
|
-
|
|
10049
|
-
/**
|
|
10050
|
-
* @license
|
|
10051
|
-
* Copyright 2025 Google LLC
|
|
10052
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
10053
|
-
*/
|
|
10054
|
-
class BaseInteractions extends APIResource {
|
|
10055
|
-
create(params, options) {
|
|
10056
|
-
var _a;
|
|
10057
|
-
const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
|
|
10058
|
-
if ('model' in body && 'agent_config' in body) {
|
|
10059
|
-
throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
|
|
10060
|
-
}
|
|
10061
|
-
if ('agent' in body && 'generation_config' in body) {
|
|
10062
|
-
throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
|
|
10063
|
-
}
|
|
10064
|
-
return this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a = params.stream) !== null && _a !== void 0 ? _a : false }));
|
|
10065
|
-
}
|
|
10066
|
-
/**
|
|
10067
|
-
* Deletes the interaction by id.
|
|
10068
|
-
*
|
|
10069
|
-
* @example
|
|
10070
|
-
* ```ts
|
|
10071
|
-
* const interaction = await client.interactions.delete('id', {
|
|
10072
|
-
* api_version: 'api_version',
|
|
10073
|
-
* });
|
|
10074
|
-
* ```
|
|
10075
|
-
*/
|
|
10076
|
-
delete(id, params = {}, options) {
|
|
10077
|
-
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10078
|
-
return this._client.delete(path `/${api_version}/interactions/${id}`, options);
|
|
10079
|
-
}
|
|
10080
|
-
/**
|
|
10081
|
-
* Cancels an interaction by id. This only applies to background interactions that
|
|
10082
|
-
* are still running.
|
|
10083
|
-
*
|
|
10084
|
-
* @example
|
|
10085
|
-
* ```ts
|
|
10086
|
-
* const interaction = await client.interactions.cancel('id', {
|
|
10087
|
-
* api_version: 'api_version',
|
|
10088
|
-
* });
|
|
10089
|
-
* ```
|
|
10090
|
-
*/
|
|
10091
|
-
cancel(id, params = {}, options) {
|
|
10092
|
-
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10093
|
-
return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
|
|
10094
|
-
}
|
|
10095
|
-
get(id, params = {}, options) {
|
|
10096
|
-
var _a;
|
|
10097
|
-
const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
|
|
10098
|
-
return this._client.get(path `/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a = params === null || params === void 0 ? void 0 : params.stream) !== null && _a !== void 0 ? _a : false }));
|
|
10099
|
-
}
|
|
10100
|
-
}
|
|
10101
|
-
BaseInteractions._key = Object.freeze(['interactions']);
|
|
10102
|
-
class Interactions extends BaseInteractions {
|
|
10103
|
-
}
|
|
10104
|
-
|
|
10105
|
-
/**
|
|
10106
|
-
* @license
|
|
10107
|
-
* Copyright 2025 Google LLC
|
|
10108
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
10109
|
-
*/
|
|
10110
|
-
class BaseWebhooks extends APIResource {
|
|
10111
|
-
/**
|
|
10112
|
-
* Creates a new Webhook.
|
|
10113
|
-
*/
|
|
10114
|
-
create(params, options) {
|
|
10115
|
-
const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
|
|
10116
|
-
return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
|
|
10117
|
-
}
|
|
10118
|
-
/**
|
|
10119
|
-
* Updates an existing Webhook.
|
|
10120
|
-
*/
|
|
10121
|
-
update(id, params = {}, options) {
|
|
10122
|
-
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
|
|
10123
|
-
return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
|
|
10124
|
-
}
|
|
10125
|
-
/**
|
|
10126
|
-
* Lists all Webhooks.
|
|
10127
|
-
*/
|
|
10128
|
-
list(params = {}, options) {
|
|
10129
|
-
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
|
|
10130
|
-
return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
|
|
10131
|
-
}
|
|
10132
|
-
/**
|
|
10133
|
-
* Deletes a Webhook.
|
|
10134
|
-
*/
|
|
10135
|
-
delete(id, params = {}, options) {
|
|
10136
|
-
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10137
|
-
return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
|
|
10138
|
-
}
|
|
10139
|
-
/**
|
|
10140
|
-
* Gets a specific Webhook.
|
|
10141
|
-
*/
|
|
10142
|
-
get(id, params = {}, options) {
|
|
10143
|
-
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10144
|
-
return this._client.get(path `/${api_version}/webhooks/${id}`, options);
|
|
10145
|
-
}
|
|
10146
|
-
/**
|
|
10147
|
-
* Sends a ping event to a Webhook.
|
|
10148
|
-
*/
|
|
10149
|
-
ping(id, params = undefined, options) {
|
|
10150
|
-
const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
|
|
10151
|
-
return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
|
|
10152
|
-
}
|
|
10153
|
-
/**
|
|
10154
|
-
* Generates a new signing secret for a Webhook.
|
|
10155
|
-
*/
|
|
10156
|
-
rotateSigningSecret(id, params = {}, options) {
|
|
10157
|
-
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
|
|
10158
|
-
return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
|
|
10159
|
-
}
|
|
10160
|
-
}
|
|
10161
|
-
BaseWebhooks._key = Object.freeze(['webhooks']);
|
|
10162
|
-
class Webhooks extends BaseWebhooks {
|
|
10163
|
-
}
|
|
10164
|
-
|
|
10165
9933
|
/**
|
|
10166
9934
|
* @license
|
|
10167
9935
|
* Copyright 2025 Google LLC
|
|
@@ -10702,20 +10470,352 @@ function partition(str, delimiter) {
|
|
|
10702
10470
|
* Copyright 2025 Google LLC
|
|
10703
10471
|
* SPDX-License-Identifier: Apache-2.0
|
|
10704
10472
|
*/
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10473
|
+
const LEGACY_LYRIA_MODELS = new Set([
|
|
10474
|
+
'lyria-3-pro-preview',
|
|
10475
|
+
'lyria-3-clip-preview',
|
|
10476
|
+
]);
|
|
10477
|
+
const LEGACY_EVENT_TYPE_RENAMES = {
|
|
10478
|
+
'interaction.start': 'interaction.created',
|
|
10479
|
+
'content.start': 'step.start',
|
|
10480
|
+
'content.delta': 'step.delta',
|
|
10481
|
+
'content.stop': 'step.stop',
|
|
10482
|
+
'interaction.complete': 'interaction.completed',
|
|
10483
|
+
};
|
|
10484
|
+
function isLegacyLyriaRequest({ isVertex, model }) {
|
|
10485
|
+
return Boolean(isVertex) && typeof model === 'string' && LEGACY_LYRIA_MODELS.has(model);
|
|
10486
|
+
}
|
|
10487
|
+
/**
|
|
10488
|
+
* Detect whether a client is in vertex mode. Reads the `clientAdapter` field
|
|
10489
|
+
* directly because `BaseGeminiNextGenAPIClient` keeps it `private`; centralizing
|
|
10490
|
+
* the runtime cast here avoids leaking it into resource files.
|
|
10491
|
+
*/
|
|
10492
|
+
function isVertexClient(client) {
|
|
10493
|
+
const adapter = client.clientAdapter;
|
|
10494
|
+
return Boolean(adapter && adapter.isVertexAI());
|
|
10495
|
+
}
|
|
10496
|
+
function isPlainObject(value) {
|
|
10497
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
10498
|
+
}
|
|
10499
|
+
/**
|
|
10500
|
+
* Wrap a legacy `outputs: Array<Content>` payload into the modern
|
|
10501
|
+
* `steps: [{type: 'model_output', content: outputs}]` shape. Returns the input
|
|
10502
|
+
* unchanged when `steps` already wins or `outputs` is absent.
|
|
10503
|
+
*/
|
|
10504
|
+
function wrapOutputsAsSteps(data) {
|
|
10505
|
+
if (!('outputs' in data) || 'steps' in data) {
|
|
10506
|
+
return data;
|
|
10507
|
+
}
|
|
10508
|
+
const { outputs } = data, rest = __rest(data, ["outputs"]);
|
|
10509
|
+
return Object.assign(Object.assign({}, rest), { steps: [{ type: 'model_output', content: outputs }] });
|
|
10510
|
+
}
|
|
10511
|
+
/**
|
|
10512
|
+
* Non-streaming: rewrite a legacy interaction response so consumers see the
|
|
10513
|
+
* modern `steps` shape.
|
|
10514
|
+
*/
|
|
10515
|
+
function coerceLegacyInteractionResponse(data) {
|
|
10516
|
+
if (!isPlainObject(data))
|
|
10517
|
+
return data;
|
|
10518
|
+
return wrapOutputsAsSteps(data);
|
|
10519
|
+
}
|
|
10520
|
+
/**
|
|
10521
|
+
* Streaming: translate one legacy SSE event to its modern equivalent.
|
|
10522
|
+
*
|
|
10523
|
+
* Returns the input unchanged when the `event_type` is not one of the legacy
|
|
10524
|
+
* ones we know how to map. Two non-trivial cases:
|
|
10525
|
+
* 1. `content.start` carries `content: <Content>` — the modern `step.start`
|
|
10526
|
+
* expects `step: {type: 'model_output', content: [<Content>]}`.
|
|
10527
|
+
* 2. `interaction.start` / `interaction.complete` wrap an `interaction`
|
|
10528
|
+
* object that may itself carry the legacy `outputs` field; recurse.
|
|
10529
|
+
*/
|
|
10530
|
+
function maybeRemapLegacyStreamEvent(data) {
|
|
10531
|
+
if (!isPlainObject(data))
|
|
10532
|
+
return data;
|
|
10533
|
+
const eventType = data['event_type'];
|
|
10534
|
+
if (typeof eventType !== 'string' || !(eventType in LEGACY_EVENT_TYPE_RENAMES)) {
|
|
10535
|
+
return data;
|
|
10536
|
+
}
|
|
10537
|
+
const renamed = Object.assign(Object.assign({}, data), { event_type: LEGACY_EVENT_TYPE_RENAMES[eventType] });
|
|
10538
|
+
if (eventType === 'content.start') {
|
|
10539
|
+
const { content } = renamed, rest = __rest(renamed, ["content"]);
|
|
10540
|
+
let stepContent;
|
|
10541
|
+
if (content == null) {
|
|
10542
|
+
stepContent = [];
|
|
10717
10543
|
}
|
|
10718
|
-
|
|
10544
|
+
else if (Array.isArray(content)) {
|
|
10545
|
+
stepContent = content;
|
|
10546
|
+
}
|
|
10547
|
+
else {
|
|
10548
|
+
stepContent = [content];
|
|
10549
|
+
}
|
|
10550
|
+
return Object.assign(Object.assign({}, rest), { step: { type: 'model_output', content: stepContent } });
|
|
10551
|
+
}
|
|
10552
|
+
if (eventType === 'interaction.start' || eventType === 'interaction.complete') {
|
|
10553
|
+
const inner = renamed['interaction'];
|
|
10554
|
+
if (isPlainObject(inner)) {
|
|
10555
|
+
renamed['interaction'] = wrapOutputsAsSteps(inner);
|
|
10556
|
+
}
|
|
10557
|
+
}
|
|
10558
|
+
return renamed;
|
|
10559
|
+
}
|
|
10560
|
+
/**
|
|
10561
|
+
* Stream subclass that runs each yielded SSE event through
|
|
10562
|
+
* `maybeRemapLegacyStreamEvent` so consumers always see modern event shapes.
|
|
10563
|
+
*
|
|
10564
|
+
* Wired in via the `__streamClass` request option from `resources/interactions.ts`
|
|
10565
|
+
* (read by `src/internal/parse.ts:defaultParseResponse`).
|
|
10566
|
+
*/
|
|
10567
|
+
class LegacyLyriaStream extends Stream {
|
|
10568
|
+
static fromSSEResponse(response, controller, client) {
|
|
10569
|
+
const base = Stream.fromSSEResponse(response, controller, client);
|
|
10570
|
+
function wrappedIterator() {
|
|
10571
|
+
return __asyncGenerator(this, arguments, function* wrappedIterator_1() {
|
|
10572
|
+
var _a, e_1, _b, _c;
|
|
10573
|
+
try {
|
|
10574
|
+
for (var _d = true, base_1 = __asyncValues(base), base_1_1; base_1_1 = yield __await(base_1.next()), _a = base_1_1.done, !_a; _d = true) {
|
|
10575
|
+
_c = base_1_1.value;
|
|
10576
|
+
_d = false;
|
|
10577
|
+
const item = _c;
|
|
10578
|
+
yield yield __await(maybeRemapLegacyStreamEvent(item));
|
|
10579
|
+
}
|
|
10580
|
+
}
|
|
10581
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
10582
|
+
finally {
|
|
10583
|
+
try {
|
|
10584
|
+
if (!_d && !_a && (_b = base_1.return)) yield __await(_b.call(base_1));
|
|
10585
|
+
}
|
|
10586
|
+
finally { if (e_1) throw e_1.error; }
|
|
10587
|
+
}
|
|
10588
|
+
});
|
|
10589
|
+
}
|
|
10590
|
+
return new LegacyLyriaStream(wrappedIterator, controller, client);
|
|
10591
|
+
}
|
|
10592
|
+
}
|
|
10593
|
+
|
|
10594
|
+
/**
|
|
10595
|
+
* @license
|
|
10596
|
+
* Copyright 2025 Google LLC
|
|
10597
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10598
|
+
*/
|
|
10599
|
+
/**
|
|
10600
|
+
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
10601
|
+
*
|
|
10602
|
+
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
10603
|
+
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
10604
|
+
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
10605
|
+
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
10606
|
+
*/
|
|
10607
|
+
function encodeURIPath(str) {
|
|
10608
|
+
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
10609
|
+
}
|
|
10610
|
+
const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
10611
|
+
const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
|
|
10612
|
+
// If there are no params, no processing is needed.
|
|
10613
|
+
if (statics.length === 1)
|
|
10614
|
+
return statics[0];
|
|
10615
|
+
let postPath = false;
|
|
10616
|
+
const invalidSegments = [];
|
|
10617
|
+
const path = statics.reduce((previousValue, currentValue, index) => {
|
|
10618
|
+
var _a, _b, _c;
|
|
10619
|
+
if (/[?#]/.test(currentValue)) {
|
|
10620
|
+
postPath = true;
|
|
10621
|
+
}
|
|
10622
|
+
const value = params[index];
|
|
10623
|
+
let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
|
|
10624
|
+
if (index !== params.length &&
|
|
10625
|
+
(value == null ||
|
|
10626
|
+
(typeof value === 'object' &&
|
|
10627
|
+
// handle values from other realms
|
|
10628
|
+
value.toString ===
|
|
10629
|
+
((_c = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a = value.hasOwnProperty) !== null && _a !== void 0 ? _a : EMPTY)) !== null && _b !== void 0 ? _b : EMPTY)) === null || _c === void 0 ? void 0 : _c.toString)))) {
|
|
10630
|
+
encoded = value + '';
|
|
10631
|
+
invalidSegments.push({
|
|
10632
|
+
start: previousValue.length + currentValue.length,
|
|
10633
|
+
length: encoded.length,
|
|
10634
|
+
error: `Value of type ${Object.prototype.toString
|
|
10635
|
+
.call(value)
|
|
10636
|
+
.slice(8, -1)} is not a valid path parameter`,
|
|
10637
|
+
});
|
|
10638
|
+
}
|
|
10639
|
+
return previousValue + currentValue + (index === params.length ? '' : encoded);
|
|
10640
|
+
}, '');
|
|
10641
|
+
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
10642
|
+
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
10643
|
+
let match;
|
|
10644
|
+
// Find all invalid segments
|
|
10645
|
+
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
10646
|
+
const hasLeadingSlash = match[0].startsWith('/');
|
|
10647
|
+
const offset = hasLeadingSlash ? 1 : 0;
|
|
10648
|
+
const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
|
|
10649
|
+
invalidSegments.push({
|
|
10650
|
+
start: match.index + offset,
|
|
10651
|
+
length: cleanMatch.length,
|
|
10652
|
+
error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
|
|
10653
|
+
});
|
|
10654
|
+
}
|
|
10655
|
+
invalidSegments.sort((a, b) => a.start - b.start);
|
|
10656
|
+
if (invalidSegments.length > 0) {
|
|
10657
|
+
let lastEnd = 0;
|
|
10658
|
+
const underline = invalidSegments.reduce((acc, segment) => {
|
|
10659
|
+
const spaces = ' '.repeat(segment.start - lastEnd);
|
|
10660
|
+
const arrows = '^'.repeat(segment.length);
|
|
10661
|
+
lastEnd = segment.start + segment.length;
|
|
10662
|
+
return acc + spaces + arrows;
|
|
10663
|
+
}, '');
|
|
10664
|
+
throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
|
|
10665
|
+
.map((e) => e.error)
|
|
10666
|
+
.join('\n')}\n${path}\n${underline}`);
|
|
10667
|
+
}
|
|
10668
|
+
return path;
|
|
10669
|
+
});
|
|
10670
|
+
/**
|
|
10671
|
+
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
10672
|
+
*/
|
|
10673
|
+
const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
10674
|
+
|
|
10675
|
+
/**
|
|
10676
|
+
* @license
|
|
10677
|
+
* Copyright 2025 Google LLC
|
|
10678
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10679
|
+
*/
|
|
10680
|
+
class BaseInteractions extends APIResource {
|
|
10681
|
+
create(params, options) {
|
|
10682
|
+
var _a;
|
|
10683
|
+
const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
|
|
10684
|
+
if ('model' in body && 'agent_config' in body) {
|
|
10685
|
+
throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
|
|
10686
|
+
}
|
|
10687
|
+
if ('agent' in body && 'generation_config' in body) {
|
|
10688
|
+
throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
|
|
10689
|
+
}
|
|
10690
|
+
const needsLegacyLyriaShim = isLegacyLyriaRequest({
|
|
10691
|
+
isVertex: isVertexClient(this._client),
|
|
10692
|
+
model: 'model' in body ? body.model : undefined,
|
|
10693
|
+
});
|
|
10694
|
+
const isStreaming = (_a = params.stream) !== null && _a !== void 0 ? _a : false;
|
|
10695
|
+
const promise = this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign(Object.assign({ body }, options), { stream: isStreaming }), (needsLegacyLyriaShim && isStreaming ? { __streamClass: LegacyLyriaStream } : {})));
|
|
10696
|
+
if (needsLegacyLyriaShim && !isStreaming) {
|
|
10697
|
+
return promise._thenUnwrap((data) => coerceLegacyInteractionResponse(data));
|
|
10698
|
+
}
|
|
10699
|
+
return promise;
|
|
10700
|
+
}
|
|
10701
|
+
/**
|
|
10702
|
+
* Deletes the interaction by id.
|
|
10703
|
+
*
|
|
10704
|
+
* @example
|
|
10705
|
+
* ```ts
|
|
10706
|
+
* const interaction = await client.interactions.delete('id', {
|
|
10707
|
+
* api_version: 'api_version',
|
|
10708
|
+
* });
|
|
10709
|
+
* ```
|
|
10710
|
+
*/
|
|
10711
|
+
delete(id, params = {}, options) {
|
|
10712
|
+
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10713
|
+
return this._client.delete(path `/${api_version}/interactions/${id}`, options);
|
|
10714
|
+
}
|
|
10715
|
+
/**
|
|
10716
|
+
* Cancels an interaction by id. This only applies to background interactions that
|
|
10717
|
+
* are still running.
|
|
10718
|
+
*
|
|
10719
|
+
* @example
|
|
10720
|
+
* ```ts
|
|
10721
|
+
* const interaction = await client.interactions.cancel('id', {
|
|
10722
|
+
* api_version: 'api_version',
|
|
10723
|
+
* });
|
|
10724
|
+
* ```
|
|
10725
|
+
*/
|
|
10726
|
+
cancel(id, params = {}, options) {
|
|
10727
|
+
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10728
|
+
return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
|
|
10729
|
+
}
|
|
10730
|
+
get(id, params = {}, options) {
|
|
10731
|
+
var _a;
|
|
10732
|
+
const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
|
|
10733
|
+
return this._client.get(path `/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a = params === null || params === void 0 ? void 0 : params.stream) !== null && _a !== void 0 ? _a : false }));
|
|
10734
|
+
}
|
|
10735
|
+
}
|
|
10736
|
+
BaseInteractions._key = Object.freeze(['interactions']);
|
|
10737
|
+
class Interactions extends BaseInteractions {
|
|
10738
|
+
}
|
|
10739
|
+
|
|
10740
|
+
/**
|
|
10741
|
+
* @license
|
|
10742
|
+
* Copyright 2025 Google LLC
|
|
10743
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10744
|
+
*/
|
|
10745
|
+
class BaseWebhooks extends APIResource {
|
|
10746
|
+
/**
|
|
10747
|
+
* Creates a new Webhook.
|
|
10748
|
+
*/
|
|
10749
|
+
create(params, options) {
|
|
10750
|
+
const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
|
|
10751
|
+
return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
|
|
10752
|
+
}
|
|
10753
|
+
/**
|
|
10754
|
+
* Updates an existing Webhook.
|
|
10755
|
+
*/
|
|
10756
|
+
update(id, params = {}, options) {
|
|
10757
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
|
|
10758
|
+
return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
|
|
10759
|
+
}
|
|
10760
|
+
/**
|
|
10761
|
+
* Lists all Webhooks.
|
|
10762
|
+
*/
|
|
10763
|
+
list(params = {}, options) {
|
|
10764
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
|
|
10765
|
+
return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
|
|
10766
|
+
}
|
|
10767
|
+
/**
|
|
10768
|
+
* Deletes a Webhook.
|
|
10769
|
+
*/
|
|
10770
|
+
delete(id, params = {}, options) {
|
|
10771
|
+
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10772
|
+
return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
|
|
10773
|
+
}
|
|
10774
|
+
/**
|
|
10775
|
+
* Gets a specific Webhook.
|
|
10776
|
+
*/
|
|
10777
|
+
get(id, params = {}, options) {
|
|
10778
|
+
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
10779
|
+
return this._client.get(path `/${api_version}/webhooks/${id}`, options);
|
|
10780
|
+
}
|
|
10781
|
+
/**
|
|
10782
|
+
* Sends a ping event to a Webhook.
|
|
10783
|
+
*/
|
|
10784
|
+
ping(id, params = undefined, options) {
|
|
10785
|
+
const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
|
|
10786
|
+
return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
|
|
10787
|
+
}
|
|
10788
|
+
/**
|
|
10789
|
+
* Generates a new signing secret for a Webhook.
|
|
10790
|
+
*/
|
|
10791
|
+
rotateSigningSecret(id, params = {}, options) {
|
|
10792
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
|
|
10793
|
+
return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
|
|
10794
|
+
}
|
|
10795
|
+
}
|
|
10796
|
+
BaseWebhooks._key = Object.freeze(['webhooks']);
|
|
10797
|
+
class Webhooks extends BaseWebhooks {
|
|
10798
|
+
}
|
|
10799
|
+
|
|
10800
|
+
/**
|
|
10801
|
+
* @license
|
|
10802
|
+
* Copyright 2025 Google LLC
|
|
10803
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10804
|
+
*/
|
|
10805
|
+
async function defaultParseResponse(client, props) {
|
|
10806
|
+
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
10807
|
+
const body = await (async () => {
|
|
10808
|
+
var _a;
|
|
10809
|
+
if (props.options.stream) {
|
|
10810
|
+
loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);
|
|
10811
|
+
// Note: there is an invariant here that isn't represented in the type system
|
|
10812
|
+
// that if you set `stream: true` the response type must also be `Stream<T>`
|
|
10813
|
+
if (props.options.__streamClass) {
|
|
10814
|
+
return props.options.__streamClass.fromSSEResponse(response, props.controller, client);
|
|
10815
|
+
}
|
|
10816
|
+
return Stream.fromSSEResponse(response, props.controller, client);
|
|
10817
|
+
}
|
|
10818
|
+
// fetch refuses to read the body when the status code is 204.
|
|
10719
10819
|
if (response.status === 204) {
|
|
10720
10820
|
return null;
|
|
10721
10821
|
}
|
|
@@ -11379,7 +11479,7 @@ GeminiNextGenAPIClient.Webhooks = Webhooks;
|
|
|
11379
11479
|
function audioTranscriptionConfigToMldev$1(fromObject) {
|
|
11380
11480
|
const toObject = {};
|
|
11381
11481
|
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
11382
|
-
throw new Error('languageCodes parameter is
|
|
11482
|
+
throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11383
11483
|
}
|
|
11384
11484
|
return toObject;
|
|
11385
11485
|
}
|
|
@@ -11390,23 +11490,23 @@ function authConfigToMldev$2(fromObject) {
|
|
|
11390
11490
|
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
11391
11491
|
}
|
|
11392
11492
|
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
11393
|
-
throw new Error('apiKeyConfig parameter is
|
|
11493
|
+
throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11394
11494
|
}
|
|
11395
11495
|
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
11396
|
-
throw new Error('authType parameter is
|
|
11496
|
+
throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11397
11497
|
}
|
|
11398
11498
|
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
11399
11499
|
undefined) {
|
|
11400
|
-
throw new Error('googleServiceAccountConfig parameter is
|
|
11500
|
+
throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11401
11501
|
}
|
|
11402
11502
|
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
11403
|
-
throw new Error('httpBasicAuthConfig parameter is
|
|
11503
|
+
throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11404
11504
|
}
|
|
11405
11505
|
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
11406
|
-
throw new Error('oauthConfig parameter is
|
|
11506
|
+
throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11407
11507
|
}
|
|
11408
11508
|
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
11409
|
-
throw new Error('oidcConfig parameter is
|
|
11509
|
+
throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11410
11510
|
}
|
|
11411
11511
|
return toObject;
|
|
11412
11512
|
}
|
|
@@ -11417,7 +11517,7 @@ function blobToMldev$2(fromObject) {
|
|
|
11417
11517
|
setValueByPath(toObject, ['data'], fromData);
|
|
11418
11518
|
}
|
|
11419
11519
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
11420
|
-
throw new Error('displayName parameter is
|
|
11520
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11421
11521
|
}
|
|
11422
11522
|
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
11423
11523
|
if (fromMimeType != null) {
|
|
@@ -11464,7 +11564,7 @@ function contentToVertex$1(fromObject) {
|
|
|
11464
11564
|
function fileDataToMldev$2(fromObject) {
|
|
11465
11565
|
const toObject = {};
|
|
11466
11566
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
11467
|
-
throw new Error('displayName parameter is
|
|
11567
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11468
11568
|
}
|
|
11469
11569
|
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
11470
11570
|
if (fromFileUri != null) {
|
|
@@ -11491,45 +11591,10 @@ function functionCallToMldev$2(fromObject) {
|
|
|
11491
11591
|
setValueByPath(toObject, ['name'], fromName);
|
|
11492
11592
|
}
|
|
11493
11593
|
if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
|
|
11494
|
-
throw new Error('partialArgs parameter is
|
|
11594
|
+
throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11495
11595
|
}
|
|
11496
11596
|
if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
|
|
11497
|
-
throw new Error('willContinue parameter is
|
|
11498
|
-
}
|
|
11499
|
-
return toObject;
|
|
11500
|
-
}
|
|
11501
|
-
function functionDeclarationToVertex$1(fromObject) {
|
|
11502
|
-
const toObject = {};
|
|
11503
|
-
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
11504
|
-
if (fromDescription != null) {
|
|
11505
|
-
setValueByPath(toObject, ['description'], fromDescription);
|
|
11506
|
-
}
|
|
11507
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
11508
|
-
if (fromName != null) {
|
|
11509
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
11510
|
-
}
|
|
11511
|
-
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
11512
|
-
if (fromParameters != null) {
|
|
11513
|
-
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
11514
|
-
}
|
|
11515
|
-
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
11516
|
-
'parametersJsonSchema',
|
|
11517
|
-
]);
|
|
11518
|
-
if (fromParametersJsonSchema != null) {
|
|
11519
|
-
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
11520
|
-
}
|
|
11521
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
11522
|
-
if (fromResponse != null) {
|
|
11523
|
-
setValueByPath(toObject, ['response'], fromResponse);
|
|
11524
|
-
}
|
|
11525
|
-
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
11526
|
-
'responseJsonSchema',
|
|
11527
|
-
]);
|
|
11528
|
-
if (fromResponseJsonSchema != null) {
|
|
11529
|
-
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
11530
|
-
}
|
|
11531
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
11532
|
-
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
11597
|
+
throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11533
11598
|
}
|
|
11534
11599
|
return toObject;
|
|
11535
11600
|
}
|
|
@@ -11657,7 +11722,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
11657
11722
|
}
|
|
11658
11723
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
11659
11724
|
undefined) {
|
|
11660
|
-
throw new Error('enableEnhancedCivicAnswers parameter is
|
|
11725
|
+
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11661
11726
|
}
|
|
11662
11727
|
return toObject;
|
|
11663
11728
|
}
|
|
@@ -11680,10 +11745,10 @@ function googleSearchToMldev$2(fromObject) {
|
|
|
11680
11745
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
11681
11746
|
}
|
|
11682
11747
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
11683
|
-
throw new Error('blockingConfidence parameter is
|
|
11748
|
+
throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11684
11749
|
}
|
|
11685
11750
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
11686
|
-
throw new Error('excludeDomains parameter is
|
|
11751
|
+
throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11687
11752
|
}
|
|
11688
11753
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
11689
11754
|
'timeRangeFilter',
|
|
@@ -11802,7 +11867,7 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
11802
11867
|
setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
|
|
11803
11868
|
}
|
|
11804
11869
|
if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
|
|
11805
|
-
throw new Error('explicitVadSignal parameter is
|
|
11870
|
+
throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
11806
11871
|
}
|
|
11807
11872
|
const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
|
|
11808
11873
|
if (parentObject !== undefined && fromAvatarConfig != null) {
|
|
@@ -12273,13 +12338,13 @@ function partToVertex$1(fromObject) {
|
|
|
12273
12338
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
12274
12339
|
}
|
|
12275
12340
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
12276
|
-
throw new Error('toolCall parameter is
|
|
12341
|
+
throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12277
12342
|
}
|
|
12278
12343
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
12279
|
-
throw new Error('toolResponse parameter is
|
|
12344
|
+
throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12280
12345
|
}
|
|
12281
12346
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
12282
|
-
throw new Error('partMetadata parameter is
|
|
12347
|
+
throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12283
12348
|
}
|
|
12284
12349
|
return toObject;
|
|
12285
12350
|
}
|
|
@@ -12290,7 +12355,7 @@ function safetySettingToMldev$2(fromObject) {
|
|
|
12290
12355
|
setValueByPath(toObject, ['category'], fromCategory);
|
|
12291
12356
|
}
|
|
12292
12357
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
12293
|
-
throw new Error('method parameter is
|
|
12358
|
+
throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12294
12359
|
}
|
|
12295
12360
|
const fromThreshold = getValueByPath(fromObject, ['threshold']);
|
|
12296
12361
|
if (fromThreshold != null) {
|
|
@@ -12305,14 +12370,14 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
12305
12370
|
setValueByPath(toObject, ['handle'], fromHandle);
|
|
12306
12371
|
}
|
|
12307
12372
|
if (getValueByPath(fromObject, ['transparent']) !== undefined) {
|
|
12308
|
-
throw new Error('transparent parameter is
|
|
12373
|
+
throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12309
12374
|
}
|
|
12310
12375
|
return toObject;
|
|
12311
12376
|
}
|
|
12312
12377
|
function toolToMldev$2(fromObject) {
|
|
12313
12378
|
const toObject = {};
|
|
12314
12379
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
12315
|
-
throw new Error('retrieval parameter is
|
|
12380
|
+
throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12316
12381
|
}
|
|
12317
12382
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
12318
12383
|
if (fromComputerUse != null) {
|
|
@@ -12337,7 +12402,7 @@ function toolToMldev$2(fromObject) {
|
|
|
12337
12402
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
12338
12403
|
}
|
|
12339
12404
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
12340
|
-
throw new Error('enterpriseWebSearch parameter is
|
|
12405
|
+
throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12341
12406
|
}
|
|
12342
12407
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
12343
12408
|
'functionDeclarations',
|
|
@@ -12358,7 +12423,7 @@ function toolToMldev$2(fromObject) {
|
|
|
12358
12423
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
12359
12424
|
}
|
|
12360
12425
|
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
12361
|
-
throw new Error('parallelAiSearch parameter is
|
|
12426
|
+
throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12362
12427
|
}
|
|
12363
12428
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
12364
12429
|
if (fromUrlContext != null) {
|
|
@@ -12387,7 +12452,7 @@ function toolToVertex$1(fromObject) {
|
|
|
12387
12452
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
12388
12453
|
}
|
|
12389
12454
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
12390
|
-
throw new Error('fileSearch parameter is
|
|
12455
|
+
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12391
12456
|
}
|
|
12392
12457
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
12393
12458
|
if (fromGoogleSearch != null) {
|
|
@@ -12416,7 +12481,7 @@ function toolToVertex$1(fromObject) {
|
|
|
12416
12481
|
let transformedList = fromFunctionDeclarations;
|
|
12417
12482
|
if (Array.isArray(transformedList)) {
|
|
12418
12483
|
transformedList = transformedList.map((item) => {
|
|
12419
|
-
return
|
|
12484
|
+
return item;
|
|
12420
12485
|
});
|
|
12421
12486
|
}
|
|
12422
12487
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -12438,7 +12503,7 @@ function toolToVertex$1(fromObject) {
|
|
|
12438
12503
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
12439
12504
|
}
|
|
12440
12505
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
12441
|
-
throw new Error('mcpServers parameter is
|
|
12506
|
+
throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12442
12507
|
}
|
|
12443
12508
|
return toObject;
|
|
12444
12509
|
}
|
|
@@ -12555,23 +12620,23 @@ function authConfigToMldev$1(fromObject, _rootObject) {
|
|
|
12555
12620
|
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
12556
12621
|
}
|
|
12557
12622
|
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
12558
|
-
throw new Error('apiKeyConfig parameter is
|
|
12623
|
+
throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12559
12624
|
}
|
|
12560
12625
|
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
12561
|
-
throw new Error('authType parameter is
|
|
12626
|
+
throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12562
12627
|
}
|
|
12563
12628
|
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
12564
12629
|
undefined) {
|
|
12565
|
-
throw new Error('googleServiceAccountConfig parameter is
|
|
12630
|
+
throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12566
12631
|
}
|
|
12567
12632
|
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
12568
|
-
throw new Error('httpBasicAuthConfig parameter is
|
|
12633
|
+
throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12569
12634
|
}
|
|
12570
12635
|
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
12571
|
-
throw new Error('oauthConfig parameter is
|
|
12636
|
+
throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12572
12637
|
}
|
|
12573
12638
|
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
12574
|
-
throw new Error('oidcConfig parameter is
|
|
12639
|
+
throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12575
12640
|
}
|
|
12576
12641
|
return toObject;
|
|
12577
12642
|
}
|
|
@@ -12582,7 +12647,7 @@ function blobToMldev$1(fromObject, _rootObject) {
|
|
|
12582
12647
|
setValueByPath(toObject, ['data'], fromData);
|
|
12583
12648
|
}
|
|
12584
12649
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
12585
|
-
throw new Error('displayName parameter is
|
|
12650
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12586
12651
|
}
|
|
12587
12652
|
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
12588
12653
|
if (fromMimeType != null) {
|
|
@@ -12779,13 +12844,13 @@ function controlReferenceConfigToVertex(fromObject, _rootObject) {
|
|
|
12779
12844
|
function countTokensConfigToMldev(fromObject, _rootObject) {
|
|
12780
12845
|
const toObject = {};
|
|
12781
12846
|
if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
|
|
12782
|
-
throw new Error('systemInstruction parameter is
|
|
12847
|
+
throw new Error('systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12783
12848
|
}
|
|
12784
12849
|
if (getValueByPath(fromObject, ['tools']) !== undefined) {
|
|
12785
|
-
throw new Error('tools parameter is
|
|
12850
|
+
throw new Error('tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12786
12851
|
}
|
|
12787
12852
|
if (getValueByPath(fromObject, ['generationConfig']) !== undefined) {
|
|
12788
|
-
throw new Error('generationConfig parameter is
|
|
12853
|
+
throw new Error('generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12789
12854
|
}
|
|
12790
12855
|
return toObject;
|
|
12791
12856
|
}
|
|
@@ -13086,16 +13151,16 @@ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
13086
13151
|
setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
|
|
13087
13152
|
}
|
|
13088
13153
|
if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
|
|
13089
|
-
throw new Error('mimeType parameter is
|
|
13154
|
+
throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13090
13155
|
}
|
|
13091
13156
|
if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
|
|
13092
|
-
throw new Error('autoTruncate parameter is
|
|
13157
|
+
throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13093
13158
|
}
|
|
13094
13159
|
if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
|
|
13095
|
-
throw new Error('documentOcr parameter is
|
|
13160
|
+
throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13096
13161
|
}
|
|
13097
13162
|
if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
|
|
13098
|
-
throw new Error('audioTrackExtraction parameter is
|
|
13163
|
+
throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13099
13164
|
}
|
|
13100
13165
|
return toObject;
|
|
13101
13166
|
}
|
|
@@ -13379,7 +13444,7 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
13379
13444
|
function fileDataToMldev$1(fromObject, _rootObject) {
|
|
13380
13445
|
const toObject = {};
|
|
13381
13446
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
13382
|
-
throw new Error('displayName parameter is
|
|
13447
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13383
13448
|
}
|
|
13384
13449
|
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
13385
13450
|
if (fromFileUri != null) {
|
|
@@ -13406,10 +13471,10 @@ function functionCallToMldev$1(fromObject, _rootObject) {
|
|
|
13406
13471
|
setValueByPath(toObject, ['name'], fromName);
|
|
13407
13472
|
}
|
|
13408
13473
|
if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
|
|
13409
|
-
throw new Error('partialArgs parameter is
|
|
13474
|
+
throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13410
13475
|
}
|
|
13411
13476
|
if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
|
|
13412
|
-
throw new Error('willContinue parameter is
|
|
13477
|
+
throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13413
13478
|
}
|
|
13414
13479
|
return toObject;
|
|
13415
13480
|
}
|
|
@@ -13427,42 +13492,7 @@ function functionCallingConfigToMldev(fromObject, _rootObject) {
|
|
|
13427
13492
|
}
|
|
13428
13493
|
if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
|
|
13429
13494
|
undefined) {
|
|
13430
|
-
throw new Error('streamFunctionCallArguments parameter is
|
|
13431
|
-
}
|
|
13432
|
-
return toObject;
|
|
13433
|
-
}
|
|
13434
|
-
function functionDeclarationToVertex(fromObject, _rootObject) {
|
|
13435
|
-
const toObject = {};
|
|
13436
|
-
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
13437
|
-
if (fromDescription != null) {
|
|
13438
|
-
setValueByPath(toObject, ['description'], fromDescription);
|
|
13439
|
-
}
|
|
13440
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
13441
|
-
if (fromName != null) {
|
|
13442
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
13443
|
-
}
|
|
13444
|
-
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
13445
|
-
if (fromParameters != null) {
|
|
13446
|
-
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
13447
|
-
}
|
|
13448
|
-
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
13449
|
-
'parametersJsonSchema',
|
|
13450
|
-
]);
|
|
13451
|
-
if (fromParametersJsonSchema != null) {
|
|
13452
|
-
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
13453
|
-
}
|
|
13454
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
13455
|
-
if (fromResponse != null) {
|
|
13456
|
-
setValueByPath(toObject, ['response'], fromResponse);
|
|
13457
|
-
}
|
|
13458
|
-
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
13459
|
-
'responseJsonSchema',
|
|
13460
|
-
]);
|
|
13461
|
-
if (fromResponseJsonSchema != null) {
|
|
13462
|
-
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
13463
|
-
}
|
|
13464
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
13465
|
-
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
13495
|
+
throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13466
13496
|
}
|
|
13467
13497
|
return toObject;
|
|
13468
13498
|
}
|
|
@@ -13549,10 +13579,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
13549
13579
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
13550
13580
|
}
|
|
13551
13581
|
if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
|
|
13552
|
-
throw new Error('routingConfig parameter is
|
|
13582
|
+
throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13553
13583
|
}
|
|
13554
13584
|
if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
|
|
13555
|
-
throw new Error('modelSelectionConfig parameter is
|
|
13585
|
+
throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13556
13586
|
}
|
|
13557
13587
|
const fromSafetySettings = getValueByPath(fromObject, [
|
|
13558
13588
|
'safetySettings',
|
|
@@ -13581,7 +13611,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
13581
13611
|
setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev(fromToolConfig));
|
|
13582
13612
|
}
|
|
13583
13613
|
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
13584
|
-
throw new Error('labels parameter is
|
|
13614
|
+
throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13585
13615
|
}
|
|
13586
13616
|
const fromCachedContent = getValueByPath(fromObject, [
|
|
13587
13617
|
'cachedContent',
|
|
@@ -13606,7 +13636,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
13606
13636
|
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
13607
13637
|
}
|
|
13608
13638
|
if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
|
|
13609
|
-
throw new Error('audioTimestamp parameter is
|
|
13639
|
+
throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13610
13640
|
}
|
|
13611
13641
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
13612
13642
|
'thinkingConfig',
|
|
@@ -13625,7 +13655,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
|
|
|
13625
13655
|
setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
|
|
13626
13656
|
}
|
|
13627
13657
|
if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
|
|
13628
|
-
throw new Error('modelArmorConfig parameter is
|
|
13658
|
+
throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13629
13659
|
}
|
|
13630
13660
|
const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
|
|
13631
13661
|
if (parentObject !== undefined && fromServiceTier != null) {
|
|
@@ -13797,7 +13827,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
13797
13827
|
}
|
|
13798
13828
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
13799
13829
|
undefined) {
|
|
13800
|
-
throw new Error('enableEnhancedCivicAnswers parameter is
|
|
13830
|
+
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
13801
13831
|
}
|
|
13802
13832
|
const fromModelArmorConfig = getValueByPath(fromObject, [
|
|
13803
13833
|
'modelArmorConfig',
|
|
@@ -13946,10 +13976,10 @@ function generateContentResponseFromVertex(fromObject, _rootObject) {
|
|
|
13946
13976
|
function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
13947
13977
|
const toObject = {};
|
|
13948
13978
|
if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
|
|
13949
|
-
throw new Error('outputGcsUri parameter is
|
|
13979
|
+
throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13950
13980
|
}
|
|
13951
13981
|
if (getValueByPath(fromObject, ['negativePrompt']) !== undefined) {
|
|
13952
|
-
throw new Error('negativePrompt parameter is
|
|
13982
|
+
throw new Error('negativePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13953
13983
|
}
|
|
13954
13984
|
const fromNumberOfImages = getValueByPath(fromObject, [
|
|
13955
13985
|
'numberOfImages',
|
|
@@ -13968,7 +13998,7 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
13968
13998
|
setValueByPath(parentObject, ['parameters', 'guidanceScale'], fromGuidanceScale);
|
|
13969
13999
|
}
|
|
13970
14000
|
if (getValueByPath(fromObject, ['seed']) !== undefined) {
|
|
13971
|
-
throw new Error('seed parameter is
|
|
14001
|
+
throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
13972
14002
|
}
|
|
13973
14003
|
const fromSafetyFilterLevel = getValueByPath(fromObject, [
|
|
13974
14004
|
'safetyFilterLevel',
|
|
@@ -14011,17 +14041,17 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
14011
14041
|
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
14012
14042
|
}
|
|
14013
14043
|
if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
|
|
14014
|
-
throw new Error('addWatermark parameter is
|
|
14044
|
+
throw new Error('addWatermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14015
14045
|
}
|
|
14016
14046
|
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
14017
|
-
throw new Error('labels parameter is
|
|
14047
|
+
throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14018
14048
|
}
|
|
14019
14049
|
const fromImageSize = getValueByPath(fromObject, ['imageSize']);
|
|
14020
14050
|
if (parentObject !== undefined && fromImageSize != null) {
|
|
14021
14051
|
setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
|
|
14022
14052
|
}
|
|
14023
14053
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
14024
|
-
throw new Error('enhancePrompt parameter is
|
|
14054
|
+
throw new Error('enhancePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14025
14055
|
}
|
|
14026
14056
|
return toObject;
|
|
14027
14057
|
}
|
|
@@ -14214,10 +14244,10 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14214
14244
|
setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfVideos);
|
|
14215
14245
|
}
|
|
14216
14246
|
if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
|
|
14217
|
-
throw new Error('outputGcsUri parameter is
|
|
14247
|
+
throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14218
14248
|
}
|
|
14219
14249
|
if (getValueByPath(fromObject, ['fps']) !== undefined) {
|
|
14220
|
-
throw new Error('fps parameter is
|
|
14250
|
+
throw new Error('fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14221
14251
|
}
|
|
14222
14252
|
const fromDurationSeconds = getValueByPath(fromObject, [
|
|
14223
14253
|
'durationSeconds',
|
|
@@ -14226,7 +14256,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14226
14256
|
setValueByPath(parentObject, ['parameters', 'durationSeconds'], fromDurationSeconds);
|
|
14227
14257
|
}
|
|
14228
14258
|
if (getValueByPath(fromObject, ['seed']) !== undefined) {
|
|
14229
|
-
throw new Error('seed parameter is
|
|
14259
|
+
throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14230
14260
|
}
|
|
14231
14261
|
const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
|
|
14232
14262
|
if (parentObject !== undefined && fromAspectRatio != null) {
|
|
@@ -14243,7 +14273,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14243
14273
|
setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
|
|
14244
14274
|
}
|
|
14245
14275
|
if (getValueByPath(fromObject, ['pubsubTopic']) !== undefined) {
|
|
14246
|
-
throw new Error('pubsubTopic parameter is
|
|
14276
|
+
throw new Error('pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14247
14277
|
}
|
|
14248
14278
|
const fromNegativePrompt = getValueByPath(fromObject, [
|
|
14249
14279
|
'negativePrompt',
|
|
@@ -14258,7 +14288,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14258
14288
|
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
14259
14289
|
}
|
|
14260
14290
|
if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
|
|
14261
|
-
throw new Error('generateAudio parameter is
|
|
14291
|
+
throw new Error('generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14262
14292
|
}
|
|
14263
14293
|
const fromLastFrame = getValueByPath(fromObject, ['lastFrame']);
|
|
14264
14294
|
if (parentObject !== undefined && fromLastFrame != null) {
|
|
@@ -14277,13 +14307,13 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14277
14307
|
setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
|
|
14278
14308
|
}
|
|
14279
14309
|
if (getValueByPath(fromObject, ['mask']) !== undefined) {
|
|
14280
|
-
throw new Error('mask parameter is
|
|
14310
|
+
throw new Error('mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14281
14311
|
}
|
|
14282
14312
|
if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
|
|
14283
|
-
throw new Error('compressionQuality parameter is
|
|
14313
|
+
throw new Error('compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14284
14314
|
}
|
|
14285
14315
|
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
14286
|
-
throw new Error('labels parameter is
|
|
14316
|
+
throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14287
14317
|
}
|
|
14288
14318
|
const fromWebhookConfig = getValueByPath(fromObject, [
|
|
14289
14319
|
'webhookConfig',
|
|
@@ -14292,7 +14322,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
14292
14322
|
setValueByPath(parentObject, ['webhookConfig'], fromWebhookConfig);
|
|
14293
14323
|
}
|
|
14294
14324
|
if (getValueByPath(fromObject, ['resizeMode']) !== undefined) {
|
|
14295
|
-
throw new Error('resizeMode parameter is
|
|
14325
|
+
throw new Error('resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14296
14326
|
}
|
|
14297
14327
|
return toObject;
|
|
14298
14328
|
}
|
|
@@ -14389,7 +14419,7 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
14389
14419
|
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
14390
14420
|
}
|
|
14391
14421
|
if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
|
|
14392
|
-
throw new Error('webhookConfig parameter is
|
|
14422
|
+
throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
14393
14423
|
}
|
|
14394
14424
|
const fromResizeMode = getValueByPath(fromObject, ['resizeMode']);
|
|
14395
14425
|
if (parentObject !== undefined && fromResizeMode != null) {
|
|
@@ -14788,7 +14818,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
14788
14818
|
}
|
|
14789
14819
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
14790
14820
|
undefined) {
|
|
14791
|
-
throw new Error('enableEnhancedCivicAnswers parameter is
|
|
14821
|
+
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
14792
14822
|
}
|
|
14793
14823
|
return toObject;
|
|
14794
14824
|
}
|
|
@@ -14827,10 +14857,10 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
|
|
|
14827
14857
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
14828
14858
|
}
|
|
14829
14859
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
14830
|
-
throw new Error('blockingConfidence parameter is
|
|
14860
|
+
throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14831
14861
|
}
|
|
14832
14862
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
14833
|
-
throw new Error('excludeDomains parameter is
|
|
14863
|
+
throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14834
14864
|
}
|
|
14835
14865
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
14836
14866
|
'timeRangeFilter',
|
|
@@ -14851,20 +14881,20 @@ function imageConfigToMldev(fromObject, _rootObject) {
|
|
|
14851
14881
|
setValueByPath(toObject, ['imageSize'], fromImageSize);
|
|
14852
14882
|
}
|
|
14853
14883
|
if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
|
|
14854
|
-
throw new Error('personGeneration parameter is
|
|
14884
|
+
throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14855
14885
|
}
|
|
14856
14886
|
if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
|
|
14857
|
-
throw new Error('prominentPeople parameter is
|
|
14887
|
+
throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14858
14888
|
}
|
|
14859
14889
|
if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
|
|
14860
|
-
throw new Error('outputMimeType parameter is
|
|
14890
|
+
throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14861
14891
|
}
|
|
14862
14892
|
if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
|
|
14863
14893
|
undefined) {
|
|
14864
|
-
throw new Error('outputCompressionQuality parameter is
|
|
14894
|
+
throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14865
14895
|
}
|
|
14866
14896
|
if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
|
|
14867
|
-
throw new Error('imageOutputOptions parameter is
|
|
14897
|
+
throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14868
14898
|
}
|
|
14869
14899
|
return toObject;
|
|
14870
14900
|
}
|
|
@@ -14945,7 +14975,7 @@ function imageFromVertex(fromObject, _rootObject) {
|
|
|
14945
14975
|
function imageToMldev(fromObject, _rootObject) {
|
|
14946
14976
|
const toObject = {};
|
|
14947
14977
|
if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
|
|
14948
|
-
throw new Error('gcsUri parameter is
|
|
14978
|
+
throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
14949
14979
|
}
|
|
14950
14980
|
const fromImageBytes = getValueByPath(fromObject, ['imageBytes']);
|
|
14951
14981
|
if (fromImageBytes != null) {
|
|
@@ -15348,13 +15378,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
15348
15378
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
15349
15379
|
}
|
|
15350
15380
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
15351
|
-
throw new Error('toolCall parameter is
|
|
15381
|
+
throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15352
15382
|
}
|
|
15353
15383
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
15354
|
-
throw new Error('toolResponse parameter is
|
|
15384
|
+
throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15355
15385
|
}
|
|
15356
15386
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
15357
|
-
throw new Error('partMetadata parameter is
|
|
15387
|
+
throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15358
15388
|
}
|
|
15359
15389
|
return toObject;
|
|
15360
15390
|
}
|
|
@@ -15577,7 +15607,7 @@ function safetySettingToMldev$1(fromObject, _rootObject) {
|
|
|
15577
15607
|
setValueByPath(toObject, ['category'], fromCategory);
|
|
15578
15608
|
}
|
|
15579
15609
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
15580
|
-
throw new Error('method parameter is
|
|
15610
|
+
throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15581
15611
|
}
|
|
15582
15612
|
const fromThreshold = getValueByPath(fromObject, ['threshold']);
|
|
15583
15613
|
if (fromThreshold != null) {
|
|
@@ -15711,14 +15741,14 @@ function toolConfigToVertex(fromObject, _rootObject) {
|
|
|
15711
15741
|
}
|
|
15712
15742
|
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
15713
15743
|
undefined) {
|
|
15714
|
-
throw new Error('includeServerSideToolInvocations parameter is
|
|
15744
|
+
throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15715
15745
|
}
|
|
15716
15746
|
return toObject;
|
|
15717
15747
|
}
|
|
15718
15748
|
function toolToMldev$1(fromObject, rootObject) {
|
|
15719
15749
|
const toObject = {};
|
|
15720
15750
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
15721
|
-
throw new Error('retrieval parameter is
|
|
15751
|
+
throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15722
15752
|
}
|
|
15723
15753
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
15724
15754
|
if (fromComputerUse != null) {
|
|
@@ -15743,7 +15773,7 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
15743
15773
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
15744
15774
|
}
|
|
15745
15775
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
15746
|
-
throw new Error('enterpriseWebSearch parameter is
|
|
15776
|
+
throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15747
15777
|
}
|
|
15748
15778
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
15749
15779
|
'functionDeclarations',
|
|
@@ -15764,7 +15794,7 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
15764
15794
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
15765
15795
|
}
|
|
15766
15796
|
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
15767
|
-
throw new Error('parallelAiSearch parameter is
|
|
15797
|
+
throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15768
15798
|
}
|
|
15769
15799
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
15770
15800
|
if (fromUrlContext != null) {
|
|
@@ -15782,7 +15812,7 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
15782
15812
|
}
|
|
15783
15813
|
return toObject;
|
|
15784
15814
|
}
|
|
15785
|
-
function toolToVertex(fromObject,
|
|
15815
|
+
function toolToVertex(fromObject, _rootObject) {
|
|
15786
15816
|
const toObject = {};
|
|
15787
15817
|
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
15788
15818
|
if (fromRetrieval != null) {
|
|
@@ -15793,7 +15823,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
15793
15823
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
15794
15824
|
}
|
|
15795
15825
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
15796
|
-
throw new Error('fileSearch parameter is
|
|
15826
|
+
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15797
15827
|
}
|
|
15798
15828
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
15799
15829
|
if (fromGoogleSearch != null) {
|
|
@@ -15822,7 +15852,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
15822
15852
|
let transformedList = fromFunctionDeclarations;
|
|
15823
15853
|
if (Array.isArray(transformedList)) {
|
|
15824
15854
|
transformedList = transformedList.map((item) => {
|
|
15825
|
-
return
|
|
15855
|
+
return item;
|
|
15826
15856
|
});
|
|
15827
15857
|
}
|
|
15828
15858
|
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
@@ -15844,7 +15874,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
15844
15874
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
15845
15875
|
}
|
|
15846
15876
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
15847
|
-
throw new Error('mcpServers parameter is
|
|
15877
|
+
throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15848
15878
|
}
|
|
15849
15879
|
return toObject;
|
|
15850
15880
|
}
|
|
@@ -17361,7 +17391,7 @@ class Models extends BaseModule {
|
|
|
17361
17391
|
if (this.apiClient.isVertexAI()) {
|
|
17362
17392
|
if (!actualParams.config.queryBase) {
|
|
17363
17393
|
if ((_a = actualParams.config) === null || _a === void 0 ? void 0 : _a.filter) {
|
|
17364
|
-
throw new Error('Filtering tuned models list
|
|
17394
|
+
throw new Error('Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
17365
17395
|
}
|
|
17366
17396
|
else {
|
|
17367
17397
|
actualParams.config.filter = 'labels.tune-type:*';
|
|
@@ -18817,7 +18847,7 @@ class Operations extends BaseModule {
|
|
|
18817
18847
|
function audioTranscriptionConfigToMldev(fromObject) {
|
|
18818
18848
|
const toObject = {};
|
|
18819
18849
|
if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
|
|
18820
|
-
throw new Error('languageCodes parameter is
|
|
18850
|
+
throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18821
18851
|
}
|
|
18822
18852
|
return toObject;
|
|
18823
18853
|
}
|
|
@@ -18828,23 +18858,23 @@ function authConfigToMldev(fromObject) {
|
|
|
18828
18858
|
setValueByPath(toObject, ['apiKey'], fromApiKey);
|
|
18829
18859
|
}
|
|
18830
18860
|
if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
|
|
18831
|
-
throw new Error('apiKeyConfig parameter is
|
|
18861
|
+
throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18832
18862
|
}
|
|
18833
18863
|
if (getValueByPath(fromObject, ['authType']) !== undefined) {
|
|
18834
|
-
throw new Error('authType parameter is
|
|
18864
|
+
throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18835
18865
|
}
|
|
18836
18866
|
if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
|
|
18837
18867
|
undefined) {
|
|
18838
|
-
throw new Error('googleServiceAccountConfig parameter is
|
|
18868
|
+
throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18839
18869
|
}
|
|
18840
18870
|
if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
|
|
18841
|
-
throw new Error('httpBasicAuthConfig parameter is
|
|
18871
|
+
throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18842
18872
|
}
|
|
18843
18873
|
if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
|
|
18844
|
-
throw new Error('oauthConfig parameter is
|
|
18874
|
+
throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18845
18875
|
}
|
|
18846
18876
|
if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
|
|
18847
|
-
throw new Error('oidcConfig parameter is
|
|
18877
|
+
throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18848
18878
|
}
|
|
18849
18879
|
return toObject;
|
|
18850
18880
|
}
|
|
@@ -18855,7 +18885,7 @@ function blobToMldev(fromObject) {
|
|
|
18855
18885
|
setValueByPath(toObject, ['data'], fromData);
|
|
18856
18886
|
}
|
|
18857
18887
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
18858
|
-
throw new Error('displayName parameter is
|
|
18888
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18859
18889
|
}
|
|
18860
18890
|
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
18861
18891
|
if (fromMimeType != null) {
|
|
@@ -18922,7 +18952,7 @@ function createAuthTokenParametersToMldev(apiClient, fromObject) {
|
|
|
18922
18952
|
function fileDataToMldev(fromObject) {
|
|
18923
18953
|
const toObject = {};
|
|
18924
18954
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
18925
|
-
throw new Error('displayName parameter is
|
|
18955
|
+
throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18926
18956
|
}
|
|
18927
18957
|
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
18928
18958
|
if (fromFileUri != null) {
|
|
@@ -18949,10 +18979,10 @@ function functionCallToMldev(fromObject) {
|
|
|
18949
18979
|
setValueByPath(toObject, ['name'], fromName);
|
|
18950
18980
|
}
|
|
18951
18981
|
if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
|
|
18952
|
-
throw new Error('partialArgs parameter is
|
|
18982
|
+
throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18953
18983
|
}
|
|
18954
18984
|
if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
|
|
18955
|
-
throw new Error('willContinue parameter is
|
|
18985
|
+
throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18956
18986
|
}
|
|
18957
18987
|
return toObject;
|
|
18958
18988
|
}
|
|
@@ -18975,10 +19005,10 @@ function googleSearchToMldev(fromObject) {
|
|
|
18975
19005
|
setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
|
|
18976
19006
|
}
|
|
18977
19007
|
if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
|
|
18978
|
-
throw new Error('blockingConfidence parameter is
|
|
19008
|
+
throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18979
19009
|
}
|
|
18980
19010
|
if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
|
|
18981
|
-
throw new Error('excludeDomains parameter is
|
|
19011
|
+
throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
18982
19012
|
}
|
|
18983
19013
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
18984
19014
|
'timeRangeFilter',
|
|
@@ -19097,7 +19127,7 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
|
|
|
19097
19127
|
setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
|
|
19098
19128
|
}
|
|
19099
19129
|
if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
|
|
19100
|
-
throw new Error('explicitVadSignal parameter is
|
|
19130
|
+
throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19101
19131
|
}
|
|
19102
19132
|
const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
|
|
19103
19133
|
if (parentObject !== undefined && fromAvatarConfig != null) {
|
|
@@ -19208,7 +19238,7 @@ function safetySettingToMldev(fromObject) {
|
|
|
19208
19238
|
setValueByPath(toObject, ['category'], fromCategory);
|
|
19209
19239
|
}
|
|
19210
19240
|
if (getValueByPath(fromObject, ['method']) !== undefined) {
|
|
19211
|
-
throw new Error('method parameter is
|
|
19241
|
+
throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19212
19242
|
}
|
|
19213
19243
|
const fromThreshold = getValueByPath(fromObject, ['threshold']);
|
|
19214
19244
|
if (fromThreshold != null) {
|
|
@@ -19223,14 +19253,14 @@ function sessionResumptionConfigToMldev(fromObject) {
|
|
|
19223
19253
|
setValueByPath(toObject, ['handle'], fromHandle);
|
|
19224
19254
|
}
|
|
19225
19255
|
if (getValueByPath(fromObject, ['transparent']) !== undefined) {
|
|
19226
|
-
throw new Error('transparent parameter is
|
|
19256
|
+
throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19227
19257
|
}
|
|
19228
19258
|
return toObject;
|
|
19229
19259
|
}
|
|
19230
19260
|
function toolToMldev(fromObject) {
|
|
19231
19261
|
const toObject = {};
|
|
19232
19262
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
19233
|
-
throw new Error('retrieval parameter is
|
|
19263
|
+
throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19234
19264
|
}
|
|
19235
19265
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
19236
19266
|
if (fromComputerUse != null) {
|
|
@@ -19255,7 +19285,7 @@ function toolToMldev(fromObject) {
|
|
|
19255
19285
|
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
19256
19286
|
}
|
|
19257
19287
|
if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
|
|
19258
|
-
throw new Error('enterpriseWebSearch parameter is
|
|
19288
|
+
throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19259
19289
|
}
|
|
19260
19290
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
19261
19291
|
'functionDeclarations',
|
|
@@ -19276,7 +19306,7 @@ function toolToMldev(fromObject) {
|
|
|
19276
19306
|
setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
|
|
19277
19307
|
}
|
|
19278
19308
|
if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
|
|
19279
|
-
throw new Error('parallelAiSearch parameter is
|
|
19309
|
+
throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19280
19310
|
}
|
|
19281
19311
|
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
19282
19312
|
if (fromUrlContext != null) {
|
|
@@ -19610,7 +19640,7 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
|
|
|
19610
19640
|
function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
19611
19641
|
const toObject = {};
|
|
19612
19642
|
if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
|
|
19613
|
-
throw new Error('validationDataset parameter is
|
|
19643
|
+
throw new Error('validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19614
19644
|
}
|
|
19615
19645
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19616
19646
|
'tunedModelDisplayName',
|
|
@@ -19619,7 +19649,7 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19619
19649
|
setValueByPath(parentObject, ['displayName'], fromTunedModelDisplayName);
|
|
19620
19650
|
}
|
|
19621
19651
|
if (getValueByPath(fromObject, ['description']) !== undefined) {
|
|
19622
|
-
throw new Error('description parameter is
|
|
19652
|
+
throw new Error('description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19623
19653
|
}
|
|
19624
19654
|
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
19625
19655
|
if (parentObject !== undefined && fromEpochCount != null) {
|
|
@@ -19633,20 +19663,20 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19633
19663
|
}
|
|
19634
19664
|
if (getValueByPath(fromObject, ['exportLastCheckpointOnly']) !==
|
|
19635
19665
|
undefined) {
|
|
19636
|
-
throw new Error('exportLastCheckpointOnly parameter is
|
|
19666
|
+
throw new Error('exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19637
19667
|
}
|
|
19638
19668
|
if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
|
|
19639
19669
|
undefined) {
|
|
19640
|
-
throw new Error('preTunedModelCheckpointId parameter is
|
|
19670
|
+
throw new Error('preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19641
19671
|
}
|
|
19642
19672
|
if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
|
|
19643
|
-
throw new Error('adapterSize parameter is
|
|
19673
|
+
throw new Error('adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19644
19674
|
}
|
|
19645
19675
|
if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
|
|
19646
|
-
throw new Error('tuningMode parameter is
|
|
19676
|
+
throw new Error('tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19647
19677
|
}
|
|
19648
19678
|
if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
|
|
19649
|
-
throw new Error('customBaseModel parameter is
|
|
19679
|
+
throw new Error('customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19650
19680
|
}
|
|
19651
19681
|
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
19652
19682
|
if (parentObject !== undefined && fromBatchSize != null) {
|
|
@@ -19657,25 +19687,25 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19657
19687
|
setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
|
|
19658
19688
|
}
|
|
19659
19689
|
if (getValueByPath(fromObject, ['labels']) !== undefined) {
|
|
19660
|
-
throw new Error('labels parameter is
|
|
19690
|
+
throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19661
19691
|
}
|
|
19662
19692
|
if (getValueByPath(fromObject, ['beta']) !== undefined) {
|
|
19663
|
-
throw new Error('beta parameter is
|
|
19693
|
+
throw new Error('beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19664
19694
|
}
|
|
19665
19695
|
if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
|
|
19666
|
-
throw new Error('baseTeacherModel parameter is
|
|
19696
|
+
throw new Error('baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19667
19697
|
}
|
|
19668
19698
|
if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
|
|
19669
|
-
throw new Error('tunedTeacherModelSource parameter is
|
|
19699
|
+
throw new Error('tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19670
19700
|
}
|
|
19671
19701
|
if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
|
|
19672
|
-
throw new Error('sftLossWeightMultiplier parameter is
|
|
19702
|
+
throw new Error('sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19673
19703
|
}
|
|
19674
19704
|
if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
|
|
19675
|
-
throw new Error('outputUri parameter is
|
|
19705
|
+
throw new Error('outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19676
19706
|
}
|
|
19677
19707
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19678
|
-
throw new Error('encryptionSpec parameter is
|
|
19708
|
+
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19679
19709
|
}
|
|
19680
19710
|
return toObject;
|
|
19681
19711
|
}
|
|
@@ -20069,10 +20099,10 @@ function tunedModelFromMldev(fromObject, _rootObject) {
|
|
|
20069
20099
|
function tuningDatasetToMldev(fromObject, _rootObject) {
|
|
20070
20100
|
const toObject = {};
|
|
20071
20101
|
if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
|
|
20072
|
-
throw new Error('gcsUri parameter is
|
|
20102
|
+
throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20073
20103
|
}
|
|
20074
20104
|
if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
|
|
20075
|
-
throw new Error('vertexDatasetResource parameter is
|
|
20105
|
+
throw new Error('vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
20076
20106
|
}
|
|
20077
20107
|
const fromExamples = getValueByPath(fromObject, ['examples']);
|
|
20078
20108
|
if (fromExamples != null) {
|
|
@@ -20145,7 +20175,7 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20145
20175
|
}
|
|
20146
20176
|
}
|
|
20147
20177
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20148
|
-
throw new Error('examples parameter is
|
|
20178
|
+
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20149
20179
|
}
|
|
20150
20180
|
return toObject;
|
|
20151
20181
|
}
|