@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.
@@ -796,11 +796,11 @@ var PhishBlockThreshold;
796
796
  */
797
797
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
798
798
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
799
- /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
799
+ /** 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. */
800
800
  var Behavior;
801
801
  (function (Behavior) {
802
802
  /**
803
- * This value is unused.
803
+ * This value is unspecified.
804
804
  */
805
805
  Behavior["UNSPECIFIED"] = "UNSPECIFIED";
806
806
  /**
@@ -3775,23 +3775,23 @@ function authConfigToMldev$4(fromObject) {
3775
3775
  setValueByPath(toObject, ['apiKey'], fromApiKey);
3776
3776
  }
3777
3777
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
3778
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
3778
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3779
3779
  }
3780
3780
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
3781
- throw new Error('authType parameter is not supported in Gemini API.');
3781
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3782
3782
  }
3783
3783
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
3784
3784
  undefined) {
3785
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
3785
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3786
3786
  }
3787
3787
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
3788
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
3788
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3789
3789
  }
3790
3790
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
3791
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
3791
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3792
3792
  }
3793
3793
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
3794
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
3794
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
3795
3795
  }
3796
3796
  return toObject;
3797
3797
  }
@@ -3872,14 +3872,14 @@ function batchJobDestinationToVertex(fromObject) {
3872
3872
  setValueByPath(toObject, ['bigqueryDestination', 'outputUri'], fromBigqueryUri);
3873
3873
  }
3874
3874
  if (getValueByPath(fromObject, ['fileName']) !== undefined) {
3875
- throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3875
+ throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3876
3876
  }
3877
3877
  if (getValueByPath(fromObject, ['inlinedResponses']) !== undefined) {
3878
- throw new Error('inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3878
+ throw new Error('inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3879
3879
  }
3880
3880
  if (getValueByPath(fromObject, ['inlinedEmbedContentResponses']) !==
3881
3881
  undefined) {
3882
- throw new Error('inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
3882
+ throw new Error('inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
3883
3883
  }
3884
3884
  const fromVertexDataset = getValueByPath(fromObject, [
3885
3885
  'vertexDataset',
@@ -4024,13 +4024,13 @@ function batchJobSourceFromVertex(fromObject) {
4024
4024
  function batchJobSourceToMldev(apiClient, fromObject) {
4025
4025
  const toObject = {};
4026
4026
  if (getValueByPath(fromObject, ['format']) !== undefined) {
4027
- throw new Error('format parameter is not supported in Gemini API.');
4027
+ throw new Error('format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4028
4028
  }
4029
4029
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
4030
- throw new Error('gcsUri parameter is not supported in Gemini API.');
4030
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4031
4031
  }
4032
4032
  if (getValueByPath(fromObject, ['bigqueryUri']) !== undefined) {
4033
- throw new Error('bigqueryUri parameter is not supported in Gemini API.');
4033
+ throw new Error('bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4034
4034
  }
4035
4035
  const fromFileName = getValueByPath(fromObject, ['fileName']);
4036
4036
  if (fromFileName != null) {
@@ -4049,7 +4049,7 @@ function batchJobSourceToMldev(apiClient, fromObject) {
4049
4049
  setValueByPath(toObject, ['requests', 'requests'], transformedList);
4050
4050
  }
4051
4051
  if (getValueByPath(fromObject, ['vertexDatasetName']) !== undefined) {
4052
- throw new Error('vertexDatasetName parameter is not supported in Gemini API.');
4052
+ throw new Error('vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4053
4053
  }
4054
4054
  return toObject;
4055
4055
  }
@@ -4068,10 +4068,10 @@ function batchJobSourceToVertex(fromObject) {
4068
4068
  setValueByPath(toObject, ['bigquerySource', 'inputUri'], fromBigqueryUri);
4069
4069
  }
4070
4070
  if (getValueByPath(fromObject, ['fileName']) !== undefined) {
4071
- throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4071
+ throw new Error('fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4072
4072
  }
4073
4073
  if (getValueByPath(fromObject, ['inlinedRequests']) !== undefined) {
4074
- throw new Error('inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4074
+ throw new Error('inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4075
4075
  }
4076
4076
  const fromVertexDatasetName = getValueByPath(fromObject, [
4077
4077
  'vertexDatasetName',
@@ -4088,7 +4088,7 @@ function blobToMldev$4(fromObject) {
4088
4088
  setValueByPath(toObject, ['data'], fromData);
4089
4089
  }
4090
4090
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4091
- throw new Error('displayName parameter is not supported in Gemini API.');
4091
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4092
4092
  }
4093
4093
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
4094
4094
  if (fromMimeType != null) {
@@ -4211,7 +4211,7 @@ function createBatchJobConfigToMldev(fromObject, parentObject) {
4211
4211
  setValueByPath(parentObject, ['batch', 'displayName'], fromDisplayName);
4212
4212
  }
4213
4213
  if (getValueByPath(fromObject, ['dest']) !== undefined) {
4214
- throw new Error('dest parameter is not supported in Gemini API.');
4214
+ throw new Error('dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4215
4215
  }
4216
4216
  const fromWebhookConfig = getValueByPath(fromObject, [
4217
4217
  'webhookConfig',
@@ -4232,7 +4232,7 @@ function createBatchJobConfigToVertex(fromObject, parentObject) {
4232
4232
  setValueByPath(parentObject, ['outputConfig'], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
4233
4233
  }
4234
4234
  if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
4235
- throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
4235
+ throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
4236
4236
  }
4237
4237
  return toObject;
4238
4238
  }
@@ -4388,16 +4388,16 @@ function embedContentConfigToMldev$1(fromObject, parentObject) {
4388
4388
  setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
4389
4389
  }
4390
4390
  if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
4391
- throw new Error('mimeType parameter is not supported in Gemini API.');
4391
+ throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4392
4392
  }
4393
4393
  if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
4394
- throw new Error('autoTruncate parameter is not supported in Gemini API.');
4394
+ throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4395
4395
  }
4396
4396
  if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
4397
- throw new Error('documentOcr parameter is not supported in Gemini API.');
4397
+ throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4398
4398
  }
4399
4399
  if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
4400
- throw new Error('audioTrackExtraction parameter is not supported in Gemini API.');
4400
+ throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4401
4401
  }
4402
4402
  return toObject;
4403
4403
  }
@@ -4418,7 +4418,7 @@ function embeddingsBatchJobSourceToMldev(apiClient, fromObject) {
4418
4418
  function fileDataToMldev$4(fromObject) {
4419
4419
  const toObject = {};
4420
4420
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4421
- throw new Error('displayName parameter is not supported in Gemini API.');
4421
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4422
4422
  }
4423
4423
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
4424
4424
  if (fromFileUri != null) {
@@ -4445,10 +4445,10 @@ function functionCallToMldev$4(fromObject) {
4445
4445
  setValueByPath(toObject, ['name'], fromName);
4446
4446
  }
4447
4447
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
4448
- throw new Error('partialArgs parameter is not supported in Gemini API.');
4448
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4449
4449
  }
4450
4450
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
4451
- throw new Error('willContinue parameter is not supported in Gemini API.');
4451
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4452
4452
  }
4453
4453
  return toObject;
4454
4454
  }
@@ -4466,7 +4466,7 @@ function functionCallingConfigToMldev$2(fromObject) {
4466
4466
  }
4467
4467
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
4468
4468
  undefined) {
4469
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
4469
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4470
4470
  }
4471
4471
  return toObject;
4472
4472
  }
@@ -4553,10 +4553,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4553
4553
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
4554
4554
  }
4555
4555
  if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
4556
- throw new Error('routingConfig parameter is not supported in Gemini API.');
4556
+ throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4557
4557
  }
4558
4558
  if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
4559
- throw new Error('modelSelectionConfig parameter is not supported in Gemini API.');
4559
+ throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4560
4560
  }
4561
4561
  const fromSafetySettings = getValueByPath(fromObject, [
4562
4562
  'safetySettings',
@@ -4585,7 +4585,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4585
4585
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$2(fromToolConfig));
4586
4586
  }
4587
4587
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
4588
- throw new Error('labels parameter is not supported in Gemini API.');
4588
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4589
4589
  }
4590
4590
  const fromCachedContent = getValueByPath(fromObject, [
4591
4591
  'cachedContent',
@@ -4610,7 +4610,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4610
4610
  setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
4611
4611
  }
4612
4612
  if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
4613
- throw new Error('audioTimestamp parameter is not supported in Gemini API.');
4613
+ throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4614
4614
  }
4615
4615
  const fromThinkingConfig = getValueByPath(fromObject, [
4616
4616
  'thinkingConfig',
@@ -4629,7 +4629,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4629
4629
  setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
4630
4630
  }
4631
4631
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4632
- throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4632
+ throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4633
4633
  }
4634
4634
  const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4635
4635
  if (parentObject !== undefined && fromServiceTier != null) {
@@ -4716,10 +4716,10 @@ function googleSearchToMldev$4(fromObject) {
4716
4716
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
4717
4717
  }
4718
4718
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
4719
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
4719
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4720
4720
  }
4721
4721
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
4722
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
4722
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4723
4723
  }
4724
4724
  const fromTimeRangeFilter = getValueByPath(fromObject, [
4725
4725
  'timeRangeFilter',
@@ -4740,20 +4740,20 @@ function imageConfigToMldev$1(fromObject) {
4740
4740
  setValueByPath(toObject, ['imageSize'], fromImageSize);
4741
4741
  }
4742
4742
  if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
4743
- throw new Error('personGeneration parameter is not supported in Gemini API.');
4743
+ throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4744
4744
  }
4745
4745
  if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
4746
- throw new Error('prominentPeople parameter is not supported in Gemini API.');
4746
+ throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4747
4747
  }
4748
4748
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
4749
- throw new Error('outputMimeType parameter is not supported in Gemini API.');
4749
+ throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4750
4750
  }
4751
4751
  if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
4752
4752
  undefined) {
4753
- throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
4753
+ throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4754
4754
  }
4755
4755
  if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
4756
- throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
4756
+ throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4757
4757
  }
4758
4758
  return toObject;
4759
4759
  }
@@ -4810,7 +4810,7 @@ function listBatchJobsConfigToMldev(fromObject, parentObject) {
4810
4810
  setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
4811
4811
  }
4812
4812
  if (getValueByPath(fromObject, ['filter']) !== undefined) {
4813
- throw new Error('filter parameter is not supported in Gemini API.');
4813
+ throw new Error('filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4814
4814
  }
4815
4815
  return toObject;
4816
4816
  }
@@ -4979,7 +4979,7 @@ function safetySettingToMldev$3(fromObject) {
4979
4979
  setValueByPath(toObject, ['category'], fromCategory);
4980
4980
  }
4981
4981
  if (getValueByPath(fromObject, ['method']) !== undefined) {
4982
- throw new Error('method parameter is not supported in Gemini API.');
4982
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
4983
4983
  }
4984
4984
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
4985
4985
  if (fromThreshold != null) {
@@ -5010,7 +5010,7 @@ function toolConfigToMldev$2(fromObject) {
5010
5010
  function toolToMldev$4(fromObject) {
5011
5011
  const toObject = {};
5012
5012
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5013
- throw new Error('retrieval parameter is not supported in Gemini API.');
5013
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5014
5014
  }
5015
5015
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5016
5016
  if (fromComputerUse != null) {
@@ -5035,7 +5035,7 @@ function toolToMldev$4(fromObject) {
5035
5035
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5036
5036
  }
5037
5037
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5038
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5038
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5039
5039
  }
5040
5040
  const fromFunctionDeclarations = getValueByPath(fromObject, [
5041
5041
  'functionDeclarations',
@@ -5056,7 +5056,7 @@ function toolToMldev$4(fromObject) {
5056
5056
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5057
5057
  }
5058
5058
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
5059
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
5059
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5060
5060
  }
5061
5061
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5062
5062
  if (fromUrlContext != null) {
@@ -5803,23 +5803,23 @@ function authConfigToMldev$3(fromObject) {
5803
5803
  setValueByPath(toObject, ['apiKey'], fromApiKey);
5804
5804
  }
5805
5805
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
5806
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
5806
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5807
5807
  }
5808
5808
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
5809
- throw new Error('authType parameter is not supported in Gemini API.');
5809
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5810
5810
  }
5811
5811
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
5812
5812
  undefined) {
5813
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
5813
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5814
5814
  }
5815
5815
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
5816
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
5816
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5817
5817
  }
5818
5818
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
5819
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
5819
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5820
5820
  }
5821
5821
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
5822
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
5822
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5823
5823
  }
5824
5824
  return toObject;
5825
5825
  }
@@ -5830,7 +5830,7 @@ function blobToMldev$3(fromObject) {
5830
5830
  setValueByPath(toObject, ['data'], fromData);
5831
5831
  }
5832
5832
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
5833
- throw new Error('displayName parameter is not supported in Gemini API.');
5833
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5834
5834
  }
5835
5835
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
5836
5836
  if (fromMimeType != null) {
@@ -5919,7 +5919,7 @@ function createCachedContentConfigToMldev(fromObject, parentObject) {
5919
5919
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev$1(fromToolConfig));
5920
5920
  }
5921
5921
  if (getValueByPath(fromObject, ['kmsKeyName']) !== undefined) {
5922
- throw new Error('kmsKeyName parameter is not supported in Gemini API.');
5922
+ throw new Error('kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5923
5923
  }
5924
5924
  return toObject;
5925
5925
  }
@@ -6036,7 +6036,7 @@ function deleteCachedContentResponseFromVertex(fromObject) {
6036
6036
  function fileDataToMldev$3(fromObject) {
6037
6037
  const toObject = {};
6038
6038
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6039
- throw new Error('displayName parameter is not supported in Gemini API.');
6039
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6040
6040
  }
6041
6041
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
6042
6042
  if (fromFileUri != null) {
@@ -6063,10 +6063,10 @@ function functionCallToMldev$3(fromObject) {
6063
6063
  setValueByPath(toObject, ['name'], fromName);
6064
6064
  }
6065
6065
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
6066
- throw new Error('partialArgs parameter is not supported in Gemini API.');
6066
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6067
6067
  }
6068
6068
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
6069
- throw new Error('willContinue parameter is not supported in Gemini API.');
6069
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6070
6070
  }
6071
6071
  return toObject;
6072
6072
  }
@@ -6084,42 +6084,7 @@ function functionCallingConfigToMldev$1(fromObject) {
6084
6084
  }
6085
6085
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
6086
6086
  undefined) {
6087
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
6088
- }
6089
- return toObject;
6090
- }
6091
- function functionDeclarationToVertex$2(fromObject) {
6092
- const toObject = {};
6093
- const fromDescription = getValueByPath(fromObject, ['description']);
6094
- if (fromDescription != null) {
6095
- setValueByPath(toObject, ['description'], fromDescription);
6096
- }
6097
- const fromName = getValueByPath(fromObject, ['name']);
6098
- if (fromName != null) {
6099
- setValueByPath(toObject, ['name'], fromName);
6100
- }
6101
- const fromParameters = getValueByPath(fromObject, ['parameters']);
6102
- if (fromParameters != null) {
6103
- setValueByPath(toObject, ['parameters'], fromParameters);
6104
- }
6105
- const fromParametersJsonSchema = getValueByPath(fromObject, [
6106
- 'parametersJsonSchema',
6107
- ]);
6108
- if (fromParametersJsonSchema != null) {
6109
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
6110
- }
6111
- const fromResponse = getValueByPath(fromObject, ['response']);
6112
- if (fromResponse != null) {
6113
- setValueByPath(toObject, ['response'], fromResponse);
6114
- }
6115
- const fromResponseJsonSchema = getValueByPath(fromObject, [
6116
- 'responseJsonSchema',
6117
- ]);
6118
- if (fromResponseJsonSchema != null) {
6119
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
6120
- }
6121
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
6122
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6087
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6123
6088
  }
6124
6089
  return toObject;
6125
6090
  }
@@ -6158,10 +6123,10 @@ function googleSearchToMldev$3(fromObject) {
6158
6123
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
6159
6124
  }
6160
6125
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
6161
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
6126
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6162
6127
  }
6163
6128
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6164
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
6129
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6165
6130
  }
6166
6131
  const fromTimeRangeFilter = getValueByPath(fromObject, [
6167
6132
  'timeRangeFilter',
@@ -6398,13 +6363,13 @@ function partToVertex$2(fromObject) {
6398
6363
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
6399
6364
  }
6400
6365
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
6401
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6366
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6402
6367
  }
6403
6368
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6404
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6369
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6405
6370
  }
6406
6371
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6407
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6372
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6408
6373
  }
6409
6374
  return toObject;
6410
6375
  }
@@ -6444,14 +6409,14 @@ function toolConfigToVertex$1(fromObject) {
6444
6409
  }
6445
6410
  if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
6446
6411
  undefined) {
6447
- throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6412
+ throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6448
6413
  }
6449
6414
  return toObject;
6450
6415
  }
6451
6416
  function toolToMldev$3(fromObject) {
6452
6417
  const toObject = {};
6453
6418
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
6454
- throw new Error('retrieval parameter is not supported in Gemini API.');
6419
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6455
6420
  }
6456
6421
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
6457
6422
  if (fromComputerUse != null) {
@@ -6476,7 +6441,7 @@ function toolToMldev$3(fromObject) {
6476
6441
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
6477
6442
  }
6478
6443
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
6479
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
6444
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6480
6445
  }
6481
6446
  const fromFunctionDeclarations = getValueByPath(fromObject, [
6482
6447
  'functionDeclarations',
@@ -6497,7 +6462,7 @@ function toolToMldev$3(fromObject) {
6497
6462
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
6498
6463
  }
6499
6464
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
6500
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
6465
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6501
6466
  }
6502
6467
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
6503
6468
  if (fromUrlContext != null) {
@@ -6526,7 +6491,7 @@ function toolToVertex$2(fromObject) {
6526
6491
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
6527
6492
  }
6528
6493
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
6529
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6494
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6530
6495
  }
6531
6496
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
6532
6497
  if (fromGoogleSearch != null) {
@@ -6555,7 +6520,7 @@ function toolToVertex$2(fromObject) {
6555
6520
  let transformedList = fromFunctionDeclarations;
6556
6521
  if (Array.isArray(transformedList)) {
6557
6522
  transformedList = transformedList.map((item) => {
6558
- return functionDeclarationToVertex$2(item);
6523
+ return item;
6559
6524
  });
6560
6525
  }
6561
6526
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -6577,7 +6542,7 @@ function toolToVertex$2(fromObject) {
6577
6542
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
6578
6543
  }
6579
6544
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
6580
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
6545
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6581
6546
  }
6582
6547
  return toObject;
6583
6548
  }
@@ -7869,7 +7834,7 @@ class Files extends BaseModule {
7869
7834
  function audioTranscriptionConfigToMldev$1(fromObject) {
7870
7835
  const toObject = {};
7871
7836
  if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
7872
- throw new Error('languageCodes parameter is not supported in Gemini API.');
7837
+ throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7873
7838
  }
7874
7839
  return toObject;
7875
7840
  }
@@ -7880,23 +7845,23 @@ function authConfigToMldev$2(fromObject) {
7880
7845
  setValueByPath(toObject, ['apiKey'], fromApiKey);
7881
7846
  }
7882
7847
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
7883
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
7848
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7884
7849
  }
7885
7850
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
7886
- throw new Error('authType parameter is not supported in Gemini API.');
7851
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7887
7852
  }
7888
7853
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
7889
7854
  undefined) {
7890
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
7855
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7891
7856
  }
7892
7857
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
7893
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
7858
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7894
7859
  }
7895
7860
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
7896
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
7861
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7897
7862
  }
7898
7863
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
7899
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
7864
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7900
7865
  }
7901
7866
  return toObject;
7902
7867
  }
@@ -7907,7 +7872,7 @@ function blobToMldev$2(fromObject) {
7907
7872
  setValueByPath(toObject, ['data'], fromData);
7908
7873
  }
7909
7874
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7910
- throw new Error('displayName parameter is not supported in Gemini API.');
7875
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7911
7876
  }
7912
7877
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7913
7878
  if (fromMimeType != null) {
@@ -7954,7 +7919,7 @@ function contentToVertex$1(fromObject) {
7954
7919
  function fileDataToMldev$2(fromObject) {
7955
7920
  const toObject = {};
7956
7921
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7957
- throw new Error('displayName parameter is not supported in Gemini API.');
7922
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7958
7923
  }
7959
7924
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7960
7925
  if (fromFileUri != null) {
@@ -7981,45 +7946,10 @@ function functionCallToMldev$2(fromObject) {
7981
7946
  setValueByPath(toObject, ['name'], fromName);
7982
7947
  }
7983
7948
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
7984
- throw new Error('partialArgs parameter is not supported in Gemini API.');
7949
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
7985
7950
  }
7986
7951
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
7987
- throw new Error('willContinue parameter is not supported in Gemini API.');
7988
- }
7989
- return toObject;
7990
- }
7991
- function functionDeclarationToVertex$1(fromObject) {
7992
- const toObject = {};
7993
- const fromDescription = getValueByPath(fromObject, ['description']);
7994
- if (fromDescription != null) {
7995
- setValueByPath(toObject, ['description'], fromDescription);
7996
- }
7997
- const fromName = getValueByPath(fromObject, ['name']);
7998
- if (fromName != null) {
7999
- setValueByPath(toObject, ['name'], fromName);
8000
- }
8001
- const fromParameters = getValueByPath(fromObject, ['parameters']);
8002
- if (fromParameters != null) {
8003
- setValueByPath(toObject, ['parameters'], fromParameters);
8004
- }
8005
- const fromParametersJsonSchema = getValueByPath(fromObject, [
8006
- 'parametersJsonSchema',
8007
- ]);
8008
- if (fromParametersJsonSchema != null) {
8009
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
8010
- }
8011
- const fromResponse = getValueByPath(fromObject, ['response']);
8012
- if (fromResponse != null) {
8013
- setValueByPath(toObject, ['response'], fromResponse);
8014
- }
8015
- const fromResponseJsonSchema = getValueByPath(fromObject, [
8016
- 'responseJsonSchema',
8017
- ]);
8018
- if (fromResponseJsonSchema != null) {
8019
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
8020
- }
8021
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8022
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
7952
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8023
7953
  }
8024
7954
  return toObject;
8025
7955
  }
@@ -8147,7 +8077,7 @@ function generationConfigToVertex$1(fromObject) {
8147
8077
  }
8148
8078
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
8149
8079
  undefined) {
8150
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8080
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8151
8081
  }
8152
8082
  return toObject;
8153
8083
  }
@@ -8170,10 +8100,10 @@ function googleSearchToMldev$2(fromObject) {
8170
8100
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
8171
8101
  }
8172
8102
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
8173
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
8103
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8174
8104
  }
8175
8105
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
8176
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
8106
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8177
8107
  }
8178
8108
  const fromTimeRangeFilter = getValueByPath(fromObject, [
8179
8109
  'timeRangeFilter',
@@ -8292,7 +8222,7 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
8292
8222
  setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
8293
8223
  }
8294
8224
  if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
8295
- throw new Error('explicitVadSignal parameter is not supported in Gemini API.');
8225
+ throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8296
8226
  }
8297
8227
  const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
8298
8228
  if (parentObject !== undefined && fromAvatarConfig != null) {
@@ -8763,13 +8693,13 @@ function partToVertex$1(fromObject) {
8763
8693
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
8764
8694
  }
8765
8695
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
8766
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8696
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8767
8697
  }
8768
8698
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
8769
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8699
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8770
8700
  }
8771
8701
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
8772
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8702
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8773
8703
  }
8774
8704
  return toObject;
8775
8705
  }
@@ -8780,7 +8710,7 @@ function safetySettingToMldev$2(fromObject) {
8780
8710
  setValueByPath(toObject, ['category'], fromCategory);
8781
8711
  }
8782
8712
  if (getValueByPath(fromObject, ['method']) !== undefined) {
8783
- throw new Error('method parameter is not supported in Gemini API.');
8713
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8784
8714
  }
8785
8715
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
8786
8716
  if (fromThreshold != null) {
@@ -8795,14 +8725,14 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8795
8725
  setValueByPath(toObject, ['handle'], fromHandle);
8796
8726
  }
8797
8727
  if (getValueByPath(fromObject, ['transparent']) !== undefined) {
8798
- throw new Error('transparent parameter is not supported in Gemini API.');
8728
+ throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8799
8729
  }
8800
8730
  return toObject;
8801
8731
  }
8802
8732
  function toolToMldev$2(fromObject) {
8803
8733
  const toObject = {};
8804
8734
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
8805
- throw new Error('retrieval parameter is not supported in Gemini API.');
8735
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8806
8736
  }
8807
8737
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8808
8738
  if (fromComputerUse != null) {
@@ -8827,7 +8757,7 @@ function toolToMldev$2(fromObject) {
8827
8757
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8828
8758
  }
8829
8759
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
8830
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
8760
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8831
8761
  }
8832
8762
  const fromFunctionDeclarations = getValueByPath(fromObject, [
8833
8763
  'functionDeclarations',
@@ -8848,7 +8778,7 @@ function toolToMldev$2(fromObject) {
8848
8778
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
8849
8779
  }
8850
8780
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
8851
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
8781
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
8852
8782
  }
8853
8783
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8854
8784
  if (fromUrlContext != null) {
@@ -8877,7 +8807,7 @@ function toolToVertex$1(fromObject) {
8877
8807
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
8878
8808
  }
8879
8809
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
8880
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8810
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8881
8811
  }
8882
8812
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8883
8813
  if (fromGoogleSearch != null) {
@@ -8906,7 +8836,7 @@ function toolToVertex$1(fromObject) {
8906
8836
  let transformedList = fromFunctionDeclarations;
8907
8837
  if (Array.isArray(transformedList)) {
8908
8838
  transformedList = transformedList.map((item) => {
8909
- return functionDeclarationToVertex$1(item);
8839
+ return item;
8910
8840
  });
8911
8841
  }
8912
8842
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -8928,7 +8858,7 @@ function toolToVertex$1(fromObject) {
8928
8858
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
8929
8859
  }
8930
8860
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
8931
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
8861
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8932
8862
  }
8933
8863
  return toObject;
8934
8864
  }
@@ -9045,23 +8975,23 @@ function authConfigToMldev$1(fromObject, _rootObject) {
9045
8975
  setValueByPath(toObject, ['apiKey'], fromApiKey);
9046
8976
  }
9047
8977
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
9048
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
8978
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9049
8979
  }
9050
8980
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
9051
- throw new Error('authType parameter is not supported in Gemini API.');
8981
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9052
8982
  }
9053
8983
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
9054
8984
  undefined) {
9055
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
8985
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9056
8986
  }
9057
8987
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
9058
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
8988
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9059
8989
  }
9060
8990
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
9061
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
8991
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9062
8992
  }
9063
8993
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
9064
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
8994
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9065
8995
  }
9066
8996
  return toObject;
9067
8997
  }
@@ -9072,7 +9002,7 @@ function blobToMldev$1(fromObject, _rootObject) {
9072
9002
  setValueByPath(toObject, ['data'], fromData);
9073
9003
  }
9074
9004
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
9075
- throw new Error('displayName parameter is not supported in Gemini API.');
9005
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9076
9006
  }
9077
9007
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9078
9008
  if (fromMimeType != null) {
@@ -9269,13 +9199,13 @@ function controlReferenceConfigToVertex(fromObject, _rootObject) {
9269
9199
  function countTokensConfigToMldev(fromObject, _rootObject) {
9270
9200
  const toObject = {};
9271
9201
  if (getValueByPath(fromObject, ['systemInstruction']) !== undefined) {
9272
- throw new Error('systemInstruction parameter is not supported in Gemini API.');
9202
+ throw new Error('systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9273
9203
  }
9274
9204
  if (getValueByPath(fromObject, ['tools']) !== undefined) {
9275
- throw new Error('tools parameter is not supported in Gemini API.');
9205
+ throw new Error('tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9276
9206
  }
9277
9207
  if (getValueByPath(fromObject, ['generationConfig']) !== undefined) {
9278
- throw new Error('generationConfig parameter is not supported in Gemini API.');
9208
+ throw new Error('generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9279
9209
  }
9280
9210
  return toObject;
9281
9211
  }
@@ -9576,16 +9506,16 @@ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
9576
9506
  setValueByPath(parentObject, ['requests[]', 'outputDimensionality'], fromOutputDimensionality);
9577
9507
  }
9578
9508
  if (getValueByPath(fromObject, ['mimeType']) !== undefined) {
9579
- throw new Error('mimeType parameter is not supported in Gemini API.');
9509
+ throw new Error('mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9580
9510
  }
9581
9511
  if (getValueByPath(fromObject, ['autoTruncate']) !== undefined) {
9582
- throw new Error('autoTruncate parameter is not supported in Gemini API.');
9512
+ throw new Error('autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9583
9513
  }
9584
9514
  if (getValueByPath(fromObject, ['documentOcr']) !== undefined) {
9585
- throw new Error('documentOcr parameter is not supported in Gemini API.');
9515
+ throw new Error('documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9586
9516
  }
9587
9517
  if (getValueByPath(fromObject, ['audioTrackExtraction']) !== undefined) {
9588
- throw new Error('audioTrackExtraction parameter is not supported in Gemini API.');
9518
+ throw new Error('audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9589
9519
  }
9590
9520
  return toObject;
9591
9521
  }
@@ -9869,7 +9799,7 @@ function endpointFromVertex(fromObject, _rootObject) {
9869
9799
  function fileDataToMldev$1(fromObject, _rootObject) {
9870
9800
  const toObject = {};
9871
9801
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
9872
- throw new Error('displayName parameter is not supported in Gemini API.');
9802
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9873
9803
  }
9874
9804
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
9875
9805
  if (fromFileUri != null) {
@@ -9896,10 +9826,10 @@ function functionCallToMldev$1(fromObject, _rootObject) {
9896
9826
  setValueByPath(toObject, ['name'], fromName);
9897
9827
  }
9898
9828
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
9899
- throw new Error('partialArgs parameter is not supported in Gemini API.');
9829
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9900
9830
  }
9901
9831
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
9902
- throw new Error('willContinue parameter is not supported in Gemini API.');
9832
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9903
9833
  }
9904
9834
  return toObject;
9905
9835
  }
@@ -9917,42 +9847,7 @@ function functionCallingConfigToMldev(fromObject, _rootObject) {
9917
9847
  }
9918
9848
  if (getValueByPath(fromObject, ['streamFunctionCallArguments']) !==
9919
9849
  undefined) {
9920
- throw new Error('streamFunctionCallArguments parameter is not supported in Gemini API.');
9921
- }
9922
- return toObject;
9923
- }
9924
- function functionDeclarationToVertex(fromObject, _rootObject) {
9925
- const toObject = {};
9926
- const fromDescription = getValueByPath(fromObject, ['description']);
9927
- if (fromDescription != null) {
9928
- setValueByPath(toObject, ['description'], fromDescription);
9929
- }
9930
- const fromName = getValueByPath(fromObject, ['name']);
9931
- if (fromName != null) {
9932
- setValueByPath(toObject, ['name'], fromName);
9933
- }
9934
- const fromParameters = getValueByPath(fromObject, ['parameters']);
9935
- if (fromParameters != null) {
9936
- setValueByPath(toObject, ['parameters'], fromParameters);
9937
- }
9938
- const fromParametersJsonSchema = getValueByPath(fromObject, [
9939
- 'parametersJsonSchema',
9940
- ]);
9941
- if (fromParametersJsonSchema != null) {
9942
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
9943
- }
9944
- const fromResponse = getValueByPath(fromObject, ['response']);
9945
- if (fromResponse != null) {
9946
- setValueByPath(toObject, ['response'], fromResponse);
9947
- }
9948
- const fromResponseJsonSchema = getValueByPath(fromObject, [
9949
- 'responseJsonSchema',
9950
- ]);
9951
- if (fromResponseJsonSchema != null) {
9952
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
9953
- }
9954
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
9955
- throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
9850
+ throw new Error('streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9956
9851
  }
9957
9852
  return toObject;
9958
9853
  }
@@ -10039,10 +9934,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10039
9934
  setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
10040
9935
  }
10041
9936
  if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
10042
- throw new Error('routingConfig parameter is not supported in Gemini API.');
9937
+ throw new Error('routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10043
9938
  }
10044
9939
  if (getValueByPath(fromObject, ['modelSelectionConfig']) !== undefined) {
10045
- throw new Error('modelSelectionConfig parameter is not supported in Gemini API.');
9940
+ throw new Error('modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10046
9941
  }
10047
9942
  const fromSafetySettings = getValueByPath(fromObject, [
10048
9943
  'safetySettings',
@@ -10071,7 +9966,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10071
9966
  setValueByPath(parentObject, ['toolConfig'], toolConfigToMldev(fromToolConfig));
10072
9967
  }
10073
9968
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10074
- throw new Error('labels parameter is not supported in Gemini API.');
9969
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10075
9970
  }
10076
9971
  const fromCachedContent = getValueByPath(fromObject, [
10077
9972
  'cachedContent',
@@ -10096,7 +9991,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10096
9991
  setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10097
9992
  }
10098
9993
  if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
10099
- throw new Error('audioTimestamp parameter is not supported in Gemini API.');
9994
+ throw new Error('audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10100
9995
  }
10101
9996
  const fromThinkingConfig = getValueByPath(fromObject, [
10102
9997
  'thinkingConfig',
@@ -10115,7 +10010,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
10115
10010
  setValueByPath(toObject, ['enableEnhancedCivicAnswers'], fromEnableEnhancedCivicAnswers);
10116
10011
  }
10117
10012
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
10118
- throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
10013
+ throw new Error('modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10119
10014
  }
10120
10015
  const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
10121
10016
  if (parentObject !== undefined && fromServiceTier != null) {
@@ -10287,7 +10182,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
10287
10182
  }
10288
10183
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
10289
10184
  undefined) {
10290
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
10185
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
10291
10186
  }
10292
10187
  const fromModelArmorConfig = getValueByPath(fromObject, [
10293
10188
  'modelArmorConfig',
@@ -10436,10 +10331,10 @@ function generateContentResponseFromVertex(fromObject, _rootObject) {
10436
10331
  function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10437
10332
  const toObject = {};
10438
10333
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
10439
- throw new Error('outputGcsUri parameter is not supported in Gemini API.');
10334
+ throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10440
10335
  }
10441
10336
  if (getValueByPath(fromObject, ['negativePrompt']) !== undefined) {
10442
- throw new Error('negativePrompt parameter is not supported in Gemini API.');
10337
+ throw new Error('negativePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10443
10338
  }
10444
10339
  const fromNumberOfImages = getValueByPath(fromObject, [
10445
10340
  'numberOfImages',
@@ -10458,7 +10353,7 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10458
10353
  setValueByPath(parentObject, ['parameters', 'guidanceScale'], fromGuidanceScale);
10459
10354
  }
10460
10355
  if (getValueByPath(fromObject, ['seed']) !== undefined) {
10461
- throw new Error('seed parameter is not supported in Gemini API.');
10356
+ throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10462
10357
  }
10463
10358
  const fromSafetyFilterLevel = getValueByPath(fromObject, [
10464
10359
  'safetyFilterLevel',
@@ -10501,17 +10396,17 @@ function generateImagesConfigToMldev(fromObject, parentObject, _rootObject) {
10501
10396
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
10502
10397
  }
10503
10398
  if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
10504
- throw new Error('addWatermark parameter is not supported in Gemini API.');
10399
+ throw new Error('addWatermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10505
10400
  }
10506
10401
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10507
- throw new Error('labels parameter is not supported in Gemini API.');
10402
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10508
10403
  }
10509
10404
  const fromImageSize = getValueByPath(fromObject, ['imageSize']);
10510
10405
  if (parentObject !== undefined && fromImageSize != null) {
10511
10406
  setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
10512
10407
  }
10513
10408
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
10514
- throw new Error('enhancePrompt parameter is not supported in Gemini API.');
10409
+ throw new Error('enhancePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10515
10410
  }
10516
10411
  return toObject;
10517
10412
  }
@@ -10704,10 +10599,10 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10704
10599
  setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfVideos);
10705
10600
  }
10706
10601
  if (getValueByPath(fromObject, ['outputGcsUri']) !== undefined) {
10707
- throw new Error('outputGcsUri parameter is not supported in Gemini API.');
10602
+ throw new Error('outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10708
10603
  }
10709
10604
  if (getValueByPath(fromObject, ['fps']) !== undefined) {
10710
- throw new Error('fps parameter is not supported in Gemini API.');
10605
+ throw new Error('fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10711
10606
  }
10712
10607
  const fromDurationSeconds = getValueByPath(fromObject, [
10713
10608
  'durationSeconds',
@@ -10716,7 +10611,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10716
10611
  setValueByPath(parentObject, ['parameters', 'durationSeconds'], fromDurationSeconds);
10717
10612
  }
10718
10613
  if (getValueByPath(fromObject, ['seed']) !== undefined) {
10719
- throw new Error('seed parameter is not supported in Gemini API.');
10614
+ throw new Error('seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10720
10615
  }
10721
10616
  const fromAspectRatio = getValueByPath(fromObject, ['aspectRatio']);
10722
10617
  if (parentObject !== undefined && fromAspectRatio != null) {
@@ -10733,7 +10628,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10733
10628
  setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
10734
10629
  }
10735
10630
  if (getValueByPath(fromObject, ['pubsubTopic']) !== undefined) {
10736
- throw new Error('pubsubTopic parameter is not supported in Gemini API.');
10631
+ throw new Error('pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10737
10632
  }
10738
10633
  const fromNegativePrompt = getValueByPath(fromObject, [
10739
10634
  'negativePrompt',
@@ -10748,7 +10643,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10748
10643
  setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
10749
10644
  }
10750
10645
  if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
10751
- throw new Error('generateAudio parameter is not supported in Gemini API.');
10646
+ throw new Error('generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10752
10647
  }
10753
10648
  const fromLastFrame = getValueByPath(fromObject, ['lastFrame']);
10754
10649
  if (parentObject !== undefined && fromLastFrame != null) {
@@ -10767,13 +10662,13 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10767
10662
  setValueByPath(parentObject, ['instances[0]', 'referenceImages'], transformedList);
10768
10663
  }
10769
10664
  if (getValueByPath(fromObject, ['mask']) !== undefined) {
10770
- throw new Error('mask parameter is not supported in Gemini API.');
10665
+ throw new Error('mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10771
10666
  }
10772
10667
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
10773
- throw new Error('compressionQuality parameter is not supported in Gemini API.');
10668
+ throw new Error('compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10774
10669
  }
10775
10670
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
10776
- throw new Error('labels parameter is not supported in Gemini API.');
10671
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10777
10672
  }
10778
10673
  const fromWebhookConfig = getValueByPath(fromObject, [
10779
10674
  'webhookConfig',
@@ -10782,7 +10677,7 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10782
10677
  setValueByPath(parentObject, ['webhookConfig'], fromWebhookConfig);
10783
10678
  }
10784
10679
  if (getValueByPath(fromObject, ['resizeMode']) !== undefined) {
10785
- throw new Error('resizeMode parameter is not supported in Gemini API.');
10680
+ throw new Error('resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
10786
10681
  }
10787
10682
  return toObject;
10788
10683
  }
@@ -10879,7 +10774,7 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
10879
10774
  setValueByPath(parentObject, ['labels'], fromLabels);
10880
10775
  }
10881
10776
  if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
10882
- throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
10777
+ throw new Error('webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
10883
10778
  }
10884
10779
  const fromResizeMode = getValueByPath(fromObject, ['resizeMode']);
10885
10780
  if (parentObject !== undefined && fromResizeMode != null) {
@@ -11278,7 +11173,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
11278
11173
  }
11279
11174
  if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
11280
11175
  undefined) {
11281
- throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11176
+ throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11282
11177
  }
11283
11178
  return toObject;
11284
11179
  }
@@ -11317,10 +11212,10 @@ function googleSearchToMldev$1(fromObject, _rootObject) {
11317
11212
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
11318
11213
  }
11319
11214
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
11320
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
11215
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11321
11216
  }
11322
11217
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
11323
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
11218
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11324
11219
  }
11325
11220
  const fromTimeRangeFilter = getValueByPath(fromObject, [
11326
11221
  'timeRangeFilter',
@@ -11341,20 +11236,20 @@ function imageConfigToMldev(fromObject, _rootObject) {
11341
11236
  setValueByPath(toObject, ['imageSize'], fromImageSize);
11342
11237
  }
11343
11238
  if (getValueByPath(fromObject, ['personGeneration']) !== undefined) {
11344
- throw new Error('personGeneration parameter is not supported in Gemini API.');
11239
+ throw new Error('personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11345
11240
  }
11346
11241
  if (getValueByPath(fromObject, ['prominentPeople']) !== undefined) {
11347
- throw new Error('prominentPeople parameter is not supported in Gemini API.');
11242
+ throw new Error('prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11348
11243
  }
11349
11244
  if (getValueByPath(fromObject, ['outputMimeType']) !== undefined) {
11350
- throw new Error('outputMimeType parameter is not supported in Gemini API.');
11245
+ throw new Error('outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11351
11246
  }
11352
11247
  if (getValueByPath(fromObject, ['outputCompressionQuality']) !==
11353
11248
  undefined) {
11354
- throw new Error('outputCompressionQuality parameter is not supported in Gemini API.');
11249
+ throw new Error('outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11355
11250
  }
11356
11251
  if (getValueByPath(fromObject, ['imageOutputOptions']) !== undefined) {
11357
- throw new Error('imageOutputOptions parameter is not supported in Gemini API.');
11252
+ throw new Error('imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11358
11253
  }
11359
11254
  return toObject;
11360
11255
  }
@@ -11435,7 +11330,7 @@ function imageFromVertex(fromObject, _rootObject) {
11435
11330
  function imageToMldev(fromObject, _rootObject) {
11436
11331
  const toObject = {};
11437
11332
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
11438
- throw new Error('gcsUri parameter is not supported in Gemini API.');
11333
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
11439
11334
  }
11440
11335
  const fromImageBytes = getValueByPath(fromObject, ['imageBytes']);
11441
11336
  if (fromImageBytes != null) {
@@ -11838,13 +11733,13 @@ function partToVertex(fromObject, _rootObject) {
11838
11733
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11839
11734
  }
11840
11735
  if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
11841
- throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11736
+ throw new Error('toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11842
11737
  }
11843
11738
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11844
- throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11739
+ throw new Error('toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11845
11740
  }
11846
11741
  if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
11847
- throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
11742
+ throw new Error('partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11848
11743
  }
11849
11744
  return toObject;
11850
11745
  }
@@ -12067,7 +11962,7 @@ function safetySettingToMldev$1(fromObject, _rootObject) {
12067
11962
  setValueByPath(toObject, ['category'], fromCategory);
12068
11963
  }
12069
11964
  if (getValueByPath(fromObject, ['method']) !== undefined) {
12070
- throw new Error('method parameter is not supported in Gemini API.');
11965
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12071
11966
  }
12072
11967
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
12073
11968
  if (fromThreshold != null) {
@@ -12201,14 +12096,14 @@ function toolConfigToVertex(fromObject, _rootObject) {
12201
12096
  }
12202
12097
  if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
12203
12098
  undefined) {
12204
- throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12099
+ throw new Error('includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12205
12100
  }
12206
12101
  return toObject;
12207
12102
  }
12208
12103
  function toolToMldev$1(fromObject, rootObject) {
12209
12104
  const toObject = {};
12210
12105
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
12211
- throw new Error('retrieval parameter is not supported in Gemini API.');
12106
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12212
12107
  }
12213
12108
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
12214
12109
  if (fromComputerUse != null) {
@@ -12233,7 +12128,7 @@ function toolToMldev$1(fromObject, rootObject) {
12233
12128
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
12234
12129
  }
12235
12130
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
12236
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
12131
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12237
12132
  }
12238
12133
  const fromFunctionDeclarations = getValueByPath(fromObject, [
12239
12134
  'functionDeclarations',
@@ -12254,7 +12149,7 @@ function toolToMldev$1(fromObject, rootObject) {
12254
12149
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
12255
12150
  }
12256
12151
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
12257
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
12152
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12258
12153
  }
12259
12154
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
12260
12155
  if (fromUrlContext != null) {
@@ -12272,7 +12167,7 @@ function toolToMldev$1(fromObject, rootObject) {
12272
12167
  }
12273
12168
  return toObject;
12274
12169
  }
12275
- function toolToVertex(fromObject, rootObject) {
12170
+ function toolToVertex(fromObject, _rootObject) {
12276
12171
  const toObject = {};
12277
12172
  const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
12278
12173
  if (fromRetrieval != null) {
@@ -12283,7 +12178,7 @@ function toolToVertex(fromObject, rootObject) {
12283
12178
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
12284
12179
  }
12285
12180
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
12286
- throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12181
+ throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12287
12182
  }
12288
12183
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
12289
12184
  if (fromGoogleSearch != null) {
@@ -12312,7 +12207,7 @@ function toolToVertex(fromObject, rootObject) {
12312
12207
  let transformedList = fromFunctionDeclarations;
12313
12208
  if (Array.isArray(transformedList)) {
12314
12209
  transformedList = transformedList.map((item) => {
12315
- return functionDeclarationToVertex(item);
12210
+ return item;
12316
12211
  });
12317
12212
  }
12318
12213
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -12334,7 +12229,7 @@ function toolToVertex(fromObject, rootObject) {
12334
12229
  setValueByPath(toObject, ['urlContext'], fromUrlContext);
12335
12230
  }
12336
12231
  if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
12337
- throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
12232
+ throw new Error('mcpServers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12338
12233
  }
12339
12234
  return toObject;
12340
12235
  }
@@ -12897,7 +12792,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12897
12792
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12898
12793
  const USER_AGENT_HEADER = 'User-Agent';
12899
12794
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12900
- const SDK_VERSION = '2.0.1'; // x-release-please-version
12795
+ const SDK_VERSION = '2.2.0'; // x-release-please-version
12901
12796
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12902
12797
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12903
12798
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14793,7 +14688,7 @@ class Models extends BaseModule {
14793
14688
  if (this.apiClient.isVertexAI()) {
14794
14689
  if (!actualParams.config.queryBase) {
14795
14690
  if ((_a = actualParams.config) === null || _a === void 0 ? void 0 : _a.filter) {
14796
- throw new Error('Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported');
14691
+ throw new Error('Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14797
14692
  }
14798
14693
  else {
14799
14694
  actualParams.config.filter = 'labels.tune-type:*';
@@ -16249,7 +16144,7 @@ class Operations extends BaseModule {
16249
16144
  function audioTranscriptionConfigToMldev(fromObject) {
16250
16145
  const toObject = {};
16251
16146
  if (getValueByPath(fromObject, ['languageCodes']) !== undefined) {
16252
- throw new Error('languageCodes parameter is not supported in Gemini API.');
16147
+ throw new Error('languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16253
16148
  }
16254
16149
  return toObject;
16255
16150
  }
@@ -16260,23 +16155,23 @@ function authConfigToMldev(fromObject) {
16260
16155
  setValueByPath(toObject, ['apiKey'], fromApiKey);
16261
16156
  }
16262
16157
  if (getValueByPath(fromObject, ['apiKeyConfig']) !== undefined) {
16263
- throw new Error('apiKeyConfig parameter is not supported in Gemini API.');
16158
+ throw new Error('apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16264
16159
  }
16265
16160
  if (getValueByPath(fromObject, ['authType']) !== undefined) {
16266
- throw new Error('authType parameter is not supported in Gemini API.');
16161
+ throw new Error('authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16267
16162
  }
16268
16163
  if (getValueByPath(fromObject, ['googleServiceAccountConfig']) !==
16269
16164
  undefined) {
16270
- throw new Error('googleServiceAccountConfig parameter is not supported in Gemini API.');
16165
+ throw new Error('googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16271
16166
  }
16272
16167
  if (getValueByPath(fromObject, ['httpBasicAuthConfig']) !== undefined) {
16273
- throw new Error('httpBasicAuthConfig parameter is not supported in Gemini API.');
16168
+ throw new Error('httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16274
16169
  }
16275
16170
  if (getValueByPath(fromObject, ['oauthConfig']) !== undefined) {
16276
- throw new Error('oauthConfig parameter is not supported in Gemini API.');
16171
+ throw new Error('oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16277
16172
  }
16278
16173
  if (getValueByPath(fromObject, ['oidcConfig']) !== undefined) {
16279
- throw new Error('oidcConfig parameter is not supported in Gemini API.');
16174
+ throw new Error('oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16280
16175
  }
16281
16176
  return toObject;
16282
16177
  }
@@ -16287,7 +16182,7 @@ function blobToMldev(fromObject) {
16287
16182
  setValueByPath(toObject, ['data'], fromData);
16288
16183
  }
16289
16184
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
16290
- throw new Error('displayName parameter is not supported in Gemini API.');
16185
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16291
16186
  }
16292
16187
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
16293
16188
  if (fromMimeType != null) {
@@ -16354,7 +16249,7 @@ function createAuthTokenParametersToMldev(apiClient, fromObject) {
16354
16249
  function fileDataToMldev(fromObject) {
16355
16250
  const toObject = {};
16356
16251
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
16357
- throw new Error('displayName parameter is not supported in Gemini API.');
16252
+ throw new Error('displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16358
16253
  }
16359
16254
  const fromFileUri = getValueByPath(fromObject, ['fileUri']);
16360
16255
  if (fromFileUri != null) {
@@ -16381,10 +16276,10 @@ function functionCallToMldev(fromObject) {
16381
16276
  setValueByPath(toObject, ['name'], fromName);
16382
16277
  }
16383
16278
  if (getValueByPath(fromObject, ['partialArgs']) !== undefined) {
16384
- throw new Error('partialArgs parameter is not supported in Gemini API.');
16279
+ throw new Error('partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16385
16280
  }
16386
16281
  if (getValueByPath(fromObject, ['willContinue']) !== undefined) {
16387
- throw new Error('willContinue parameter is not supported in Gemini API.');
16282
+ throw new Error('willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16388
16283
  }
16389
16284
  return toObject;
16390
16285
  }
@@ -16407,10 +16302,10 @@ function googleSearchToMldev(fromObject) {
16407
16302
  setValueByPath(toObject, ['searchTypes'], fromSearchTypes);
16408
16303
  }
16409
16304
  if (getValueByPath(fromObject, ['blockingConfidence']) !== undefined) {
16410
- throw new Error('blockingConfidence parameter is not supported in Gemini API.');
16305
+ throw new Error('blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16411
16306
  }
16412
16307
  if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
16413
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
16308
+ throw new Error('excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16414
16309
  }
16415
16310
  const fromTimeRangeFilter = getValueByPath(fromObject, [
16416
16311
  'timeRangeFilter',
@@ -16529,7 +16424,7 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
16529
16424
  setValueByPath(parentObject, ['setup', 'proactivity'], fromProactivity);
16530
16425
  }
16531
16426
  if (getValueByPath(fromObject, ['explicitVadSignal']) !== undefined) {
16532
- throw new Error('explicitVadSignal parameter is not supported in Gemini API.');
16427
+ throw new Error('explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16533
16428
  }
16534
16429
  const fromAvatarConfig = getValueByPath(fromObject, ['avatarConfig']);
16535
16430
  if (parentObject !== undefined && fromAvatarConfig != null) {
@@ -16640,7 +16535,7 @@ function safetySettingToMldev(fromObject) {
16640
16535
  setValueByPath(toObject, ['category'], fromCategory);
16641
16536
  }
16642
16537
  if (getValueByPath(fromObject, ['method']) !== undefined) {
16643
- throw new Error('method parameter is not supported in Gemini API.');
16538
+ throw new Error('method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16644
16539
  }
16645
16540
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
16646
16541
  if (fromThreshold != null) {
@@ -16655,14 +16550,14 @@ function sessionResumptionConfigToMldev(fromObject) {
16655
16550
  setValueByPath(toObject, ['handle'], fromHandle);
16656
16551
  }
16657
16552
  if (getValueByPath(fromObject, ['transparent']) !== undefined) {
16658
- throw new Error('transparent parameter is not supported in Gemini API.');
16553
+ throw new Error('transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16659
16554
  }
16660
16555
  return toObject;
16661
16556
  }
16662
16557
  function toolToMldev(fromObject) {
16663
16558
  const toObject = {};
16664
16559
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
16665
- throw new Error('retrieval parameter is not supported in Gemini API.');
16560
+ throw new Error('retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16666
16561
  }
16667
16562
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
16668
16563
  if (fromComputerUse != null) {
@@ -16687,7 +16582,7 @@ function toolToMldev(fromObject) {
16687
16582
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
16688
16583
  }
16689
16584
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
16690
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
16585
+ throw new Error('enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16691
16586
  }
16692
16587
  const fromFunctionDeclarations = getValueByPath(fromObject, [
16693
16588
  'functionDeclarations',
@@ -16708,7 +16603,7 @@ function toolToMldev(fromObject) {
16708
16603
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
16709
16604
  }
16710
16605
  if (getValueByPath(fromObject, ['parallelAiSearch']) !== undefined) {
16711
- throw new Error('parallelAiSearch parameter is not supported in Gemini API.');
16606
+ throw new Error('parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
16712
16607
  }
16713
16608
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
16714
16609
  if (fromUrlContext != null) {
@@ -18044,325 +17939,128 @@ class APIResource {
18044
17939
  */
18045
17940
  APIResource._key = [];
18046
17941
 
17942
+ /**
17943
+ * @license
17944
+ * Copyright 2025 Google LLC
17945
+ * SPDX-License-Identifier: Apache-2.0
17946
+ */
17947
+ function concatBytes(buffers) {
17948
+ let length = 0;
17949
+ for (const buffer of buffers) {
17950
+ length += buffer.length;
17951
+ }
17952
+ const output = new Uint8Array(length);
17953
+ let index = 0;
17954
+ for (const buffer of buffers) {
17955
+ output.set(buffer, index);
17956
+ index += buffer.length;
17957
+ }
17958
+ return output;
17959
+ }
17960
+ let encodeUTF8_;
17961
+ function encodeUTF8(str) {
17962
+ let encoder;
17963
+ return (encodeUTF8_ !== null && encodeUTF8_ !== void 0 ? encodeUTF8_ : ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
17964
+ }
17965
+ let decodeUTF8_;
17966
+ function decodeUTF8(bytes) {
17967
+ let decoder;
17968
+ return (decodeUTF8_ !== null && decodeUTF8_ !== void 0 ? decodeUTF8_ : ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
17969
+ }
17970
+
18047
17971
  /**
18048
17972
  * @license
18049
17973
  * Copyright 2025 Google LLC
18050
17974
  * SPDX-License-Identifier: Apache-2.0
18051
17975
  */
18052
17976
  /**
18053
- * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
17977
+ * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
17978
+ * reading lines from text.
18054
17979
  *
18055
- * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
18056
- * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
18057
- * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
18058
- * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
17980
+ * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
18059
17981
  */
18060
- function encodeURIPath(str) {
18061
- return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
18062
- }
18063
- const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
18064
- const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
18065
- // If there are no params, no processing is needed.
18066
- if (statics.length === 1)
18067
- return statics[0];
18068
- let postPath = false;
18069
- const invalidSegments = [];
18070
- const path = statics.reduce((previousValue, currentValue, index) => {
18071
- var _a, _b, _c;
18072
- if (/[?#]/.test(currentValue)) {
18073
- postPath = true;
17982
+ class LineDecoder {
17983
+ constructor() {
17984
+ this.buffer = new Uint8Array();
17985
+ this.carriageReturnIndex = null;
17986
+ this.searchIndex = 0;
17987
+ }
17988
+ decode(chunk) {
17989
+ var _a;
17990
+ if (chunk == null) {
17991
+ return [];
18074
17992
  }
18075
- const value = params[index];
18076
- let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
18077
- if (index !== params.length &&
18078
- (value == null ||
18079
- (typeof value === 'object' &&
18080
- // handle values from other realms
18081
- value.toString ===
18082
- ((_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)))) {
18083
- encoded = value + '';
18084
- invalidSegments.push({
18085
- start: previousValue.length + currentValue.length,
18086
- length: encoded.length,
18087
- error: `Value of type ${Object.prototype.toString
18088
- .call(value)
18089
- .slice(8, -1)} is not a valid path parameter`,
18090
- });
17993
+ const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
17994
+ : typeof chunk === 'string' ? encodeUTF8(chunk)
17995
+ : chunk;
17996
+ this.buffer = concatBytes([this.buffer, binaryChunk]);
17997
+ const lines = [];
17998
+ let patternIndex;
17999
+ while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
18000
+ if (patternIndex.carriage && this.carriageReturnIndex == null) {
18001
+ // skip until we either get a corresponding `\n`, a new `\r` or nothing
18002
+ this.carriageReturnIndex = patternIndex.index;
18003
+ continue;
18004
+ }
18005
+ // we got double \r or \rtext\n
18006
+ if (this.carriageReturnIndex != null &&
18007
+ (patternIndex.index !== this.carriageReturnIndex + 1 || patternIndex.carriage)) {
18008
+ lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
18009
+ this.buffer = this.buffer.subarray(this.carriageReturnIndex);
18010
+ this.carriageReturnIndex = null;
18011
+ this.searchIndex = 0;
18012
+ continue;
18013
+ }
18014
+ const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
18015
+ const line = decodeUTF8(this.buffer.subarray(0, endIndex));
18016
+ lines.push(line);
18017
+ this.buffer = this.buffer.subarray(patternIndex.index);
18018
+ this.carriageReturnIndex = null;
18019
+ this.searchIndex = 0;
18091
18020
  }
18092
- return previousValue + currentValue + (index === params.length ? '' : encoded);
18093
- }, '');
18094
- const pathOnly = path.split(/[?#]/, 1)[0];
18095
- const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
18096
- let match;
18097
- // Find all invalid segments
18098
- while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
18099
- const hasLeadingSlash = match[0].startsWith('/');
18100
- const offset = hasLeadingSlash ? 1 : 0;
18101
- const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
18102
- invalidSegments.push({
18103
- start: match.index + offset,
18104
- length: cleanMatch.length,
18105
- error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
18106
- });
18021
+ this.searchIndex = Math.max(0, this.buffer.length - 1);
18022
+ return lines;
18107
18023
  }
18108
- invalidSegments.sort((a, b) => a.start - b.start);
18109
- if (invalidSegments.length > 0) {
18110
- let lastEnd = 0;
18111
- const underline = invalidSegments.reduce((acc, segment) => {
18112
- const spaces = ' '.repeat(segment.start - lastEnd);
18113
- const arrows = '^'.repeat(segment.length);
18114
- lastEnd = segment.start + segment.length;
18115
- return acc + spaces + arrows;
18116
- }, '');
18117
- throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
18118
- .map((e) => e.error)
18119
- .join('\n')}\n${path}\n${underline}`);
18024
+ flush() {
18025
+ if (!this.buffer.length) {
18026
+ return [];
18027
+ }
18028
+ return this.decode('\n');
18120
18029
  }
18121
- return path;
18122
- });
18030
+ }
18031
+ // prettier-ignore
18032
+ LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
18033
+ LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
18123
18034
  /**
18124
- * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
18035
+ * This function searches the buffer for the end patterns, (\r or \n)
18036
+ * and returns an object with the index preceding the matched newline and the
18037
+ * index after the newline char. `null` is returned if no new line is found.
18038
+ *
18039
+ * ```ts
18040
+ * findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
18041
+ * ```
18125
18042
  */
18126
- const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
18127
-
18128
- /**
18129
- * @license
18130
- * Copyright 2025 Google LLC
18131
- * SPDX-License-Identifier: Apache-2.0
18132
- */
18133
- class BaseInteractions extends APIResource {
18134
- create(params, options) {
18135
- var _a;
18136
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18137
- if ('model' in body && 'agent_config' in body) {
18138
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
18139
- }
18140
- if ('agent' in body && 'generation_config' in body) {
18141
- throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
18142
- }
18143
- return this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a = params.stream) !== null && _a !== void 0 ? _a : false }));
18144
- }
18145
- /**
18146
- * Deletes the interaction by id.
18147
- *
18148
- * @example
18149
- * ```ts
18150
- * const interaction = await client.interactions.delete('id', {
18151
- * api_version: 'api_version',
18152
- * });
18153
- * ```
18154
- */
18155
- delete(id, params = {}, options) {
18156
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18157
- return this._client.delete(path `/${api_version}/interactions/${id}`, options);
18158
- }
18159
- /**
18160
- * Cancels an interaction by id. This only applies to background interactions that
18161
- * are still running.
18162
- *
18163
- * @example
18164
- * ```ts
18165
- * const interaction = await client.interactions.cancel('id', {
18166
- * api_version: 'api_version',
18167
- * });
18168
- * ```
18169
- */
18170
- cancel(id, params = {}, options) {
18171
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18172
- return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
18173
- }
18174
- get(id, params = {}, options) {
18175
- var _a;
18176
- const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
18177
- 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 }));
18178
- }
18179
- }
18180
- BaseInteractions._key = Object.freeze(['interactions']);
18181
- class Interactions extends BaseInteractions {
18182
- }
18183
-
18184
- /**
18185
- * @license
18186
- * Copyright 2025 Google LLC
18187
- * SPDX-License-Identifier: Apache-2.0
18188
- */
18189
- class BaseWebhooks extends APIResource {
18190
- /**
18191
- * Creates a new Webhook.
18192
- */
18193
- create(params, options) {
18194
- const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18195
- return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
18196
- }
18197
- /**
18198
- * Updates an existing Webhook.
18199
- */
18200
- update(id, params = {}, options) {
18201
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
18202
- return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
18203
- }
18204
- /**
18205
- * Lists all Webhooks.
18206
- */
18207
- list(params = {}, options) {
18208
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
18209
- return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
18210
- }
18211
- /**
18212
- * Deletes a Webhook.
18213
- */
18214
- delete(id, params = {}, options) {
18215
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18216
- return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
18217
- }
18218
- /**
18219
- * Gets a specific Webhook.
18220
- */
18221
- get(id, params = {}, options) {
18222
- const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18223
- return this._client.get(path `/${api_version}/webhooks/${id}`, options);
18224
- }
18225
- /**
18226
- * Sends a ping event to a Webhook.
18227
- */
18228
- ping(id, params = undefined, options) {
18229
- const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
18230
- return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
18231
- }
18232
- /**
18233
- * Generates a new signing secret for a Webhook.
18234
- */
18235
- rotateSigningSecret(id, params = {}, options) {
18236
- const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
18237
- return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
18238
- }
18239
- }
18240
- BaseWebhooks._key = Object.freeze(['webhooks']);
18241
- class Webhooks extends BaseWebhooks {
18242
- }
18243
-
18244
- /**
18245
- * @license
18246
- * Copyright 2025 Google LLC
18247
- * SPDX-License-Identifier: Apache-2.0
18248
- */
18249
- function concatBytes(buffers) {
18250
- let length = 0;
18251
- for (const buffer of buffers) {
18252
- length += buffer.length;
18253
- }
18254
- const output = new Uint8Array(length);
18255
- let index = 0;
18256
- for (const buffer of buffers) {
18257
- output.set(buffer, index);
18258
- index += buffer.length;
18259
- }
18260
- return output;
18261
- }
18262
- let encodeUTF8_;
18263
- function encodeUTF8(str) {
18264
- let encoder;
18265
- return (encodeUTF8_ !== null && encodeUTF8_ !== void 0 ? encodeUTF8_ : ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
18266
- }
18267
- let decodeUTF8_;
18268
- function decodeUTF8(bytes) {
18269
- let decoder;
18270
- return (decodeUTF8_ !== null && decodeUTF8_ !== void 0 ? decodeUTF8_ : ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
18271
- }
18272
-
18273
- /**
18274
- * @license
18275
- * Copyright 2025 Google LLC
18276
- * SPDX-License-Identifier: Apache-2.0
18277
- */
18278
- /**
18279
- * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
18280
- * reading lines from text.
18281
- *
18282
- * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
18283
- */
18284
- class LineDecoder {
18285
- constructor() {
18286
- this.buffer = new Uint8Array();
18287
- this.carriageReturnIndex = null;
18288
- this.searchIndex = 0;
18289
- }
18290
- decode(chunk) {
18291
- var _a;
18292
- if (chunk == null) {
18293
- return [];
18294
- }
18295
- const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
18296
- : typeof chunk === 'string' ? encodeUTF8(chunk)
18297
- : chunk;
18298
- this.buffer = concatBytes([this.buffer, binaryChunk]);
18299
- const lines = [];
18300
- let patternIndex;
18301
- while ((patternIndex = findNewlineIndex(this.buffer, (_a = this.carriageReturnIndex) !== null && _a !== void 0 ? _a : this.searchIndex)) != null) {
18302
- if (patternIndex.carriage && this.carriageReturnIndex == null) {
18303
- // skip until we either get a corresponding `\n`, a new `\r` or nothing
18304
- this.carriageReturnIndex = patternIndex.index;
18305
- continue;
18306
- }
18307
- // we got double \r or \rtext\n
18308
- if (this.carriageReturnIndex != null &&
18309
- (patternIndex.index !== this.carriageReturnIndex + 1 || patternIndex.carriage)) {
18310
- lines.push(decodeUTF8(this.buffer.subarray(0, this.carriageReturnIndex - 1)));
18311
- this.buffer = this.buffer.subarray(this.carriageReturnIndex);
18312
- this.carriageReturnIndex = null;
18313
- this.searchIndex = 0;
18314
- continue;
18315
- }
18316
- const endIndex = this.carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
18317
- const line = decodeUTF8(this.buffer.subarray(0, endIndex));
18318
- lines.push(line);
18319
- this.buffer = this.buffer.subarray(patternIndex.index);
18320
- this.carriageReturnIndex = null;
18321
- this.searchIndex = 0;
18322
- }
18323
- this.searchIndex = Math.max(0, this.buffer.length - 1);
18324
- return lines;
18325
- }
18326
- flush() {
18327
- if (!this.buffer.length) {
18328
- return [];
18329
- }
18330
- return this.decode('\n');
18331
- }
18332
- }
18333
- // prettier-ignore
18334
- LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
18335
- LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
18336
- /**
18337
- * This function searches the buffer for the end patterns, (\r or \n)
18338
- * and returns an object with the index preceding the matched newline and the
18339
- * index after the newline char. `null` is returned if no new line is found.
18340
- *
18341
- * ```ts
18342
- * findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
18343
- * ```
18344
- */
18345
- function findNewlineIndex(buffer, startIndex) {
18346
- const newline = 0x0a; // \n
18347
- const carriage = 0x0d; // \r
18348
- const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
18349
- const nextNewline = buffer.indexOf(newline, start);
18350
- const nextCarriage = buffer.indexOf(carriage, start);
18351
- if (nextNewline === -1 && nextCarriage === -1) {
18352
- return null;
18353
- }
18354
- let i;
18355
- if (nextNewline !== -1 && nextCarriage !== -1) {
18356
- i = Math.min(nextNewline, nextCarriage);
18357
- }
18358
- else {
18359
- i = nextNewline !== -1 ? nextNewline : nextCarriage;
18360
- }
18361
- if (buffer[i] === newline) {
18362
- return { preceding: i, index: i + 1, carriage: false };
18363
- }
18364
- return { preceding: i, index: i + 1, carriage: true };
18365
- }
18043
+ function findNewlineIndex(buffer, startIndex) {
18044
+ const newline = 0x0a; // \n
18045
+ const carriage = 0x0d; // \r
18046
+ const start = startIndex !== null && startIndex !== void 0 ? startIndex : 0;
18047
+ const nextNewline = buffer.indexOf(newline, start);
18048
+ const nextCarriage = buffer.indexOf(carriage, start);
18049
+ if (nextNewline === -1 && nextCarriage === -1) {
18050
+ return null;
18051
+ }
18052
+ let i;
18053
+ if (nextNewline !== -1 && nextCarriage !== -1) {
18054
+ i = Math.min(nextNewline, nextCarriage);
18055
+ }
18056
+ else {
18057
+ i = nextNewline !== -1 ? nextNewline : nextCarriage;
18058
+ }
18059
+ if (buffer[i] === newline) {
18060
+ return { preceding: i, index: i + 1, carriage: false };
18061
+ }
18062
+ return { preceding: i, index: i + 1, carriage: true };
18063
+ }
18366
18064
 
18367
18065
  /**
18368
18066
  * @license
@@ -18776,6 +18474,338 @@ function partition(str, delimiter) {
18776
18474
  return [str, '', ''];
18777
18475
  }
18778
18476
 
18477
+ /**
18478
+ * @license
18479
+ * Copyright 2025 Google LLC
18480
+ * SPDX-License-Identifier: Apache-2.0
18481
+ */
18482
+ const LEGACY_LYRIA_MODELS = new Set([
18483
+ 'lyria-3-pro-preview',
18484
+ 'lyria-3-clip-preview',
18485
+ ]);
18486
+ const LEGACY_EVENT_TYPE_RENAMES = {
18487
+ 'interaction.start': 'interaction.created',
18488
+ 'content.start': 'step.start',
18489
+ 'content.delta': 'step.delta',
18490
+ 'content.stop': 'step.stop',
18491
+ 'interaction.complete': 'interaction.completed',
18492
+ };
18493
+ function isLegacyLyriaRequest({ isVertex, model }) {
18494
+ return Boolean(isVertex) && typeof model === 'string' && LEGACY_LYRIA_MODELS.has(model);
18495
+ }
18496
+ /**
18497
+ * Detect whether a client is in vertex mode. Reads the `clientAdapter` field
18498
+ * directly because `BaseGeminiNextGenAPIClient` keeps it `private`; centralizing
18499
+ * the runtime cast here avoids leaking it into resource files.
18500
+ */
18501
+ function isVertexClient(client) {
18502
+ const adapter = client.clientAdapter;
18503
+ return Boolean(adapter && adapter.isVertexAI());
18504
+ }
18505
+ function isPlainObject(value) {
18506
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
18507
+ }
18508
+ /**
18509
+ * Wrap a legacy `outputs: Array<Content>` payload into the modern
18510
+ * `steps: [{type: 'model_output', content: outputs}]` shape. Returns the input
18511
+ * unchanged when `steps` already wins or `outputs` is absent.
18512
+ */
18513
+ function wrapOutputsAsSteps(data) {
18514
+ if (!('outputs' in data) || 'steps' in data) {
18515
+ return data;
18516
+ }
18517
+ const { outputs } = data, rest = __rest(data, ["outputs"]);
18518
+ return Object.assign(Object.assign({}, rest), { steps: [{ type: 'model_output', content: outputs }] });
18519
+ }
18520
+ /**
18521
+ * Non-streaming: rewrite a legacy interaction response so consumers see the
18522
+ * modern `steps` shape.
18523
+ */
18524
+ function coerceLegacyInteractionResponse(data) {
18525
+ if (!isPlainObject(data))
18526
+ return data;
18527
+ return wrapOutputsAsSteps(data);
18528
+ }
18529
+ /**
18530
+ * Streaming: translate one legacy SSE event to its modern equivalent.
18531
+ *
18532
+ * Returns the input unchanged when the `event_type` is not one of the legacy
18533
+ * ones we know how to map. Two non-trivial cases:
18534
+ * 1. `content.start` carries `content: <Content>` — the modern `step.start`
18535
+ * expects `step: {type: 'model_output', content: [<Content>]}`.
18536
+ * 2. `interaction.start` / `interaction.complete` wrap an `interaction`
18537
+ * object that may itself carry the legacy `outputs` field; recurse.
18538
+ */
18539
+ function maybeRemapLegacyStreamEvent(data) {
18540
+ if (!isPlainObject(data))
18541
+ return data;
18542
+ const eventType = data['event_type'];
18543
+ if (typeof eventType !== 'string' || !(eventType in LEGACY_EVENT_TYPE_RENAMES)) {
18544
+ return data;
18545
+ }
18546
+ const renamed = Object.assign(Object.assign({}, data), { event_type: LEGACY_EVENT_TYPE_RENAMES[eventType] });
18547
+ if (eventType === 'content.start') {
18548
+ const { content } = renamed, rest = __rest(renamed, ["content"]);
18549
+ let stepContent;
18550
+ if (content == null) {
18551
+ stepContent = [];
18552
+ }
18553
+ else if (Array.isArray(content)) {
18554
+ stepContent = content;
18555
+ }
18556
+ else {
18557
+ stepContent = [content];
18558
+ }
18559
+ return Object.assign(Object.assign({}, rest), { step: { type: 'model_output', content: stepContent } });
18560
+ }
18561
+ if (eventType === 'interaction.start' || eventType === 'interaction.complete') {
18562
+ const inner = renamed['interaction'];
18563
+ if (isPlainObject(inner)) {
18564
+ renamed['interaction'] = wrapOutputsAsSteps(inner);
18565
+ }
18566
+ }
18567
+ return renamed;
18568
+ }
18569
+ /**
18570
+ * Stream subclass that runs each yielded SSE event through
18571
+ * `maybeRemapLegacyStreamEvent` so consumers always see modern event shapes.
18572
+ *
18573
+ * Wired in via the `__streamClass` request option from `resources/interactions.ts`
18574
+ * (read by `src/internal/parse.ts:defaultParseResponse`).
18575
+ */
18576
+ class LegacyLyriaStream extends Stream {
18577
+ static fromSSEResponse(response, controller, client) {
18578
+ const base = Stream.fromSSEResponse(response, controller, client);
18579
+ function wrappedIterator() {
18580
+ return __asyncGenerator(this, arguments, function* wrappedIterator_1() {
18581
+ var _a, e_1, _b, _c;
18582
+ try {
18583
+ 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) {
18584
+ _c = base_1_1.value;
18585
+ _d = false;
18586
+ const item = _c;
18587
+ yield yield __await(maybeRemapLegacyStreamEvent(item));
18588
+ }
18589
+ }
18590
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
18591
+ finally {
18592
+ try {
18593
+ if (!_d && !_a && (_b = base_1.return)) yield __await(_b.call(base_1));
18594
+ }
18595
+ finally { if (e_1) throw e_1.error; }
18596
+ }
18597
+ });
18598
+ }
18599
+ return new LegacyLyriaStream(wrappedIterator, controller, client);
18600
+ }
18601
+ }
18602
+
18603
+ /**
18604
+ * @license
18605
+ * Copyright 2025 Google LLC
18606
+ * SPDX-License-Identifier: Apache-2.0
18607
+ */
18608
+ /**
18609
+ * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
18610
+ *
18611
+ * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
18612
+ * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
18613
+ * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
18614
+ * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
18615
+ */
18616
+ function encodeURIPath(str) {
18617
+ return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
18618
+ }
18619
+ const EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
18620
+ const createPathTagFunction = (pathEncoder = encodeURIPath) => (function path(statics, ...params) {
18621
+ // If there are no params, no processing is needed.
18622
+ if (statics.length === 1)
18623
+ return statics[0];
18624
+ let postPath = false;
18625
+ const invalidSegments = [];
18626
+ const path = statics.reduce((previousValue, currentValue, index) => {
18627
+ var _a, _b, _c;
18628
+ if (/[?#]/.test(currentValue)) {
18629
+ postPath = true;
18630
+ }
18631
+ const value = params[index];
18632
+ let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);
18633
+ if (index !== params.length &&
18634
+ (value == null ||
18635
+ (typeof value === 'object' &&
18636
+ // handle values from other realms
18637
+ value.toString ===
18638
+ ((_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)))) {
18639
+ encoded = value + '';
18640
+ invalidSegments.push({
18641
+ start: previousValue.length + currentValue.length,
18642
+ length: encoded.length,
18643
+ error: `Value of type ${Object.prototype.toString
18644
+ .call(value)
18645
+ .slice(8, -1)} is not a valid path parameter`,
18646
+ });
18647
+ }
18648
+ return previousValue + currentValue + (index === params.length ? '' : encoded);
18649
+ }, '');
18650
+ const pathOnly = path.split(/[?#]/, 1)[0];
18651
+ const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
18652
+ let match;
18653
+ // Find all invalid segments
18654
+ while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
18655
+ const hasLeadingSlash = match[0].startsWith('/');
18656
+ const offset = hasLeadingSlash ? 1 : 0;
18657
+ const cleanMatch = hasLeadingSlash ? match[0].slice(1) : match[0];
18658
+ invalidSegments.push({
18659
+ start: match.index + offset,
18660
+ length: cleanMatch.length,
18661
+ error: `Value "${cleanMatch}" can\'t be safely passed as a path parameter`,
18662
+ });
18663
+ }
18664
+ invalidSegments.sort((a, b) => a.start - b.start);
18665
+ if (invalidSegments.length > 0) {
18666
+ let lastEnd = 0;
18667
+ const underline = invalidSegments.reduce((acc, segment) => {
18668
+ const spaces = ' '.repeat(segment.start - lastEnd);
18669
+ const arrows = '^'.repeat(segment.length);
18670
+ lastEnd = segment.start + segment.length;
18671
+ return acc + spaces + arrows;
18672
+ }, '');
18673
+ throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:\n${invalidSegments
18674
+ .map((e) => e.error)
18675
+ .join('\n')}\n${path}\n${underline}`);
18676
+ }
18677
+ return path;
18678
+ });
18679
+ /**
18680
+ * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
18681
+ */
18682
+ const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
18683
+
18684
+ /**
18685
+ * @license
18686
+ * Copyright 2025 Google LLC
18687
+ * SPDX-License-Identifier: Apache-2.0
18688
+ */
18689
+ class BaseInteractions extends APIResource {
18690
+ create(params, options) {
18691
+ var _a;
18692
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18693
+ if ('model' in body && 'agent_config' in body) {
18694
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
18695
+ }
18696
+ if ('agent' in body && 'generation_config' in body) {
18697
+ throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
18698
+ }
18699
+ const needsLegacyLyriaShim = isLegacyLyriaRequest({
18700
+ isVertex: isVertexClient(this._client),
18701
+ model: 'model' in body ? body.model : undefined,
18702
+ });
18703
+ const isStreaming = (_a = params.stream) !== null && _a !== void 0 ? _a : false;
18704
+ const promise = this._client.post(path `/${api_version}/interactions`, Object.assign(Object.assign(Object.assign({ body }, options), { stream: isStreaming }), (needsLegacyLyriaShim && isStreaming ? { __streamClass: LegacyLyriaStream } : {})));
18705
+ if (needsLegacyLyriaShim && !isStreaming) {
18706
+ return promise._thenUnwrap((data) => coerceLegacyInteractionResponse(data));
18707
+ }
18708
+ return promise;
18709
+ }
18710
+ /**
18711
+ * Deletes the interaction by id.
18712
+ *
18713
+ * @example
18714
+ * ```ts
18715
+ * const interaction = await client.interactions.delete('id', {
18716
+ * api_version: 'api_version',
18717
+ * });
18718
+ * ```
18719
+ */
18720
+ delete(id, params = {}, options) {
18721
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18722
+ return this._client.delete(path `/${api_version}/interactions/${id}`, options);
18723
+ }
18724
+ /**
18725
+ * Cancels an interaction by id. This only applies to background interactions that
18726
+ * are still running.
18727
+ *
18728
+ * @example
18729
+ * ```ts
18730
+ * const interaction = await client.interactions.cancel('id', {
18731
+ * api_version: 'api_version',
18732
+ * });
18733
+ * ```
18734
+ */
18735
+ cancel(id, params = {}, options) {
18736
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18737
+ return this._client.post(path `/${api_version}/interactions/${id}/cancel`, options);
18738
+ }
18739
+ get(id, params = {}, options) {
18740
+ var _a;
18741
+ const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
18742
+ 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 }));
18743
+ }
18744
+ }
18745
+ BaseInteractions._key = Object.freeze(['interactions']);
18746
+ class Interactions extends BaseInteractions {
18747
+ }
18748
+
18749
+ /**
18750
+ * @license
18751
+ * Copyright 2025 Google LLC
18752
+ * SPDX-License-Identifier: Apache-2.0
18753
+ */
18754
+ class BaseWebhooks extends APIResource {
18755
+ /**
18756
+ * Creates a new Webhook.
18757
+ */
18758
+ create(params, options) {
18759
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
18760
+ return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
18761
+ }
18762
+ /**
18763
+ * Updates an existing Webhook.
18764
+ */
18765
+ update(id, params = {}, options) {
18766
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
18767
+ return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
18768
+ }
18769
+ /**
18770
+ * Lists all Webhooks.
18771
+ */
18772
+ list(params = {}, options) {
18773
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, query = __rest(_a, ["api_version"]);
18774
+ return this._client.get(path `/${api_version}/webhooks`, Object.assign({ query }, options));
18775
+ }
18776
+ /**
18777
+ * Deletes a Webhook.
18778
+ */
18779
+ delete(id, params = {}, options) {
18780
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18781
+ return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
18782
+ }
18783
+ /**
18784
+ * Gets a specific Webhook.
18785
+ */
18786
+ get(id, params = {}, options) {
18787
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
18788
+ return this._client.get(path `/${api_version}/webhooks/${id}`, options);
18789
+ }
18790
+ /**
18791
+ * Sends a ping event to a Webhook.
18792
+ */
18793
+ ping(id, params = undefined, options) {
18794
+ const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
18795
+ return this._client.post(path `/${api_version}/webhooks/${id}:ping`, Object.assign({ body: body }, options));
18796
+ }
18797
+ /**
18798
+ * Generates a new signing secret for a Webhook.
18799
+ */
18800
+ rotateSigningSecret(id, params = {}, options) {
18801
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a, body = __rest(_a, ["api_version"]);
18802
+ return this._client.post(path `/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
18803
+ }
18804
+ }
18805
+ BaseWebhooks._key = Object.freeze(['webhooks']);
18806
+ class Webhooks extends BaseWebhooks {
18807
+ }
18808
+
18779
18809
  /**
18780
18810
  * @license
18781
18811
  * Copyright 2025 Google LLC
@@ -19674,7 +19704,7 @@ function cancelTuningJobResponseFromVertex(fromObject, _rootObject) {
19674
19704
  function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19675
19705
  const toObject = {};
19676
19706
  if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
19677
- throw new Error('validationDataset parameter is not supported in Gemini API.');
19707
+ throw new Error('validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19678
19708
  }
19679
19709
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
19680
19710
  'tunedModelDisplayName',
@@ -19683,7 +19713,7 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19683
19713
  setValueByPath(parentObject, ['displayName'], fromTunedModelDisplayName);
19684
19714
  }
19685
19715
  if (getValueByPath(fromObject, ['description']) !== undefined) {
19686
- throw new Error('description parameter is not supported in Gemini API.');
19716
+ throw new Error('description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19687
19717
  }
19688
19718
  const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
19689
19719
  if (parentObject !== undefined && fromEpochCount != null) {
@@ -19697,20 +19727,20 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19697
19727
  }
19698
19728
  if (getValueByPath(fromObject, ['exportLastCheckpointOnly']) !==
19699
19729
  undefined) {
19700
- throw new Error('exportLastCheckpointOnly parameter is not supported in Gemini API.');
19730
+ throw new Error('exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19701
19731
  }
19702
19732
  if (getValueByPath(fromObject, ['preTunedModelCheckpointId']) !==
19703
19733
  undefined) {
19704
- throw new Error('preTunedModelCheckpointId parameter is not supported in Gemini API.');
19734
+ throw new Error('preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19705
19735
  }
19706
19736
  if (getValueByPath(fromObject, ['adapterSize']) !== undefined) {
19707
- throw new Error('adapterSize parameter is not supported in Gemini API.');
19737
+ throw new Error('adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19708
19738
  }
19709
19739
  if (getValueByPath(fromObject, ['tuningMode']) !== undefined) {
19710
- throw new Error('tuningMode parameter is not supported in Gemini API.');
19740
+ throw new Error('tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19711
19741
  }
19712
19742
  if (getValueByPath(fromObject, ['customBaseModel']) !== undefined) {
19713
- throw new Error('customBaseModel parameter is not supported in Gemini API.');
19743
+ throw new Error('customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19714
19744
  }
19715
19745
  const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19716
19746
  if (parentObject !== undefined && fromBatchSize != null) {
@@ -19721,25 +19751,25 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
19721
19751
  setValueByPath(parentObject, ['tuningTask', 'hyperparameters', 'learningRate'], fromLearningRate);
19722
19752
  }
19723
19753
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
19724
- throw new Error('labels parameter is not supported in Gemini API.');
19754
+ throw new Error('labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19725
19755
  }
19726
19756
  if (getValueByPath(fromObject, ['beta']) !== undefined) {
19727
- throw new Error('beta parameter is not supported in Gemini API.');
19757
+ throw new Error('beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19728
19758
  }
19729
19759
  if (getValueByPath(fromObject, ['baseTeacherModel']) !== undefined) {
19730
- throw new Error('baseTeacherModel parameter is not supported in Gemini API.');
19760
+ throw new Error('baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19731
19761
  }
19732
19762
  if (getValueByPath(fromObject, ['tunedTeacherModelSource']) !== undefined) {
19733
- throw new Error('tunedTeacherModelSource parameter is not supported in Gemini API.');
19763
+ throw new Error('tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19734
19764
  }
19735
19765
  if (getValueByPath(fromObject, ['sftLossWeightMultiplier']) !== undefined) {
19736
- throw new Error('sftLossWeightMultiplier parameter is not supported in Gemini API.');
19766
+ throw new Error('sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19737
19767
  }
19738
19768
  if (getValueByPath(fromObject, ['outputUri']) !== undefined) {
19739
- throw new Error('outputUri parameter is not supported in Gemini API.');
19769
+ throw new Error('outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19740
19770
  }
19741
19771
  if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
19742
- throw new Error('encryptionSpec parameter is not supported in Gemini API.');
19772
+ throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
19743
19773
  }
19744
19774
  return toObject;
19745
19775
  }
@@ -20133,10 +20163,10 @@ function tunedModelFromMldev(fromObject, _rootObject) {
20133
20163
  function tuningDatasetToMldev(fromObject, _rootObject) {
20134
20164
  const toObject = {};
20135
20165
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
20136
- throw new Error('gcsUri parameter is not supported in Gemini API.');
20166
+ throw new Error('gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
20137
20167
  }
20138
20168
  if (getValueByPath(fromObject, ['vertexDatasetResource']) !== undefined) {
20139
- throw new Error('vertexDatasetResource parameter is not supported in Gemini API.');
20169
+ throw new Error('vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
20140
20170
  }
20141
20171
  const fromExamples = getValueByPath(fromObject, ['examples']);
20142
20172
  if (fromExamples != null) {
@@ -20209,7 +20239,7 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
20209
20239
  }
20210
20240
  }
20211
20241
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
20212
- throw new Error('examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
20242
+ throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
20213
20243
  }
20214
20244
  return toObject;
20215
20245
  }