@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.
@@ -788,11 +788,11 @@ var PhishBlockThreshold;
788
788
  */
789
789
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
790
790
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
791
- /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
791
+ /** 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. */
792
792
  var Behavior;
793
793
  (function (Behavior) {
794
794
  /**
795
- * This value is unused.
795
+ * This value is unspecified.
796
796
  */
797
797
  Behavior["UNSPECIFIED"] = "UNSPECIFIED";
798
798
  /**
@@ -3767,23 +3767,23 @@ function authConfigToMldev$4(fromObject) {
3767
3767
  setValueByPath(toObject, ['apiKey'], fromApiKey);
3768
3768
  }
3769
3769
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
3770
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
3770
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3771
3771
  }
3772
3772
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
3773
- throw new Error('authType parameter is not supported in Gemini API.');
3773
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3774
3774
  }
3775
3775
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
3776
3776
  undefined) {
3777
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
3777
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3778
3778
  }
3779
3779
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
3780
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
3780
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3781
3781
  }
3782
3782
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
3783
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
3783
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3784
3784
  }
3785
3785
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
3786
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
3786
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3787
3787
  }
3788
3788
  return toObject;
3789
3789
  }
@@ -3864,14 +3864,14 @@ function batchJobDestinationToVertex(fromObject) {
3864
3864
  setValueByPath(toObject, ['bigqueryDestination', 'outputUri'], fromBigqueryUri);
3865
3865
  }
3866
3866
  if (getValueByPath(fromObject, ['fileName']) !== undefined) {
3867
- throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3867
+ throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3868
3868
  }
3869
3869
  if (getValueByPath(fromObject, ['inlinedResponses']) !== undefined) {
3870
- throw new Error('inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3870
+ throw new Error('inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3871
3871
  }
3872
3872
  if (getValueByPath(fromObject, ['inlinedEmbedContentResponses']) !==
3873
3873
  undefined) {
3874
- throw new Error('inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3874
+ throw new Error('inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3875
3875
  }
3876
3876
  const fromVertexDataset = getValueByPath(fromObject, [
3877
3877
  'vertexDataset',
@@ -4016,13 +4016,13 @@ function batchJobSourceFromVertex(fromObject) {
4016
4016
  function batchJobSourceToMldev(apiClient, fromObject) {
4017
4017
  const toObject = {};
4018
4018
  if (getValueByPath(fromObject, ['format']) !== undefined) {
4019
- throw new Error('format parameter is not supported in Gemini API.');
4019
+ throw new Error('format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4020
4020
  }
4021
4021
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
4022
- throw new Error('gcsUri parameter is not supported in Gemini API.');
4022
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4023
4023
  }
4024
4024
  if (getValueByPath(fromObject, ['bigqueryUri']) !== undefined) {
4025
- throw new Error('bigqueryUri parameter is not supported in Gemini API.');
4025
+ throw new Error('bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4026
4026
  }
4027
4027
  const fromFileName = getValueByPath(fromObject, ['fileName']);
4028
4028
  if (fromFileName != null) {
@@ -4041,7 +4041,7 @@ function batchJobSourceToMldev(apiClient, fromObject) {
4041
4041
  setValueByPath(toObject, ['requests', 'requests'], transformedList);
4042
4042
  }
4043
4043
  if (getValueByPath(fromObject, ['vertexDatasetName']) !== undefined) {
4044
- throw new Error('vertexDatasetName parameter is not supported in Gemini API.');
4044
+ throw new Error('vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4045
4045
  }
4046
4046
  return toObject;
4047
4047
  }
@@ -4060,10 +4060,10 @@ function batchJobSourceToVertex(fromObject) {
4060
4060
  setValueByPath(toObject, ['bigquerySource', 'inputUri'], fromBigqueryUri);
4061
4061
  }
4062
4062
  if (getValueByPath(fromObject, ['fileName']) !== undefined) {
4063
- throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4063
+ throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4064
4064
  }
4065
4065
  if (getValueByPath(fromObject, ['inlinedRequests']) !== undefined) {
4066
- throw new Error('inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4066
+ throw new Error('inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4067
4067
  }
4068
4068
  const fromVertexDatasetName = getValueByPath(fromObject, [
4069
4069
  'vertexDatasetName',
@@ -4080,7 +4080,7 @@ function blobToMldev$4(fromObject) {
4080
4080
  setValueByPath(toObject, ['data'], fromData);
4081
4081
  }
4082
4082
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4083
- throw new Error('displayName parameter is not supported in Gemini API.');
4083
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4084
4084
  }
4085
4085
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
4086
4086
  if (fromMimeType != null) {
@@ -4203,7 +4203,7 @@ function createBatchJobConfigToMldev(fromObject, parentObject) {
4203
4203
  setValueByPath(parentObject, ['batch', 'displayName'], fromDisplayName);
4204
4204
  }
4205
4205
  if (getValueByPath(fromObject, ['dest']) !== undefined) {
4206
- throw new Error('dest parameter is not supported in Gemini API.');
4206
+ throw new Error('dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4207
4207
  }
4208
4208
  const fromWebhookConfig = getValueByPath(fromObject, [
4209
4209
  'webhookConfig',
@@ -4224,7 +4224,7 @@ function createBatchJobConfigToVertex(fromObject, parentObject) {
4224
4224
  setValueByPath(parentObject, ['outputConfig'], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
4225
4225
  }
4226
4226
  if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
4227
- throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4227
+ throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4228
4228
  }
4229
4229
  return toObject;
4230
4230
  }
@@ -4380,16 +4380,16 @@ function embedContentConfigToMldev$1(fromObject, parentObject) {
4380
4380
  setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
4381
4381
  }
4382
4382
  if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
4383
- throw new Error('mimeType parameter is not supported in Gemini API.');
4383
+ throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4384
4384
  }
4385
4385
  if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
4386
- throw new Error('autoTruncate parameter is not supported in Gemini API.');
4386
+ throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4387
4387
  }
4388
4388
  if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
4389
- throw new Error('documentOcr parameter is not supported in Gemini API.');
4389
+ throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4390
4390
  }
4391
4391
  if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
4392
- throw new Error('audioTrackExtraction parameter is not supported in Gemini API.');
4392
+ throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4393
4393
  }
4394
4394
  return toObject;
4395
4395
  }
@@ -4410,7 +4410,7 @@ function embeddingsBatchJobSourceToMldev(apiClient, fromObject) {
4410
4410
  function fileDataToMldev$4(fromObject) {
4411
4411
  const toObject = {};
4412
4412
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4413
- throw new Error('displayName parameter is not supported in Gemini API.');
4413
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4414
4414
  }
4415
4415
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
4416
4416
  if (fromFileUri != null) {
@@ -4437,10 +4437,10 @@ function functionCallToMldev$4(fromObject) {
4437
4437
  setValueByPath(toObject, ['name'], fromName);
4438
4438
  }
4439
4439
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
4440
- throw new Error('partialArgs parameter is not supported in Gemini API.');
4440
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4441
4441
  }
4442
4442
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
4443
- throw new Error('willContinue parameter is not supported in Gemini API.');
4443
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4444
4444
  }
4445
4445
  return toObject;
4446
4446
  }
@@ -4458,7 +4458,7 @@ function functionCallingConfigToMldev$2(fromObject) {
4458
4458
  }
4459
4459
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
4460
4460
  undefined) {
4461
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
4461
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4462
4462
  }
4463
4463
  return toObject;
4464
4464
  }
@@ -4545,10 +4545,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4545
4545
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
4546
4546
  }
4547
4547
  if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
4548
- throw new Error('routingConfig parameter is not supported in Gemini API.');
4548
+ throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4549
4549
  }
4550
4550
  if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
4551
- throw new Error('modelSelectionConfig parameter is not supported in Gemini API.');
4551
+ throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4552
4552
  }
4553
4553
  const fromSafetySettings = getValueByPath(fromObject, [
4554
4554
  'safetySettings',
@@ -4577,7 +4577,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4577
4577
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$2(fromToolConfig));
4578
4578
  }
4579
4579
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
4580
- throw new Error('labels parameter is not supported in Gemini API.');
4580
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4581
4581
  }
4582
4582
  const fromCachedContent = getValueByPath(fromObject, [
4583
4583
  'cachedContent',
@@ -4602,7 +4602,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4602
4602
  setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
4603
4603
  }
4604
4604
  if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
4605
- throw new Error('audioTimestamp parameter is not supported in Gemini API.');
4605
+ throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4606
4606
  }
4607
4607
  const fromThinkingConfig = getValueByPath(fromObject, [
4608
4608
  'thinkingConfig',
@@ -4621,7 +4621,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4621
4621
  setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
4622
4622
  }
4623
4623
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4624
- throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4624
+ throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4625
4625
  }
4626
4626
  const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4627
4627
  if (parentObject !== undefined && fromServiceTier != null) {
@@ -4708,10 +4708,10 @@ function googleSearchToMldev$4(fromObject) {
4708
4708
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
4709
4709
  }
4710
4710
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
4711
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
4711
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4712
4712
  }
4713
4713
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4714
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
4714
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4715
4715
  }
4716
4716
  const fromTimeRangeFilter = getValueByPath(fromObject, [
4717
4717
  'timeRangeFilter',
@@ -4732,20 +4732,20 @@ function imageConfigToMldev$1(fromObject) {
4732
4732
  setValueByPath(toObject, ['imageSize'], fromImageSize);
4733
4733
  }
4734
4734
  if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
4735
- throw new Error('personGeneration parameter is not supported in Gemini API.');
4735
+ throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4736
4736
  }
4737
4737
  if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
4738
- throw new Error('prominentPeople parameter is not supported in Gemini API.');
4738
+ throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4739
4739
  }
4740
4740
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
4741
- throw new Error('outputMimeType parameter is not supported in Gemini API.');
4741
+ throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4742
4742
  }
4743
4743
  if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
4744
4744
  undefined) {
4745
- throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
4745
+ throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4746
4746
  }
4747
4747
  if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
4748
- throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
4748
+ throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4749
4749
  }
4750
4750
  return toObject;
4751
4751
  }
@@ -4802,7 +4802,7 @@ function listBatchJobsConfigToMldev(fromObject, parentObject) {
4802
4802
  setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
4803
4803
  }
4804
4804
  if (getValueByPath(fromObject, ['filter']) !== undefined) {
4805
- throw new Error('filter parameter is not supported in Gemini API.');
4805
+ throw new Error('filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4806
4806
  }
4807
4807
  return toObject;
4808
4808
  }
@@ -4971,7 +4971,7 @@ function safetySettingToMldev$3(fromObject) {
4971
4971
  setValueByPath(toObject, ['category'], fromCategory);
4972
4972
  }
4973
4973
  if (getValueByPath(fromObject, ['method']) !== undefined) {
4974
- throw new Error('method parameter is not supported in Gemini API.');
4974
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4975
4975
  }
4976
4976
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
4977
4977
  if (fromThreshold != null) {
@@ -5002,7 +5002,7 @@ function toolConfigToMldev$2(fromObject) {
5002
5002
  function toolToMldev$4(fromObject) {
5003
5003
  const toObject = {};
5004
5004
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5005
- throw new Error('retrieval parameter is not supported in Gemini API.');
5005
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5006
5006
  }
5007
5007
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5008
5008
  if (fromComputerUse != null) {
@@ -5027,7 +5027,7 @@ function toolToMldev$4(fromObject) {
5027
5027
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5028
5028
  }
5029
5029
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5030
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5030
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5031
5031
  }
5032
5032
  const fromFunctionDeclarations = getValueByPath(fromObject, [
5033
5033
  'functionDeclarations',
@@ -5048,7 +5048,7 @@ function toolToMldev$4(fromObject) {
5048
5048
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5049
5049
  }
5050
5050
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
5051
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
5051
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5052
5052
  }
5053
5053
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5054
5054
  if (fromUrlContext != null) {
@@ -5795,23 +5795,23 @@ function authConfigToMldev$3(fromObject) {
5795
5795
  setValueByPath(toObject, ['apiKey'], fromApiKey);
5796
5796
  }
5797
5797
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
5798
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
5798
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5799
5799
  }
5800
5800
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
5801
- throw new Error('authType parameter is not supported in Gemini API.');
5801
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5802
5802
  }
5803
5803
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
5804
5804
  undefined) {
5805
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
5805
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5806
5806
  }
5807
5807
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
5808
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
5808
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5809
5809
  }
5810
5810
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
5811
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
5811
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5812
5812
  }
5813
5813
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
5814
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
5814
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5815
5815
  }
5816
5816
  return toObject;
5817
5817
  }
@@ -5822,7 +5822,7 @@ function blobToMldev$3(fromObject) {
5822
5822
  setValueByPath(toObject, ['data'], fromData);
5823
5823
  }
5824
5824
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
5825
- throw new Error('displayName parameter is not supported in Gemini API.');
5825
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5826
5826
  }
5827
5827
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
5828
5828
  if (fromMimeType != null) {
@@ -5911,7 +5911,7 @@ function createCachedContentConfigToMldev(fromObject, parentObject) {
5911
5911
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$1(fromToolConfig));
5912
5912
  }
5913
5913
  if (getValueByPath(fromObject, ['kmsKeyName']) !== undefined) {
5914
- throw new Error('kmsKeyName parameter is not supported in Gemini API.');
5914
+ throw new Error('kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5915
5915
  }
5916
5916
  return toObject;
5917
5917
  }
@@ -6028,7 +6028,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
6028
6028
  function fileDataToMldev$3(fromObject) {
6029
6029
  const toObject = {};
6030
6030
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6031
- throw new Error('displayName parameter is not supported in Gemini API.');
6031
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6032
6032
  }
6033
6033
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
6034
6034
  if (fromFileUri != null) {
@@ -6055,10 +6055,10 @@ function functionCallToMldev$3(fromObject) {
6055
6055
  setValueByPath(toObject, ['name'], fromName);
6056
6056
  }
6057
6057
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
6058
- throw new Error('partialArgs parameter is not supported in Gemini API.');
6058
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6059
6059
  }
6060
6060
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
6061
- throw new Error('willContinue parameter is not supported in Gemini API.');
6061
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6062
6062
  }
6063
6063
  return toObject;
6064
6064
  }
@@ -6076,42 +6076,7 @@ function functionCallingConfigToMldev$1(fromObject) {
6076
6076
  }
6077
6077
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
6078
6078
  undefined) {
6079
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
6080
- }
6081
- return toObject;
6082
- }
6083
- function functionDeclarationToVertex$2(fromObject) {
6084
- const toObject = {};
6085
- const fromDescription = getValueByPath(fromObject, ['description']);
6086
- if (fromDescription != null) {
6087
- setValueByPath(toObject, ['description'], fromDescription);
6088
- }
6089
- const fromName = getValueByPath(fromObject, ['name']);
6090
- if (fromName != null) {
6091
- setValueByPath(toObject, ['name'], fromName);
6092
- }
6093
- const fromParameters = getValueByPath(fromObject, ['parameters']);
6094
- if (fromParameters != null) {
6095
- setValueByPath(toObject, ['parameters'], fromParameters);
6096
- }
6097
- const fromParametersJsonSchema = getValueByPath(fromObject, [
6098
- 'parametersJsonSchema',
6099
- ]);
6100
- if (fromParametersJsonSchema != null) {
6101
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
6102
- }
6103
- const fromResponse = getValueByPath(fromObject, ['response']);
6104
- if (fromResponse != null) {
6105
- setValueByPath(toObject, ['response'], fromResponse);
6106
- }
6107
- const fromResponseJsonSchema = getValueByPath(fromObject, [
6108
- 'responseJsonSchema',
6109
- ]);
6110
- if (fromResponseJsonSchema != null) {
6111
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
6112
- }
6113
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
6114
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6079
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6115
6080
  }
6116
6081
  return toObject;
6117
6082
  }
@@ -6150,10 +6115,10 @@ function googleSearchToMldev$3(fromObject) {
6150
6115
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
6151
6116
  }
6152
6117
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
6153
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
6118
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6154
6119
  }
6155
6120
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6156
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
6121
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6157
6122
  }
6158
6123
  const fromTimeRangeFilter = getValueByPath(fromObject, [
6159
6124
  'timeRangeFilter',
@@ -6390,13 +6355,13 @@ function partToVertex$2(fromObject) {
6390
6355
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
6391
6356
  }
6392
6357
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
6393
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6358
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6394
6359
  }
6395
6360
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6396
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6361
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6397
6362
  }
6398
6363
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6399
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6364
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6400
6365
  }
6401
6366
  return toObject;
6402
6367
  }
@@ -6436,14 +6401,14 @@ function toolConfigToVertex$1(fromObject) {
6436
6401
  }
6437
6402
  if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
6438
6403
  undefined) {
6439
- throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6404
+ throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6440
6405
  }
6441
6406
  return toObject;
6442
6407
  }
6443
6408
  function toolToMldev$3(fromObject) {
6444
6409
  const toObject = {};
6445
6410
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
6446
- throw new Error('retrieval parameter is not supported in Gemini API.');
6411
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6447
6412
  }
6448
6413
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
6449
6414
  if (fromComputerUse != null) {
@@ -6468,7 +6433,7 @@ function toolToMldev$3(fromObject) {
6468
6433
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
6469
6434
  }
6470
6435
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
6471
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
6436
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6472
6437
  }
6473
6438
  const fromFunctionDeclarations = getValueByPath(fromObject, [
6474
6439
  'functionDeclarations',
@@ -6489,7 +6454,7 @@ function toolToMldev$3(fromObject) {
6489
6454
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
6490
6455
  }
6491
6456
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
6492
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
6457
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6493
6458
  }
6494
6459
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
6495
6460
  if (fromUrlContext != null) {
@@ -6518,7 +6483,7 @@ function toolToVertex$2(fromObject) {
6518
6483
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
6519
6484
  }
6520
6485
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
6521
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6486
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6522
6487
  }
6523
6488
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
6524
6489
  if (fromGoogleSearch != null) {
@@ -6547,7 +6512,7 @@ function toolToVertex$2(fromObject) {
6547
6512
  let transformedList = fromFunctionDeclarations;
6548
6513
  if (Array.isArray(transformedList)) {
6549
6514
  transformedList = transformedList.map((item) => {
6550
- return functionDeclarationToVertex$2(item);
6515
+ return item;
6551
6516
  });
6552
6517
  }
6553
6518
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -6569,7 +6534,7 @@ function toolToVertex$2(fromObject) {
6569
6534
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
6570
6535
  }
6571
6536
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
6572
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6537
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6573
6538
  }
6574
6539
  return toObject;
6575
6540
  }
@@ -7861,7 +7826,7 @@ class Files extends BaseModule {
7861
7826
  function audioTranscriptionConfigToMldev$1(fromObject) {
7862
7827
  const toObject = {};
7863
7828
  if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
7864
- throw new Error('languageCodes parameter is not supported in Gemini API.');
7829
+ throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7865
7830
  }
7866
7831
  return toObject;
7867
7832
  }
@@ -7872,23 +7837,23 @@ function authConfigToMldev$2(fromObject) {
7872
7837
  setValueByPath(toObject, ['apiKey'], fromApiKey);
7873
7838
  }
7874
7839
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
7875
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
7840
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7876
7841
  }
7877
7842
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
7878
- throw new Error('authType parameter is not supported in Gemini API.');
7843
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7879
7844
  }
7880
7845
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
7881
7846
  undefined) {
7882
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
7847
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7883
7848
  }
7884
7849
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
7885
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
7850
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7886
7851
  }
7887
7852
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
7888
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
7853
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7889
7854
  }
7890
7855
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
7891
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
7856
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7892
7857
  }
7893
7858
  return toObject;
7894
7859
  }
@@ -7899,7 +7864,7 @@ function blobToMldev$2(fromObject) {
7899
7864
  setValueByPath(toObject, ['data'], fromData);
7900
7865
  }
7901
7866
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7902
- throw new Error('displayName parameter is not supported in Gemini API.');
7867
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7903
7868
  }
7904
7869
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7905
7870
  if (fromMimeType != null) {
@@ -7946,7 +7911,7 @@ function contentToVertex$1(fromObject) {
7946
7911
  function fileDataToMldev$2(fromObject) {
7947
7912
  const toObject = {};
7948
7913
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7949
- throw new Error('displayName parameter is not supported in Gemini API.');
7914
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7950
7915
  }
7951
7916
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7952
7917
  if (fromFileUri != null) {
@@ -7973,45 +7938,10 @@ function functionCallToMldev$2(fromObject) {
7973
7938
  setValueByPath(toObject, ['name'], fromName);
7974
7939
  }
7975
7940
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
7976
- throw new Error('partialArgs parameter is not supported in Gemini API.');
7941
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7977
7942
  }
7978
7943
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
7979
- throw new Error('willContinue parameter is not supported in Gemini API.');
7980
- }
7981
- return toObject;
7982
- }
7983
- function functionDeclarationToVertex$1(fromObject) {
7984
- const toObject = {};
7985
- const fromDescription = getValueByPath(fromObject, ['description']);
7986
- if (fromDescription != null) {
7987
- setValueByPath(toObject, ['description'], fromDescription);
7988
- }
7989
- const fromName = getValueByPath(fromObject, ['name']);
7990
- if (fromName != null) {
7991
- setValueByPath(toObject, ['name'], fromName);
7992
- }
7993
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7994
- if (fromParameters != null) {
7995
- setValueByPath(toObject, ['parameters'], fromParameters);
7996
- }
7997
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7998
- 'parametersJsonSchema',
7999
- ]);
8000
- if (fromParametersJsonSchema != null) {
8001
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
8002
- }
8003
- const fromResponse = getValueByPath(fromObject, ['response']);
8004
- if (fromResponse != null) {
8005
- setValueByPath(toObject, ['response'], fromResponse);
8006
- }
8007
- const fromResponseJsonSchema = getValueByPath(fromObject, [
8008
- 'responseJsonSchema',
8009
- ]);
8010
- if (fromResponseJsonSchema != null) {
8011
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
8012
- }
8013
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8014
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
7944
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8015
7945
  }
8016
7946
  return toObject;
8017
7947
  }
@@ -8139,7 +8069,7 @@ function generationConfigToVertex$1(fromObject) {
8139
8069
  }
8140
8070
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
8141
8071
  undefined) {
8142
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8072
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8143
8073
  }
8144
8074
  return toObject;
8145
8075
  }
@@ -8162,10 +8092,10 @@ function googleSearchToMldev$2(fromObject) {
8162
8092
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
8163
8093
  }
8164
8094
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
8165
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
8095
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8166
8096
  }
8167
8097
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
8168
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
8098
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8169
8099
  }
8170
8100
  const fromTimeRangeFilter = getValueByPath(fromObject, [
8171
8101
  'timeRangeFilter',
@@ -8284,7 +8214,7 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
8284
8214
  setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
8285
8215
  }
8286
8216
  if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
8287
- throw new Error('explicitVadSignal parameter is not supported in Gemini API.');
8217
+ throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8288
8218
  }
8289
8219
  const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
8290
8220
  if (parentObject !== undefined && fromAvatarConfig != null) {
@@ -8755,13 +8685,13 @@ function partToVertex$1(fromObject) {
8755
8685
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
8756
8686
  }
8757
8687
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
8758
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8688
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8759
8689
  }
8760
8690
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
8761
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8691
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8762
8692
  }
8763
8693
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
8764
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8694
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8765
8695
  }
8766
8696
  return toObject;
8767
8697
  }
@@ -8772,7 +8702,7 @@ function safetySettingToMldev$2(fromObject) {
8772
8702
  setValueByPath(toObject, ['category'], fromCategory);
8773
8703
  }
8774
8704
  if (getValueByPath(fromObject, ['method']) !== undefined) {
8775
- throw new Error('method parameter is not supported in Gemini API.');
8705
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8776
8706
  }
8777
8707
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
8778
8708
  if (fromThreshold != null) {
@@ -8787,14 +8717,14 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8787
8717
  setValueByPath(toObject, ['handle'], fromHandle);
8788
8718
  }
8789
8719
  if (getValueByPath(fromObject, ['transparent']) !== undefined) {
8790
- throw new Error('transparent parameter is not supported in Gemini API.');
8720
+ throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8791
8721
  }
8792
8722
  return toObject;
8793
8723
  }
8794
8724
  function toolToMldev$2(fromObject) {
8795
8725
  const toObject = {};
8796
8726
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
8797
- throw new Error('retrieval parameter is not supported in Gemini API.');
8727
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8798
8728
  }
8799
8729
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8800
8730
  if (fromComputerUse != null) {
@@ -8819,7 +8749,7 @@ function toolToMldev$2(fromObject) {
8819
8749
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8820
8750
  }
8821
8751
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
8822
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
8752
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8823
8753
  }
8824
8754
  const fromFunctionDeclarations = getValueByPath(fromObject, [
8825
8755
  'functionDeclarations',
@@ -8840,7 +8770,7 @@ function toolToMldev$2(fromObject) {
8840
8770
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
8841
8771
  }
8842
8772
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
8843
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
8773
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8844
8774
  }
8845
8775
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8846
8776
  if (fromUrlContext != null) {
@@ -8869,7 +8799,7 @@ function toolToVertex$1(fromObject) {
8869
8799
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
8870
8800
  }
8871
8801
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
8872
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8802
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8873
8803
  }
8874
8804
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8875
8805
  if (fromGoogleSearch != null) {
@@ -8898,7 +8828,7 @@ function toolToVertex$1(fromObject) {
8898
8828
  let transformedList = fromFunctionDeclarations;
8899
8829
  if (Array.isArray(transformedList)) {
8900
8830
  transformedList = transformedList.map((item) => {
8901
- return functionDeclarationToVertex$1(item);
8831
+ return item;
8902
8832
  });
8903
8833
  }
8904
8834
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -8920,7 +8850,7 @@ function toolToVertex$1(fromObject) {
8920
8850
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
8921
8851
  }
8922
8852
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
8923
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8853
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8924
8854
  }
8925
8855
  return toObject;
8926
8856
  }
@@ -9037,23 +8967,23 @@ function authConfigToMldev$1(fromObject, _rootObject) {
9037
8967
  setValueByPath(toObject, ['apiKey'], fromApiKey);
9038
8968
  }
9039
8969
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
9040
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
8970
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9041
8971
  }
9042
8972
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
9043
- throw new Error('authType parameter is not supported in Gemini API.');
8973
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9044
8974
  }
9045
8975
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
9046
8976
  undefined) {
9047
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
8977
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9048
8978
  }
9049
8979
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
9050
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
8980
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9051
8981
  }
9052
8982
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
9053
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
8983
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9054
8984
  }
9055
8985
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
9056
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
8986
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9057
8987
  }
9058
8988
  return toObject;
9059
8989
  }
@@ -9064,7 +8994,7 @@ function blobToMldev$1(fromObject, _rootObject) {
9064
8994
  setValueByPath(toObject, ['data'], fromData);
9065
8995
  }
9066
8996
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
9067
- throw new Error('displayName parameter is not supported in Gemini API.');
8997
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9068
8998
  }
9069
8999
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9070
9000
  if (fromMimeType != null) {
@@ -9261,13 +9191,13 @@ function controlReferenceConfigToVertex(fromObject, _rootObject) {
9261
9191
  function countTokensConfigToMldev(fromObject, _rootObject) {
9262
9192
  const toObject = {};
9263
9193
  if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
9264
- throw new Error('systemInstruction parameter is not supported in Gemini API.');
9194
+ throw new Error('systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9265
9195
  }
9266
9196
  if (getValueByPath(fromObject, ['tools']) !== undefined) {
9267
- throw new Error('tools parameter is not supported in Gemini API.');
9197
+ throw new Error('tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9268
9198
  }
9269
9199
  if (getValueByPath(fromObject, ['generationConfig']) !== undefined) {
9270
- throw new Error('generationConfig parameter is not supported in Gemini API.');
9200
+ throw new Error('generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9271
9201
  }
9272
9202
  return toObject;
9273
9203
  }
@@ -9568,16 +9498,16 @@ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
9568
9498
  setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
9569
9499
  }
9570
9500
  if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
9571
- throw new Error('mimeType parameter is not supported in Gemini API.');
9501
+ throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9572
9502
  }
9573
9503
  if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
9574
- throw new Error('autoTruncate parameter is not supported in Gemini API.');
9504
+ throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9575
9505
  }
9576
9506
  if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
9577
- throw new Error('documentOcr parameter is not supported in Gemini API.');
9507
+ throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9578
9508
  }
9579
9509
  if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
9580
- throw new Error('audioTrackExtraction parameter is not supported in Gemini API.');
9510
+ throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9581
9511
  }
9582
9512
  return toObject;
9583
9513
  }
@@ -9861,7 +9791,7 @@ function endpointFromVertex(fromObject, _rootObject) {
9861
9791
  function fileDataToMldev$1(fromObject, _rootObject) {
9862
9792
  const toObject = {};
9863
9793
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
9864
- throw new Error('displayName parameter is not supported in Gemini API.');
9794
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9865
9795
  }
9866
9796
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
9867
9797
  if (fromFileUri != null) {
@@ -9888,10 +9818,10 @@ function functionCallToMldev$1(fromObject, _rootObject) {
9888
9818
  setValueByPath(toObject, ['name'], fromName);
9889
9819
  }
9890
9820
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
9891
- throw new Error('partialArgs parameter is not supported in Gemini API.');
9821
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9892
9822
  }
9893
9823
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
9894
- throw new Error('willContinue parameter is not supported in Gemini API.');
9824
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9895
9825
  }
9896
9826
  return toObject;
9897
9827
  }
@@ -9909,42 +9839,7 @@ function functionCallingConfigToMldev(fromObject, _rootObject) {
9909
9839
  }
9910
9840
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
9911
9841
  undefined) {
9912
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
9913
- }
9914
- return toObject;
9915
- }
9916
- function functionDeclarationToVertex(fromObject, _rootObject) {
9917
- const toObject = {};
9918
- const fromDescription = getValueByPath(fromObject, ['description']);
9919
- if (fromDescription != null) {
9920
- setValueByPath(toObject, ['description'], fromDescription);
9921
- }
9922
- const fromName = getValueByPath(fromObject, ['name']);
9923
- if (fromName != null) {
9924
- setValueByPath(toObject, ['name'], fromName);
9925
- }
9926
- const fromParameters = getValueByPath(fromObject, ['parameters']);
9927
- if (fromParameters != null) {
9928
- setValueByPath(toObject, ['parameters'], fromParameters);
9929
- }
9930
- const fromParametersJsonSchema = getValueByPath(fromObject, [
9931
- 'parametersJsonSchema',
9932
- ]);
9933
- if (fromParametersJsonSchema != null) {
9934
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
9935
- }
9936
- const fromResponse = getValueByPath(fromObject, ['response']);
9937
- if (fromResponse != null) {
9938
- setValueByPath(toObject, ['response'], fromResponse);
9939
- }
9940
- const fromResponseJsonSchema = getValueByPath(fromObject, [
9941
- 'responseJsonSchema',
9942
- ]);
9943
- if (fromResponseJsonSchema != null) {
9944
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
9945
- }
9946
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
9947
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
9842
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9948
9843
  }
9949
9844
  return toObject;
9950
9845
  }
@@ -10031,10 +9926,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10031
9926
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
10032
9927
  }
10033
9928
  if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
10034
- throw new Error('routingConfig parameter is not supported in Gemini API.');
9929
+ throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10035
9930
  }
10036
9931
  if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
10037
- throw new Error('modelSelectionConfig parameter is not supported in Gemini API.');
9932
+ throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10038
9933
  }
10039
9934
  const fromSafetySettings = getValueByPath(fromObject, [
10040
9935
  'safetySettings',
@@ -10063,7 +9958,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10063
9958
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev(fromToolConfig));
10064
9959
  }
10065
9960
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10066
- throw new Error('labels parameter is not supported in Gemini API.');
9961
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10067
9962
  }
10068
9963
  const fromCachedContent = getValueByPath(fromObject, [
10069
9964
  'cachedContent',
@@ -10088,7 +9983,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10088
9983
  setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10089
9984
  }
10090
9985
  if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
10091
- throw new Error('audioTimestamp parameter is not supported in Gemini API.');
9986
+ throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10092
9987
  }
10093
9988
  const fromThinkingConfig = getValueByPath(fromObject, [
10094
9989
  'thinkingConfig',
@@ -10107,7 +10002,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10107
10002
  setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
10108
10003
  }
10109
10004
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
10110
- throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
10005
+ throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10111
10006
  }
10112
10007
  const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
10113
10008
  if (parentObject !== undefined && fromServiceTier != null) {
@@ -10279,7 +10174,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
10279
10174
  }
10280
10175
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
10281
10176
  undefined) {
10282
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
10177
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
10283
10178
  }
10284
10179
  const fromModelArmorConfig = getValueByPath(fromObject, [
10285
10180
  'modelArmorConfig',
@@ -10428,10 +10323,10 @@ function generateContentResponseFromVertex(fromObject, _rootObject) {
10428
10323
  function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10429
10324
  const toObject = {};
10430
10325
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
10431
- throw new Error('outputGcsUri parameter is not supported in Gemini API.');
10326
+ throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10432
10327
  }
10433
10328
  if (getValueByPath(fromObject, ['negativePrompt']) !== undefined) {
10434
- throw new Error('negativePrompt parameter is not supported in Gemini API.');
10329
+ throw new Error('negativePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10435
10330
  }
10436
10331
  const fromNumberOfImages = getValueByPath(fromObject, [
10437
10332
  'numberOfImages',
@@ -10450,7 +10345,7 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10450
10345
  setValueByPath(parentObject, ['parameters', 'guidanceScale'], fromGuidanceScale);
10451
10346
  }
10452
10347
  if (getValueByPath(fromObject, ['seed']) !== undefined) {
10453
- throw new Error('seed parameter is not supported in Gemini API.');
10348
+ throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10454
10349
  }
10455
10350
  const fromSafetyFilterLevel = getValueByPath(fromObject, [
10456
10351
  'safetyFilterLevel',
@@ -10493,17 +10388,17 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10493
10388
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
10494
10389
  }
10495
10390
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
10496
- throw new Error('addWatermark parameter is not supported in Gemini API.');
10391
+ throw new Error('addWatermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10497
10392
  }
10498
10393
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10499
- throw new Error('labels parameter is not supported in Gemini API.');
10394
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10500
10395
  }
10501
10396
  const fromImageSize = getValueByPath(fromObject, ['imageSize']);
10502
10397
  if (parentObject !== undefined && fromImageSize != null) {
10503
10398
  setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
10504
10399
  }
10505
10400
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
10506
- throw new Error('enhancePrompt parameter is not supported in Gemini API.');
10401
+ throw new Error('enhancePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10507
10402
  }
10508
10403
  return toObject;
10509
10404
  }
@@ -10696,10 +10591,10 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10696
10591
  setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfVideos);
10697
10592
  }
10698
10593
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
10699
- throw new Error('outputGcsUri parameter is not supported in Gemini API.');
10594
+ throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10700
10595
  }
10701
10596
  if (getValueByPath(fromObject, ['fps']) !== undefined) {
10702
- throw new Error('fps parameter is not supported in Gemini API.');
10597
+ throw new Error('fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10703
10598
  }
10704
10599
  const fromDurationSeconds = getValueByPath(fromObject, [
10705
10600
  'durationSeconds',
@@ -10708,7 +10603,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10708
10603
  setValueByPath(parentObject, ['parameters', 'durationSeconds'], fromDurationSeconds);
10709
10604
  }
10710
10605
  if (getValueByPath(fromObject, ['seed']) !== undefined) {
10711
- throw new Error('seed parameter is not supported in Gemini API.');
10606
+ throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10712
10607
  }
10713
10608
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10714
10609
  if (parentObject !== undefined && fromAspectRatio != null) {
@@ -10725,7 +10620,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10725
10620
  setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
10726
10621
  }
10727
10622
  if (getValueByPath(fromObject, ['pubsubTopic']) !== undefined) {
10728
- throw new Error('pubsubTopic parameter is not supported in Gemini API.');
10623
+ throw new Error('pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10729
10624
  }
10730
10625
  const fromNegativePrompt = getValueByPath(fromObject, [
10731
10626
  'negativePrompt',
@@ -10740,7 +10635,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10740
10635
  setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
10741
10636
  }
10742
10637
  if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
10743
- throw new Error('generateAudio parameter is not supported in Gemini API.');
10638
+ throw new Error('generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10744
10639
  }
10745
10640
  const fromLastFrame = getValueByPath(fromObject, ['lastFrame']);
10746
10641
  if (parentObject !== undefined && fromLastFrame != null) {
@@ -10759,13 +10654,13 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10759
10654
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
10760
10655
  }
10761
10656
  if (getValueByPath(fromObject, ['mask']) !== undefined) {
10762
- throw new Error('mask parameter is not supported in Gemini API.');
10657
+ throw new Error('mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10763
10658
  }
10764
10659
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
10765
- throw new Error('compressionQuality parameter is not supported in Gemini API.');
10660
+ throw new Error('compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10766
10661
  }
10767
10662
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10768
- throw new Error('labels parameter is not supported in Gemini API.');
10663
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10769
10664
  }
10770
10665
  const fromWebhookConfig = getValueByPath(fromObject, [
10771
10666
  'webhookConfig',
@@ -10774,7 +10669,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10774
10669
  setValueByPath(parentObject, ['webhookConfig'], fromWebhookConfig);
10775
10670
  }
10776
10671
  if (getValueByPath(fromObject, ['resizeMode']) !== undefined) {
10777
- throw new Error('resizeMode parameter is not supported in Gemini API.');
10672
+ throw new Error('resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10778
10673
  }
10779
10674
  return toObject;
10780
10675
  }
@@ -10871,7 +10766,7 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
10871
10766
  setValueByPath(parentObject, ['labels'], fromLabels);
10872
10767
  }
10873
10768
  if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
10874
- throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
10769
+ throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
10875
10770
  }
10876
10771
  const fromResizeMode = getValueByPath(fromObject, ['resizeMode']);
10877
10772
  if (parentObject !== undefined && fromResizeMode != null) {
@@ -11270,7 +11165,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
11270
11165
  }
11271
11166
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
11272
11167
  undefined) {
11273
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11168
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11274
11169
  }
11275
11170
  return toObject;
11276
11171
  }
@@ -11309,10 +11204,10 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
11309
11204
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
11310
11205
  }
11311
11206
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
11312
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
11207
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11313
11208
  }
11314
11209
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
11315
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
11210
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11316
11211
  }
11317
11212
  const fromTimeRangeFilter = getValueByPath(fromObject, [
11318
11213
  'timeRangeFilter',
@@ -11333,20 +11228,20 @@ function imageConfigToMldev(fromObject, _rootObject) {
11333
11228
  setValueByPath(toObject, ['imageSize'], fromImageSize);
11334
11229
  }
11335
11230
  if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
11336
- throw new Error('personGeneration parameter is not supported in Gemini API.');
11231
+ throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11337
11232
  }
11338
11233
  if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
11339
- throw new Error('prominentPeople parameter is not supported in Gemini API.');
11234
+ throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11340
11235
  }
11341
11236
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
11342
- throw new Error('outputMimeType parameter is not supported in Gemini API.');
11237
+ throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11343
11238
  }
11344
11239
  if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
11345
11240
  undefined) {
11346
- throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
11241
+ throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11347
11242
  }
11348
11243
  if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
11349
- throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
11244
+ throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11350
11245
  }
11351
11246
  return toObject;
11352
11247
  }
@@ -11427,7 +11322,7 @@ function imageFromVertex(fromObject, _rootObject) {
11427
11322
  function imageToMldev(fromObject, _rootObject) {
11428
11323
  const toObject = {};
11429
11324
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
11430
- throw new Error('gcsUri parameter is not supported in Gemini API.');
11325
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11431
11326
  }
11432
11327
  const fromImageBytes = getValueByPath(fromObject, ['imageBytes']);
11433
11328
  if (fromImageBytes != null) {
@@ -11830,13 +11725,13 @@ function partToVertex(fromObject, _rootObject) {
11830
11725
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11831
11726
  }
11832
11727
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
11833
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11728
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11834
11729
  }
11835
11730
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11836
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11731
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11837
11732
  }
11838
11733
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
11839
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11734
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11840
11735
  }
11841
11736
  return toObject;
11842
11737
  }
@@ -12059,7 +11954,7 @@ function safetySettingToMldev$1(fromObject, _rootObject) {
12059
11954
  setValueByPath(toObject, ['category'], fromCategory);
12060
11955
  }
12061
11956
  if (getValueByPath(fromObject, ['method']) !== undefined) {
12062
- throw new Error('method parameter is not supported in Gemini API.');
11957
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12063
11958
  }
12064
11959
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
12065
11960
  if (fromThreshold != null) {
@@ -12193,14 +12088,14 @@ function toolConfigToVertex(fromObject, _rootObject) {
12193
12088
  }
12194
12089
  if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
12195
12090
  undefined) {
12196
- throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12091
+ throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12197
12092
  }
12198
12093
  return toObject;
12199
12094
  }
12200
12095
  function toolToMldev$1(fromObject, rootObject) {
12201
12096
  const toObject = {};
12202
12097
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
12203
- throw new Error('retrieval parameter is not supported in Gemini API.');
12098
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12204
12099
  }
12205
12100
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
12206
12101
  if (fromComputerUse != null) {
@@ -12225,7 +12120,7 @@ function toolToMldev$1(fromObject, rootObject) {
12225
12120
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
12226
12121
  }
12227
12122
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
12228
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
12123
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12229
12124
  }
12230
12125
  const fromFunctionDeclarations = getValueByPath(fromObject, [
12231
12126
  'functionDeclarations',
@@ -12246,7 +12141,7 @@ function toolToMldev$1(fromObject, rootObject) {
12246
12141
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
12247
12142
  }
12248
12143
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
12249
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
12144
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12250
12145
  }
12251
12146
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
12252
12147
  if (fromUrlContext != null) {
@@ -12264,7 +12159,7 @@ function toolToMldev$1(fromObject, rootObject) {
12264
12159
  }
12265
12160
  return toObject;
12266
12161
  }
12267
- function toolToVertex(fromObject, rootObject) {
12162
+ function toolToVertex(fromObject, _rootObject) {
12268
12163
  const toObject = {};
12269
12164
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
12270
12165
  if (fromRetrieval != null) {
@@ -12275,7 +12170,7 @@ function toolToVertex(fromObject, rootObject) {
12275
12170
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
12276
12171
  }
12277
12172
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
12278
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12173
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12279
12174
  }
12280
12175
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
12281
12176
  if (fromGoogleSearch != null) {
@@ -12304,7 +12199,7 @@ function toolToVertex(fromObject, rootObject) {
12304
12199
  let transformedList = fromFunctionDeclarations;
12305
12200
  if (Array.isArray(transformedList)) {
12306
12201
  transformedList = transformedList.map((item) => {
12307
- return functionDeclarationToVertex(item);
12202
+ return item;
12308
12203
  });
12309
12204
  }
12310
12205
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -12326,7 +12221,7 @@ function toolToVertex(fromObject, rootObject) {
12326
12221
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
12327
12222
  }
12328
12223
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
12329
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12224
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12330
12225
  }
12331
12226
  return toObject;
12332
12227
  }
@@ -12889,7 +12784,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12889
12784
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12890
12785
  const USER_AGENT_HEADER = 'User-Agent';
12891
12786
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12892
- const SDK_VERSION = '2.0.1'; // x-release-please-version
12787
+ const SDK_VERSION = '2.2.0'; // x-release-please-version
12893
12788
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12894
12789
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12895
12790
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14785,7 +14680,7 @@ class Models extends BaseModule {
14785
14680
  if (this.apiClient.isVertexAI()) {
14786
14681
  if (!actualParams.config.queryBase) {
14787
14682
  if ((_a = actualParams.config) === null || _a === void 0 ? void 0 : _a.filter) {
14788
- throw new Error('Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported');
14683
+ throw new Error('Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14789
14684
  }
14790
14685
  else {
14791
14686
  actualParams.config.filter = 'labels.tune-type:*';
@@ -16241,7 +16136,7 @@ class Operations extends BaseModule {
16241
16136
  function audioTranscriptionConfigToMldev(fromObject) {
16242
16137
  const toObject = {};
16243
16138
  if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
16244
- throw new Error('languageCodes parameter is not supported in Gemini API.');
16139
+ throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16245
16140
  }
16246
16141
  return toObject;
16247
16142
  }
@@ -16252,23 +16147,23 @@ function authConfigToMldev(fromObject) {
16252
16147
  setValueByPath(toObject, ['apiKey'], fromApiKey);
16253
16148
  }
16254
16149
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
16255
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
16150
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16256
16151
  }
16257
16152
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
16258
- throw new Error('authType parameter is not supported in Gemini API.');
16153
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16259
16154
  }
16260
16155
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
16261
16156
  undefined) {
16262
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
16157
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16263
16158
  }
16264
16159
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
16265
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
16160
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16266
16161
  }
16267
16162
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
16268
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
16163
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16269
16164
  }
16270
16165
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
16271
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
16166
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16272
16167
  }
16273
16168
  return toObject;
16274
16169
  }
@@ -16279,7 +16174,7 @@ function blobToMldev(fromObject) {
16279
16174
  setValueByPath(toObject, ['data'], fromData);
16280
16175
  }
16281
16176
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
16282
- throw new Error('displayName parameter is not supported in Gemini API.');
16177
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16283
16178
  }
16284
16179
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
16285
16180
  if (fromMimeType != null) {
@@ -16346,7 +16241,7 @@ function createAuthTokenParametersToMldev(apiClient, fromObject) {
16346
16241
  function fileDataToMldev(fromObject) {
16347
16242
  const toObject = {};
16348
16243
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
16349
- throw new Error('displayName parameter is not supported in Gemini API.');
16244
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16350
16245
  }
16351
16246
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
16352
16247
  if (fromFileUri != null) {
@@ -16373,10 +16268,10 @@ function functionCallToMldev(fromObject) {
16373
16268
  setValueByPath(toObject, ['name'], fromName);
16374
16269
  }
16375
16270
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
16376
- throw new Error('partialArgs parameter is not supported in Gemini API.');
16271
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16377
16272
  }
16378
16273
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
16379
- throw new Error('willContinue parameter is not supported in Gemini API.');
16274
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16380
16275
  }
16381
16276
  return toObject;
16382
16277
  }
@@ -16399,10 +16294,10 @@ function googleSearchToMldev(fromObject) {
16399
16294
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
16400
16295
  }
16401
16296
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
16402
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
16297
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16403
16298
  }
16404
16299
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16405
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
16300
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16406
16301
  }
16407
16302
  const fromTimeRangeFilter = getValueByPath(fromObject, [
16408
16303
  'timeRangeFilter',
@@ -16521,7 +16416,7 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
16521
16416
  setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
16522
16417
  }
16523
16418
  if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
16524
- throw new Error('explicitVadSignal parameter is not supported in Gemini API.');
16419
+ throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16525
16420
  }
16526
16421
  const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
16527
16422
  if (parentObject !== undefined && fromAvatarConfig != null) {
@@ -16632,7 +16527,7 @@ function safetySettingToMldev(fromObject) {
16632
16527
  setValueByPath(toObject, ['category'], fromCategory);
16633
16528
  }
16634
16529
  if (getValueByPath(fromObject, ['method']) !== undefined) {
16635
- throw new Error('method parameter is not supported in Gemini API.');
16530
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16636
16531
  }
16637
16532
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
16638
16533
  if (fromThreshold != null) {
@@ -16647,14 +16542,14 @@ function sessionResumptionConfigToMldev(fromObject) {
16647
16542
  setValueByPath(toObject, ['handle'], fromHandle);
16648
16543
  }
16649
16544
  if (getValueByPath(fromObject, ['transparent']) !== undefined) {
16650
- throw new Error('transparent parameter is not supported in Gemini API.');
16545
+ throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16651
16546
  }
16652
16547
  return toObject;
16653
16548
  }
16654
16549
  function toolToMldev(fromObject) {
16655
16550
  const toObject = {};
16656
16551
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
16657
- throw new Error('retrieval parameter is not supported in Gemini API.');
16552
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16658
16553
  }
16659
16554
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16660
16555
  if (fromComputerUse != null) {
@@ -16679,7 +16574,7 @@ function toolToMldev(fromObject) {
16679
16574
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16680
16575
  }
16681
16576
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
16682
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
16577
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16683
16578
  }
16684
16579
  const fromFunctionDeclarations = getValueByPath(fromObject, [
16685
16580
  'functionDeclarations',
@@ -16700,7 +16595,7 @@ function toolToMldev(fromObject) {
16700
16595
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
16701
16596
  }
16702
16597
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
16703
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
16598
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16704
16599
  }
16705
16600
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
16706
16601
  if (fromUrlContext != null) {
@@ -18036,325 +17931,128 @@ class APIResource {
18036
17931
  */
18037
17932
  APIResource._key = [];
18038
17933
 
17934
+ /**
17935
+ * @license
17936
+ * Copyright 2025 Google LLC
17937
+ * SPDX-License-Identifier: Apache-2.0
17938
+ */
17939
+ function concatBytes(buffers) {
17940
+ let length = 0;
17941
+ for (const buffer of buffers) {
17942
+ length += buffer.length;
17943
+ }
17944
+ const output = new Uint8Array(length);
17945
+ let index = 0;
17946
+ for (const buffer of buffers) {
17947
+ output.set(buffer, index);
17948
+ index += buffer.length;
17949
+ }
17950
+ return output;
17951
+ }
17952
+ let encodeUTF8_;
17953
+ function encodeUTF8(str) {
17954
+ let encoder;
17955
+ return (encodeUTF8_ !== null && encodeUTF8_ !== void 0 ? encodeUTF8_ : ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
17956
+ }
17957
+ let decodeUTF8_;
17958
+ function decodeUTF8(bytes) {
17959
+ let decoder;
17960
+ return (decodeUTF8_ !== null && decodeUTF8_ !== void 0 ? decodeUTF8_ : ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
17961
+ }
17962
+
18039
17963
  /**
18040
17964
  * @license
18041
17965
  * Copyright 2025 Google LLC
18042
17966
  * SPDX-License-Identifier: Apache-2.0
18043
17967
  */
18044
17968
  /**
18045
- * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
17969
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
17970
+ * reading lines from text.
18046
17971
  *
18047
- * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
18048
- * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
18049
- * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
18050
- * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
17972
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
18051
17973
  */
18052
- function encodeURIPath(str) {
18053
- return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
18054
- }
18055
- const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
18056
- const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
18057
- // If there are no params, no processing is needed.
18058
- if (statics.length === 1)
18059
- return statics[0];
18060
- let postPath = false;
18061
- const invalidSegments = [];
18062
- const path = statics.reduce((previousValue, currentValue, index) => {
18063
- var _a, _b, _c;
18064
- if (/[?#]/.test(currentValue)) {
18065
- postPath = true;
17974
+ class LineDecoder {
17975
+ constructor() {
17976
+ this.buffer = new Uint8Array();
17977
+ this.carriageReturnIndex = null;
17978
+ this.searchIndex = 0;
17979
+ }
17980
+ decode(chunk) {
17981
+ var _a;
17982
+ if (chunk == null) {
17983
+ return [];
18066
17984
  }
18067
- const value = params[index];
18068
- let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
18069
- if (index !== params.length &&
18070
- (value == null ||
18071
- (typeof value === 'object' &&
18072
- // handle values from other realms
18073
- value.toString ===
18074
- ((_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)))) {
18075
- encoded = value + '';
18076
- invalidSegments.push({
18077
- start: previousValue.length + currentValue.length,
18078
- length: encoded.length,
18079
- error: `Value of type ${Object.prototype.toString
18080
- .call(value)
18081
- .slice(8, -1)} is not a valid path parameter`,
18082
- });
17985
+ const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
17986
+ : typeof chunk === 'string' ? encodeUTF8(chunk)
17987
+ : chunk;
17988
+ this.buffer = concatBytes([this.buffer, binaryChunk]);
17989
+ const lines = [];
17990
+ let patternIndex;
17991
+ while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
17992
+ if (patternIndex.carriage && this.carriageReturnIndex == null) {
17993
+ // skip until we either get a corresponding `\n`, a new `\r` or nothing
17994
+ this.carriageReturnIndex = patternIndex.index;
17995
+ continue;
17996
+ }
17997
+ // we got double \r or \rtext\n
17998
+ if (this.carriageReturnIndex != null &&
17999
+ (patternIndex.index !== this.carriageReturnIndex + 1 || patternIndex.carriage)) {
18000
+ lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
18001
+ this.buffer = this.buffer.subarray(this.carriageReturnIndex);
18002
+ this.carriageReturnIndex = null;
18003
+ this.searchIndex = 0;
18004
+ continue;
18005
+ }
18006
+ const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
18007
+ const line = decodeUTF8(this.buffer.subarray(0, endIndex));
18008
+ lines.push(line);
18009
+ this.buffer = this.buffer.subarray(patternIndex.index);
18010
+ this.carriageReturnIndex = null;
18011
+ this.searchIndex = 0;
18083
18012
  }
18084
- return previousValue + currentValue + (index === params.length ? '' : encoded);
18085
- }, '');
18086
- const pathOnly = path.split(/[?#]/, 1)[0];
18087
- const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
18088
- let match;
18089
- // Find all invalid segments
18090
- while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
18091
- const hasLeadingSlash = match[0].startsWith('/');
18092
- const offset = hasLeadingSlash ? 1 : 0;
18093
- const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
18094
- invalidSegments.push({
18095
- start: match.index + offset,
18096
- length: cleanMatch.length,
18097
- error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
18098
- });
18013
+ this.searchIndex = Math.max(0, this.buffer.length - 1);
18014
+ return lines;
18099
18015
  }
18100
- invalidSegments.sort((a, b) => a.start - b.start);
18101
- if (invalidSegments.length > 0) {
18102
- let lastEnd = 0;
18103
- const underline = invalidSegments.reduce((acc, segment) => {
18104
- const spaces = ' '.repeat(segment.start - lastEnd);
18105
- const arrows = '^'.repeat(segment.length);
18106
- lastEnd = segment.start + segment.length;
18107
- return acc + spaces + arrows;
18108
- }, '');
18109
- throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
18110
- .map((e) => e.error)
18111
- .join('\n')}\n${path}\n${underline}`);
18016
+ flush() {
18017
+ if (!this.buffer.length) {
18018
+ return [];
18019
+ }
18020
+ return this.decode('\n');
18112
18021
  }
18113
- return path;
18114
- });
18022
+ }
18023
+ // prettier-ignore
18024
+ LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
18025
+ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
18115
18026
  /**
18116
- * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
18027
+ * This function searches the buffer for the end patterns, (\r or \n)
18028
+ * and returns an object with the index preceding the matched newline and the
18029
+ * index after the newline char. `null` is returned if no new line is found.
18030
+ *
18031
+ * ```ts
18032
+ * findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
18033
+ * ```
18117
18034
  */
18118
- const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
18119
-
18120
- /**
18121
- * @license
18122
- * Copyright 2025 Google LLC
18123
- * SPDX-License-Identifier: Apache-2.0
18124
- */
18125
- class BaseInteractions extends APIResource {
18126
- create(params, options) {
18127
- var _a;
18128
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18129
- if ('model' in body && 'agent_config' in body) {
18130
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
18131
- }
18132
- if ('agent' in body && 'generation_config' in body) {
18133
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
18134
- }
18135
- return this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a = params.stream) !== null && _a !== void 0 ? _a : false }));
18136
- }
18137
- /**
18138
- * Deletes the interaction by id.
18139
- *
18140
- * @example
18141
- * ```ts
18142
- * const interaction = await client.interactions.delete('id', {
18143
- * api_version: 'api_version',
18144
- * });
18145
- * ```
18146
- */
18147
- delete(id, params = {}, options) {
18148
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18149
- return this._client.delete(path `/${api_version}/interactions/${id}`, options);
18150
- }
18151
- /**
18152
- * Cancels an interaction by id. This only applies to background interactions that
18153
- * are still running.
18154
- *
18155
- * @example
18156
- * ```ts
18157
- * const interaction = await client.interactions.cancel('id', {
18158
- * api_version: 'api_version',
18159
- * });
18160
- * ```
18161
- */
18162
- cancel(id, params = {}, options) {
18163
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18164
- return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
18165
- }
18166
- get(id, params = {}, options) {
18167
- var _a;
18168
- const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
18169
- 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 }));
18170
- }
18171
- }
18172
- BaseInteractions._key = Object.freeze(['interactions']);
18173
- class Interactions extends BaseInteractions {
18174
- }
18175
-
18176
- /**
18177
- * @license
18178
- * Copyright 2025 Google LLC
18179
- * SPDX-License-Identifier: Apache-2.0
18180
- */
18181
- class BaseWebhooks extends APIResource {
18182
- /**
18183
- * Creates a new Webhook.
18184
- */
18185
- create(params, options) {
18186
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18187
- return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
18188
- }
18189
- /**
18190
- * Updates an existing Webhook.
18191
- */
18192
- update(id, params = {}, options) {
18193
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
18194
- return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
18195
- }
18196
- /**
18197
- * Lists all Webhooks.
18198
- */
18199
- list(params = {}, options) {
18200
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
18201
- return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
18202
- }
18203
- /**
18204
- * Deletes a Webhook.
18205
- */
18206
- delete(id, params = {}, options) {
18207
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18208
- return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
18209
- }
18210
- /**
18211
- * Gets a specific Webhook.
18212
- */
18213
- get(id, params = {}, options) {
18214
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18215
- return this._client.get(path `/${api_version}/webhooks/${id}`, options);
18216
- }
18217
- /**
18218
- * Sends a ping event to a Webhook.
18219
- */
18220
- ping(id, params = undefined, options) {
18221
- const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
18222
- return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
18223
- }
18224
- /**
18225
- * Generates a new signing secret for a Webhook.
18226
- */
18227
- rotateSigningSecret(id, params = {}, options) {
18228
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
18229
- return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
18230
- }
18231
- }
18232
- BaseWebhooks._key = Object.freeze(['webhooks']);
18233
- class Webhooks extends BaseWebhooks {
18234
- }
18235
-
18236
- /**
18237
- * @license
18238
- * Copyright 2025 Google LLC
18239
- * SPDX-License-Identifier: Apache-2.0
18240
- */
18241
- function concatBytes(buffers) {
18242
- let length = 0;
18243
- for (const buffer of buffers) {
18244
- length += buffer.length;
18245
- }
18246
- const output = new Uint8Array(length);
18247
- let index = 0;
18248
- for (const buffer of buffers) {
18249
- output.set(buffer, index);
18250
- index += buffer.length;
18251
- }
18252
- return output;
18253
- }
18254
- let encodeUTF8_;
18255
- function encodeUTF8(str) {
18256
- let encoder;
18257
- return (encodeUTF8_ !== null && encodeUTF8_ !== void 0 ? encodeUTF8_ : ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
18258
- }
18259
- let decodeUTF8_;
18260
- function decodeUTF8(bytes) {
18261
- let decoder;
18262
- return (decodeUTF8_ !== null && decodeUTF8_ !== void 0 ? decodeUTF8_ : ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
18263
- }
18264
-
18265
- /**
18266
- * @license
18267
- * Copyright 2025 Google LLC
18268
- * SPDX-License-Identifier: Apache-2.0
18269
- */
18270
- /**
18271
- * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
18272
- * reading lines from text.
18273
- *
18274
- * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
18275
- */
18276
- class LineDecoder {
18277
- constructor() {
18278
- this.buffer = new Uint8Array();
18279
- this.carriageReturnIndex = null;
18280
- this.searchIndex = 0;
18281
- }
18282
- decode(chunk) {
18283
- var _a;
18284
- if (chunk == null) {
18285
- return [];
18286
- }
18287
- const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
18288
- : typeof chunk === 'string' ? encodeUTF8(chunk)
18289
- : chunk;
18290
- this.buffer = concatBytes([this.buffer, binaryChunk]);
18291
- const lines = [];
18292
- let patternIndex;
18293
- while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
18294
- if (patternIndex.carriage && this.carriageReturnIndex == null) {
18295
- // skip until we either get a corresponding `\n`, a new `\r` or nothing
18296
- this.carriageReturnIndex = patternIndex.index;
18297
- continue;
18298
- }
18299
- // we got double \r or \rtext\n
18300
- if (this.carriageReturnIndex != null &&
18301
- (patternIndex.index !== this.carriageReturnIndex + 1 || patternIndex.carriage)) {
18302
- lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
18303
- this.buffer = this.buffer.subarray(this.carriageReturnIndex);
18304
- this.carriageReturnIndex = null;
18305
- this.searchIndex = 0;
18306
- continue;
18307
- }
18308
- const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
18309
- const line = decodeUTF8(this.buffer.subarray(0, endIndex));
18310
- lines.push(line);
18311
- this.buffer = this.buffer.subarray(patternIndex.index);
18312
- this.carriageReturnIndex = null;
18313
- this.searchIndex = 0;
18314
- }
18315
- this.searchIndex = Math.max(0, this.buffer.length - 1);
18316
- return lines;
18317
- }
18318
- flush() {
18319
- if (!this.buffer.length) {
18320
- return [];
18321
- }
18322
- return this.decode('\n');
18323
- }
18324
- }
18325
- // prettier-ignore
18326
- LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
18327
- LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
18328
- /**
18329
- * This function searches the buffer for the end patterns, (\r or \n)
18330
- * and returns an object with the index preceding the matched newline and the
18331
- * index after the newline char. `null` is returned if no new line is found.
18332
- *
18333
- * ```ts
18334
- * findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
18335
- * ```
18336
- */
18337
- function findNewlineIndex(buffer, startIndex) {
18338
- const newline = 0x0a; // \n
18339
- const carriage = 0x0d; // \r
18340
- const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
18341
- const nextNewline = buffer.indexOf(newline, start);
18342
- const nextCarriage = buffer.indexOf(carriage, start);
18343
- if (nextNewline === -1 && nextCarriage === -1) {
18344
- return null;
18345
- }
18346
- let i;
18347
- if (nextNewline !== -1 && nextCarriage !== -1) {
18348
- i = Math.min(nextNewline, nextCarriage);
18349
- }
18350
- else {
18351
- i = nextNewline !== -1 ? nextNewline : nextCarriage;
18352
- }
18353
- if (buffer[i] === newline) {
18354
- return { preceding: i, index: i + 1, carriage: false };
18355
- }
18356
- return { preceding: i, index: i + 1, carriage: true };
18357
- }
18035
+ function findNewlineIndex(buffer, startIndex) {
18036
+ const newline = 0x0a; // \n
18037
+ const carriage = 0x0d; // \r
18038
+ const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
18039
+ const nextNewline = buffer.indexOf(newline, start);
18040
+ const nextCarriage = buffer.indexOf(carriage, start);
18041
+ if (nextNewline === -1 && nextCarriage === -1) {
18042
+ return null;
18043
+ }
18044
+ let i;
18045
+ if (nextNewline !== -1 && nextCarriage !== -1) {
18046
+ i = Math.min(nextNewline, nextCarriage);
18047
+ }
18048
+ else {
18049
+ i = nextNewline !== -1 ? nextNewline : nextCarriage;
18050
+ }
18051
+ if (buffer[i] === newline) {
18052
+ return { preceding: i, index: i + 1, carriage: false };
18053
+ }
18054
+ return { preceding: i, index: i + 1, carriage: true };
18055
+ }
18358
18056
 
18359
18057
  /**
18360
18058
  * @license
@@ -18768,6 +18466,338 @@ function partition(str, delimiter) {
18768
18466
  return [str, '', ''];
18769
18467
  }
18770
18468
 
18469
+ /**
18470
+ * @license
18471
+ * Copyright 2025 Google LLC
18472
+ * SPDX-License-Identifier: Apache-2.0
18473
+ */
18474
+ const LEGACY_LYRIA_MODELS = new Set([
18475
+ 'lyria-3-pro-preview',
18476
+ 'lyria-3-clip-preview',
18477
+ ]);
18478
+ const LEGACY_EVENT_TYPE_RENAMES = {
18479
+ 'interaction.start': 'interaction.created',
18480
+ 'content.start': 'step.start',
18481
+ 'content.delta': 'step.delta',
18482
+ 'content.stop': 'step.stop',
18483
+ 'interaction.complete': 'interaction.completed',
18484
+ };
18485
+ function isLegacyLyriaRequest({ isVertex, model }) {
18486
+ return Boolean(isVertex) && typeof model === 'string' && LEGACY_LYRIA_MODELS.has(model);
18487
+ }
18488
+ /**
18489
+ * Detect whether a client is in vertex mode. Reads the `clientAdapter` field
18490
+ * directly because `BaseGeminiNextGenAPIClient` keeps it `private`; centralizing
18491
+ * the runtime cast here avoids leaking it into resource files.
18492
+ */
18493
+ function isVertexClient(client) {
18494
+ const adapter = client.clientAdapter;
18495
+ return Boolean(adapter && adapter.isVertexAI());
18496
+ }
18497
+ function isPlainObject(value) {
18498
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
18499
+ }
18500
+ /**
18501
+ * Wrap a legacy `outputs: Array<Content>` payload into the modern
18502
+ * `steps: [{type: 'model_output', content: outputs}]` shape. Returns the input
18503
+ * unchanged when `steps` already wins or `outputs` is absent.
18504
+ */
18505
+ function wrapOutputsAsSteps(data) {
18506
+ if (!('outputs' in data) || 'steps' in data) {
18507
+ return data;
18508
+ }
18509
+ const { outputs } = data, rest = __rest(data, ["outputs"]);
18510
+ return Object.assign(Object.assign({}, rest), { steps: [{ type: 'model_output', content: outputs }] });
18511
+ }
18512
+ /**
18513
+ * Non-streaming: rewrite a legacy interaction response so consumers see the
18514
+ * modern `steps` shape.
18515
+ */
18516
+ function coerceLegacyInteractionResponse(data) {
18517
+ if (!isPlainObject(data))
18518
+ return data;
18519
+ return wrapOutputsAsSteps(data);
18520
+ }
18521
+ /**
18522
+ * Streaming: translate one legacy SSE event to its modern equivalent.
18523
+ *
18524
+ * Returns the input unchanged when the `event_type` is not one of the legacy
18525
+ * ones we know how to map. Two non-trivial cases:
18526
+ * 1. `content.start` carries `content: <Content>` — the modern `step.start`
18527
+ * expects `step: {type: 'model_output', content: [<Content>]}`.
18528
+ * 2. `interaction.start` / `interaction.complete` wrap an `interaction`
18529
+ * object that may itself carry the legacy `outputs` field; recurse.
18530
+ */
18531
+ function maybeRemapLegacyStreamEvent(data) {
18532
+ if (!isPlainObject(data))
18533
+ return data;
18534
+ const eventType = data['event_type'];
18535
+ if (typeof eventType !== 'string' || !(eventType in LEGACY_EVENT_TYPE_RENAMES)) {
18536
+ return data;
18537
+ }
18538
+ const renamed = Object.assign(Object.assign({}, data), { event_type: LEGACY_EVENT_TYPE_RENAMES[eventType] });
18539
+ if (eventType === 'content.start') {
18540
+ const { content } = renamed, rest = __rest(renamed, ["content"]);
18541
+ let stepContent;
18542
+ if (content == null) {
18543
+ stepContent = [];
18544
+ }
18545
+ else if (Array.isArray(content)) {
18546
+ stepContent = content;
18547
+ }
18548
+ else {
18549
+ stepContent = [content];
18550
+ }
18551
+ return Object.assign(Object.assign({}, rest), { step: { type: 'model_output', content: stepContent } });
18552
+ }
18553
+ if (eventType === 'interaction.start' || eventType === 'interaction.complete') {
18554
+ const inner = renamed['interaction'];
18555
+ if (isPlainObject(inner)) {
18556
+ renamed['interaction'] = wrapOutputsAsSteps(inner);
18557
+ }
18558
+ }
18559
+ return renamed;
18560
+ }
18561
+ /**
18562
+ * Stream subclass that runs each yielded SSE event through
18563
+ * `maybeRemapLegacyStreamEvent` so consumers always see modern event shapes.
18564
+ *
18565
+ * Wired in via the `__streamClass` request option from `resources/interactions.ts`
18566
+ * (read by `src/internal/parse.ts:defaultParseResponse`).
18567
+ */
18568
+ class LegacyLyriaStream extends Stream {
18569
+ static fromSSEResponse(response, controller, client) {
18570
+ const base = Stream.fromSSEResponse(response, controller, client);
18571
+ function wrappedIterator() {
18572
+ return __asyncGenerator(this, arguments, function* wrappedIterator_1() {
18573
+ var _a, e_1, _b, _c;
18574
+ try {
18575
+ 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) {
18576
+ _c = base_1_1.value;
18577
+ _d = false;
18578
+ const item = _c;
18579
+ yield yield __await(maybeRemapLegacyStreamEvent(item));
18580
+ }
18581
+ }
18582
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
18583
+ finally {
18584
+ try {
18585
+ if (!_d && !_a && (_b = base_1.return)) yield __await(_b.call(base_1));
18586
+ }
18587
+ finally { if (e_1) throw e_1.error; }
18588
+ }
18589
+ });
18590
+ }
18591
+ return new LegacyLyriaStream(wrappedIterator, controller, client);
18592
+ }
18593
+ }
18594
+
18595
+ /**
18596
+ * @license
18597
+ * Copyright 2025 Google LLC
18598
+ * SPDX-License-Identifier: Apache-2.0
18599
+ */
18600
+ /**
18601
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
18602
+ *
18603
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
18604
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
18605
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
18606
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
18607
+ */
18608
+ function encodeURIPath(str) {
18609
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
18610
+ }
18611
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
18612
+ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
18613
+ // If there are no params, no processing is needed.
18614
+ if (statics.length === 1)
18615
+ return statics[0];
18616
+ let postPath = false;
18617
+ const invalidSegments = [];
18618
+ const path = statics.reduce((previousValue, currentValue, index) => {
18619
+ var _a, _b, _c;
18620
+ if (/[?#]/.test(currentValue)) {
18621
+ postPath = true;
18622
+ }
18623
+ const value = params[index];
18624
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
18625
+ if (index !== params.length &&
18626
+ (value == null ||
18627
+ (typeof value === 'object' &&
18628
+ // handle values from other realms
18629
+ value.toString ===
18630
+ ((_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)))) {
18631
+ encoded = value + '';
18632
+ invalidSegments.push({
18633
+ start: previousValue.length + currentValue.length,
18634
+ length: encoded.length,
18635
+ error: `Value of type ${Object.prototype.toString
18636
+ .call(value)
18637
+ .slice(8, -1)} is not a valid path parameter`,
18638
+ });
18639
+ }
18640
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
18641
+ }, '');
18642
+ const pathOnly = path.split(/[?#]/, 1)[0];
18643
+ const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
18644
+ let match;
18645
+ // Find all invalid segments
18646
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
18647
+ const hasLeadingSlash = match[0].startsWith('/');
18648
+ const offset = hasLeadingSlash ? 1 : 0;
18649
+ const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
18650
+ invalidSegments.push({
18651
+ start: match.index + offset,
18652
+ length: cleanMatch.length,
18653
+ error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
18654
+ });
18655
+ }
18656
+ invalidSegments.sort((a, b) => a.start - b.start);
18657
+ if (invalidSegments.length > 0) {
18658
+ let lastEnd = 0;
18659
+ const underline = invalidSegments.reduce((acc, segment) => {
18660
+ const spaces = ' '.repeat(segment.start - lastEnd);
18661
+ const arrows = '^'.repeat(segment.length);
18662
+ lastEnd = segment.start + segment.length;
18663
+ return acc + spaces + arrows;
18664
+ }, '');
18665
+ throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
18666
+ .map((e) => e.error)
18667
+ .join('\n')}\n${path}\n${underline}`);
18668
+ }
18669
+ return path;
18670
+ });
18671
+ /**
18672
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
18673
+ */
18674
+ const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
18675
+
18676
+ /**
18677
+ * @license
18678
+ * Copyright 2025 Google LLC
18679
+ * SPDX-License-Identifier: Apache-2.0
18680
+ */
18681
+ class BaseInteractions extends APIResource {
18682
+ create(params, options) {
18683
+ var _a;
18684
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18685
+ if ('model' in body && 'agent_config' in body) {
18686
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
18687
+ }
18688
+ if ('agent' in body && 'generation_config' in body) {
18689
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
18690
+ }
18691
+ const needsLegacyLyriaShim = isLegacyLyriaRequest({
18692
+ isVertex: isVertexClient(this._client),
18693
+ model: 'model' in body ? body.model : undefined,
18694
+ });
18695
+ const isStreaming = (_a = params.stream) !== null && _a !== void 0 ? _a : false;
18696
+ const promise = this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign(Object.assign({ body }, options), { stream: isStreaming }), (needsLegacyLyriaShim && isStreaming ? { __streamClass: LegacyLyriaStream } : {})));
18697
+ if (needsLegacyLyriaShim && !isStreaming) {
18698
+ return promise._thenUnwrap((data) => coerceLegacyInteractionResponse(data));
18699
+ }
18700
+ return promise;
18701
+ }
18702
+ /**
18703
+ * Deletes the interaction by id.
18704
+ *
18705
+ * @example
18706
+ * ```ts
18707
+ * const interaction = await client.interactions.delete('id', {
18708
+ * api_version: 'api_version',
18709
+ * });
18710
+ * ```
18711
+ */
18712
+ delete(id, params = {}, options) {
18713
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18714
+ return this._client.delete(path `/${api_version}/interactions/${id}`, options);
18715
+ }
18716
+ /**
18717
+ * Cancels an interaction by id. This only applies to background interactions that
18718
+ * are still running.
18719
+ *
18720
+ * @example
18721
+ * ```ts
18722
+ * const interaction = await client.interactions.cancel('id', {
18723
+ * api_version: 'api_version',
18724
+ * });
18725
+ * ```
18726
+ */
18727
+ cancel(id, params = {}, options) {
18728
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18729
+ return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
18730
+ }
18731
+ get(id, params = {}, options) {
18732
+ var _a;
18733
+ const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
18734
+ 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 }));
18735
+ }
18736
+ }
18737
+ BaseInteractions._key = Object.freeze(['interactions']);
18738
+ class Interactions extends BaseInteractions {
18739
+ }
18740
+
18741
+ /**
18742
+ * @license
18743
+ * Copyright 2025 Google LLC
18744
+ * SPDX-License-Identifier: Apache-2.0
18745
+ */
18746
+ class BaseWebhooks extends APIResource {
18747
+ /**
18748
+ * Creates a new Webhook.
18749
+ */
18750
+ create(params, options) {
18751
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18752
+ return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
18753
+ }
18754
+ /**
18755
+ * Updates an existing Webhook.
18756
+ */
18757
+ update(id, params = {}, options) {
18758
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
18759
+ return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
18760
+ }
18761
+ /**
18762
+ * Lists all Webhooks.
18763
+ */
18764
+ list(params = {}, options) {
18765
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
18766
+ return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
18767
+ }
18768
+ /**
18769
+ * Deletes a Webhook.
18770
+ */
18771
+ delete(id, params = {}, options) {
18772
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18773
+ return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
18774
+ }
18775
+ /**
18776
+ * Gets a specific Webhook.
18777
+ */
18778
+ get(id, params = {}, options) {
18779
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18780
+ return this._client.get(path `/${api_version}/webhooks/${id}`, options);
18781
+ }
18782
+ /**
18783
+ * Sends a ping event to a Webhook.
18784
+ */
18785
+ ping(id, params = undefined, options) {
18786
+ const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
18787
+ return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
18788
+ }
18789
+ /**
18790
+ * Generates a new signing secret for a Webhook.
18791
+ */
18792
+ rotateSigningSecret(id, params = {}, options) {
18793
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
18794
+ return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
18795
+ }
18796
+ }
18797
+ BaseWebhooks._key = Object.freeze(['webhooks']);
18798
+ class Webhooks extends BaseWebhooks {
18799
+ }
18800
+
18771
18801
  /**
18772
18802
  * @license
18773
18803
  * Copyright 2025 Google LLC
@@ -19487,7 +19517,7 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
19487
19517
  function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19488
19518
  const toObject = {};
19489
19519
  if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
19490
- throw new Error('validationDataset parameter is not supported in Gemini API.');
19520
+ throw new Error('validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19491
19521
  }
19492
19522
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
19493
19523
  'tunedModelDisplayName',
@@ -19496,7 +19526,7 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19496
19526
  setValueByPath(parentObject, ['displayName'], fromTunedModelDisplayName);
19497
19527
  }
19498
19528
  if (getValueByPath(fromObject, ['description']) !== undefined) {
19499
- throw new Error('description parameter is not supported in Gemini API.');
19529
+ throw new Error('description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19500
19530
  }
19501
19531
  const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
19502
19532
  if (parentObject !== undefined && fromEpochCount != null) {
@@ -19510,20 +19540,20 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19510
19540
  }
19511
19541
  if (getValueByPath(fromObject, ['exportLastCheckpointOnly']) !==
19512
19542
  undefined) {
19513
- throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
19543
+ throw new Error('exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19514
19544
  }
19515
19545
  if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
19516
19546
  undefined) {
19517
- throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
19547
+ throw new Error('preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19518
19548
  }
19519
19549
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
19520
- throw new Error('adapterSize parameter is not supported in Gemini API.');
19550
+ throw new Error('adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19521
19551
  }
19522
19552
  if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
19523
- throw new Error('tuningMode parameter is not supported in Gemini API.');
19553
+ throw new Error('tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19524
19554
  }
19525
19555
  if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
19526
- throw new Error('customBaseModel parameter is not supported in Gemini API.');
19556
+ throw new Error('customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19527
19557
  }
19528
19558
  const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19529
19559
  if (parentObject !== undefined && fromBatchSize != null) {
@@ -19534,25 +19564,25 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19534
19564
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
19535
19565
  }
19536
19566
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
19537
- throw new Error('labels parameter is not supported in Gemini API.');
19567
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19538
19568
  }
19539
19569
  if (getValueByPath(fromObject, ['beta']) !== undefined) {
19540
- throw new Error('beta parameter is not supported in Gemini API.');
19570
+ throw new Error('beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19541
19571
  }
19542
19572
  if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
19543
- throw new Error('baseTeacherModel parameter is not supported in Gemini API.');
19573
+ throw new Error('baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19544
19574
  }
19545
19575
  if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
19546
- throw new Error('tunedTeacherModelSource parameter is not supported in Gemini API.');
19576
+ throw new Error('tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19547
19577
  }
19548
19578
  if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
19549
- throw new Error('sftLossWeightMultiplier parameter is not supported in Gemini API.');
19579
+ throw new Error('sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19550
19580
  }
19551
19581
  if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
19552
- throw new Error('outputUri parameter is not supported in Gemini API.');
19582
+ throw new Error('outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19553
19583
  }
19554
19584
  if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
19555
- throw new Error('encryptionSpec parameter is not supported in Gemini API.');
19585
+ throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19556
19586
  }
19557
19587
  return toObject;
19558
19588
  }
@@ -19946,10 +19976,10 @@ function tunedModelFromMldev(fromObject, _rootObject) {
19946
19976
  function tuningDatasetToMldev(fromObject, _rootObject) {
19947
19977
  const toObject = {};
19948
19978
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
19949
- throw new Error('gcsUri parameter is not supported in Gemini API.');
19979
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19950
19980
  }
19951
19981
  if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
19952
- throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
19982
+ throw new Error('vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19953
19983
  }
19954
19984
  const fromExamples = getValueByPath(fromObject, ['examples']);
19955
19985
  if (fromExamples != null) {
@@ -20022,7 +20052,7 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
20022
20052
  }
20023
20053
  }
20024
20054
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
20025
- throw new Error('examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
20055
+ throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
20026
20056
  }
20027
20057
  return toObject;
20028
20058
  }