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