@fre4x/gemini 1.0.64 → 1.0.65-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +988 -287
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -29425,6 +29425,11 @@ function videoFromVertex$1(fromObject) {
29425
29425
  }
29426
29426
  return toObject;
29427
29427
  }
29428
+ var Language;
29429
+ (function(Language2) {
29430
+ Language2["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
29431
+ Language2["PYTHON"] = "PYTHON";
29432
+ })(Language || (Language = {}));
29428
29433
  var Outcome;
29429
29434
  (function(Outcome2) {
29430
29435
  Outcome2["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
@@ -29432,11 +29437,6 @@ var Outcome;
29432
29437
  Outcome2["OUTCOME_FAILED"] = "OUTCOME_FAILED";
29433
29438
  Outcome2["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
29434
29439
  })(Outcome || (Outcome = {}));
29435
- var Language;
29436
- (function(Language2) {
29437
- Language2["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
29438
- Language2["PYTHON"] = "PYTHON";
29439
- })(Language || (Language = {}));
29440
29440
  var FunctionResponseScheduling;
29441
29441
  (function(FunctionResponseScheduling2) {
29442
29442
  FunctionResponseScheduling2["SCHEDULING_UNSPECIFIED"] = "SCHEDULING_UNSPECIFIED";
@@ -29455,16 +29455,11 @@ var Type;
29455
29455
  Type2["OBJECT"] = "OBJECT";
29456
29456
  Type2["NULL"] = "NULL";
29457
29457
  })(Type || (Type = {}));
29458
- var PhishBlockThreshold;
29459
- (function(PhishBlockThreshold2) {
29460
- PhishBlockThreshold2["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
29461
- PhishBlockThreshold2["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
29462
- PhishBlockThreshold2["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
29463
- PhishBlockThreshold2["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
29464
- PhishBlockThreshold2["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
29465
- PhishBlockThreshold2["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
29466
- PhishBlockThreshold2["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
29467
- })(PhishBlockThreshold || (PhishBlockThreshold = {}));
29458
+ var Environment;
29459
+ (function(Environment2) {
29460
+ Environment2["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
29461
+ Environment2["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
29462
+ })(Environment || (Environment = {}));
29468
29463
  var AuthType;
29469
29464
  (function(AuthType2) {
29470
29465
  AuthType2["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
@@ -29490,6 +29485,16 @@ var ApiSpec;
29490
29485
  ApiSpec2["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
29491
29486
  ApiSpec2["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
29492
29487
  })(ApiSpec || (ApiSpec = {}));
29488
+ var PhishBlockThreshold;
29489
+ (function(PhishBlockThreshold2) {
29490
+ PhishBlockThreshold2["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
29491
+ PhishBlockThreshold2["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
29492
+ PhishBlockThreshold2["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
29493
+ PhishBlockThreshold2["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
29494
+ PhishBlockThreshold2["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
29495
+ PhishBlockThreshold2["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
29496
+ PhishBlockThreshold2["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
29497
+ })(PhishBlockThreshold || (PhishBlockThreshold = {}));
29493
29498
  var Behavior;
29494
29499
  (function(Behavior2) {
29495
29500
  Behavior2["UNSPECIFIED"] = "UNSPECIFIED";
@@ -29512,10 +29517,10 @@ var FunctionCallingConfigMode;
29512
29517
  var ThinkingLevel;
29513
29518
  (function(ThinkingLevel2) {
29514
29519
  ThinkingLevel2["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
29520
+ ThinkingLevel2["MINIMAL"] = "MINIMAL";
29515
29521
  ThinkingLevel2["LOW"] = "LOW";
29516
29522
  ThinkingLevel2["MEDIUM"] = "MEDIUM";
29517
29523
  ThinkingLevel2["HIGH"] = "HIGH";
29518
- ThinkingLevel2["MINIMAL"] = "MINIMAL";
29519
29524
  })(ThinkingLevel || (ThinkingLevel = {}));
29520
29525
  var PersonGeneration;
29521
29526
  (function(PersonGeneration2) {
@@ -29523,6 +29528,12 @@ var PersonGeneration;
29523
29528
  PersonGeneration2["ALLOW_ADULT"] = "ALLOW_ADULT";
29524
29529
  PersonGeneration2["ALLOW_ALL"] = "ALLOW_ALL";
29525
29530
  })(PersonGeneration || (PersonGeneration = {}));
29531
+ var ProminentPeople;
29532
+ (function(ProminentPeople2) {
29533
+ ProminentPeople2["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
29534
+ ProminentPeople2["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
29535
+ ProminentPeople2["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
29536
+ })(ProminentPeople || (ProminentPeople = {}));
29526
29537
  var HarmCategory;
29527
29538
  (function(HarmCategory2) {
29528
29539
  HarmCategory2["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
@@ -29621,7 +29632,19 @@ var Modality;
29621
29632
  Modality2["TEXT"] = "TEXT";
29622
29633
  Modality2["IMAGE"] = "IMAGE";
29623
29634
  Modality2["AUDIO"] = "AUDIO";
29635
+ Modality2["VIDEO"] = "VIDEO";
29624
29636
  })(Modality || (Modality = {}));
29637
+ var ModelStage;
29638
+ (function(ModelStage2) {
29639
+ ModelStage2["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
29640
+ ModelStage2["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
29641
+ ModelStage2["EXPERIMENTAL"] = "EXPERIMENTAL";
29642
+ ModelStage2["PREVIEW"] = "PREVIEW";
29643
+ ModelStage2["STABLE"] = "STABLE";
29644
+ ModelStage2["LEGACY"] = "LEGACY";
29645
+ ModelStage2["DEPRECATED"] = "DEPRECATED";
29646
+ ModelStage2["RETIRED"] = "RETIRED";
29647
+ })(ModelStage || (ModelStage = {}));
29625
29648
  var MediaResolution;
29626
29649
  (function(MediaResolution2) {
29627
29650
  MediaResolution2["MEDIA_RESOLUTION_UNSPECIFIED"] = "MEDIA_RESOLUTION_UNSPECIFIED";
@@ -29697,6 +29720,13 @@ var TuningTask;
29697
29720
  TuningTask2["TUNING_TASK_T2V"] = "TUNING_TASK_T2V";
29698
29721
  TuningTask2["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
29699
29722
  })(TuningTask || (TuningTask = {}));
29723
+ var DocumentState;
29724
+ (function(DocumentState2) {
29725
+ DocumentState2["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
29726
+ DocumentState2["STATE_PENDING"] = "STATE_PENDING";
29727
+ DocumentState2["STATE_ACTIVE"] = "STATE_ACTIVE";
29728
+ DocumentState2["STATE_FAILED"] = "STATE_FAILED";
29729
+ })(DocumentState || (DocumentState = {}));
29700
29730
  var PartMediaResolutionLevel;
29701
29731
  (function(PartMediaResolutionLevel2) {
29702
29732
  PartMediaResolutionLevel2["MEDIA_RESOLUTION_UNSPECIFIED"] = "MEDIA_RESOLUTION_UNSPECIFIED";
@@ -29705,10 +29735,26 @@ var PartMediaResolutionLevel;
29705
29735
  PartMediaResolutionLevel2["MEDIA_RESOLUTION_HIGH"] = "MEDIA_RESOLUTION_HIGH";
29706
29736
  PartMediaResolutionLevel2["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
29707
29737
  })(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
29738
+ var ToolType;
29739
+ (function(ToolType2) {
29740
+ ToolType2["TOOL_TYPE_UNSPECIFIED"] = "TOOL_TYPE_UNSPECIFIED";
29741
+ ToolType2["GOOGLE_SEARCH_WEB"] = "GOOGLE_SEARCH_WEB";
29742
+ ToolType2["GOOGLE_SEARCH_IMAGE"] = "GOOGLE_SEARCH_IMAGE";
29743
+ ToolType2["URL_CONTEXT"] = "URL_CONTEXT";
29744
+ ToolType2["GOOGLE_MAPS"] = "GOOGLE_MAPS";
29745
+ ToolType2["FILE_SEARCH"] = "FILE_SEARCH";
29746
+ })(ToolType || (ToolType = {}));
29708
29747
  var ResourceScope;
29709
29748
  (function(ResourceScope2) {
29710
29749
  ResourceScope2["COLLECTION"] = "COLLECTION";
29711
29750
  })(ResourceScope || (ResourceScope = {}));
29751
+ var ServiceTier;
29752
+ (function(ServiceTier2) {
29753
+ ServiceTier2["UNSPECIFIED"] = "unspecified";
29754
+ ServiceTier2["FLEX"] = "flex";
29755
+ ServiceTier2["STANDARD"] = "standard";
29756
+ ServiceTier2["PRIORITY"] = "priority";
29757
+ })(ServiceTier || (ServiceTier = {}));
29712
29758
  var FeatureSelectionPreference;
29713
29759
  (function(FeatureSelectionPreference2) {
29714
29760
  FeatureSelectionPreference2["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
@@ -29716,17 +29762,6 @@ var FeatureSelectionPreference;
29716
29762
  FeatureSelectionPreference2["BALANCED"] = "BALANCED";
29717
29763
  FeatureSelectionPreference2["PRIORITIZE_COST"] = "PRIORITIZE_COST";
29718
29764
  })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
29719
- var Environment;
29720
- (function(Environment2) {
29721
- Environment2["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
29722
- Environment2["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
29723
- })(Environment || (Environment = {}));
29724
- var ProminentPeople;
29725
- (function(ProminentPeople2) {
29726
- ProminentPeople2["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
29727
- ProminentPeople2["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
29728
- ProminentPeople2["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
29729
- })(ProminentPeople || (ProminentPeople = {}));
29730
29765
  var EmbeddingApiType;
29731
29766
  (function(EmbeddingApiType2) {
29732
29767
  EmbeddingApiType2["PREDICT"] = "PREDICT";
@@ -29808,19 +29843,17 @@ var VideoCompressionQuality;
29808
29843
  VideoCompressionQuality2["OPTIMIZED"] = "OPTIMIZED";
29809
29844
  VideoCompressionQuality2["LOSSLESS"] = "LOSSLESS";
29810
29845
  })(VideoCompressionQuality || (VideoCompressionQuality = {}));
29846
+ var ImageResizeMode;
29847
+ (function(ImageResizeMode2) {
29848
+ ImageResizeMode2["CROP"] = "CROP";
29849
+ ImageResizeMode2["PAD"] = "PAD";
29850
+ })(ImageResizeMode || (ImageResizeMode = {}));
29811
29851
  var TuningMethod;
29812
29852
  (function(TuningMethod2) {
29813
29853
  TuningMethod2["SUPERVISED_FINE_TUNING"] = "SUPERVISED_FINE_TUNING";
29814
29854
  TuningMethod2["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
29815
29855
  TuningMethod2["DISTILLATION"] = "DISTILLATION";
29816
29856
  })(TuningMethod || (TuningMethod = {}));
29817
- var DocumentState;
29818
- (function(DocumentState2) {
29819
- DocumentState2["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
29820
- DocumentState2["STATE_PENDING"] = "STATE_PENDING";
29821
- DocumentState2["STATE_ACTIVE"] = "STATE_ACTIVE";
29822
- DocumentState2["STATE_FAILED"] = "STATE_FAILED";
29823
- })(DocumentState || (DocumentState = {}));
29824
29857
  var FileState;
29825
29858
  (function(FileState2) {
29826
29859
  FileState2["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
@@ -29841,6 +29874,30 @@ var TurnCompleteReason;
29841
29874
  TurnCompleteReason2["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
29842
29875
  TurnCompleteReason2["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
29843
29876
  TurnCompleteReason2["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
29877
+ TurnCompleteReason2["PROHIBITED_INPUT_CONTENT"] = "PROHIBITED_INPUT_CONTENT";
29878
+ TurnCompleteReason2["IMAGE_PROHIBITED_INPUT_CONTENT"] = "IMAGE_PROHIBITED_INPUT_CONTENT";
29879
+ TurnCompleteReason2["INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED"] = "INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED";
29880
+ TurnCompleteReason2["INPUT_IMAGE_CELEBRITY"] = "INPUT_IMAGE_CELEBRITY";
29881
+ TurnCompleteReason2["INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED"] = "INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED";
29882
+ TurnCompleteReason2["INPUT_TEXT_NCII_PROHIBITED"] = "INPUT_TEXT_NCII_PROHIBITED";
29883
+ TurnCompleteReason2["INPUT_OTHER"] = "INPUT_OTHER";
29884
+ TurnCompleteReason2["INPUT_IP_PROHIBITED"] = "INPUT_IP_PROHIBITED";
29885
+ TurnCompleteReason2["BLOCKLIST"] = "BLOCKLIST";
29886
+ TurnCompleteReason2["UNSAFE_PROMPT_FOR_IMAGE_GENERATION"] = "UNSAFE_PROMPT_FOR_IMAGE_GENERATION";
29887
+ TurnCompleteReason2["GENERATED_IMAGE_SAFETY"] = "GENERATED_IMAGE_SAFETY";
29888
+ TurnCompleteReason2["GENERATED_CONTENT_SAFETY"] = "GENERATED_CONTENT_SAFETY";
29889
+ TurnCompleteReason2["GENERATED_AUDIO_SAFETY"] = "GENERATED_AUDIO_SAFETY";
29890
+ TurnCompleteReason2["GENERATED_VIDEO_SAFETY"] = "GENERATED_VIDEO_SAFETY";
29891
+ TurnCompleteReason2["GENERATED_CONTENT_PROHIBITED"] = "GENERATED_CONTENT_PROHIBITED";
29892
+ TurnCompleteReason2["GENERATED_CONTENT_BLOCKLIST"] = "GENERATED_CONTENT_BLOCKLIST";
29893
+ TurnCompleteReason2["GENERATED_IMAGE_PROHIBITED"] = "GENERATED_IMAGE_PROHIBITED";
29894
+ TurnCompleteReason2["GENERATED_IMAGE_CELEBRITY"] = "GENERATED_IMAGE_CELEBRITY";
29895
+ TurnCompleteReason2["GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER"] = "GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER";
29896
+ TurnCompleteReason2["GENERATED_IMAGE_IDENTIFIABLE_PEOPLE"] = "GENERATED_IMAGE_IDENTIFIABLE_PEOPLE";
29897
+ TurnCompleteReason2["GENERATED_IMAGE_MINORS"] = "GENERATED_IMAGE_MINORS";
29898
+ TurnCompleteReason2["OUTPUT_IMAGE_IP_PROHIBITED"] = "OUTPUT_IMAGE_IP_PROHIBITED";
29899
+ TurnCompleteReason2["GENERATED_OTHER"] = "GENERATED_OTHER";
29900
+ TurnCompleteReason2["MAX_REGENERATION_REACHED"] = "MAX_REGENERATION_REACHED";
29844
29901
  })(TurnCompleteReason || (TurnCompleteReason = {}));
29845
29902
  var MediaModality;
29846
29903
  (function(MediaModality2) {
@@ -29886,6 +29943,7 @@ var TurnCoverage;
29886
29943
  TurnCoverage2["TURN_COVERAGE_UNSPECIFIED"] = "TURN_COVERAGE_UNSPECIFIED";
29887
29944
  TurnCoverage2["TURN_INCLUDES_ONLY_ACTIVITY"] = "TURN_INCLUDES_ONLY_ACTIVITY";
29888
29945
  TurnCoverage2["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
29946
+ TurnCoverage2["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
29889
29947
  })(TurnCoverage || (TurnCoverage = {}));
29890
29948
  var Scale;
29891
29949
  (function(Scale2) {
@@ -30175,7 +30233,6 @@ var ComputeTokensResponse = class {
30175
30233
  var GenerateVideosOperation = class _GenerateVideosOperation {
30176
30234
  /**
30177
30235
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
30178
- * @internal
30179
30236
  */
30180
30237
  _fromAPIResponse({ apiResponse, _isVertexAI }) {
30181
30238
  const operation = new _GenerateVideosOperation();
@@ -30207,7 +30264,6 @@ var UploadToFileSearchStoreResumableResponse = class {
30207
30264
  var ImportFileOperation = class _ImportFileOperation {
30208
30265
  /**
30209
30266
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
30210
- * @internal
30211
30267
  */
30212
30268
  _fromAPIResponse({ apiResponse, _isVertexAI }) {
30213
30269
  const operation = new _ImportFileOperation();
@@ -30304,7 +30360,6 @@ var LiveMusicServerMessage = class {
30304
30360
  var UploadToFileSearchStoreOperation = class _UploadToFileSearchStoreOperation {
30305
30361
  /**
30306
30362
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
30307
- * @internal
30308
30363
  */
30309
30364
  _fromAPIResponse({ apiResponse, _isVertexAI }) {
30310
30365
  const operation = new _UploadToFileSearchStoreOperation();
@@ -30767,6 +30822,8 @@ function tBatchJobSource(client, src) {
30767
30822
  sourceObj = { format: "jsonl", gcsUri: [src] };
30768
30823
  } else if (src.startsWith("bq://")) {
30769
30824
  sourceObj = { format: "bigquery", bigqueryUri: src };
30825
+ } else if (/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(src)) {
30826
+ sourceObj = { format: "vertex-dataset", vertexDatasetName: src };
30770
30827
  } else {
30771
30828
  throw new Error(`Unsupported string source for Vertex AI: ${src}`);
30772
30829
  }
@@ -30785,14 +30842,18 @@ function tBatchJobSource(client, src) {
30785
30842
  } else {
30786
30843
  sourceObj = src;
30787
30844
  }
30788
- const vertexSourcesCount = [sourceObj.gcsUri, sourceObj.bigqueryUri].filter(Boolean).length;
30845
+ const vertexSourcesCount = [
30846
+ sourceObj.gcsUri,
30847
+ sourceObj.bigqueryUri,
30848
+ sourceObj.vertexDatasetName
30849
+ ].filter(Boolean).length;
30789
30850
  const mldevSourcesCount = [
30790
30851
  sourceObj.inlinedRequests,
30791
30852
  sourceObj.fileName
30792
30853
  ].filter(Boolean).length;
30793
30854
  if (client.isVertexAI()) {
30794
30855
  if (mldevSourcesCount > 0 || vertexSourcesCount !== 1) {
30795
- throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.");
30856
+ throw new Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.");
30796
30857
  }
30797
30858
  } else {
30798
30859
  if (vertexSourcesCount > 0 || mldevSourcesCount !== 1) {
@@ -30978,6 +31039,12 @@ function batchJobDestinationFromVertex(fromObject) {
30978
31039
  if (fromBigqueryUri != null) {
30979
31040
  setValueByPath(toObject, ["bigqueryUri"], fromBigqueryUri);
30980
31041
  }
31042
+ const fromVertexDataset = getValueByPath(fromObject, [
31043
+ "vertexMultimodalDatasetDestination"
31044
+ ]);
31045
+ if (fromVertexDataset != null) {
31046
+ setValueByPath(toObject, ["vertexDataset"], vertexMultimodalDatasetDestinationFromVertex(fromVertexDataset));
31047
+ }
30981
31048
  return toObject;
30982
31049
  }
30983
31050
  function batchJobDestinationToVertex(fromObject) {
@@ -30995,13 +31062,19 @@ function batchJobDestinationToVertex(fromObject) {
30995
31062
  setValueByPath(toObject, ["bigqueryDestination", "outputUri"], fromBigqueryUri);
30996
31063
  }
30997
31064
  if (getValueByPath(fromObject, ["fileName"]) !== void 0) {
30998
- throw new Error("fileName parameter is not supported in Vertex AI.");
31065
+ throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
30999
31066
  }
31000
31067
  if (getValueByPath(fromObject, ["inlinedResponses"]) !== void 0) {
31001
- throw new Error("inlinedResponses parameter is not supported in Vertex AI.");
31068
+ throw new Error("inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
31002
31069
  }
31003
31070
  if (getValueByPath(fromObject, ["inlinedEmbedContentResponses"]) !== void 0) {
31004
- throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");
31071
+ throw new Error("inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
31072
+ }
31073
+ const fromVertexDataset = getValueByPath(fromObject, [
31074
+ "vertexDataset"
31075
+ ]);
31076
+ if (fromVertexDataset != null) {
31077
+ setValueByPath(toObject, ["vertexMultimodalDatasetDestination"], vertexMultimodalDatasetDestinationToVertex(fromVertexDataset));
31005
31078
  }
31006
31079
  return toObject;
31007
31080
  }
@@ -31105,6 +31178,10 @@ function batchJobFromVertex(fromObject) {
31105
31178
  if (fromCompletionStats != null) {
31106
31179
  setValueByPath(toObject, ["completionStats"], fromCompletionStats);
31107
31180
  }
31181
+ const fromOutputInfo = getValueByPath(fromObject, ["outputInfo"]);
31182
+ if (fromOutputInfo != null) {
31183
+ setValueByPath(toObject, ["outputInfo"], fromOutputInfo);
31184
+ }
31108
31185
  return toObject;
31109
31186
  }
31110
31187
  function batchJobSourceFromVertex(fromObject) {
@@ -31124,6 +31201,13 @@ function batchJobSourceFromVertex(fromObject) {
31124
31201
  if (fromBigqueryUri != null) {
31125
31202
  setValueByPath(toObject, ["bigqueryUri"], fromBigqueryUri);
31126
31203
  }
31204
+ const fromVertexDatasetName = getValueByPath(fromObject, [
31205
+ "vertexMultimodalDatasetSource",
31206
+ "datasetName"
31207
+ ]);
31208
+ if (fromVertexDatasetName != null) {
31209
+ setValueByPath(toObject, ["vertexDatasetName"], fromVertexDatasetName);
31210
+ }
31127
31211
  return toObject;
31128
31212
  }
31129
31213
  function batchJobSourceToMldev(apiClient, fromObject) {
@@ -31153,6 +31237,9 @@ function batchJobSourceToMldev(apiClient, fromObject) {
31153
31237
  }
31154
31238
  setValueByPath(toObject, ["requests", "requests"], transformedList);
31155
31239
  }
31240
+ if (getValueByPath(fromObject, ["vertexDatasetName"]) !== void 0) {
31241
+ throw new Error("vertexDatasetName parameter is not supported in Gemini API.");
31242
+ }
31156
31243
  return toObject;
31157
31244
  }
31158
31245
  function batchJobSourceToVertex(fromObject) {
@@ -31170,10 +31257,16 @@ function batchJobSourceToVertex(fromObject) {
31170
31257
  setValueByPath(toObject, ["bigquerySource", "inputUri"], fromBigqueryUri);
31171
31258
  }
31172
31259
  if (getValueByPath(fromObject, ["fileName"]) !== void 0) {
31173
- throw new Error("fileName parameter is not supported in Vertex AI.");
31260
+ throw new Error("fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
31174
31261
  }
31175
31262
  if (getValueByPath(fromObject, ["inlinedRequests"]) !== void 0) {
31176
- throw new Error("inlinedRequests parameter is not supported in Vertex AI.");
31263
+ throw new Error("inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
31264
+ }
31265
+ const fromVertexDatasetName = getValueByPath(fromObject, [
31266
+ "vertexDatasetName"
31267
+ ]);
31268
+ if (fromVertexDatasetName != null) {
31269
+ setValueByPath(toObject, ["vertexMultimodalDatasetSource", "datasetName"], fromVertexDatasetName);
31177
31270
  }
31178
31271
  return toObject;
31179
31272
  }
@@ -31309,6 +31402,12 @@ function createBatchJobConfigToMldev(fromObject, parentObject) {
31309
31402
  if (getValueByPath(fromObject, ["dest"]) !== void 0) {
31310
31403
  throw new Error("dest parameter is not supported in Gemini API.");
31311
31404
  }
31405
+ const fromWebhookConfig = getValueByPath(fromObject, [
31406
+ "webhookConfig"
31407
+ ]);
31408
+ if (parentObject !== void 0 && fromWebhookConfig != null) {
31409
+ setValueByPath(parentObject, ["batch", "webhookConfig"], fromWebhookConfig);
31410
+ }
31312
31411
  return toObject;
31313
31412
  }
31314
31413
  function createBatchJobConfigToVertex(fromObject, parentObject) {
@@ -31321,6 +31420,9 @@ function createBatchJobConfigToVertex(fromObject, parentObject) {
31321
31420
  if (parentObject !== void 0 && fromDest != null) {
31322
31421
  setValueByPath(parentObject, ["outputConfig"], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
31323
31422
  }
31423
+ if (getValueByPath(fromObject, ["webhookConfig"]) !== void 0) {
31424
+ throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
31425
+ }
31324
31426
  return toObject;
31325
31427
  }
31326
31428
  function createBatchJobParametersToMldev(apiClient, fromObject) {
@@ -31480,6 +31582,12 @@ function embedContentConfigToMldev$1(fromObject, parentObject) {
31480
31582
  if (getValueByPath(fromObject, ["autoTruncate"]) !== void 0) {
31481
31583
  throw new Error("autoTruncate parameter is not supported in Gemini API.");
31482
31584
  }
31585
+ if (getValueByPath(fromObject, ["documentOcr"]) !== void 0) {
31586
+ throw new Error("documentOcr parameter is not supported in Gemini API.");
31587
+ }
31588
+ if (getValueByPath(fromObject, ["audioTrackExtraction"]) !== void 0) {
31589
+ throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");
31590
+ }
31483
31591
  return toObject;
31484
31592
  }
31485
31593
  function embeddingsBatchJobSourceToMldev(apiClient, fromObject) {
@@ -31645,7 +31753,7 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
31645
31753
  let transformedList = fromSafetySettings;
31646
31754
  if (Array.isArray(transformedList)) {
31647
31755
  transformedList = transformedList.map((item) => {
31648
- return safetySettingToMldev$1(item);
31756
+ return safetySettingToMldev$3(item);
31649
31757
  });
31650
31758
  }
31651
31759
  setValueByPath(parentObject, ["safetySettings"], transformedList);
@@ -31711,6 +31819,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
31711
31819
  if (getValueByPath(fromObject, ["modelArmorConfig"]) !== void 0) {
31712
31820
  throw new Error("modelArmorConfig parameter is not supported in Gemini API.");
31713
31821
  }
31822
+ const fromServiceTier = getValueByPath(fromObject, ["serviceTier"]);
31823
+ if (parentObject !== void 0 && fromServiceTier != null) {
31824
+ setValueByPath(parentObject, ["serviceTier"], fromServiceTier);
31825
+ }
31714
31826
  return toObject;
31715
31827
  }
31716
31828
  function generateContentResponseFromMldev$1(fromObject) {
@@ -31751,6 +31863,10 @@ function generateContentResponseFromMldev$1(fromObject) {
31751
31863
  if (fromUsageMetadata != null) {
31752
31864
  setValueByPath(toObject, ["usageMetadata"], fromUsageMetadata);
31753
31865
  }
31866
+ const fromModelStatus = getValueByPath(fromObject, ["modelStatus"]);
31867
+ if (fromModelStatus != null) {
31868
+ setValueByPath(toObject, ["modelStatus"], fromModelStatus);
31869
+ }
31754
31870
  return toObject;
31755
31871
  }
31756
31872
  function getBatchJobParametersToMldev(apiClient, fromObject) {
@@ -32029,9 +32145,21 @@ function partToMldev$4(fromObject) {
32029
32145
  if (fromVideoMetadata != null) {
32030
32146
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
32031
32147
  }
32148
+ const fromToolCall = getValueByPath(fromObject, ["toolCall"]);
32149
+ if (fromToolCall != null) {
32150
+ setValueByPath(toObject, ["toolCall"], fromToolCall);
32151
+ }
32152
+ const fromToolResponse = getValueByPath(fromObject, ["toolResponse"]);
32153
+ if (fromToolResponse != null) {
32154
+ setValueByPath(toObject, ["toolResponse"], fromToolResponse);
32155
+ }
32156
+ const fromPartMetadata = getValueByPath(fromObject, ["partMetadata"]);
32157
+ if (fromPartMetadata != null) {
32158
+ setValueByPath(toObject, ["partMetadata"], fromPartMetadata);
32159
+ }
32032
32160
  return toObject;
32033
32161
  }
32034
- function safetySettingToMldev$1(fromObject) {
32162
+ function safetySettingToMldev$3(fromObject) {
32035
32163
  const toObject = {};
32036
32164
  const fromCategory = getValueByPath(fromObject, ["category"]);
32037
32165
  if (fromCategory != null) {
@@ -32060,6 +32188,10 @@ function toolConfigToMldev$2(fromObject) {
32060
32188
  if (fromFunctionCallingConfig != null) {
32061
32189
  setValueByPath(toObject, ["functionCallingConfig"], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
32062
32190
  }
32191
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ["includeServerSideToolInvocations"]);
32192
+ if (fromIncludeServerSideToolInvocations != null) {
32193
+ setValueByPath(toObject, ["includeServerSideToolInvocations"], fromIncludeServerSideToolInvocations);
32194
+ }
32063
32195
  return toObject;
32064
32196
  }
32065
32197
  function toolToMldev$4(fromObject) {
@@ -32129,6 +32261,35 @@ function toolToMldev$4(fromObject) {
32129
32261
  }
32130
32262
  return toObject;
32131
32263
  }
32264
+ function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
32265
+ const toObject = {};
32266
+ const fromBigqueryDestination = getValueByPath(fromObject, [
32267
+ "bigqueryDestination",
32268
+ "outputUri"
32269
+ ]);
32270
+ if (fromBigqueryDestination != null) {
32271
+ setValueByPath(toObject, ["bigqueryDestination"], fromBigqueryDestination);
32272
+ }
32273
+ const fromDisplayName = getValueByPath(fromObject, ["displayName"]);
32274
+ if (fromDisplayName != null) {
32275
+ setValueByPath(toObject, ["displayName"], fromDisplayName);
32276
+ }
32277
+ return toObject;
32278
+ }
32279
+ function vertexMultimodalDatasetDestinationToVertex(fromObject) {
32280
+ const toObject = {};
32281
+ const fromBigqueryDestination = getValueByPath(fromObject, [
32282
+ "bigqueryDestination"
32283
+ ]);
32284
+ if (fromBigqueryDestination != null) {
32285
+ setValueByPath(toObject, ["bigqueryDestination", "outputUri"], fromBigqueryDestination);
32286
+ }
32287
+ const fromDisplayName = getValueByPath(fromObject, ["displayName"]);
32288
+ if (fromDisplayName != null) {
32289
+ setValueByPath(toObject, ["displayName"], fromDisplayName);
32290
+ }
32291
+ return toObject;
32292
+ }
32132
32293
  var PagedItem;
32133
32294
  (function(PagedItem2) {
32134
32295
  PagedItem2["PAGED_ITEM_BATCH_JOBS"] = "batchJobs";
@@ -32315,7 +32476,7 @@ var Batches = class extends BaseModule {
32315
32476
  this.createEmbeddings = async (params) => {
32316
32477
  console.warn("batches.createEmbeddings() is experimental and may change without notice.");
32317
32478
  if (this.apiClient.isVertexAI()) {
32318
- throw new Error("Vertex AI does not support batches.createEmbeddings.");
32479
+ throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.");
32319
32480
  }
32320
32481
  return this.createEmbeddingsInternal(params);
32321
32482
  };
@@ -32390,7 +32551,7 @@ var Batches = class extends BaseModule {
32390
32551
  } else if (bigqueryUri) {
32391
32552
  newConfig.dest = `${bigqueryUri}_dest_${timestampStr}`;
32392
32553
  } else {
32393
- throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.");
32554
+ throw new Error("Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.");
32394
32555
  }
32395
32556
  }
32396
32557
  return newConfig;
@@ -32781,6 +32942,24 @@ function contentToMldev$3(fromObject) {
32781
32942
  }
32782
32943
  return toObject;
32783
32944
  }
32945
+ function contentToVertex$2(fromObject) {
32946
+ const toObject = {};
32947
+ const fromParts = getValueByPath(fromObject, ["parts"]);
32948
+ if (fromParts != null) {
32949
+ let transformedList = fromParts;
32950
+ if (Array.isArray(transformedList)) {
32951
+ transformedList = transformedList.map((item) => {
32952
+ return partToVertex$2(item);
32953
+ });
32954
+ }
32955
+ setValueByPath(toObject, ["parts"], transformedList);
32956
+ }
32957
+ const fromRole = getValueByPath(fromObject, ["role"]);
32958
+ if (fromRole != null) {
32959
+ setValueByPath(toObject, ["role"], fromRole);
32960
+ }
32961
+ return toObject;
32962
+ }
32784
32963
  function createCachedContentConfigToMldev(fromObject, parentObject) {
32785
32964
  const toObject = {};
32786
32965
  const fromTtl = getValueByPath(fromObject, ["ttl"]);
@@ -32849,7 +33028,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
32849
33028
  let transformedList = tContents(fromContents);
32850
33029
  if (Array.isArray(transformedList)) {
32851
33030
  transformedList = transformedList.map((item) => {
32852
- return item;
33031
+ return contentToVertex$2(item);
32853
33032
  });
32854
33033
  }
32855
33034
  setValueByPath(parentObject, ["contents"], transformedList);
@@ -32858,7 +33037,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
32858
33037
  "systemInstruction"
32859
33038
  ]);
32860
33039
  if (parentObject !== void 0 && fromSystemInstruction != null) {
32861
- setValueByPath(parentObject, ["systemInstruction"], tContent(fromSystemInstruction));
33040
+ setValueByPath(parentObject, ["systemInstruction"], contentToVertex$2(tContent(fromSystemInstruction)));
32862
33041
  }
32863
33042
  const fromTools = getValueByPath(fromObject, ["tools"]);
32864
33043
  if (parentObject !== void 0 && fromTools != null) {
@@ -32872,7 +33051,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
32872
33051
  }
32873
33052
  const fromToolConfig = getValueByPath(fromObject, ["toolConfig"]);
32874
33053
  if (parentObject !== void 0 && fromToolConfig != null) {
32875
- setValueByPath(parentObject, ["toolConfig"], fromToolConfig);
33054
+ setValueByPath(parentObject, ["toolConfig"], toolConfigToVertex$1(fromToolConfig));
32876
33055
  }
32877
33056
  const fromKmsKeyName = getValueByPath(fromObject, ["kmsKeyName"]);
32878
33057
  if (parentObject !== void 0 && fromKmsKeyName != null) {
@@ -33025,7 +33204,7 @@ function functionDeclarationToVertex$2(fromObject) {
33025
33204
  setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
33026
33205
  }
33027
33206
  if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
33028
- throw new Error("behavior parameter is not supported in Vertex AI.");
33207
+ throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33029
33208
  }
33030
33209
  return toObject;
33031
33210
  }
@@ -33231,6 +33410,87 @@ function partToMldev$3(fromObject) {
33231
33410
  if (fromVideoMetadata != null) {
33232
33411
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
33233
33412
  }
33413
+ const fromToolCall = getValueByPath(fromObject, ["toolCall"]);
33414
+ if (fromToolCall != null) {
33415
+ setValueByPath(toObject, ["toolCall"], fromToolCall);
33416
+ }
33417
+ const fromToolResponse = getValueByPath(fromObject, ["toolResponse"]);
33418
+ if (fromToolResponse != null) {
33419
+ setValueByPath(toObject, ["toolResponse"], fromToolResponse);
33420
+ }
33421
+ const fromPartMetadata = getValueByPath(fromObject, ["partMetadata"]);
33422
+ if (fromPartMetadata != null) {
33423
+ setValueByPath(toObject, ["partMetadata"], fromPartMetadata);
33424
+ }
33425
+ return toObject;
33426
+ }
33427
+ function partToVertex$2(fromObject) {
33428
+ const toObject = {};
33429
+ const fromMediaResolution = getValueByPath(fromObject, [
33430
+ "mediaResolution"
33431
+ ]);
33432
+ if (fromMediaResolution != null) {
33433
+ setValueByPath(toObject, ["mediaResolution"], fromMediaResolution);
33434
+ }
33435
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
33436
+ "codeExecutionResult"
33437
+ ]);
33438
+ if (fromCodeExecutionResult != null) {
33439
+ setValueByPath(toObject, ["codeExecutionResult"], fromCodeExecutionResult);
33440
+ }
33441
+ const fromExecutableCode = getValueByPath(fromObject, [
33442
+ "executableCode"
33443
+ ]);
33444
+ if (fromExecutableCode != null) {
33445
+ setValueByPath(toObject, ["executableCode"], fromExecutableCode);
33446
+ }
33447
+ const fromFileData = getValueByPath(fromObject, ["fileData"]);
33448
+ if (fromFileData != null) {
33449
+ setValueByPath(toObject, ["fileData"], fromFileData);
33450
+ }
33451
+ const fromFunctionCall = getValueByPath(fromObject, ["functionCall"]);
33452
+ if (fromFunctionCall != null) {
33453
+ setValueByPath(toObject, ["functionCall"], fromFunctionCall);
33454
+ }
33455
+ const fromFunctionResponse = getValueByPath(fromObject, [
33456
+ "functionResponse"
33457
+ ]);
33458
+ if (fromFunctionResponse != null) {
33459
+ setValueByPath(toObject, ["functionResponse"], fromFunctionResponse);
33460
+ }
33461
+ const fromInlineData = getValueByPath(fromObject, ["inlineData"]);
33462
+ if (fromInlineData != null) {
33463
+ setValueByPath(toObject, ["inlineData"], fromInlineData);
33464
+ }
33465
+ const fromText = getValueByPath(fromObject, ["text"]);
33466
+ if (fromText != null) {
33467
+ setValueByPath(toObject, ["text"], fromText);
33468
+ }
33469
+ const fromThought = getValueByPath(fromObject, ["thought"]);
33470
+ if (fromThought != null) {
33471
+ setValueByPath(toObject, ["thought"], fromThought);
33472
+ }
33473
+ const fromThoughtSignature = getValueByPath(fromObject, [
33474
+ "thoughtSignature"
33475
+ ]);
33476
+ if (fromThoughtSignature != null) {
33477
+ setValueByPath(toObject, ["thoughtSignature"], fromThoughtSignature);
33478
+ }
33479
+ const fromVideoMetadata = getValueByPath(fromObject, [
33480
+ "videoMetadata"
33481
+ ]);
33482
+ if (fromVideoMetadata != null) {
33483
+ setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
33484
+ }
33485
+ if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
33486
+ throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33487
+ }
33488
+ if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
33489
+ throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33490
+ }
33491
+ if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
33492
+ throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33493
+ }
33234
33494
  return toObject;
33235
33495
  }
33236
33496
  function toolConfigToMldev$1(fromObject) {
@@ -33247,6 +33507,29 @@ function toolConfigToMldev$1(fromObject) {
33247
33507
  if (fromFunctionCallingConfig != null) {
33248
33508
  setValueByPath(toObject, ["functionCallingConfig"], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
33249
33509
  }
33510
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ["includeServerSideToolInvocations"]);
33511
+ if (fromIncludeServerSideToolInvocations != null) {
33512
+ setValueByPath(toObject, ["includeServerSideToolInvocations"], fromIncludeServerSideToolInvocations);
33513
+ }
33514
+ return toObject;
33515
+ }
33516
+ function toolConfigToVertex$1(fromObject) {
33517
+ const toObject = {};
33518
+ const fromRetrievalConfig = getValueByPath(fromObject, [
33519
+ "retrievalConfig"
33520
+ ]);
33521
+ if (fromRetrievalConfig != null) {
33522
+ setValueByPath(toObject, ["retrievalConfig"], fromRetrievalConfig);
33523
+ }
33524
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
33525
+ "functionCallingConfig"
33526
+ ]);
33527
+ if (fromFunctionCallingConfig != null) {
33528
+ setValueByPath(toObject, ["functionCallingConfig"], fromFunctionCallingConfig);
33529
+ }
33530
+ if (getValueByPath(fromObject, ["includeServerSideToolInvocations"]) !== void 0) {
33531
+ throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33532
+ }
33250
33533
  return toObject;
33251
33534
  }
33252
33535
  function toolToMldev$3(fromObject) {
@@ -33327,7 +33610,7 @@ function toolToVertex$2(fromObject) {
33327
33610
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
33328
33611
  }
33329
33612
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
33330
- throw new Error("fileSearch parameter is not supported in Vertex AI.");
33613
+ throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33331
33614
  }
33332
33615
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
33333
33616
  if (fromGoogleSearch != null) {
@@ -33378,7 +33661,7 @@ function toolToVertex$2(fromObject) {
33378
33661
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
33379
33662
  }
33380
33663
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
33381
- throw new Error("mcpServers parameter is not supported in Vertex AI.");
33664
+ throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
33382
33665
  }
33383
33666
  return toObject;
33384
33667
  }
@@ -33444,7 +33727,7 @@ var Caches = class extends BaseModule {
33444
33727
  * @remarks
33445
33728
  * Context caching is only supported for specific models. See [Gemini
33446
33729
  * Developer API reference](https://ai.google.dev/gemini-api/docs/caching?lang=node/context-cac)
33447
- * and [Vertex AI reference](https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview#supported_models)
33730
+ * and [Gemini Enterprise Agent Platform reference](https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview#supported_models)
33448
33731
  * for more information.
33449
33732
  *
33450
33733
  * @param params - The parameters for the create request.
@@ -34253,7 +34536,7 @@ var Files = class extends BaseModule {
34253
34536
  }
34254
34537
  /**
34255
34538
  * Uploads a file asynchronously to the Gemini API.
34256
- * This method is not available in Vertex AI.
34539
+ * This method is not available in Gemini Enterprise Agent Platform (previously known as Vertex AI).
34257
34540
  * Supported upload sources:
34258
34541
  * - Node.js: File path (string) or Blob object.
34259
34542
  * - Browser: Blob object (e.g., File).
@@ -34279,7 +34562,7 @@ var Files = class extends BaseModule {
34279
34562
  * @see {@link types.UploadFileParameters#config} for the optional
34280
34563
  * config in the parameters.
34281
34564
  * @return A promise that resolves to a `types.File` object.
34282
- * @throws An error if called on a Vertex AI client.
34565
+ * @throws An error if called on a Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
34283
34566
  * @throws An error if the `mimeType` is not provided and can not be inferred,
34284
34567
  * the `mimeType` can be provided in the `params.config` parameter.
34285
34568
  * @throws An error occurs if a suitable upload location cannot be established.
@@ -34296,7 +34579,7 @@ var Files = class extends BaseModule {
34296
34579
  */
34297
34580
  async upload(params) {
34298
34581
  if (this.apiClient.isVertexAI()) {
34299
- throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");
34582
+ throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.");
34300
34583
  }
34301
34584
  return this.apiClient.uploadFile(params.file, params.config).then((resp) => {
34302
34585
  return resp;
@@ -34590,6 +34873,24 @@ function contentToMldev$2(fromObject) {
34590
34873
  }
34591
34874
  return toObject;
34592
34875
  }
34876
+ function contentToVertex$1(fromObject) {
34877
+ const toObject = {};
34878
+ const fromParts = getValueByPath(fromObject, ["parts"]);
34879
+ if (fromParts != null) {
34880
+ let transformedList = fromParts;
34881
+ if (Array.isArray(transformedList)) {
34882
+ transformedList = transformedList.map((item) => {
34883
+ return partToVertex$1(item);
34884
+ });
34885
+ }
34886
+ setValueByPath(toObject, ["parts"], transformedList);
34887
+ }
34888
+ const fromRole = getValueByPath(fromObject, ["role"]);
34889
+ if (fromRole != null) {
34890
+ setValueByPath(toObject, ["role"], fromRole);
34891
+ }
34892
+ return toObject;
34893
+ }
34593
34894
  function fileDataToMldev$2(fromObject) {
34594
34895
  const toObject = {};
34595
34896
  if (getValueByPath(fromObject, ["displayName"]) !== void 0) {
@@ -34658,7 +34959,7 @@ function functionDeclarationToVertex$1(fromObject) {
34658
34959
  setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
34659
34960
  }
34660
34961
  if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
34661
- throw new Error("behavior parameter is not supported in Vertex AI.");
34962
+ throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
34662
34963
  }
34663
34964
  return toObject;
34664
34965
  }
@@ -34785,7 +35086,7 @@ function generationConfigToVertex$1(fromObject) {
34785
35086
  setValueByPath(toObject, ["topP"], fromTopP);
34786
35087
  }
34787
35088
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
34788
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");
35089
+ throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
34789
35090
  }
34790
35091
  return toObject;
34791
35092
  }
@@ -34932,6 +35233,22 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
34932
35233
  if (getValueByPath(fromObject, ["explicitVadSignal"]) !== void 0) {
34933
35234
  throw new Error("explicitVadSignal parameter is not supported in Gemini API.");
34934
35235
  }
35236
+ const fromAvatarConfig = getValueByPath(fromObject, ["avatarConfig"]);
35237
+ if (parentObject !== void 0 && fromAvatarConfig != null) {
35238
+ setValueByPath(parentObject, ["setup", "avatarConfig"], fromAvatarConfig);
35239
+ }
35240
+ const fromSafetySettings = getValueByPath(fromObject, [
35241
+ "safetySettings"
35242
+ ]);
35243
+ if (parentObject !== void 0 && fromSafetySettings != null) {
35244
+ let transformedList = fromSafetySettings;
35245
+ if (Array.isArray(transformedList)) {
35246
+ transformedList = transformedList.map((item) => {
35247
+ return safetySettingToMldev$2(item);
35248
+ });
35249
+ }
35250
+ setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
35251
+ }
34935
35252
  return toObject;
34936
35253
  }
34937
35254
  function liveConnectConfigToVertex(fromObject, parentObject) {
@@ -34996,7 +35313,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
34996
35313
  "systemInstruction"
34997
35314
  ]);
34998
35315
  if (parentObject !== void 0 && fromSystemInstruction != null) {
34999
- setValueByPath(parentObject, ["setup", "systemInstruction"], tContent(fromSystemInstruction));
35316
+ setValueByPath(parentObject, ["setup", "systemInstruction"], contentToVertex$1(tContent(fromSystemInstruction)));
35000
35317
  }
35001
35318
  const fromTools = getValueByPath(fromObject, ["tools"]);
35002
35319
  if (parentObject !== void 0 && fromTools != null) {
@@ -35048,6 +35365,22 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
35048
35365
  if (parentObject !== void 0 && fromExplicitVadSignal != null) {
35049
35366
  setValueByPath(parentObject, ["setup", "explicitVadSignal"], fromExplicitVadSignal);
35050
35367
  }
35368
+ const fromAvatarConfig = getValueByPath(fromObject, ["avatarConfig"]);
35369
+ if (parentObject !== void 0 && fromAvatarConfig != null) {
35370
+ setValueByPath(parentObject, ["setup", "avatarConfig"], fromAvatarConfig);
35371
+ }
35372
+ const fromSafetySettings = getValueByPath(fromObject, [
35373
+ "safetySettings"
35374
+ ]);
35375
+ if (parentObject !== void 0 && fromSafetySettings != null) {
35376
+ let transformedList = fromSafetySettings;
35377
+ if (Array.isArray(transformedList)) {
35378
+ transformedList = transformedList.map((item) => {
35379
+ return item;
35380
+ });
35381
+ }
35382
+ setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
35383
+ }
35051
35384
  return toObject;
35052
35385
  }
35053
35386
  function liveConnectParametersToMldev(apiClient, fromObject) {
@@ -35296,6 +35629,102 @@ function partToMldev$2(fromObject) {
35296
35629
  if (fromVideoMetadata != null) {
35297
35630
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
35298
35631
  }
35632
+ const fromToolCall = getValueByPath(fromObject, ["toolCall"]);
35633
+ if (fromToolCall != null) {
35634
+ setValueByPath(toObject, ["toolCall"], fromToolCall);
35635
+ }
35636
+ const fromToolResponse = getValueByPath(fromObject, ["toolResponse"]);
35637
+ if (fromToolResponse != null) {
35638
+ setValueByPath(toObject, ["toolResponse"], fromToolResponse);
35639
+ }
35640
+ const fromPartMetadata = getValueByPath(fromObject, ["partMetadata"]);
35641
+ if (fromPartMetadata != null) {
35642
+ setValueByPath(toObject, ["partMetadata"], fromPartMetadata);
35643
+ }
35644
+ return toObject;
35645
+ }
35646
+ function partToVertex$1(fromObject) {
35647
+ const toObject = {};
35648
+ const fromMediaResolution = getValueByPath(fromObject, [
35649
+ "mediaResolution"
35650
+ ]);
35651
+ if (fromMediaResolution != null) {
35652
+ setValueByPath(toObject, ["mediaResolution"], fromMediaResolution);
35653
+ }
35654
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
35655
+ "codeExecutionResult"
35656
+ ]);
35657
+ if (fromCodeExecutionResult != null) {
35658
+ setValueByPath(toObject, ["codeExecutionResult"], fromCodeExecutionResult);
35659
+ }
35660
+ const fromExecutableCode = getValueByPath(fromObject, [
35661
+ "executableCode"
35662
+ ]);
35663
+ if (fromExecutableCode != null) {
35664
+ setValueByPath(toObject, ["executableCode"], fromExecutableCode);
35665
+ }
35666
+ const fromFileData = getValueByPath(fromObject, ["fileData"]);
35667
+ if (fromFileData != null) {
35668
+ setValueByPath(toObject, ["fileData"], fromFileData);
35669
+ }
35670
+ const fromFunctionCall = getValueByPath(fromObject, ["functionCall"]);
35671
+ if (fromFunctionCall != null) {
35672
+ setValueByPath(toObject, ["functionCall"], fromFunctionCall);
35673
+ }
35674
+ const fromFunctionResponse = getValueByPath(fromObject, [
35675
+ "functionResponse"
35676
+ ]);
35677
+ if (fromFunctionResponse != null) {
35678
+ setValueByPath(toObject, ["functionResponse"], fromFunctionResponse);
35679
+ }
35680
+ const fromInlineData = getValueByPath(fromObject, ["inlineData"]);
35681
+ if (fromInlineData != null) {
35682
+ setValueByPath(toObject, ["inlineData"], fromInlineData);
35683
+ }
35684
+ const fromText = getValueByPath(fromObject, ["text"]);
35685
+ if (fromText != null) {
35686
+ setValueByPath(toObject, ["text"], fromText);
35687
+ }
35688
+ const fromThought = getValueByPath(fromObject, ["thought"]);
35689
+ if (fromThought != null) {
35690
+ setValueByPath(toObject, ["thought"], fromThought);
35691
+ }
35692
+ const fromThoughtSignature = getValueByPath(fromObject, [
35693
+ "thoughtSignature"
35694
+ ]);
35695
+ if (fromThoughtSignature != null) {
35696
+ setValueByPath(toObject, ["thoughtSignature"], fromThoughtSignature);
35697
+ }
35698
+ const fromVideoMetadata = getValueByPath(fromObject, [
35699
+ "videoMetadata"
35700
+ ]);
35701
+ if (fromVideoMetadata != null) {
35702
+ setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
35703
+ }
35704
+ if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
35705
+ throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
35706
+ }
35707
+ if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
35708
+ throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
35709
+ }
35710
+ if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
35711
+ throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
35712
+ }
35713
+ return toObject;
35714
+ }
35715
+ function safetySettingToMldev$2(fromObject) {
35716
+ const toObject = {};
35717
+ const fromCategory = getValueByPath(fromObject, ["category"]);
35718
+ if (fromCategory != null) {
35719
+ setValueByPath(toObject, ["category"], fromCategory);
35720
+ }
35721
+ if (getValueByPath(fromObject, ["method"]) !== void 0) {
35722
+ throw new Error("method parameter is not supported in Gemini API.");
35723
+ }
35724
+ const fromThreshold = getValueByPath(fromObject, ["threshold"]);
35725
+ if (fromThreshold != null) {
35726
+ setValueByPath(toObject, ["threshold"], fromThreshold);
35727
+ }
35299
35728
  return toObject;
35300
35729
  }
35301
35730
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -35387,7 +35816,7 @@ function toolToVertex$1(fromObject) {
35387
35816
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
35388
35817
  }
35389
35818
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
35390
- throw new Error("fileSearch parameter is not supported in Vertex AI.");
35819
+ throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
35391
35820
  }
35392
35821
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
35393
35822
  if (fromGoogleSearch != null) {
@@ -35438,7 +35867,7 @@ function toolToVertex$1(fromObject) {
35438
35867
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
35439
35868
  }
35440
35869
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
35441
- throw new Error("mcpServers parameter is not supported in Vertex AI.");
35870
+ throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
35442
35871
  }
35443
35872
  return toObject;
35444
35873
  }
@@ -35657,7 +36086,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
35657
36086
  }
35658
36087
  return toObject;
35659
36088
  }
35660
- function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
36089
+ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
35661
36090
  const toObject = {};
35662
36091
  const fromModel = getValueByPath(fromObject, ["model"]);
35663
36092
  if (fromModel != null) {
@@ -35668,7 +36097,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
35668
36097
  let transformedList = tContents(fromContents);
35669
36098
  if (Array.isArray(transformedList)) {
35670
36099
  transformedList = transformedList.map((item) => {
35671
- return item;
36100
+ return contentToVertex(item);
35672
36101
  });
35673
36102
  }
35674
36103
  setValueByPath(toObject, ["contents"], transformedList);
@@ -35737,6 +36166,24 @@ function contentToMldev$1(fromObject, rootObject) {
35737
36166
  }
35738
36167
  return toObject;
35739
36168
  }
36169
+ function contentToVertex(fromObject, rootObject) {
36170
+ const toObject = {};
36171
+ const fromParts = getValueByPath(fromObject, ["parts"]);
36172
+ if (fromParts != null) {
36173
+ let transformedList = fromParts;
36174
+ if (Array.isArray(transformedList)) {
36175
+ transformedList = transformedList.map((item) => {
36176
+ return partToVertex(item);
36177
+ });
36178
+ }
36179
+ setValueByPath(toObject, ["parts"], transformedList);
36180
+ }
36181
+ const fromRole = getValueByPath(fromObject, ["role"]);
36182
+ if (fromRole != null) {
36183
+ setValueByPath(toObject, ["role"], fromRole);
36184
+ }
36185
+ return toObject;
36186
+ }
35740
36187
  function controlReferenceConfigToVertex(fromObject, _rootObject) {
35741
36188
  const toObject = {};
35742
36189
  const fromControlType = getValueByPath(fromObject, ["controlType"]);
@@ -35770,7 +36217,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
35770
36217
  "systemInstruction"
35771
36218
  ]);
35772
36219
  if (parentObject !== void 0 && fromSystemInstruction != null) {
35773
- setValueByPath(parentObject, ["systemInstruction"], tContent(fromSystemInstruction));
36220
+ setValueByPath(parentObject, ["systemInstruction"], contentToVertex(tContent(fromSystemInstruction)));
35774
36221
  }
35775
36222
  const fromTools = getValueByPath(fromObject, ["tools"]);
35776
36223
  if (parentObject !== void 0 && fromTools != null) {
@@ -35823,7 +36270,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
35823
36270
  let transformedList = tContents(fromContents);
35824
36271
  if (Array.isArray(transformedList)) {
35825
36272
  transformedList = transformedList.map((item) => {
35826
- return item;
36273
+ return contentToVertex(item);
35827
36274
  });
35828
36275
  }
35829
36276
  setValueByPath(toObject, ["contents"], transformedList);
@@ -36066,6 +36513,12 @@ function embedContentConfigToMldev(fromObject, parentObject, _rootObject) {
36066
36513
  if (getValueByPath(fromObject, ["autoTruncate"]) !== void 0) {
36067
36514
  throw new Error("autoTruncate parameter is not supported in Gemini API.");
36068
36515
  }
36516
+ if (getValueByPath(fromObject, ["documentOcr"]) !== void 0) {
36517
+ throw new Error("documentOcr parameter is not supported in Gemini API.");
36518
+ }
36519
+ if (getValueByPath(fromObject, ["audioTrackExtraction"]) !== void 0) {
36520
+ throw new Error("audioTrackExtraction parameter is not supported in Gemini API.");
36521
+ }
36069
36522
  return toObject;
36070
36523
  }
36071
36524
  function embedContentConfigToVertex(fromObject, parentObject, rootObject) {
@@ -36084,7 +36537,7 @@ function embedContentConfigToVertex(fromObject, parentObject, rootObject) {
36084
36537
  } else if (discriminatorTaskType === "EMBED_CONTENT") {
36085
36538
  const fromTaskType = getValueByPath(fromObject, ["taskType"]);
36086
36539
  if (parentObject !== void 0 && fromTaskType != null) {
36087
- setValueByPath(parentObject, ["taskType"], fromTaskType);
36540
+ setValueByPath(parentObject, ["embedContentConfig", "taskType"], fromTaskType);
36088
36541
  }
36089
36542
  }
36090
36543
  let discriminatorTitle = getValueByPath(rootObject, [
@@ -36101,7 +36554,7 @@ function embedContentConfigToVertex(fromObject, parentObject, rootObject) {
36101
36554
  } else if (discriminatorTitle === "EMBED_CONTENT") {
36102
36555
  const fromTitle = getValueByPath(fromObject, ["title"]);
36103
36556
  if (parentObject !== void 0 && fromTitle != null) {
36104
- setValueByPath(parentObject, ["title"], fromTitle);
36557
+ setValueByPath(parentObject, ["embedContentConfig", "title"], fromTitle);
36105
36558
  }
36106
36559
  }
36107
36560
  let discriminatorOutputDimensionality = getValueByPath(rootObject, [
@@ -36122,7 +36575,7 @@ function embedContentConfigToVertex(fromObject, parentObject, rootObject) {
36122
36575
  "outputDimensionality"
36123
36576
  ]);
36124
36577
  if (parentObject !== void 0 && fromOutputDimensionality != null) {
36125
- setValueByPath(parentObject, ["outputDimensionality"], fromOutputDimensionality);
36578
+ setValueByPath(parentObject, ["embedContentConfig", "outputDimensionality"], fromOutputDimensionality);
36126
36579
  }
36127
36580
  }
36128
36581
  let discriminatorMimeType = getValueByPath(rootObject, [
@@ -36155,7 +36608,33 @@ function embedContentConfigToVertex(fromObject, parentObject, rootObject) {
36155
36608
  "autoTruncate"
36156
36609
  ]);
36157
36610
  if (parentObject !== void 0 && fromAutoTruncate != null) {
36158
- setValueByPath(parentObject, ["autoTruncate"], fromAutoTruncate);
36611
+ setValueByPath(parentObject, ["embedContentConfig", "autoTruncate"], fromAutoTruncate);
36612
+ }
36613
+ }
36614
+ let discriminatorDocumentOcr = getValueByPath(rootObject, [
36615
+ "embeddingApiType"
36616
+ ]);
36617
+ if (discriminatorDocumentOcr === void 0) {
36618
+ discriminatorDocumentOcr = "PREDICT";
36619
+ }
36620
+ if (discriminatorDocumentOcr === "EMBED_CONTENT") {
36621
+ const fromDocumentOcr = getValueByPath(fromObject, ["documentOcr"]);
36622
+ if (parentObject !== void 0 && fromDocumentOcr != null) {
36623
+ setValueByPath(parentObject, ["embedContentConfig", "documentOcr"], fromDocumentOcr);
36624
+ }
36625
+ }
36626
+ let discriminatorAudioTrackExtraction = getValueByPath(rootObject, [
36627
+ "embeddingApiType"
36628
+ ]);
36629
+ if (discriminatorAudioTrackExtraction === void 0) {
36630
+ discriminatorAudioTrackExtraction = "PREDICT";
36631
+ }
36632
+ if (discriminatorAudioTrackExtraction === "EMBED_CONTENT") {
36633
+ const fromAudioTrackExtraction = getValueByPath(fromObject, [
36634
+ "audioTrackExtraction"
36635
+ ]);
36636
+ if (parentObject !== void 0 && fromAudioTrackExtraction != null) {
36637
+ setValueByPath(parentObject, ["embedContentConfig", "audioTrackExtraction"], fromAudioTrackExtraction);
36159
36638
  }
36160
36639
  }
36161
36640
  return toObject;
@@ -36223,7 +36702,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
36223
36702
  if (discriminatorContent === "EMBED_CONTENT") {
36224
36703
  const fromContent = getValueByPath(fromObject, ["content"]);
36225
36704
  if (fromContent != null) {
36226
- setValueByPath(toObject, ["content"], tContent(fromContent));
36705
+ setValueByPath(toObject, ["content"], contentToVertex(tContent(fromContent)));
36227
36706
  }
36228
36707
  }
36229
36708
  const fromConfig = getValueByPath(fromObject, ["config"]);
@@ -36398,7 +36877,7 @@ function functionDeclarationToVertex(fromObject, _rootObject) {
36398
36877
  setValueByPath(toObject, ["responseJsonSchema"], fromResponseJsonSchema);
36399
36878
  }
36400
36879
  if (getValueByPath(fromObject, ["behavior"]) !== void 0) {
36401
- throw new Error("behavior parameter is not supported in Vertex AI.");
36880
+ throw new Error("behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
36402
36881
  }
36403
36882
  return toObject;
36404
36883
  }
@@ -36497,7 +36976,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
36497
36976
  let transformedList = fromSafetySettings;
36498
36977
  if (Array.isArray(transformedList)) {
36499
36978
  transformedList = transformedList.map((item) => {
36500
- return safetySettingToMldev(item);
36979
+ return safetySettingToMldev$1(item);
36501
36980
  });
36502
36981
  }
36503
36982
  setValueByPath(parentObject, ["safetySettings"], transformedList);
@@ -36563,6 +37042,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
36563
37042
  if (getValueByPath(fromObject, ["modelArmorConfig"]) !== void 0) {
36564
37043
  throw new Error("modelArmorConfig parameter is not supported in Gemini API.");
36565
37044
  }
37045
+ const fromServiceTier = getValueByPath(fromObject, ["serviceTier"]);
37046
+ if (parentObject !== void 0 && fromServiceTier != null) {
37047
+ setValueByPath(parentObject, ["serviceTier"], fromServiceTier);
37048
+ }
36566
37049
  return toObject;
36567
37050
  }
36568
37051
  function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
@@ -36571,7 +37054,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
36571
37054
  "systemInstruction"
36572
37055
  ]);
36573
37056
  if (parentObject !== void 0 && fromSystemInstruction != null) {
36574
- setValueByPath(parentObject, ["systemInstruction"], tContent(fromSystemInstruction));
37057
+ setValueByPath(parentObject, ["systemInstruction"], contentToVertex(tContent(fromSystemInstruction)));
36575
37058
  }
36576
37059
  const fromTemperature = getValueByPath(fromObject, ["temperature"]);
36577
37060
  if (fromTemperature != null) {
@@ -36683,7 +37166,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
36683
37166
  }
36684
37167
  const fromToolConfig = getValueByPath(fromObject, ["toolConfig"]);
36685
37168
  if (parentObject !== void 0 && fromToolConfig != null) {
36686
- setValueByPath(parentObject, ["toolConfig"], fromToolConfig);
37169
+ setValueByPath(parentObject, ["toolConfig"], toolConfigToVertex(fromToolConfig));
36687
37170
  }
36688
37171
  const fromLabels = getValueByPath(fromObject, ["labels"]);
36689
37172
  if (parentObject !== void 0 && fromLabels != null) {
@@ -36728,7 +37211,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
36728
37211
  setValueByPath(toObject, ["imageConfig"], imageConfigToVertex(fromImageConfig));
36729
37212
  }
36730
37213
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
36731
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");
37214
+ throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
36732
37215
  }
36733
37216
  const fromModelArmorConfig = getValueByPath(fromObject, [
36734
37217
  "modelArmorConfig"
@@ -36736,6 +37219,10 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
36736
37219
  if (parentObject !== void 0 && fromModelArmorConfig != null) {
36737
37220
  setValueByPath(parentObject, ["modelArmorConfig"], fromModelArmorConfig);
36738
37221
  }
37222
+ const fromServiceTier = getValueByPath(fromObject, ["serviceTier"]);
37223
+ if (parentObject !== void 0 && fromServiceTier != null) {
37224
+ setValueByPath(parentObject, ["serviceTier"], fromServiceTier);
37225
+ }
36739
37226
  return toObject;
36740
37227
  }
36741
37228
  function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
@@ -36771,7 +37258,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
36771
37258
  let transformedList = tContents(fromContents);
36772
37259
  if (Array.isArray(transformedList)) {
36773
37260
  transformedList = transformedList.map((item) => {
36774
- return item;
37261
+ return contentToVertex(item);
36775
37262
  });
36776
37263
  }
36777
37264
  setValueByPath(toObject, ["contents"], transformedList);
@@ -36820,6 +37307,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
36820
37307
  if (fromUsageMetadata != null) {
36821
37308
  setValueByPath(toObject, ["usageMetadata"], fromUsageMetadata);
36822
37309
  }
37310
+ const fromModelStatus = getValueByPath(fromObject, ["modelStatus"]);
37311
+ if (fromModelStatus != null) {
37312
+ setValueByPath(toObject, ["modelStatus"], fromModelStatus);
37313
+ }
36823
37314
  return toObject;
36824
37315
  }
36825
37316
  function generateContentResponseFromVertex(fromObject, _rootObject) {
@@ -37205,6 +37696,18 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
37205
37696
  if (getValueByPath(fromObject, ["compressionQuality"]) !== void 0) {
37206
37697
  throw new Error("compressionQuality parameter is not supported in Gemini API.");
37207
37698
  }
37699
+ if (getValueByPath(fromObject, ["labels"]) !== void 0) {
37700
+ throw new Error("labels parameter is not supported in Gemini API.");
37701
+ }
37702
+ const fromWebhookConfig = getValueByPath(fromObject, [
37703
+ "webhookConfig"
37704
+ ]);
37705
+ if (parentObject !== void 0 && fromWebhookConfig != null) {
37706
+ setValueByPath(parentObject, ["webhookConfig"], fromWebhookConfig);
37707
+ }
37708
+ if (getValueByPath(fromObject, ["resizeMode"]) !== void 0) {
37709
+ throw new Error("resizeMode parameter is not supported in Gemini API.");
37710
+ }
37208
37711
  return toObject;
37209
37712
  }
37210
37713
  function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
@@ -37295,6 +37798,17 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
37295
37798
  if (parentObject !== void 0 && fromCompressionQuality != null) {
37296
37799
  setValueByPath(parentObject, ["parameters", "compressionQuality"], fromCompressionQuality);
37297
37800
  }
37801
+ const fromLabels = getValueByPath(fromObject, ["labels"]);
37802
+ if (parentObject !== void 0 && fromLabels != null) {
37803
+ setValueByPath(parentObject, ["labels"], fromLabels);
37804
+ }
37805
+ if (getValueByPath(fromObject, ["webhookConfig"]) !== void 0) {
37806
+ throw new Error("webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
37807
+ }
37808
+ const fromResizeMode = getValueByPath(fromObject, ["resizeMode"]);
37809
+ if (parentObject !== void 0 && fromResizeMode != null) {
37810
+ setValueByPath(parentObject, ["parameters", "resizeMode"], fromResizeMode);
37811
+ }
37298
37812
  return toObject;
37299
37813
  }
37300
37814
  function generateVideosOperationFromMldev(fromObject, rootObject) {
@@ -37687,7 +38201,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
37687
38201
  setValueByPath(toObject, ["topP"], fromTopP);
37688
38202
  }
37689
38203
  if (getValueByPath(fromObject, ["enableEnhancedCivicAnswers"]) !== void 0) {
37690
- throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");
38204
+ throw new Error("enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
37691
38205
  }
37692
38206
  return toObject;
37693
38207
  }
@@ -38089,33 +38603,105 @@ function modelFromVertex(fromObject, rootObject) {
38089
38603
  }
38090
38604
  setValueByPath(toObject, ["endpoints"], transformedList);
38091
38605
  }
38092
- const fromLabels = getValueByPath(fromObject, ["labels"]);
38093
- if (fromLabels != null) {
38094
- setValueByPath(toObject, ["labels"], fromLabels);
38606
+ const fromLabels = getValueByPath(fromObject, ["labels"]);
38607
+ if (fromLabels != null) {
38608
+ setValueByPath(toObject, ["labels"], fromLabels);
38609
+ }
38610
+ const fromTunedModelInfo = getValueByPath(fromObject, ["_self"]);
38611
+ if (fromTunedModelInfo != null) {
38612
+ setValueByPath(toObject, ["tunedModelInfo"], tunedModelInfoFromVertex(fromTunedModelInfo));
38613
+ }
38614
+ const fromDefaultCheckpointId = getValueByPath(fromObject, [
38615
+ "defaultCheckpointId"
38616
+ ]);
38617
+ if (fromDefaultCheckpointId != null) {
38618
+ setValueByPath(toObject, ["defaultCheckpointId"], fromDefaultCheckpointId);
38619
+ }
38620
+ const fromCheckpoints = getValueByPath(fromObject, ["checkpoints"]);
38621
+ if (fromCheckpoints != null) {
38622
+ let transformedList = fromCheckpoints;
38623
+ if (Array.isArray(transformedList)) {
38624
+ transformedList = transformedList.map((item) => {
38625
+ return item;
38626
+ });
38627
+ }
38628
+ setValueByPath(toObject, ["checkpoints"], transformedList);
38629
+ }
38630
+ return toObject;
38631
+ }
38632
+ function partToMldev$1(fromObject, rootObject) {
38633
+ const toObject = {};
38634
+ const fromMediaResolution = getValueByPath(fromObject, [
38635
+ "mediaResolution"
38636
+ ]);
38637
+ if (fromMediaResolution != null) {
38638
+ setValueByPath(toObject, ["mediaResolution"], fromMediaResolution);
38639
+ }
38640
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
38641
+ "codeExecutionResult"
38642
+ ]);
38643
+ if (fromCodeExecutionResult != null) {
38644
+ setValueByPath(toObject, ["codeExecutionResult"], fromCodeExecutionResult);
38645
+ }
38646
+ const fromExecutableCode = getValueByPath(fromObject, [
38647
+ "executableCode"
38648
+ ]);
38649
+ if (fromExecutableCode != null) {
38650
+ setValueByPath(toObject, ["executableCode"], fromExecutableCode);
38651
+ }
38652
+ const fromFileData = getValueByPath(fromObject, ["fileData"]);
38653
+ if (fromFileData != null) {
38654
+ setValueByPath(toObject, ["fileData"], fileDataToMldev$1(fromFileData));
38655
+ }
38656
+ const fromFunctionCall = getValueByPath(fromObject, ["functionCall"]);
38657
+ if (fromFunctionCall != null) {
38658
+ setValueByPath(toObject, ["functionCall"], functionCallToMldev$1(fromFunctionCall));
38659
+ }
38660
+ const fromFunctionResponse = getValueByPath(fromObject, [
38661
+ "functionResponse"
38662
+ ]);
38663
+ if (fromFunctionResponse != null) {
38664
+ setValueByPath(toObject, ["functionResponse"], fromFunctionResponse);
38665
+ }
38666
+ const fromInlineData = getValueByPath(fromObject, ["inlineData"]);
38667
+ if (fromInlineData != null) {
38668
+ setValueByPath(toObject, ["inlineData"], blobToMldev$1(fromInlineData));
38669
+ }
38670
+ const fromText = getValueByPath(fromObject, ["text"]);
38671
+ if (fromText != null) {
38672
+ setValueByPath(toObject, ["text"], fromText);
38673
+ }
38674
+ const fromThought = getValueByPath(fromObject, ["thought"]);
38675
+ if (fromThought != null) {
38676
+ setValueByPath(toObject, ["thought"], fromThought);
38095
38677
  }
38096
- const fromTunedModelInfo = getValueByPath(fromObject, ["_self"]);
38097
- if (fromTunedModelInfo != null) {
38098
- setValueByPath(toObject, ["tunedModelInfo"], tunedModelInfoFromVertex(fromTunedModelInfo));
38678
+ const fromThoughtSignature = getValueByPath(fromObject, [
38679
+ "thoughtSignature"
38680
+ ]);
38681
+ if (fromThoughtSignature != null) {
38682
+ setValueByPath(toObject, ["thoughtSignature"], fromThoughtSignature);
38099
38683
  }
38100
- const fromDefaultCheckpointId = getValueByPath(fromObject, [
38101
- "defaultCheckpointId"
38684
+ const fromVideoMetadata = getValueByPath(fromObject, [
38685
+ "videoMetadata"
38102
38686
  ]);
38103
- if (fromDefaultCheckpointId != null) {
38104
- setValueByPath(toObject, ["defaultCheckpointId"], fromDefaultCheckpointId);
38687
+ if (fromVideoMetadata != null) {
38688
+ setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
38105
38689
  }
38106
- const fromCheckpoints = getValueByPath(fromObject, ["checkpoints"]);
38107
- if (fromCheckpoints != null) {
38108
- let transformedList = fromCheckpoints;
38109
- if (Array.isArray(transformedList)) {
38110
- transformedList = transformedList.map((item) => {
38111
- return item;
38112
- });
38113
- }
38114
- setValueByPath(toObject, ["checkpoints"], transformedList);
38690
+ const fromToolCall = getValueByPath(fromObject, ["toolCall"]);
38691
+ if (fromToolCall != null) {
38692
+ setValueByPath(toObject, ["toolCall"], fromToolCall);
38693
+ }
38694
+ const fromToolResponse = getValueByPath(fromObject, ["toolResponse"]);
38695
+ if (fromToolResponse != null) {
38696
+ setValueByPath(toObject, ["toolResponse"], fromToolResponse);
38697
+ }
38698
+ const fromPartMetadata = getValueByPath(fromObject, ["partMetadata"]);
38699
+ if (fromPartMetadata != null) {
38700
+ setValueByPath(toObject, ["partMetadata"], fromPartMetadata);
38115
38701
  }
38116
38702
  return toObject;
38117
38703
  }
38118
- function partToMldev$1(fromObject, rootObject) {
38704
+ function partToVertex(fromObject, _rootObject) {
38119
38705
  const toObject = {};
38120
38706
  const fromMediaResolution = getValueByPath(fromObject, [
38121
38707
  "mediaResolution"
@@ -38137,11 +38723,11 @@ function partToMldev$1(fromObject, rootObject) {
38137
38723
  }
38138
38724
  const fromFileData = getValueByPath(fromObject, ["fileData"]);
38139
38725
  if (fromFileData != null) {
38140
- setValueByPath(toObject, ["fileData"], fileDataToMldev$1(fromFileData));
38726
+ setValueByPath(toObject, ["fileData"], fromFileData);
38141
38727
  }
38142
38728
  const fromFunctionCall = getValueByPath(fromObject, ["functionCall"]);
38143
38729
  if (fromFunctionCall != null) {
38144
- setValueByPath(toObject, ["functionCall"], functionCallToMldev$1(fromFunctionCall));
38730
+ setValueByPath(toObject, ["functionCall"], fromFunctionCall);
38145
38731
  }
38146
38732
  const fromFunctionResponse = getValueByPath(fromObject, [
38147
38733
  "functionResponse"
@@ -38151,7 +38737,7 @@ function partToMldev$1(fromObject, rootObject) {
38151
38737
  }
38152
38738
  const fromInlineData = getValueByPath(fromObject, ["inlineData"]);
38153
38739
  if (fromInlineData != null) {
38154
- setValueByPath(toObject, ["inlineData"], blobToMldev$1(fromInlineData));
38740
+ setValueByPath(toObject, ["inlineData"], fromInlineData);
38155
38741
  }
38156
38742
  const fromText = getValueByPath(fromObject, ["text"]);
38157
38743
  if (fromText != null) {
@@ -38173,6 +38759,15 @@ function partToMldev$1(fromObject, rootObject) {
38173
38759
  if (fromVideoMetadata != null) {
38174
38760
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
38175
38761
  }
38762
+ if (getValueByPath(fromObject, ["toolCall"]) !== void 0) {
38763
+ throw new Error("toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38764
+ }
38765
+ if (getValueByPath(fromObject, ["toolResponse"]) !== void 0) {
38766
+ throw new Error("toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38767
+ }
38768
+ if (getValueByPath(fromObject, ["partMetadata"]) !== void 0) {
38769
+ throw new Error("partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38770
+ }
38176
38771
  return toObject;
38177
38772
  }
38178
38773
  function productImageToVertex(fromObject, rootObject) {
@@ -38387,7 +38982,7 @@ function safetyAttributesFromVertex(fromObject, _rootObject) {
38387
38982
  }
38388
38983
  return toObject;
38389
38984
  }
38390
- function safetySettingToMldev(fromObject, _rootObject) {
38985
+ function safetySettingToMldev$1(fromObject, _rootObject) {
38391
38986
  const toObject = {};
38392
38987
  const fromCategory = getValueByPath(fromObject, ["category"]);
38393
38988
  if (fromCategory != null) {
@@ -38506,6 +39101,29 @@ function toolConfigToMldev(fromObject, rootObject) {
38506
39101
  if (fromFunctionCallingConfig != null) {
38507
39102
  setValueByPath(toObject, ["functionCallingConfig"], functionCallingConfigToMldev(fromFunctionCallingConfig));
38508
39103
  }
39104
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ["includeServerSideToolInvocations"]);
39105
+ if (fromIncludeServerSideToolInvocations != null) {
39106
+ setValueByPath(toObject, ["includeServerSideToolInvocations"], fromIncludeServerSideToolInvocations);
39107
+ }
39108
+ return toObject;
39109
+ }
39110
+ function toolConfigToVertex(fromObject, _rootObject) {
39111
+ const toObject = {};
39112
+ const fromRetrievalConfig = getValueByPath(fromObject, [
39113
+ "retrievalConfig"
39114
+ ]);
39115
+ if (fromRetrievalConfig != null) {
39116
+ setValueByPath(toObject, ["retrievalConfig"], fromRetrievalConfig);
39117
+ }
39118
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
39119
+ "functionCallingConfig"
39120
+ ]);
39121
+ if (fromFunctionCallingConfig != null) {
39122
+ setValueByPath(toObject, ["functionCallingConfig"], fromFunctionCallingConfig);
39123
+ }
39124
+ if (getValueByPath(fromObject, ["includeServerSideToolInvocations"]) !== void 0) {
39125
+ throw new Error("includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
39126
+ }
38509
39127
  return toObject;
38510
39128
  }
38511
39129
  function toolToMldev$1(fromObject, rootObject) {
@@ -38586,7 +39204,7 @@ function toolToVertex(fromObject, rootObject) {
38586
39204
  setValueByPath(toObject, ["computerUse"], fromComputerUse);
38587
39205
  }
38588
39206
  if (getValueByPath(fromObject, ["fileSearch"]) !== void 0) {
38589
- throw new Error("fileSearch parameter is not supported in Vertex AI.");
39207
+ throw new Error("fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38590
39208
  }
38591
39209
  const fromGoogleSearch = getValueByPath(fromObject, ["googleSearch"]);
38592
39210
  if (fromGoogleSearch != null) {
@@ -38637,7 +39255,7 @@ function toolToVertex(fromObject, rootObject) {
38637
39255
  setValueByPath(toObject, ["urlContext"], fromUrlContext);
38638
39256
  }
38639
39257
  if (getValueByPath(fromObject, ["mcpServers"]) !== void 0) {
38640
- throw new Error("mcpServers parameter is not supported in Vertex AI.");
39258
+ throw new Error("mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
38641
39259
  }
38642
39260
  return toObject;
38643
39261
  }
@@ -39182,10 +39800,11 @@ var CONTENT_TYPE_HEADER = "Content-Type";
39182
39800
  var SERVER_TIMEOUT_HEADER = "X-Server-Timeout";
39183
39801
  var USER_AGENT_HEADER = "User-Agent";
39184
39802
  var GOOGLE_API_CLIENT_HEADER = "x-goog-api-client";
39185
- var SDK_VERSION = "1.45.0";
39803
+ var SDK_VERSION = "1.51.0";
39186
39804
  var LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
39187
39805
  var VERTEX_AI_API_DEFAULT_VERSION = "v1beta1";
39188
39806
  var GOOGLE_AI_API_DEFAULT_VERSION = "v1beta";
39807
+ var MULTI_REGIONAL_LOCATIONS = /* @__PURE__ */ new Set(["us", "eu"]);
39189
39808
  var DEFAULT_RETRY_ATTEMPTS = 5;
39190
39809
  var DEFAULT_RETRY_HTTP_STATUS_CODES = [
39191
39810
  408,
@@ -39230,6 +39849,8 @@ var ApiClient = class {
39230
39849
  this.clientOptions.location = void 0;
39231
39850
  } else if (this.clientOptions.apiKey || this.clientOptions.location === "global") {
39232
39851
  initHttpOptions.baseUrl = "https://aiplatform.googleapis.com/";
39852
+ } else if (this.clientOptions.project && this.clientOptions.location && MULTI_REGIONAL_LOCATIONS.has(this.clientOptions.location)) {
39853
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
39233
39854
  } else if (this.clientOptions.project && this.clientOptions.location) {
39234
39855
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
39235
39856
  }
@@ -40306,7 +40927,7 @@ var Session = class {
40306
40927
  }
40307
40928
  }
40308
40929
  const clientMessage = {
40309
- toolResponse: { functionResponses }
40930
+ toolResponse: { "functionResponses": functionResponses }
40310
40931
  };
40311
40932
  return clientMessage;
40312
40933
  }
@@ -40518,6 +41139,10 @@ var Models = class extends BaseModule {
40518
41139
  this.apiClient = apiClient;
40519
41140
  this.embedContent = async (params) => {
40520
41141
  if (!this.apiClient.isVertexAI()) {
41142
+ const isGeminiEmbedding2Model = params.model.includes("gemini-embedding-2");
41143
+ if (isGeminiEmbedding2Model) {
41144
+ params.contents = tContents(params.contents);
41145
+ }
40521
41146
  return await this.embedContentInternal(params);
40522
41147
  }
40523
41148
  const isVertexEmbedContentModel = params.model.includes("gemini") && params.model !== "gemini-embedding-001" || params.model.includes("maas");
@@ -40643,7 +41268,7 @@ var Models = class extends BaseModule {
40643
41268
  if (this.apiClient.isVertexAI()) {
40644
41269
  if (!actualParams.config.queryBase) {
40645
41270
  if ((_a3 = actualParams.config) === null || _a3 === void 0 ? void 0 : _a3.filter) {
40646
- throw new Error("Filtering tuned models list for Vertex AI is not currently supported");
41271
+ throw new Error("Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported");
40647
41272
  } else {
40648
41273
  actualParams.config.filter = "labels.tune-type:*";
40649
41274
  }
@@ -41196,7 +41821,7 @@ var Models = class extends BaseModule {
41196
41821
  return typedResp;
41197
41822
  });
41198
41823
  } else {
41199
- throw new Error("This method is only supported by the Vertex AI.");
41824
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41200
41825
  }
41201
41826
  }
41202
41827
  /**
@@ -41236,35 +41861,21 @@ var Models = class extends BaseModule {
41236
41861
  return typedResp;
41237
41862
  });
41238
41863
  } else {
41239
- throw new Error("This method is only supported by the Vertex AI.");
41864
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41240
41865
  }
41241
41866
  }
41242
41867
  /**
41243
41868
  * Recontextualizes an image.
41244
41869
  *
41245
- * There are two types of recontextualization currently supported:
41246
- * 1) Imagen Product Recontext - Generate images of products in new scenes
41247
- * and contexts.
41248
- * 2) Virtual Try-On: Generate images of persons modeling fashion products.
41870
+ * There is one type of recontextualization currently supported:
41871
+ * 1) Virtual Try-On: Generate images of persons modeling fashion products.
41249
41872
  *
41250
41873
  * @param params - The parameters for recontextualizing an image.
41251
41874
  * @return The response from the API.
41252
41875
  *
41253
41876
  * @example
41254
41877
  * ```ts
41255
- * const response1 = await ai.models.recontextImage({
41256
- * model: 'imagen-product-recontext-preview-06-30',
41257
- * source: {
41258
- * prompt: 'In a modern kitchen setting.',
41259
- * productImages: [productImage],
41260
- * },
41261
- * config: {
41262
- * numberOfImages: 1,
41263
- * },
41264
- * });
41265
- * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
41266
- *
41267
- * const response2 = await ai.models.recontextImage({
41878
+ * const response = await ai.models.recontextImage({
41268
41879
  * model: 'virtual-try-on-001',
41269
41880
  * source: {
41270
41881
  * personImage: personImage,
@@ -41274,7 +41885,7 @@ var Models = class extends BaseModule {
41274
41885
  * numberOfImages: 1,
41275
41886
  * },
41276
41887
  * });
41277
- * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
41888
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
41278
41889
  * ```
41279
41890
  */
41280
41891
  async recontextImage(params) {
@@ -41305,7 +41916,7 @@ var Models = class extends BaseModule {
41305
41916
  return typedResp;
41306
41917
  });
41307
41918
  } else {
41308
- throw new Error("This method is only supported by the Vertex AI.");
41919
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41309
41920
  }
41310
41921
  }
41311
41922
  /**
@@ -41356,7 +41967,7 @@ var Models = class extends BaseModule {
41356
41967
  return typedResp;
41357
41968
  });
41358
41969
  } else {
41359
- throw new Error("This method is only supported by the Vertex AI.");
41970
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41360
41971
  }
41361
41972
  }
41362
41973
  /**
@@ -41746,7 +42357,7 @@ var Models = class extends BaseModule {
41746
42357
  return typedResp;
41747
42358
  });
41748
42359
  } else {
41749
- throw new Error("This method is only supported by the Vertex AI.");
42360
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41750
42361
  }
41751
42362
  }
41752
42363
  /**
@@ -41949,7 +42560,7 @@ var Operations = class extends BaseModule {
41949
42560
  });
41950
42561
  return response;
41951
42562
  } else {
41952
- throw new Error("This method is only supported by the Vertex AI.");
42563
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
41953
42564
  }
41954
42565
  }
41955
42566
  };
@@ -42237,6 +42848,22 @@ function liveConnectConfigToMldev(fromObject, parentObject) {
42237
42848
  if (getValueByPath(fromObject, ["explicitVadSignal"]) !== void 0) {
42238
42849
  throw new Error("explicitVadSignal parameter is not supported in Gemini API.");
42239
42850
  }
42851
+ const fromAvatarConfig = getValueByPath(fromObject, ["avatarConfig"]);
42852
+ if (parentObject !== void 0 && fromAvatarConfig != null) {
42853
+ setValueByPath(parentObject, ["setup", "avatarConfig"], fromAvatarConfig);
42854
+ }
42855
+ const fromSafetySettings = getValueByPath(fromObject, [
42856
+ "safetySettings"
42857
+ ]);
42858
+ if (parentObject !== void 0 && fromSafetySettings != null) {
42859
+ let transformedList = fromSafetySettings;
42860
+ if (Array.isArray(transformedList)) {
42861
+ transformedList = transformedList.map((item) => {
42862
+ return safetySettingToMldev(item);
42863
+ });
42864
+ }
42865
+ setValueByPath(parentObject, ["setup", "safetySettings"], transformedList);
42866
+ }
42240
42867
  return toObject;
42241
42868
  }
42242
42869
  function liveConnectConstraintsToMldev(apiClient, fromObject) {
@@ -42309,6 +42936,33 @@ function partToMldev(fromObject) {
42309
42936
  if (fromVideoMetadata != null) {
42310
42937
  setValueByPath(toObject, ["videoMetadata"], fromVideoMetadata);
42311
42938
  }
42939
+ const fromToolCall = getValueByPath(fromObject, ["toolCall"]);
42940
+ if (fromToolCall != null) {
42941
+ setValueByPath(toObject, ["toolCall"], fromToolCall);
42942
+ }
42943
+ const fromToolResponse = getValueByPath(fromObject, ["toolResponse"]);
42944
+ if (fromToolResponse != null) {
42945
+ setValueByPath(toObject, ["toolResponse"], fromToolResponse);
42946
+ }
42947
+ const fromPartMetadata = getValueByPath(fromObject, ["partMetadata"]);
42948
+ if (fromPartMetadata != null) {
42949
+ setValueByPath(toObject, ["partMetadata"], fromPartMetadata);
42950
+ }
42951
+ return toObject;
42952
+ }
42953
+ function safetySettingToMldev(fromObject) {
42954
+ const toObject = {};
42955
+ const fromCategory = getValueByPath(fromObject, ["category"]);
42956
+ if (fromCategory != null) {
42957
+ setValueByPath(toObject, ["category"], fromCategory);
42958
+ }
42959
+ if (getValueByPath(fromObject, ["method"]) !== void 0) {
42960
+ throw new Error("method parameter is not supported in Gemini API.");
42961
+ }
42962
+ const fromThreshold = getValueByPath(fromObject, ["threshold"]);
42963
+ if (fromThreshold != null) {
42964
+ setValueByPath(toObject, ["threshold"], fromThreshold);
42965
+ }
42312
42966
  return toObject;
42313
42967
  }
42314
42968
  function sessionResumptionConfigToMldev(fromObject) {
@@ -42779,7 +43433,7 @@ var FileSearchStores = class extends BaseModule {
42779
43433
  }
42780
43434
  /**
42781
43435
  * Uploads a file asynchronously to a given File Search Store.
42782
- * This method is not available in Vertex AI.
43436
+ * This method is not available in Gemini Enterprise Agent Platform (previously known as Vertex AI).
42783
43437
  * Supported upload sources:
42784
43438
  * - Node.js: File path (string) or Blob object.
42785
43439
  * - Browser: Blob object (e.g., File).
@@ -42798,7 +43452,7 @@ var FileSearchStores = class extends BaseModule {
42798
43452
  * @see {@link types.UploadToFileSearchStoreParameters#config} for the optional
42799
43453
  * config in the parameters.
42800
43454
  * @return A promise that resolves to a long running operation.
42801
- * @throws An error if called on a Vertex AI client.
43455
+ * @throws An error if called on a Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
42802
43456
  * @throws An error if the `mimeType` is not provided and can not be inferred,
42803
43457
  * the `mimeType` can be provided in the `params.config` parameter.
42804
43458
  * @throws An error occurs if a suitable upload location cannot be established.
@@ -42815,7 +43469,7 @@ var FileSearchStores = class extends BaseModule {
42815
43469
  */
42816
43470
  async uploadToFileSearchStore(params) {
42817
43471
  if (this.apiClient.isVertexAI()) {
42818
- throw new Error("Vertex AI does not support uploading files to a file search store.");
43472
+ throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files to a file search store.");
42819
43473
  }
42820
43474
  return this.apiClient.uploadFileToFileSearchStore(params.fileSearchStoreName, params.file, params.config);
42821
43475
  }
@@ -43441,7 +44095,8 @@ var BaseInteractions = class extends APIResource {
43441
44095
  return this._client.delete(path`/${api_version}/interactions/${id}`, options);
43442
44096
  }
43443
44097
  /**
43444
- * Cancels an interaction by id. This only applies to background interactions that are still running.
44098
+ * Cancels an interaction by id. This only applies to background interactions that
44099
+ * are still running.
43445
44100
  *
43446
44101
  * @example
43447
44102
  * ```ts
@@ -43463,6 +44118,60 @@ var BaseInteractions = class extends APIResource {
43463
44118
  BaseInteractions._key = Object.freeze(["interactions"]);
43464
44119
  var Interactions = class extends BaseInteractions {
43465
44120
  };
44121
+ var BaseWebhooks = class extends APIResource {
44122
+ /**
44123
+ * Creates a new Webhook.
44124
+ */
44125
+ create(params, options) {
44126
+ const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
44127
+ return this._client.post(path`/${api_version}/webhooks`, Object.assign({ body }, options));
44128
+ }
44129
+ /**
44130
+ * Updates an existing Webhook.
44131
+ */
44132
+ update(id, params = {}, options) {
44133
+ const _a3 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a3, body = __rest(_a3, ["api_version", "update_mask"]);
44134
+ return this._client.patch(path`/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
44135
+ }
44136
+ /**
44137
+ * Lists all Webhooks.
44138
+ */
44139
+ list(params = {}, options) {
44140
+ const _a3 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a3, query = __rest(_a3, ["api_version"]);
44141
+ return this._client.get(path`/${api_version}/webhooks`, Object.assign({ query }, options));
44142
+ }
44143
+ /**
44144
+ * Deletes a Webhook.
44145
+ */
44146
+ delete(id, params = {}, options) {
44147
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
44148
+ return this._client.delete(path`/${api_version}/webhooks/${id}`, options);
44149
+ }
44150
+ /**
44151
+ * Gets a specific Webhook.
44152
+ */
44153
+ get(id, params = {}, options) {
44154
+ const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
44155
+ return this._client.get(path`/${api_version}/webhooks/${id}`, options);
44156
+ }
44157
+ /**
44158
+ * Sends a ping event to a Webhook.
44159
+ */
44160
+ ping(id, params = void 0, options) {
44161
+ const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
44162
+ return this._client.post(path`/${api_version}/webhooks/${id}:ping`, Object.assign({ body }, options));
44163
+ }
44164
+ /**
44165
+ * Generates a new signing secret for a Webhook.
44166
+ */
44167
+ rotateSigningSecret(id, params = {}, options) {
44168
+ const _a3 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a3, body = __rest(_a3, ["api_version"]);
44169
+ return this._client.post(path`/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
44170
+ }
44171
+ };
44172
+ BaseWebhooks._key = Object.freeze(["webhooks"]);
44173
+ var Webhooks = class extends BaseWebhooks {
44174
+ };
43466
44175
  function concatBytes(buffers) {
43467
44176
  let length = 0;
43468
44177
  for (const buffer of buffers) {
@@ -44086,12 +44795,12 @@ var buildHeaders = (newHeaders) => {
44086
44795
  return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
44087
44796
  };
44088
44797
  var readEnv = (env) => {
44089
- var _a3, _b, _c, _d, _e, _f;
44798
+ var _a3, _b, _c, _d, _e;
44090
44799
  if (typeof globalThis.process !== "undefined") {
44091
- return (_c = (_b = (_a3 = globalThis.process.env) === null || _a3 === void 0 ? void 0 : _a3[env]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : void 0;
44800
+ return ((_b = (_a3 = globalThis.process.env) === null || _a3 === void 0 ? void 0 : _a3[env]) === null || _b === void 0 ? void 0 : _b.trim()) || void 0;
44092
44801
  }
44093
44802
  if (typeof globalThis.Deno !== "undefined") {
44094
- return (_f = (_e = (_d = globalThis.Deno.env) === null || _d === void 0 ? void 0 : _d.get) === null || _e === void 0 ? void 0 : _e.call(_d, env)) === null || _f === void 0 ? void 0 : _f.trim();
44803
+ return ((_e = (_d = (_c = globalThis.Deno.env) === null || _c === void 0 ? void 0 : _c.get) === null || _d === void 0 ? void 0 : _d.call(_c, env)) === null || _e === void 0 ? void 0 : _e.trim()) || void 0;
44095
44804
  }
44096
44805
  return void 0;
44097
44806
  };
@@ -44168,7 +44877,7 @@ var BaseGeminiNextGenAPIClient = class _BaseGeminiNextGenAPIClient {
44168
44877
  if (this.apiKey) {
44169
44878
  return buildHeaders([{ "x-goog-api-key": this.apiKey }]);
44170
44879
  }
44171
- if (this.clientAdapter.isVertexAI()) {
44880
+ if (this.clientAdapter && this.clientAdapter.isVertexAI()) {
44172
44881
  return buildHeaders([await this.clientAdapter.getAuthHeaders()]);
44173
44882
  }
44174
44883
  return void 0;
@@ -44474,6 +45183,7 @@ var GeminiNextGenAPIClient = class extends BaseGeminiNextGenAPIClient {
44474
45183
  constructor() {
44475
45184
  super(...arguments);
44476
45185
  this.interactions = new Interactions(this);
45186
+ this.webhooks = new Webhooks(this);
44477
45187
  }
44478
45188
  };
44479
45189
  _a = GeminiNextGenAPIClient;
@@ -44493,6 +45203,7 @@ GeminiNextGenAPIClient.PermissionDeniedError = PermissionDeniedError;
44493
45203
  GeminiNextGenAPIClient.UnprocessableEntityError = UnprocessableEntityError;
44494
45204
  GeminiNextGenAPIClient.toFile = toFile;
44495
45205
  GeminiNextGenAPIClient.Interactions = Interactions;
45206
+ GeminiNextGenAPIClient.Webhooks = Webhooks;
44496
45207
  var GOOGLE_API_KEY_HEADER = "x-goog-api-key";
44497
45208
  var REQUIRED_VERTEX_AI_SCOPE = "https://www.googleapis.com/auth/cloud-platform";
44498
45209
  var NodeAuth = class {
@@ -44901,6 +45612,11 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
44901
45612
  if (parentObject !== void 0 && fromTuningMode != null) {
44902
45613
  setValueByPath(parentObject, ["supervisedTuningSpec", "tuningMode"], fromTuningMode);
44903
45614
  }
45615
+ } else if (discriminatorTuningMode === "DISTILLATION") {
45616
+ const fromTuningMode = getValueByPath(fromObject, ["tuningMode"]);
45617
+ if (parentObject !== void 0 && fromTuningMode != null) {
45618
+ setValueByPath(parentObject, ["distillationSpec", "tuningMode"], fromTuningMode);
45619
+ }
44904
45620
  }
44905
45621
  const fromCustomBaseModel = getValueByPath(fromObject, [
44906
45622
  "customBaseModel"
@@ -44920,6 +45636,11 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
44920
45636
  if (parentObject !== void 0 && fromBatchSize != null) {
44921
45637
  setValueByPath(parentObject, ["supervisedTuningSpec", "hyperParameters", "batchSize"], fromBatchSize);
44922
45638
  }
45639
+ } else if (discriminatorBatchSize === "DISTILLATION") {
45640
+ const fromBatchSize = getValueByPath(fromObject, ["batchSize"]);
45641
+ if (parentObject !== void 0 && fromBatchSize != null) {
45642
+ setValueByPath(parentObject, ["distillationSpec", "hyperParameters", "batchSize"], fromBatchSize);
45643
+ }
44923
45644
  }
44924
45645
  let discriminatorLearningRate = getValueByPath(rootObject, [
44925
45646
  "config",
@@ -44935,6 +45656,13 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
44935
45656
  if (parentObject !== void 0 && fromLearningRate != null) {
44936
45657
  setValueByPath(parentObject, ["supervisedTuningSpec", "hyperParameters", "learningRate"], fromLearningRate);
44937
45658
  }
45659
+ } else if (discriminatorLearningRate === "DISTILLATION") {
45660
+ const fromLearningRate = getValueByPath(fromObject, [
45661
+ "learningRate"
45662
+ ]);
45663
+ if (parentObject !== void 0 && fromLearningRate != null) {
45664
+ setValueByPath(parentObject, ["distillationSpec", "hyperParameters", "learningRate"], fromLearningRate);
45665
+ }
44938
45666
  }
44939
45667
  const fromLabels = getValueByPath(fromObject, ["labels"]);
44940
45668
  if (parentObject !== void 0 && fromLabels != null) {
@@ -45038,22 +45766,6 @@ function getTuningJobParametersToVertex(fromObject, _rootObject) {
45038
45766
  }
45039
45767
  return toObject;
45040
45768
  }
45041
- function listTuningJobsConfigToMldev(fromObject, parentObject, _rootObject) {
45042
- const toObject = {};
45043
- const fromPageSize = getValueByPath(fromObject, ["pageSize"]);
45044
- if (parentObject !== void 0 && fromPageSize != null) {
45045
- setValueByPath(parentObject, ["_query", "pageSize"], fromPageSize);
45046
- }
45047
- const fromPageToken = getValueByPath(fromObject, ["pageToken"]);
45048
- if (parentObject !== void 0 && fromPageToken != null) {
45049
- setValueByPath(parentObject, ["_query", "pageToken"], fromPageToken);
45050
- }
45051
- const fromFilter = getValueByPath(fromObject, ["filter"]);
45052
- if (parentObject !== void 0 && fromFilter != null) {
45053
- setValueByPath(parentObject, ["_query", "filter"], fromFilter);
45054
- }
45055
- return toObject;
45056
- }
45057
45769
  function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
45058
45770
  const toObject = {};
45059
45771
  const fromPageSize = getValueByPath(fromObject, ["pageSize"]);
@@ -45070,14 +45782,6 @@ function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
45070
45782
  }
45071
45783
  return toObject;
45072
45784
  }
45073
- function listTuningJobsParametersToMldev(fromObject, rootObject) {
45074
- const toObject = {};
45075
- const fromConfig = getValueByPath(fromObject, ["config"]);
45076
- if (fromConfig != null) {
45077
- listTuningJobsConfigToMldev(fromConfig, toObject);
45078
- }
45079
- return toObject;
45080
- }
45081
45785
  function listTuningJobsParametersToVertex(fromObject, rootObject) {
45082
45786
  const toObject = {};
45083
45787
  const fromConfig = getValueByPath(fromObject, ["config"]);
@@ -45086,32 +45790,6 @@ function listTuningJobsParametersToVertex(fromObject, rootObject) {
45086
45790
  }
45087
45791
  return toObject;
45088
45792
  }
45089
- function listTuningJobsResponseFromMldev(fromObject, rootObject) {
45090
- const toObject = {};
45091
- const fromSdkHttpResponse = getValueByPath(fromObject, [
45092
- "sdkHttpResponse"
45093
- ]);
45094
- if (fromSdkHttpResponse != null) {
45095
- setValueByPath(toObject, ["sdkHttpResponse"], fromSdkHttpResponse);
45096
- }
45097
- const fromNextPageToken = getValueByPath(fromObject, [
45098
- "nextPageToken"
45099
- ]);
45100
- if (fromNextPageToken != null) {
45101
- setValueByPath(toObject, ["nextPageToken"], fromNextPageToken);
45102
- }
45103
- const fromTuningJobs = getValueByPath(fromObject, ["tunedModels"]);
45104
- if (fromTuningJobs != null) {
45105
- let transformedList = fromTuningJobs;
45106
- if (Array.isArray(transformedList)) {
45107
- transformedList = transformedList.map((item) => {
45108
- return tuningJobFromMldev(item);
45109
- });
45110
- }
45111
- setValueByPath(toObject, ["tuningJobs"], transformedList);
45112
- }
45113
- return toObject;
45114
- }
45115
45793
  function listTuningJobsResponseFromVertex(fromObject, rootObject) {
45116
45794
  const toObject = {};
45117
45795
  const fromSdkHttpResponse = getValueByPath(fromObject, [
@@ -45225,7 +45903,7 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
45225
45903
  }
45226
45904
  }
45227
45905
  if (getValueByPath(fromObject, ["examples"]) !== void 0) {
45228
- throw new Error("examples parameter is not supported in Vertex AI.");
45906
+ throw new Error("examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45229
45907
  }
45230
45908
  return toObject;
45231
45909
  }
@@ -45435,6 +46113,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
45435
46113
  if (fromVeoTuningSpec != null) {
45436
46114
  setValueByPath(toObject, ["veoTuningSpec"], fromVeoTuningSpec);
45437
46115
  }
46116
+ const fromDistillationSamplingSpec = getValueByPath(fromObject, [
46117
+ "distillationSamplingSpec"
46118
+ ]);
46119
+ if (fromDistillationSamplingSpec != null) {
46120
+ setValueByPath(toObject, ["distillationSamplingSpec"], fromDistillationSamplingSpec);
46121
+ }
46122
+ const fromTuningJobMetadata = getValueByPath(fromObject, [
46123
+ "tuningJobMetadata"
46124
+ ]);
46125
+ if (fromTuningJobMetadata != null) {
46126
+ setValueByPath(toObject, ["tuningJobMetadata"], fromTuningJobMetadata);
46127
+ }
45438
46128
  return toObject;
45439
46129
  }
45440
46130
  function tuningOperationFromMldev(fromObject, _rootObject) {
@@ -45581,7 +46271,7 @@ var Tunings = class extends BaseModule {
45581
46271
  }
45582
46272
  }
45583
46273
  async listInternal(params) {
45584
- var _a3, _b, _c, _d;
46274
+ var _a3, _b;
45585
46275
  let response;
45586
46276
  let path3 = "";
45587
46277
  let queryParams = {};
@@ -45614,33 +46304,7 @@ var Tunings = class extends BaseModule {
45614
46304
  return typedResp;
45615
46305
  });
45616
46306
  } else {
45617
- const body = listTuningJobsParametersToMldev(params);
45618
- path3 = formatMap("tunedModels", body["_url"]);
45619
- queryParams = body["_query"];
45620
- delete body["_url"];
45621
- delete body["_query"];
45622
- response = this.apiClient.request({
45623
- path: path3,
45624
- queryParams,
45625
- body: JSON.stringify(body),
45626
- httpMethod: "GET",
45627
- httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
45628
- abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal
45629
- }).then((httpResponse) => {
45630
- return httpResponse.json().then((jsonResponse) => {
45631
- const response2 = jsonResponse;
45632
- response2.sdkHttpResponse = {
45633
- headers: httpResponse.headers
45634
- };
45635
- return response2;
45636
- });
45637
- });
45638
- return response.then((apiResponse) => {
45639
- const resp = listTuningJobsResponseFromMldev(apiResponse);
45640
- const typedResp = new ListTuningJobsResponse();
45641
- Object.assign(typedResp, resp);
45642
- return typedResp;
45643
- });
46307
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45644
46308
  }
45645
46309
  }
45646
46310
  /**
@@ -45749,7 +46413,7 @@ var Tunings = class extends BaseModule {
45749
46413
  return resp;
45750
46414
  });
45751
46415
  } else {
45752
- throw new Error("This method is only supported by the Vertex AI.");
46416
+ throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).");
45753
46417
  }
45754
46418
  }
45755
46419
  async tuneMldevInternal(params) {
@@ -45793,18 +46457,18 @@ var MAX_RETRY_COUNT = 3;
45793
46457
  var INITIAL_RETRY_DELAY_MS = 1e3;
45794
46458
  var DELAY_MULTIPLIER = 2;
45795
46459
  var X_GOOG_UPLOAD_STATUS_HEADER_FIELD = "x-goog-upload-status";
45796
- async function uploadBlob(file2, uploadUrl, apiClient) {
46460
+ async function uploadBlob(file2, uploadUrl, apiClient, httpOptions) {
45797
46461
  var _a3;
45798
- const response = await uploadBlobInternal(file2, uploadUrl, apiClient);
46462
+ const response = await uploadBlobInternal(file2, uploadUrl, apiClient, httpOptions);
45799
46463
  const responseJson = await (response === null || response === void 0 ? void 0 : response.json());
45800
46464
  if (((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "final") {
45801
46465
  throw new Error("Failed to upload file: Upload status is not finalized.");
45802
46466
  }
45803
46467
  return responseJson["file"];
45804
46468
  }
45805
- async function uploadBlobToFileSearchStore(file2, uploadUrl, apiClient) {
46469
+ async function uploadBlobToFileSearchStore(file2, uploadUrl, apiClient, httpOptions) {
45806
46470
  var _a3;
45807
- const response = await uploadBlobInternal(file2, uploadUrl, apiClient);
46471
+ const response = await uploadBlobInternal(file2, uploadUrl, apiClient, httpOptions);
45808
46472
  const responseJson = await (response === null || response === void 0 ? void 0 : response.json());
45809
46473
  if (((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "final") {
45810
46474
  throw new Error("Failed to upload file: Upload status is not finalized.");
@@ -45814,8 +46478,18 @@ async function uploadBlobToFileSearchStore(file2, uploadUrl, apiClient) {
45814
46478
  Object.assign(typedResp, resp);
45815
46479
  return typedResp;
45816
46480
  }
45817
- async function uploadBlobInternal(file2, uploadUrl, apiClient) {
45818
- var _a3, _b;
46481
+ async function uploadBlobInternal(file2, uploadUrl, apiClient, httpOptions) {
46482
+ var _a3, _b, _c;
46483
+ let finalUrl = uploadUrl;
46484
+ const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a3 = apiClient.clientOptions.httpOptions) === null || _a3 === void 0 ? void 0 : _a3.baseUrl);
46485
+ if (effectiveBaseUrl) {
46486
+ const baseUri = new URL(effectiveBaseUrl);
46487
+ const uploadUri = new URL(uploadUrl);
46488
+ uploadUri.protocol = baseUri.protocol;
46489
+ uploadUri.host = baseUri.host;
46490
+ uploadUri.port = baseUri.port;
46491
+ finalUrl = uploadUri.toString();
46492
+ }
45819
46493
  let fileSize = 0;
45820
46494
  let offset = 0;
45821
46495
  let response = new HttpResponse(new Response());
@@ -45830,21 +46504,14 @@ async function uploadBlobInternal(file2, uploadUrl, apiClient) {
45830
46504
  let retryCount = 0;
45831
46505
  let currentDelayMs = INITIAL_RETRY_DELAY_MS;
45832
46506
  while (retryCount < MAX_RETRY_COUNT) {
46507
+ const mergedHeaders = Object.assign(Object.assign({}, (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.headers) || {}), { "X-Goog-Upload-Command": uploadCommand, "X-Goog-Upload-Offset": String(offset), "Content-Length": String(chunkSize) });
45833
46508
  response = await apiClient.request({
45834
46509
  path: "",
45835
46510
  body: chunk,
45836
46511
  httpMethod: "POST",
45837
- httpOptions: {
45838
- apiVersion: "",
45839
- baseUrl: uploadUrl,
45840
- headers: {
45841
- "X-Goog-Upload-Command": uploadCommand,
45842
- "X-Goog-Upload-Offset": String(offset),
45843
- "Content-Length": String(chunkSize)
45844
- }
45845
- }
46512
+ httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: "", baseUrl: finalUrl, headers: mergedHeaders })
45846
46513
  });
45847
- if ((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
46514
+ if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
45848
46515
  break;
45849
46516
  }
45850
46517
  retryCount++;
@@ -45852,7 +46519,7 @@ async function uploadBlobInternal(file2, uploadUrl, apiClient) {
45852
46519
  currentDelayMs = currentDelayMs * DELAY_MULTIPLIER;
45853
46520
  }
45854
46521
  offset += chunkSize;
45855
- if (((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "active") {
46522
+ if (((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "active") {
45856
46523
  break;
45857
46524
  }
45858
46525
  if (fileSize <= offset) {
@@ -45880,18 +46547,18 @@ var NodeUploader = class {
45880
46547
  return await getBlobStat(file2);
45881
46548
  }
45882
46549
  }
45883
- async upload(file2, uploadUrl, apiClient) {
46550
+ async upload(file2, uploadUrl, apiClient, httpOptions) {
45884
46551
  if (typeof file2 === "string") {
45885
- return await this.uploadFileFromPath(file2, uploadUrl, apiClient);
46552
+ return await this.uploadFileFromPath(file2, uploadUrl, apiClient, httpOptions);
45886
46553
  } else {
45887
- return uploadBlob(file2, uploadUrl, apiClient);
46554
+ return uploadBlob(file2, uploadUrl, apiClient, httpOptions);
45888
46555
  }
45889
46556
  }
45890
- async uploadToFileSearchStore(file2, uploadUrl, apiClient) {
46557
+ async uploadToFileSearchStore(file2, uploadUrl, apiClient, httpOptions) {
45891
46558
  if (typeof file2 === "string") {
45892
- return await this.uploadFileToFileSearchStoreFromPath(file2, uploadUrl, apiClient);
46559
+ return await this.uploadFileToFileSearchStoreFromPath(file2, uploadUrl, apiClient, httpOptions);
45893
46560
  } else {
45894
- return uploadBlobToFileSearchStore(file2, uploadUrl, apiClient);
46561
+ return uploadBlobToFileSearchStore(file2, uploadUrl, apiClient, httpOptions);
45895
46562
  }
45896
46563
  }
45897
46564
  /**
@@ -45980,18 +46647,18 @@ var NodeUploader = class {
45980
46647
  const mimeType = mimeTypes[fileExtension.toLowerCase()];
45981
46648
  return mimeType;
45982
46649
  }
45983
- async uploadFileFromPath(file2, uploadUrl, apiClient) {
46650
+ async uploadFileFromPath(file2, uploadUrl, apiClient, httpOptions) {
45984
46651
  var _a3;
45985
- const response = await this.uploadFileFromPathInternal(file2, uploadUrl, apiClient);
46652
+ const response = await this.uploadFileFromPathInternal(file2, uploadUrl, apiClient, httpOptions);
45986
46653
  const responseJson = await (response === null || response === void 0 ? void 0 : response.json());
45987
46654
  if (((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "final") {
45988
46655
  throw new Error("Failed to upload file: Upload status is not finalized.");
45989
46656
  }
45990
46657
  return responseJson["file"];
45991
46658
  }
45992
- async uploadFileToFileSearchStoreFromPath(file2, uploadUrl, apiClient) {
46659
+ async uploadFileToFileSearchStoreFromPath(file2, uploadUrl, apiClient, httpOptions) {
45993
46660
  var _a3;
45994
- const response = await this.uploadFileFromPathInternal(file2, uploadUrl, apiClient);
46661
+ const response = await this.uploadFileFromPathInternal(file2, uploadUrl, apiClient, httpOptions);
45995
46662
  const responseJson = await (response === null || response === void 0 ? void 0 : response.json());
45996
46663
  if (((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "final") {
45997
46664
  throw new Error("Failed to upload file: Upload status is not finalized.");
@@ -46001,8 +46668,18 @@ var NodeUploader = class {
46001
46668
  Object.assign(typedResp, resp);
46002
46669
  return typedResp;
46003
46670
  }
46004
- async uploadFileFromPathInternal(file2, uploadUrl, apiClient) {
46005
- var _a3, _b;
46671
+ async uploadFileFromPathInternal(file2, uploadUrl, apiClient, httpOptions) {
46672
+ var _a3, _b, _c;
46673
+ let finalUrl = uploadUrl;
46674
+ const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a3 = apiClient.clientOptions.httpOptions) === null || _a3 === void 0 ? void 0 : _a3.baseUrl);
46675
+ if (effectiveBaseUrl) {
46676
+ const baseUri = new URL(effectiveBaseUrl);
46677
+ const uploadUri = new URL(uploadUrl);
46678
+ uploadUri.protocol = baseUri.protocol;
46679
+ uploadUri.host = baseUri.host;
46680
+ uploadUri.port = baseUri.port;
46681
+ finalUrl = uploadUri.toString();
46682
+ }
46006
46683
  let fileSize = 0;
46007
46684
  let offset = 0;
46008
46685
  let response = new HttpResponse(new Response());
@@ -46029,22 +46706,14 @@ var NodeUploader = class {
46029
46706
  let retryCount = 0;
46030
46707
  let currentDelayMs = INITIAL_RETRY_DELAY_MS;
46031
46708
  while (retryCount < MAX_RETRY_COUNT) {
46709
+ const mergedHeaders = Object.assign(Object.assign({}, (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.headers) || {}), { "X-Goog-Upload-Command": uploadCommand, "X-Goog-Upload-Offset": String(offset), "Content-Length": String(bytesRead), "X-Goog-Upload-File-Name": fileName });
46032
46710
  response = await apiClient.request({
46033
46711
  path: "",
46034
46712
  body: chunk,
46035
46713
  httpMethod: "POST",
46036
- httpOptions: {
46037
- apiVersion: "",
46038
- baseUrl: uploadUrl,
46039
- headers: {
46040
- "X-Goog-Upload-Command": uploadCommand,
46041
- "X-Goog-Upload-Offset": String(offset),
46042
- "Content-Length": String(bytesRead),
46043
- "X-Goog-Upload-File-Name": fileName
46044
- }
46045
- }
46714
+ httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: "", baseUrl: finalUrl, headers: mergedHeaders })
46046
46715
  });
46047
- if ((_a3 = response === null || response === void 0 ? void 0 : response.headers) === null || _a3 === void 0 ? void 0 : _a3[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
46716
+ if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
46048
46717
  break;
46049
46718
  }
46050
46719
  retryCount++;
@@ -46052,7 +46721,7 @@ var NodeUploader = class {
46052
46721
  currentDelayMs = currentDelayMs * DELAY_MULTIPLIER;
46053
46722
  }
46054
46723
  offset += bytesRead;
46055
- if (((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "active") {
46724
+ if (((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== "active") {
46056
46725
  break;
46057
46726
  }
46058
46727
  if (fileSize <= offset) {
@@ -46099,46 +46768,81 @@ var NodeFiles = class extends Files {
46099
46768
  }
46100
46769
  };
46101
46770
  var LANGUAGE_LABEL_PREFIX = "gl-node/";
46771
+ function resolveCloudFlag(options) {
46772
+ var _a3;
46773
+ if (options.enterprise !== void 0 || options.vertexai !== void 0) {
46774
+ if (options.enterprise !== void 0 && options.vertexai !== void 0 && options.enterprise !== options.vertexai) {
46775
+ throw new Error("enterprise and vertexAI flags have conflicting values, please set enterprise value only.");
46776
+ }
46777
+ return (_a3 = options.enterprise) !== null && _a3 !== void 0 ? _a3 : options.vertexai;
46778
+ }
46779
+ const envEnterpriseStr = getEnv("GOOGLE_GENAI_USE_ENTERPRISE");
46780
+ const envVertexaiStr = getEnv("GOOGLE_GENAI_USE_VERTEXAI");
46781
+ const useEnterpriseEnv = stringToBoolean(envEnterpriseStr);
46782
+ const useVertexaiEnv = stringToBoolean(envVertexaiStr);
46783
+ if (envEnterpriseStr !== void 0 && envVertexaiStr !== void 0 && useEnterpriseEnv !== useVertexaiEnv) {
46784
+ console.warn("Warning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used.");
46785
+ }
46786
+ if (envEnterpriseStr !== void 0) {
46787
+ return useEnterpriseEnv;
46788
+ }
46789
+ if (envVertexaiStr !== void 0) {
46790
+ return useVertexaiEnv;
46791
+ }
46792
+ return false;
46793
+ }
46102
46794
  var GoogleGenAI = class {
46103
- get interactions() {
46795
+ getNextGenClient() {
46104
46796
  var _a3;
46105
- if (this._interactions !== void 0) {
46106
- return this._interactions;
46107
- }
46108
- console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");
46109
46797
  const httpOpts = this.httpOptions;
46798
+ if (this._nextGenClient === void 0) {
46799
+ this._nextGenClient = new GeminiNextGenAPIClient({
46800
+ baseURL: this.apiClient.getBaseUrl(),
46801
+ apiKey: this.apiKey,
46802
+ apiVersion: this.apiClient.getApiVersion(),
46803
+ clientAdapter: this.apiClient,
46804
+ defaultHeaders: this.apiClient.getDefaultHeaders(),
46805
+ timeout: httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.timeout,
46806
+ maxRetries: (_a3 = httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.retryOptions) === null || _a3 === void 0 ? void 0 : _a3.attempts
46807
+ });
46808
+ }
46110
46809
  if (httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.extraBody) {
46111
46810
  console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");
46112
46811
  }
46113
- const nextGenClient = new GeminiNextGenAPIClient({
46114
- baseURL: this.apiClient.getBaseUrl(),
46115
- apiKey: this.apiKey,
46116
- apiVersion: this.apiClient.getApiVersion(),
46117
- clientAdapter: this.apiClient,
46118
- defaultHeaders: this.apiClient.getDefaultHeaders(),
46119
- timeout: httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.timeout,
46120
- maxRetries: (_a3 = httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.retryOptions) === null || _a3 === void 0 ? void 0 : _a3.attempts
46121
- });
46122
- this._interactions = nextGenClient.interactions;
46812
+ return this._nextGenClient;
46813
+ }
46814
+ get interactions() {
46815
+ if (this._interactions !== void 0) {
46816
+ return this._interactions;
46817
+ }
46818
+ console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");
46819
+ this._interactions = this.getNextGenClient().interactions;
46123
46820
  return this._interactions;
46124
46821
  }
46822
+ get webhooks() {
46823
+ if (this._webhooks !== void 0) {
46824
+ return this._webhooks;
46825
+ }
46826
+ this._webhooks = this.getNextGenClient().webhooks;
46827
+ return this._webhooks;
46828
+ }
46125
46829
  constructor(options) {
46126
- var _a3, _b, _c, _d, _e, _f;
46830
+ var _a3, _b, _c, _d;
46127
46831
  if ((options.project || options.location) && options.apiKey) {
46128
46832
  throw new Error("Project/location and API key are mutually exclusive in the client initializer.");
46129
46833
  }
46130
- this.vertexai = (_b = (_a3 = options.vertexai) !== null && _a3 !== void 0 ? _a3 : getBooleanEnv("GOOGLE_GENAI_USE_VERTEXAI")) !== null && _b !== void 0 ? _b : false;
46834
+ this.vertexai = resolveCloudFlag(options);
46131
46835
  const envApiKey = getApiKeyFromEnv();
46132
46836
  const envProject = getEnv("GOOGLE_CLOUD_PROJECT");
46133
46837
  const envLocation = getEnv("GOOGLE_CLOUD_LOCATION");
46134
- this.apiKey = (_c = options.apiKey) !== null && _c !== void 0 ? _c : envApiKey;
46135
- this.project = (_d = options.project) !== null && _d !== void 0 ? _d : envProject;
46136
- this.location = (_e = options.location) !== null && _e !== void 0 ? _e : envLocation;
46838
+ this.apiKey = (_a3 = options.apiKey) !== null && _a3 !== void 0 ? _a3 : envApiKey;
46839
+ this.project = (_b = options.project) !== null && _b !== void 0 ? _b : envProject;
46840
+ this.location = (_c = options.location) !== null && _c !== void 0 ? _c : envLocation;
46137
46841
  if (!this.vertexai && !this.apiKey) {
46138
46842
  console.warn("API key should be set when using the Gemini API.");
46139
46843
  }
46140
- if (options.vertexai) {
46141
- if ((_f = options.googleAuthOptions) === null || _f === void 0 ? void 0 : _f.credentials) {
46844
+ if (this.vertexai) {
46845
+ if ((_d = options.googleAuthOptions) === null || _d === void 0 ? void 0 : _d.credentials) {
46142
46846
  console.debug("The user provided Google Cloud credentials will take precedence over the API key from the environment variable.");
46143
46847
  this.apiKey = void 0;
46144
46848
  }
@@ -46157,7 +46861,7 @@ var GoogleGenAI = class {
46157
46861
  this.location = "global";
46158
46862
  }
46159
46863
  }
46160
- const baseUrl = getBaseUrl(options.httpOptions, options.vertexai, getEnv("GOOGLE_VERTEX_BASE_URL"), getEnv("GOOGLE_GEMINI_BASE_URL"));
46864
+ const baseUrl = getBaseUrl(options.httpOptions, this.vertexai, getEnv("GOOGLE_VERTEX_BASE_URL"), getEnv("GOOGLE_GEMINI_BASE_URL"));
46161
46865
  if (baseUrl) {
46162
46866
  if (options.httpOptions) {
46163
46867
  options.httpOptions.baseUrl = baseUrl;
@@ -46199,9 +46903,6 @@ function getEnv(env) {
46199
46903
  var _a3, _b, _c;
46200
46904
  return (_c = (_b = (_a3 = process === null || process === void 0 ? void 0 : process.env) === null || _a3 === void 0 ? void 0 : _a3[env]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : void 0;
46201
46905
  }
46202
- function getBooleanEnv(env) {
46203
- return stringToBoolean(getEnv(env));
46204
- }
46205
46906
  function stringToBoolean(str) {
46206
46907
  if (str === void 0) {
46207
46908
  return false;