@google/genai 1.26.0 → 1.28.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.
@@ -2,9 +2,10 @@
2
2
 
3
3
  var googleAuthLibrary = require('google-auth-library');
4
4
  var fs = require('fs');
5
+ var fs$1 = require('fs/promises');
5
6
  var node_stream = require('node:stream');
7
+ var promises = require('node:stream/promises');
6
8
  var NodeWs = require('ws');
7
- var fs$1 = require('fs/promises');
8
9
 
9
10
  function _interopNamespaceDefault(e) {
10
11
  var n = Object.create(null);
@@ -23,8 +24,8 @@ function _interopNamespaceDefault(e) {
23
24
  return Object.freeze(n);
24
25
  }
25
26
 
26
- var NodeWs__namespace = /*#__PURE__*/_interopNamespaceDefault(NodeWs);
27
27
  var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs$1);
28
+ var NodeWs__namespace = /*#__PURE__*/_interopNamespaceDefault(NodeWs);
28
29
 
29
30
  /**
30
31
  * @license
@@ -528,7 +529,7 @@ function videoFromVertex$1(fromObject) {
528
529
  * Copyright 2025 Google LLC
529
530
  * SPDX-License-Identifier: Apache-2.0
530
531
  */
531
- /** Required. Outcome of the code execution. */
532
+ /** Outcome of the code execution. */
532
533
  exports.Outcome = void 0;
533
534
  (function (Outcome) {
534
535
  /**
@@ -548,7 +549,7 @@ exports.Outcome = void 0;
548
549
  */
549
550
  Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
550
551
  })(exports.Outcome || (exports.Outcome = {}));
551
- /** Required. Programming language of the `code`. */
552
+ /** Programming language of the `code`. */
552
553
  exports.Language = void 0;
553
554
  (function (Language) {
554
555
  /**
@@ -580,7 +581,7 @@ exports.FunctionResponseScheduling = void 0;
580
581
  */
581
582
  FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
582
583
  })(exports.FunctionResponseScheduling || (exports.FunctionResponseScheduling = {}));
583
- /** Optional. The type of the data. */
584
+ /** The type of the data. */
584
585
  exports.Type = void 0;
585
586
  (function (Type) {
586
587
  /**
@@ -616,7 +617,64 @@ exports.Type = void 0;
616
617
  */
617
618
  Type["NULL"] = "NULL";
618
619
  })(exports.Type || (exports.Type = {}));
619
- /** Required. Harm category. */
620
+ /** The mode of the predictor to be used in dynamic retrieval. */
621
+ exports.Mode = void 0;
622
+ (function (Mode) {
623
+ /**
624
+ * Always trigger retrieval.
625
+ */
626
+ Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
627
+ /**
628
+ * Run retrieval only when system decides it is necessary.
629
+ */
630
+ Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
631
+ })(exports.Mode || (exports.Mode = {}));
632
+ /** Type of auth scheme. This enum is not supported in Gemini API. */
633
+ exports.AuthType = void 0;
634
+ (function (AuthType) {
635
+ AuthType["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
636
+ /**
637
+ * No Auth.
638
+ */
639
+ AuthType["NO_AUTH"] = "NO_AUTH";
640
+ /**
641
+ * API Key Auth.
642
+ */
643
+ AuthType["API_KEY_AUTH"] = "API_KEY_AUTH";
644
+ /**
645
+ * HTTP Basic Auth.
646
+ */
647
+ AuthType["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
648
+ /**
649
+ * Google Service Account Auth.
650
+ */
651
+ AuthType["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
652
+ /**
653
+ * OAuth auth.
654
+ */
655
+ AuthType["OAUTH"] = "OAUTH";
656
+ /**
657
+ * OpenID Connect (OIDC) Auth.
658
+ */
659
+ AuthType["OIDC_AUTH"] = "OIDC_AUTH";
660
+ })(exports.AuthType || (exports.AuthType = {}));
661
+ /** The API spec that the external API implements. This enum is not supported in Gemini API. */
662
+ exports.ApiSpec = void 0;
663
+ (function (ApiSpec) {
664
+ /**
665
+ * Unspecified API spec. This value should not be used.
666
+ */
667
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
668
+ /**
669
+ * Simple search API spec.
670
+ */
671
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
672
+ /**
673
+ * Elastic search API spec.
674
+ */
675
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
676
+ })(exports.ApiSpec || (exports.ApiSpec = {}));
677
+ /** Harm category. */
620
678
  exports.HarmCategory = void 0;
621
679
  (function (HarmCategory) {
622
680
  /**
@@ -644,27 +702,27 @@ exports.HarmCategory = void 0;
644
702
  */
645
703
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
646
704
  /**
647
- * The harm category is image hate.
705
+ * The harm category is image hate. This enum value is not supported in Gemini API.
648
706
  */
649
707
  HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
650
708
  /**
651
- * The harm category is image dangerous content.
709
+ * The harm category is image dangerous content. This enum value is not supported in Gemini API.
652
710
  */
653
711
  HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
654
712
  /**
655
- * The harm category is image harassment.
713
+ * The harm category is image harassment. This enum value is not supported in Gemini API.
656
714
  */
657
715
  HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
658
716
  /**
659
- * The harm category is image sexually explicit content.
717
+ * The harm category is image sexually explicit content. This enum value is not supported in Gemini API.
660
718
  */
661
719
  HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
662
720
  /**
663
- * The harm category is for jailbreak prompts.
721
+ * The harm category is for jailbreak prompts. This enum value is not supported in Gemini API.
664
722
  */
665
723
  HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
666
724
  })(exports.HarmCategory || (exports.HarmCategory = {}));
667
- /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
725
+ /** Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. This enum is not supported in Gemini API. */
668
726
  exports.HarmBlockMethod = void 0;
669
727
  (function (HarmBlockMethod) {
670
728
  /**
@@ -680,7 +738,7 @@ exports.HarmBlockMethod = void 0;
680
738
  */
681
739
  HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
682
740
  })(exports.HarmBlockMethod || (exports.HarmBlockMethod = {}));
683
- /** Required. The harm block threshold. */
741
+ /** The harm block threshold. */
684
742
  exports.HarmBlockThreshold = void 0;
685
743
  (function (HarmBlockThreshold) {
686
744
  /**
@@ -708,87 +766,6 @@ exports.HarmBlockThreshold = void 0;
708
766
  */
709
767
  HarmBlockThreshold["OFF"] = "OFF";
710
768
  })(exports.HarmBlockThreshold || (exports.HarmBlockThreshold = {}));
711
- /** The mode of the predictor to be used in dynamic retrieval. */
712
- exports.Mode = void 0;
713
- (function (Mode) {
714
- /**
715
- * Always trigger retrieval.
716
- */
717
- Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
718
- /**
719
- * Run retrieval only when system decides it is necessary.
720
- */
721
- Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
722
- })(exports.Mode || (exports.Mode = {}));
723
- /** Type of auth scheme. */
724
- exports.AuthType = void 0;
725
- (function (AuthType) {
726
- AuthType["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
727
- /**
728
- * No Auth.
729
- */
730
- AuthType["NO_AUTH"] = "NO_AUTH";
731
- /**
732
- * API Key Auth.
733
- */
734
- AuthType["API_KEY_AUTH"] = "API_KEY_AUTH";
735
- /**
736
- * HTTP Basic Auth.
737
- */
738
- AuthType["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
739
- /**
740
- * Google Service Account Auth.
741
- */
742
- AuthType["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
743
- /**
744
- * OAuth auth.
745
- */
746
- AuthType["OAUTH"] = "OAUTH";
747
- /**
748
- * OpenID Connect (OIDC) Auth.
749
- */
750
- AuthType["OIDC_AUTH"] = "OIDC_AUTH";
751
- })(exports.AuthType || (exports.AuthType = {}));
752
- /** The API spec that the external API implements. */
753
- exports.ApiSpec = void 0;
754
- (function (ApiSpec) {
755
- /**
756
- * Unspecified API spec. This value should not be used.
757
- */
758
- ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
759
- /**
760
- * Simple search API spec.
761
- */
762
- ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
763
- /**
764
- * Elastic search API spec.
765
- */
766
- ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
767
- })(exports.ApiSpec || (exports.ApiSpec = {}));
768
- /** Status of the url retrieval. */
769
- exports.UrlRetrievalStatus = void 0;
770
- (function (UrlRetrievalStatus) {
771
- /**
772
- * Default value. This value is unused
773
- */
774
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
775
- /**
776
- * Url retrieval is successful.
777
- */
778
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
779
- /**
780
- * Url retrieval is failed due to error.
781
- */
782
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
783
- /**
784
- * Url retrieval is failed because the content is behind paywall.
785
- */
786
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
787
- /**
788
- * Url retrieval is failed because the content is unsafe.
789
- */
790
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
791
- })(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
792
769
  /** Output only. The reason why the model stopped generating tokens.
793
770
 
794
771
  If empty, the model has not stopped generating the tokens. */
@@ -879,7 +856,7 @@ exports.HarmProbability = void 0;
879
856
  */
880
857
  HarmProbability["HIGH"] = "HIGH";
881
858
  })(exports.HarmProbability || (exports.HarmProbability = {}));
882
- /** Output only. Harm severity levels in the content. */
859
+ /** Output only. Harm severity levels in the content. This enum is not supported in Gemini API. */
883
860
  exports.HarmSeverity = void 0;
884
861
  (function (HarmSeverity) {
885
862
  /**
@@ -903,6 +880,30 @@ exports.HarmSeverity = void 0;
903
880
  */
904
881
  HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
905
882
  })(exports.HarmSeverity || (exports.HarmSeverity = {}));
883
+ /** Status of the url retrieval. */
884
+ exports.UrlRetrievalStatus = void 0;
885
+ (function (UrlRetrievalStatus) {
886
+ /**
887
+ * Default value. This value is unused.
888
+ */
889
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
890
+ /**
891
+ * Url retrieval is successful.
892
+ */
893
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
894
+ /**
895
+ * Url retrieval is failed due to error.
896
+ */
897
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
898
+ /**
899
+ * Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI.
900
+ */
901
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
902
+ /**
903
+ * Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI.
904
+ */
905
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
906
+ })(exports.UrlRetrievalStatus || (exports.UrlRetrievalStatus = {}));
906
907
  /** Output only. The reason why the prompt was blocked. */
907
908
  exports.BlockedReason = void 0;
908
909
  (function (BlockedReason) {
@@ -931,15 +932,15 @@ exports.BlockedReason = void 0;
931
932
  */
932
933
  BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
933
934
  /**
934
- * The prompt was blocked by Model Armor.
935
+ * The prompt was blocked by Model Armor. This enum value is not supported in Gemini API.
935
936
  */
936
937
  BlockedReason["MODEL_ARMOR"] = "MODEL_ARMOR";
937
938
  /**
938
- * The prompt was blocked as a jailbreak attempt.
939
+ * The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API.
939
940
  */
940
941
  BlockedReason["JAILBREAK"] = "JAILBREAK";
941
942
  })(exports.BlockedReason || (exports.BlockedReason = {}));
942
- /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
943
+ /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. This enum is not supported in Gemini API. */
943
944
  exports.TrafficType = void 0;
944
945
  (function (TrafficType) {
945
946
  /**
@@ -995,6 +996,54 @@ exports.MediaResolution = void 0;
995
996
  */
996
997
  MediaResolution["MEDIA_RESOLUTION_HIGH"] = "MEDIA_RESOLUTION_HIGH";
997
998
  })(exports.MediaResolution || (exports.MediaResolution = {}));
999
+ /** Tuning mode. This enum is not supported in Gemini API. */
1000
+ exports.TuningMode = void 0;
1001
+ (function (TuningMode) {
1002
+ /**
1003
+ * Tuning mode is unspecified.
1004
+ */
1005
+ TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
1006
+ /**
1007
+ * Full fine-tuning mode.
1008
+ */
1009
+ TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
1010
+ /**
1011
+ * PEFT adapter tuning mode.
1012
+ */
1013
+ TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
1014
+ })(exports.TuningMode || (exports.TuningMode = {}));
1015
+ /** Adapter size for tuning. This enum is not supported in Gemini API. */
1016
+ exports.AdapterSize = void 0;
1017
+ (function (AdapterSize) {
1018
+ /**
1019
+ * Adapter size is unspecified.
1020
+ */
1021
+ AdapterSize["ADAPTER_SIZE_UNSPECIFIED"] = "ADAPTER_SIZE_UNSPECIFIED";
1022
+ /**
1023
+ * Adapter size 1.
1024
+ */
1025
+ AdapterSize["ADAPTER_SIZE_ONE"] = "ADAPTER_SIZE_ONE";
1026
+ /**
1027
+ * Adapter size 2.
1028
+ */
1029
+ AdapterSize["ADAPTER_SIZE_TWO"] = "ADAPTER_SIZE_TWO";
1030
+ /**
1031
+ * Adapter size 4.
1032
+ */
1033
+ AdapterSize["ADAPTER_SIZE_FOUR"] = "ADAPTER_SIZE_FOUR";
1034
+ /**
1035
+ * Adapter size 8.
1036
+ */
1037
+ AdapterSize["ADAPTER_SIZE_EIGHT"] = "ADAPTER_SIZE_EIGHT";
1038
+ /**
1039
+ * Adapter size 16.
1040
+ */
1041
+ AdapterSize["ADAPTER_SIZE_SIXTEEN"] = "ADAPTER_SIZE_SIXTEEN";
1042
+ /**
1043
+ * Adapter size 32.
1044
+ */
1045
+ AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1046
+ })(exports.AdapterSize || (exports.AdapterSize = {}));
998
1047
  /** Job state. */
999
1048
  exports.JobState = void 0;
1000
1049
  (function (JobState) {
@@ -1047,55 +1096,7 @@ exports.JobState = void 0;
1047
1096
  */
1048
1097
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
1049
1098
  })(exports.JobState || (exports.JobState = {}));
1050
- /** Tuning mode. */
1051
- exports.TuningMode = void 0;
1052
- (function (TuningMode) {
1053
- /**
1054
- * Tuning mode is unspecified.
1055
- */
1056
- TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
1057
- /**
1058
- * Full fine-tuning mode.
1059
- */
1060
- TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
1061
- /**
1062
- * PEFT adapter tuning mode.
1063
- */
1064
- TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
1065
- })(exports.TuningMode || (exports.TuningMode = {}));
1066
- /** Optional. Adapter size for tuning. */
1067
- exports.AdapterSize = void 0;
1068
- (function (AdapterSize) {
1069
- /**
1070
- * Adapter size is unspecified.
1071
- */
1072
- AdapterSize["ADAPTER_SIZE_UNSPECIFIED"] = "ADAPTER_SIZE_UNSPECIFIED";
1073
- /**
1074
- * Adapter size 1.
1075
- */
1076
- AdapterSize["ADAPTER_SIZE_ONE"] = "ADAPTER_SIZE_ONE";
1077
- /**
1078
- * Adapter size 2.
1079
- */
1080
- AdapterSize["ADAPTER_SIZE_TWO"] = "ADAPTER_SIZE_TWO";
1081
- /**
1082
- * Adapter size 4.
1083
- */
1084
- AdapterSize["ADAPTER_SIZE_FOUR"] = "ADAPTER_SIZE_FOUR";
1085
- /**
1086
- * Adapter size 8.
1087
- */
1088
- AdapterSize["ADAPTER_SIZE_EIGHT"] = "ADAPTER_SIZE_EIGHT";
1089
- /**
1090
- * Adapter size 16.
1091
- */
1092
- AdapterSize["ADAPTER_SIZE_SIXTEEN"] = "ADAPTER_SIZE_SIXTEEN";
1093
- /**
1094
- * Adapter size 32.
1095
- */
1096
- AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1097
- })(exports.AdapterSize || (exports.AdapterSize = {}));
1098
- /** Optional. The tuning task. Either I2V or T2V. */
1099
+ /** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
1099
1100
  exports.TuningTask = void 0;
1100
1101
  (function (TuningTask) {
1101
1102
  /**
@@ -1345,6 +1346,18 @@ exports.VideoCompressionQuality = void 0;
1345
1346
  */
1346
1347
  VideoCompressionQuality["LOSSLESS"] = "LOSSLESS";
1347
1348
  })(exports.VideoCompressionQuality || (exports.VideoCompressionQuality = {}));
1349
+ /** Enum representing the tuning method. */
1350
+ exports.TuningMethod = void 0;
1351
+ (function (TuningMethod) {
1352
+ /**
1353
+ * Supervised fine tuning.
1354
+ */
1355
+ TuningMethod["SUPERVISED_FINE_TUNING"] = "SUPERVISED_FINE_TUNING";
1356
+ /**
1357
+ * Preference optimization tuning.
1358
+ */
1359
+ TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
1360
+ })(exports.TuningMethod || (exports.TuningMethod = {}));
1348
1361
  /** State for the lifecycle of a File. */
1349
1362
  exports.FileState = void 0;
1350
1363
  (function (FileState) {
@@ -1772,7 +1785,7 @@ class HttpResponse {
1772
1785
  /** Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. */
1773
1786
  class GenerateContentResponsePromptFeedback {
1774
1787
  }
1775
- /** Usage metadata about response(s). */
1788
+ /** Usage metadata about response(s). This data type is not supported in Gemini API. */
1776
1789
  class GenerateContentResponseUsageMetadata {
1777
1790
  }
1778
1791
  /** Response message for PredictionService.GenerateContent. */
@@ -3364,13 +3377,13 @@ function batchJobSourceToVertex(fromObject) {
3364
3377
  }
3365
3378
  function blobToMldev$4(fromObject) {
3366
3379
  const toObject = {};
3367
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
3368
- throw new Error('displayName parameter is not supported in Gemini API.');
3369
- }
3370
3380
  const fromData = getValueByPath(fromObject, ['data']);
3371
3381
  if (fromData != null) {
3372
3382
  setValueByPath(toObject, ['data'], fromData);
3373
3383
  }
3384
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
3385
+ throw new Error('displayName parameter is not supported in Gemini API.');
3386
+ }
3374
3387
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
3375
3388
  if (fromMimeType != null) {
3376
3389
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -3413,12 +3426,6 @@ function candidateFromMldev$1(fromObject) {
3413
3426
  if (fromFinishReason != null) {
3414
3427
  setValueByPath(toObject, ['finishReason'], fromFinishReason);
3415
3428
  }
3416
- const fromUrlContextMetadata = getValueByPath(fromObject, [
3417
- 'urlContextMetadata',
3418
- ]);
3419
- if (fromUrlContextMetadata != null) {
3420
- setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
3421
- }
3422
3429
  const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
3423
3430
  if (fromAvgLogprobs != null) {
3424
3431
  setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
@@ -3451,6 +3458,12 @@ function candidateFromMldev$1(fromObject) {
3451
3458
  }
3452
3459
  setValueByPath(toObject, ['safetyRatings'], transformedList);
3453
3460
  }
3461
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
3462
+ 'urlContextMetadata',
3463
+ ]);
3464
+ if (fromUrlContextMetadata != null) {
3465
+ setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
3466
+ }
3454
3467
  return toObject;
3455
3468
  }
3456
3469
  function citationMetadataFromMldev$1(fromObject) {
@@ -3919,15 +3932,15 @@ function googleMapsToMldev$4(fromObject) {
3919
3932
  }
3920
3933
  function googleSearchToMldev$4(fromObject) {
3921
3934
  const toObject = {};
3935
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
3936
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
3937
+ }
3922
3938
  const fromTimeRangeFilter = getValueByPath(fromObject, [
3923
3939
  'timeRangeFilter',
3924
3940
  ]);
3925
3941
  if (fromTimeRangeFilter != null) {
3926
3942
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
3927
3943
  }
3928
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
3929
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
3930
- }
3931
3944
  return toObject;
3932
3945
  }
3933
3946
  function inlinedRequestToMldev(apiClient, fromObject) {
@@ -4071,30 +4084,6 @@ function listBatchJobsResponseFromVertex(fromObject) {
4071
4084
  }
4072
4085
  function partToMldev$4(fromObject) {
4073
4086
  const toObject = {};
4074
- const fromVideoMetadata = getValueByPath(fromObject, [
4075
- 'videoMetadata',
4076
- ]);
4077
- if (fromVideoMetadata != null) {
4078
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4079
- }
4080
- const fromThought = getValueByPath(fromObject, ['thought']);
4081
- if (fromThought != null) {
4082
- setValueByPath(toObject, ['thought'], fromThought);
4083
- }
4084
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
4085
- if (fromInlineData != null) {
4086
- setValueByPath(toObject, ['inlineData'], blobToMldev$4(fromInlineData));
4087
- }
4088
- const fromFileData = getValueByPath(fromObject, ['fileData']);
4089
- if (fromFileData != null) {
4090
- setValueByPath(toObject, ['fileData'], fileDataToMldev$4(fromFileData));
4091
- }
4092
- const fromThoughtSignature = getValueByPath(fromObject, [
4093
- 'thoughtSignature',
4094
- ]);
4095
- if (fromThoughtSignature != null) {
4096
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
4097
- }
4098
4087
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
4099
4088
  if (fromFunctionCall != null) {
4100
4089
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -4111,27 +4100,51 @@ function partToMldev$4(fromObject) {
4111
4100
  if (fromExecutableCode != null) {
4112
4101
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
4113
4102
  }
4103
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
4104
+ if (fromFileData != null) {
4105
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$4(fromFileData));
4106
+ }
4114
4107
  const fromFunctionResponse = getValueByPath(fromObject, [
4115
4108
  'functionResponse',
4116
4109
  ]);
4117
4110
  if (fromFunctionResponse != null) {
4118
4111
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
4119
4112
  }
4113
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
4114
+ if (fromInlineData != null) {
4115
+ setValueByPath(toObject, ['inlineData'], blobToMldev$4(fromInlineData));
4116
+ }
4120
4117
  const fromText = getValueByPath(fromObject, ['text']);
4121
4118
  if (fromText != null) {
4122
4119
  setValueByPath(toObject, ['text'], fromText);
4123
4120
  }
4121
+ const fromThought = getValueByPath(fromObject, ['thought']);
4122
+ if (fromThought != null) {
4123
+ setValueByPath(toObject, ['thought'], fromThought);
4124
+ }
4125
+ const fromThoughtSignature = getValueByPath(fromObject, [
4126
+ 'thoughtSignature',
4127
+ ]);
4128
+ if (fromThoughtSignature != null) {
4129
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
4130
+ }
4131
+ const fromVideoMetadata = getValueByPath(fromObject, [
4132
+ 'videoMetadata',
4133
+ ]);
4134
+ if (fromVideoMetadata != null) {
4135
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4136
+ }
4124
4137
  return toObject;
4125
4138
  }
4126
4139
  function safetySettingToMldev$1(fromObject) {
4127
4140
  const toObject = {};
4128
- if (getValueByPath(fromObject, ['method']) !== undefined) {
4129
- throw new Error('method parameter is not supported in Gemini API.');
4130
- }
4131
4141
  const fromCategory = getValueByPath(fromObject, ['category']);
4132
4142
  if (fromCategory != null) {
4133
4143
  setValueByPath(toObject, ['category'], fromCategory);
4134
4144
  }
4145
+ if (getValueByPath(fromObject, ['method']) !== undefined) {
4146
+ throw new Error('method parameter is not supported in Gemini API.');
4147
+ }
4135
4148
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
4136
4149
  if (fromThreshold != null) {
4137
4150
  setValueByPath(toObject, ['threshold'], fromThreshold);
@@ -4155,27 +4168,16 @@ function toolToMldev$4(fromObject) {
4155
4168
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
4156
4169
  throw new Error('retrieval parameter is not supported in Gemini API.');
4157
4170
  }
4158
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
4159
- if (fromGoogleSearch != null) {
4160
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4161
- }
4162
4171
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4163
4172
  'googleSearchRetrieval',
4164
4173
  ]);
4165
4174
  if (fromGoogleSearchRetrieval != null) {
4166
4175
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4167
4176
  }
4168
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4169
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4170
- }
4171
4177
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4172
4178
  if (fromGoogleMaps != null) {
4173
4179
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4174
4180
  }
4175
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4176
- if (fromUrlContext != null) {
4177
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
4178
- }
4179
4181
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4180
4182
  if (fromComputerUse != null) {
4181
4183
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -4186,6 +4188,17 @@ function toolToMldev$4(fromObject) {
4186
4188
  if (fromCodeExecution != null) {
4187
4189
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4188
4190
  }
4191
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4192
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4193
+ }
4194
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
4195
+ if (fromGoogleSearch != null) {
4196
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4197
+ }
4198
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4199
+ if (fromUrlContext != null) {
4200
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
4201
+ }
4189
4202
  return toObject;
4190
4203
  }
4191
4204
 
@@ -4201,6 +4214,8 @@ exports.PagedItem = void 0;
4201
4214
  PagedItem["PAGED_ITEM_TUNING_JOBS"] = "tuningJobs";
4202
4215
  PagedItem["PAGED_ITEM_FILES"] = "files";
4203
4216
  PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
4217
+ PagedItem["PAGED_ITEM_RAG_STORES"] = "ragStores";
4218
+ PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
4204
4219
  })(exports.PagedItem || (exports.PagedItem = {}));
4205
4220
  /**
4206
4221
  * Pager class for iterating through paginated results.
@@ -4881,13 +4896,13 @@ class Batches extends BaseModule {
4881
4896
  */
4882
4897
  function blobToMldev$3(fromObject) {
4883
4898
  const toObject = {};
4884
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4885
- throw new Error('displayName parameter is not supported in Gemini API.');
4886
- }
4887
4899
  const fromData = getValueByPath(fromObject, ['data']);
4888
4900
  if (fromData != null) {
4889
4901
  setValueByPath(toObject, ['data'], fromData);
4890
4902
  }
4903
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4904
+ throw new Error('displayName parameter is not supported in Gemini API.');
4905
+ }
4891
4906
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
4892
4907
  if (fromMimeType != null) {
4893
4908
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -5150,15 +5165,15 @@ function googleMapsToMldev$3(fromObject) {
5150
5165
  }
5151
5166
  function googleSearchToMldev$3(fromObject) {
5152
5167
  const toObject = {};
5168
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5169
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
5170
+ }
5153
5171
  const fromTimeRangeFilter = getValueByPath(fromObject, [
5154
5172
  'timeRangeFilter',
5155
5173
  ]);
5156
5174
  if (fromTimeRangeFilter != null) {
5157
5175
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
5158
5176
  }
5159
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5160
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
5161
- }
5162
5177
  return toObject;
5163
5178
  }
5164
5179
  function listCachedContentsConfigToMldev(fromObject, parentObject) {
@@ -5259,30 +5274,6 @@ function listCachedContentsResponseFromVertex(fromObject) {
5259
5274
  }
5260
5275
  function partToMldev$3(fromObject) {
5261
5276
  const toObject = {};
5262
- const fromVideoMetadata = getValueByPath(fromObject, [
5263
- 'videoMetadata',
5264
- ]);
5265
- if (fromVideoMetadata != null) {
5266
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
5267
- }
5268
- const fromThought = getValueByPath(fromObject, ['thought']);
5269
- if (fromThought != null) {
5270
- setValueByPath(toObject, ['thought'], fromThought);
5271
- }
5272
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
5273
- if (fromInlineData != null) {
5274
- setValueByPath(toObject, ['inlineData'], blobToMldev$3(fromInlineData));
5275
- }
5276
- const fromFileData = getValueByPath(fromObject, ['fileData']);
5277
- if (fromFileData != null) {
5278
- setValueByPath(toObject, ['fileData'], fileDataToMldev$3(fromFileData));
5279
- }
5280
- const fromThoughtSignature = getValueByPath(fromObject, [
5281
- 'thoughtSignature',
5282
- ]);
5283
- if (fromThoughtSignature != null) {
5284
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5285
- }
5286
5277
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
5287
5278
  if (fromFunctionCall != null) {
5288
5279
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -5299,16 +5290,40 @@ function partToMldev$3(fromObject) {
5299
5290
  if (fromExecutableCode != null) {
5300
5291
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
5301
5292
  }
5293
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
5294
+ if (fromFileData != null) {
5295
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$3(fromFileData));
5296
+ }
5302
5297
  const fromFunctionResponse = getValueByPath(fromObject, [
5303
5298
  'functionResponse',
5304
5299
  ]);
5305
5300
  if (fromFunctionResponse != null) {
5306
5301
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
5307
5302
  }
5303
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
5304
+ if (fromInlineData != null) {
5305
+ setValueByPath(toObject, ['inlineData'], blobToMldev$3(fromInlineData));
5306
+ }
5308
5307
  const fromText = getValueByPath(fromObject, ['text']);
5309
5308
  if (fromText != null) {
5310
5309
  setValueByPath(toObject, ['text'], fromText);
5311
5310
  }
5311
+ const fromThought = getValueByPath(fromObject, ['thought']);
5312
+ if (fromThought != null) {
5313
+ setValueByPath(toObject, ['thought'], fromThought);
5314
+ }
5315
+ const fromThoughtSignature = getValueByPath(fromObject, [
5316
+ 'thoughtSignature',
5317
+ ]);
5318
+ if (fromThoughtSignature != null) {
5319
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5320
+ }
5321
+ const fromVideoMetadata = getValueByPath(fromObject, [
5322
+ 'videoMetadata',
5323
+ ]);
5324
+ if (fromVideoMetadata != null) {
5325
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
5326
+ }
5312
5327
  return toObject;
5313
5328
  }
5314
5329
  function toolToMldev$3(fromObject) {
@@ -5328,27 +5343,16 @@ function toolToMldev$3(fromObject) {
5328
5343
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5329
5344
  throw new Error('retrieval parameter is not supported in Gemini API.');
5330
5345
  }
5331
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5332
- if (fromGoogleSearch != null) {
5333
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5334
- }
5335
5346
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5336
5347
  'googleSearchRetrieval',
5337
5348
  ]);
5338
5349
  if (fromGoogleSearchRetrieval != null) {
5339
5350
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5340
5351
  }
5341
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5342
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5343
- }
5344
5352
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5345
5353
  if (fromGoogleMaps != null) {
5346
5354
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5347
5355
  }
5348
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5349
- if (fromUrlContext != null) {
5350
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
5351
- }
5352
5356
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5353
5357
  if (fromComputerUse != null) {
5354
5358
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5359,6 +5363,17 @@ function toolToMldev$3(fromObject) {
5359
5363
  if (fromCodeExecution != null) {
5360
5364
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5361
5365
  }
5366
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5367
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5368
+ }
5369
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5370
+ if (fromGoogleSearch != null) {
5371
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5372
+ }
5373
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5374
+ if (fromUrlContext != null) {
5375
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
5376
+ }
5362
5377
  return toObject;
5363
5378
  }
5364
5379
  function toolToVertex$2(fromObject) {
@@ -5379,30 +5394,16 @@ function toolToVertex$2(fromObject) {
5379
5394
  if (fromRetrieval != null) {
5380
5395
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
5381
5396
  }
5382
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5383
- if (fromGoogleSearch != null) {
5384
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5385
- }
5386
5397
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5387
5398
  'googleSearchRetrieval',
5388
5399
  ]);
5389
5400
  if (fromGoogleSearchRetrieval != null) {
5390
5401
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5391
5402
  }
5392
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
5393
- 'enterpriseWebSearch',
5394
- ]);
5395
- if (fromEnterpriseWebSearch != null) {
5396
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5397
- }
5398
5403
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5399
5404
  if (fromGoogleMaps != null) {
5400
5405
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
5401
5406
  }
5402
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5403
- if (fromUrlContext != null) {
5404
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
5405
- }
5406
5407
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5407
5408
  if (fromComputerUse != null) {
5408
5409
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5413,6 +5414,20 @@ function toolToVertex$2(fromObject) {
5413
5414
  if (fromCodeExecution != null) {
5414
5415
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5415
5416
  }
5417
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
5418
+ 'enterpriseWebSearch',
5419
+ ]);
5420
+ if (fromEnterpriseWebSearch != null) {
5421
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5422
+ }
5423
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5424
+ if (fromGoogleSearch != null) {
5425
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5426
+ }
5427
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5428
+ if (fromUrlContext != null) {
5429
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
5430
+ }
5416
5431
  return toObject;
5417
5432
  }
5418
5433
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -6621,13 +6636,13 @@ class Files extends BaseModule {
6621
6636
  */
6622
6637
  function blobToMldev$2(fromObject) {
6623
6638
  const toObject = {};
6624
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6625
- throw new Error('displayName parameter is not supported in Gemini API.');
6626
- }
6627
6639
  const fromData = getValueByPath(fromObject, ['data']);
6628
6640
  if (fromData != null) {
6629
6641
  setValueByPath(toObject, ['data'], fromData);
6630
6642
  }
6643
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6644
+ throw new Error('displayName parameter is not supported in Gemini API.');
6645
+ }
6631
6646
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6632
6647
  if (fromMimeType != null) {
6633
6648
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -6843,15 +6858,15 @@ function googleMapsToMldev$2(fromObject) {
6843
6858
  }
6844
6859
  function googleSearchToMldev$2(fromObject) {
6845
6860
  const toObject = {};
6861
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6862
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
6863
+ }
6846
6864
  const fromTimeRangeFilter = getValueByPath(fromObject, [
6847
6865
  'timeRangeFilter',
6848
6866
  ]);
6849
6867
  if (fromTimeRangeFilter != null) {
6850
6868
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
6851
6869
  }
6852
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6853
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
6854
- }
6855
6870
  return toObject;
6856
6871
  }
6857
6872
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
@@ -7252,30 +7267,6 @@ function liveServerMessageFromVertex(fromObject) {
7252
7267
  }
7253
7268
  function partToMldev$2(fromObject) {
7254
7269
  const toObject = {};
7255
- const fromVideoMetadata = getValueByPath(fromObject, [
7256
- 'videoMetadata',
7257
- ]);
7258
- if (fromVideoMetadata != null) {
7259
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
7260
- }
7261
- const fromThought = getValueByPath(fromObject, ['thought']);
7262
- if (fromThought != null) {
7263
- setValueByPath(toObject, ['thought'], fromThought);
7264
- }
7265
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7266
- if (fromInlineData != null) {
7267
- setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
7268
- }
7269
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7270
- if (fromFileData != null) {
7271
- setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
7272
- }
7273
- const fromThoughtSignature = getValueByPath(fromObject, [
7274
- 'thoughtSignature',
7275
- ]);
7276
- if (fromThoughtSignature != null) {
7277
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7278
- }
7279
7270
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7280
7271
  if (fromFunctionCall != null) {
7281
7272
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -7292,16 +7283,40 @@ function partToMldev$2(fromObject) {
7292
7283
  if (fromExecutableCode != null) {
7293
7284
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7294
7285
  }
7286
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
7287
+ if (fromFileData != null) {
7288
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
7289
+ }
7295
7290
  const fromFunctionResponse = getValueByPath(fromObject, [
7296
7291
  'functionResponse',
7297
7292
  ]);
7298
7293
  if (fromFunctionResponse != null) {
7299
7294
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7300
7295
  }
7296
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7297
+ if (fromInlineData != null) {
7298
+ setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
7299
+ }
7301
7300
  const fromText = getValueByPath(fromObject, ['text']);
7302
7301
  if (fromText != null) {
7303
7302
  setValueByPath(toObject, ['text'], fromText);
7304
7303
  }
7304
+ const fromThought = getValueByPath(fromObject, ['thought']);
7305
+ if (fromThought != null) {
7306
+ setValueByPath(toObject, ['thought'], fromThought);
7307
+ }
7308
+ const fromThoughtSignature = getValueByPath(fromObject, [
7309
+ 'thoughtSignature',
7310
+ ]);
7311
+ if (fromThoughtSignature != null) {
7312
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7313
+ }
7314
+ const fromVideoMetadata = getValueByPath(fromObject, [
7315
+ 'videoMetadata',
7316
+ ]);
7317
+ if (fromVideoMetadata != null) {
7318
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
7319
+ }
7305
7320
  return toObject;
7306
7321
  }
7307
7322
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7317,6 +7332,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7317
7332
  }
7318
7333
  function speechConfigToVertex$1(fromObject) {
7319
7334
  const toObject = {};
7335
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7336
+ if (fromLanguageCode != null) {
7337
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7338
+ }
7320
7339
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7321
7340
  if (fromVoiceConfig != null) {
7322
7341
  setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
@@ -7324,10 +7343,6 @@ function speechConfigToVertex$1(fromObject) {
7324
7343
  if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7325
7344
  throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7326
7345
  }
7327
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7328
- if (fromLanguageCode != null) {
7329
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7330
- }
7331
7346
  return toObject;
7332
7347
  }
7333
7348
  function toolToMldev$2(fromObject) {
@@ -7347,27 +7362,16 @@ function toolToMldev$2(fromObject) {
7347
7362
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
7348
7363
  throw new Error('retrieval parameter is not supported in Gemini API.');
7349
7364
  }
7350
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7351
- if (fromGoogleSearch != null) {
7352
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
7353
- }
7354
7365
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7355
7366
  'googleSearchRetrieval',
7356
7367
  ]);
7357
7368
  if (fromGoogleSearchRetrieval != null) {
7358
7369
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7359
7370
  }
7360
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7361
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7362
- }
7363
7371
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7364
7372
  if (fromGoogleMaps != null) {
7365
7373
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
7366
7374
  }
7367
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7368
- if (fromUrlContext != null) {
7369
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
7370
- }
7371
7375
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7372
7376
  if (fromComputerUse != null) {
7373
7377
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7378,6 +7382,17 @@ function toolToMldev$2(fromObject) {
7378
7382
  if (fromCodeExecution != null) {
7379
7383
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7380
7384
  }
7385
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7386
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7387
+ }
7388
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7389
+ if (fromGoogleSearch != null) {
7390
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
7391
+ }
7392
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7393
+ if (fromUrlContext != null) {
7394
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
7395
+ }
7381
7396
  return toObject;
7382
7397
  }
7383
7398
  function toolToVertex$1(fromObject) {
@@ -7398,30 +7413,16 @@ function toolToVertex$1(fromObject) {
7398
7413
  if (fromRetrieval != null) {
7399
7414
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
7400
7415
  }
7401
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7402
- if (fromGoogleSearch != null) {
7403
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
7404
- }
7405
7416
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7406
7417
  'googleSearchRetrieval',
7407
7418
  ]);
7408
7419
  if (fromGoogleSearchRetrieval != null) {
7409
7420
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7410
7421
  }
7411
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7412
- 'enterpriseWebSearch',
7413
- ]);
7414
- if (fromEnterpriseWebSearch != null) {
7415
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
7416
- }
7417
7422
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7418
7423
  if (fromGoogleMaps != null) {
7419
7424
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
7420
7425
  }
7421
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7422
- if (fromUrlContext != null) {
7423
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
7424
- }
7425
7426
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7426
7427
  if (fromComputerUse != null) {
7427
7428
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7432,6 +7433,20 @@ function toolToVertex$1(fromObject) {
7432
7433
  if (fromCodeExecution != null) {
7433
7434
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7434
7435
  }
7436
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7437
+ 'enterpriseWebSearch',
7438
+ ]);
7439
+ if (fromEnterpriseWebSearch != null) {
7440
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
7441
+ }
7442
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7443
+ if (fromGoogleSearch != null) {
7444
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
7445
+ }
7446
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7447
+ if (fromUrlContext != null) {
7448
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
7449
+ }
7435
7450
  return toObject;
7436
7451
  }
7437
7452
  function usageMetadataFromVertex(fromObject) {
@@ -7534,13 +7549,13 @@ function usageMetadataFromVertex(fromObject) {
7534
7549
  */
7535
7550
  function blobToMldev$1(fromObject) {
7536
7551
  const toObject = {};
7537
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7538
- throw new Error('displayName parameter is not supported in Gemini API.');
7539
- }
7540
7552
  const fromData = getValueByPath(fromObject, ['data']);
7541
7553
  if (fromData != null) {
7542
7554
  setValueByPath(toObject, ['data'], fromData);
7543
7555
  }
7556
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7557
+ throw new Error('displayName parameter is not supported in Gemini API.');
7558
+ }
7544
7559
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7545
7560
  if (fromMimeType != null) {
7546
7561
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -7567,12 +7582,6 @@ function candidateFromMldev(fromObject) {
7567
7582
  if (fromFinishReason != null) {
7568
7583
  setValueByPath(toObject, ['finishReason'], fromFinishReason);
7569
7584
  }
7570
- const fromUrlContextMetadata = getValueByPath(fromObject, [
7571
- 'urlContextMetadata',
7572
- ]);
7573
- if (fromUrlContextMetadata != null) {
7574
- setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
7575
- }
7576
7585
  const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
7577
7586
  if (fromAvgLogprobs != null) {
7578
7587
  setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
@@ -7605,6 +7614,12 @@ function candidateFromMldev(fromObject) {
7605
7614
  }
7606
7615
  setValueByPath(toObject, ['safetyRatings'], transformedList);
7607
7616
  }
7617
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
7618
+ 'urlContextMetadata',
7619
+ ]);
7620
+ if (fromUrlContextMetadata != null) {
7621
+ setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
7622
+ }
7608
7623
  return toObject;
7609
7624
  }
7610
7625
  function citationMetadataFromMldev(fromObject) {
@@ -9522,15 +9537,15 @@ function googleMapsToMldev$1(fromObject) {
9522
9537
  }
9523
9538
  function googleSearchToMldev$1(fromObject) {
9524
9539
  const toObject = {};
9540
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9541
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
9542
+ }
9525
9543
  const fromTimeRangeFilter = getValueByPath(fromObject, [
9526
9544
  'timeRangeFilter',
9527
9545
  ]);
9528
9546
  if (fromTimeRangeFilter != null) {
9529
9547
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
9530
9548
  }
9531
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9532
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
9533
- }
9534
9549
  return toObject;
9535
9550
  }
9536
9551
  function imageFromMldev(fromObject) {
@@ -9799,51 +9814,27 @@ function modelFromVertex(fromObject) {
9799
9814
  const fromTunedModelInfo = getValueByPath(fromObject, ['_self']);
9800
9815
  if (fromTunedModelInfo != null) {
9801
9816
  setValueByPath(toObject, ['tunedModelInfo'], tunedModelInfoFromVertex(fromTunedModelInfo));
9802
- }
9803
- const fromDefaultCheckpointId = getValueByPath(fromObject, [
9804
- 'defaultCheckpointId',
9805
- ]);
9806
- if (fromDefaultCheckpointId != null) {
9807
- setValueByPath(toObject, ['defaultCheckpointId'], fromDefaultCheckpointId);
9808
- }
9809
- const fromCheckpoints = getValueByPath(fromObject, ['checkpoints']);
9810
- if (fromCheckpoints != null) {
9811
- let transformedList = fromCheckpoints;
9812
- if (Array.isArray(transformedList)) {
9813
- transformedList = transformedList.map((item) => {
9814
- return item;
9815
- });
9816
- }
9817
- setValueByPath(toObject, ['checkpoints'], transformedList);
9818
- }
9819
- return toObject;
9820
- }
9821
- function partToMldev$1(fromObject) {
9822
- const toObject = {};
9823
- const fromVideoMetadata = getValueByPath(fromObject, [
9824
- 'videoMetadata',
9825
- ]);
9826
- if (fromVideoMetadata != null) {
9827
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
9828
- }
9829
- const fromThought = getValueByPath(fromObject, ['thought']);
9830
- if (fromThought != null) {
9831
- setValueByPath(toObject, ['thought'], fromThought);
9832
- }
9833
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9834
- if (fromInlineData != null) {
9835
- setValueByPath(toObject, ['inlineData'], blobToMldev$1(fromInlineData));
9836
- }
9837
- const fromFileData = getValueByPath(fromObject, ['fileData']);
9838
- if (fromFileData != null) {
9839
- setValueByPath(toObject, ['fileData'], fileDataToMldev$1(fromFileData));
9840
- }
9841
- const fromThoughtSignature = getValueByPath(fromObject, [
9842
- 'thoughtSignature',
9817
+ }
9818
+ const fromDefaultCheckpointId = getValueByPath(fromObject, [
9819
+ 'defaultCheckpointId',
9843
9820
  ]);
9844
- if (fromThoughtSignature != null) {
9845
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
9821
+ if (fromDefaultCheckpointId != null) {
9822
+ setValueByPath(toObject, ['defaultCheckpointId'], fromDefaultCheckpointId);
9823
+ }
9824
+ const fromCheckpoints = getValueByPath(fromObject, ['checkpoints']);
9825
+ if (fromCheckpoints != null) {
9826
+ let transformedList = fromCheckpoints;
9827
+ if (Array.isArray(transformedList)) {
9828
+ transformedList = transformedList.map((item) => {
9829
+ return item;
9830
+ });
9831
+ }
9832
+ setValueByPath(toObject, ['checkpoints'], transformedList);
9846
9833
  }
9834
+ return toObject;
9835
+ }
9836
+ function partToMldev$1(fromObject) {
9837
+ const toObject = {};
9847
9838
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
9848
9839
  if (fromFunctionCall != null) {
9849
9840
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -9860,16 +9851,40 @@ function partToMldev$1(fromObject) {
9860
9851
  if (fromExecutableCode != null) {
9861
9852
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
9862
9853
  }
9854
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
9855
+ if (fromFileData != null) {
9856
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$1(fromFileData));
9857
+ }
9863
9858
  const fromFunctionResponse = getValueByPath(fromObject, [
9864
9859
  'functionResponse',
9865
9860
  ]);
9866
9861
  if (fromFunctionResponse != null) {
9867
9862
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
9868
9863
  }
9864
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9865
+ if (fromInlineData != null) {
9866
+ setValueByPath(toObject, ['inlineData'], blobToMldev$1(fromInlineData));
9867
+ }
9869
9868
  const fromText = getValueByPath(fromObject, ['text']);
9870
9869
  if (fromText != null) {
9871
9870
  setValueByPath(toObject, ['text'], fromText);
9872
9871
  }
9872
+ const fromThought = getValueByPath(fromObject, ['thought']);
9873
+ if (fromThought != null) {
9874
+ setValueByPath(toObject, ['thought'], fromThought);
9875
+ }
9876
+ const fromThoughtSignature = getValueByPath(fromObject, [
9877
+ 'thoughtSignature',
9878
+ ]);
9879
+ if (fromThoughtSignature != null) {
9880
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
9881
+ }
9882
+ const fromVideoMetadata = getValueByPath(fromObject, [
9883
+ 'videoMetadata',
9884
+ ]);
9885
+ if (fromVideoMetadata != null) {
9886
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
9887
+ }
9873
9888
  return toObject;
9874
9889
  }
9875
9890
  function productImageToVertex(fromObject) {
@@ -10086,13 +10101,13 @@ function safetyAttributesFromVertex(fromObject) {
10086
10101
  }
10087
10102
  function safetySettingToMldev(fromObject) {
10088
10103
  const toObject = {};
10089
- if (getValueByPath(fromObject, ['method']) !== undefined) {
10090
- throw new Error('method parameter is not supported in Gemini API.');
10091
- }
10092
10104
  const fromCategory = getValueByPath(fromObject, ['category']);
10093
10105
  if (fromCategory != null) {
10094
10106
  setValueByPath(toObject, ['category'], fromCategory);
10095
10107
  }
10108
+ if (getValueByPath(fromObject, ['method']) !== undefined) {
10109
+ throw new Error('method parameter is not supported in Gemini API.');
10110
+ }
10096
10111
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
10097
10112
  if (fromThreshold != null) {
10098
10113
  setValueByPath(toObject, ['threshold'], fromThreshold);
@@ -10191,6 +10206,10 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
10191
10206
  }
10192
10207
  function speechConfigToVertex(fromObject) {
10193
10208
  const toObject = {};
10209
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
10210
+ if (fromLanguageCode != null) {
10211
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
10212
+ }
10194
10213
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
10195
10214
  if (fromVoiceConfig != null) {
10196
10215
  setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
@@ -10198,10 +10217,6 @@ function speechConfigToVertex(fromObject) {
10198
10217
  if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
10199
10218
  throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
10200
10219
  }
10201
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
10202
- if (fromLanguageCode != null) {
10203
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
10204
- }
10205
10220
  return toObject;
10206
10221
  }
10207
10222
  function toolToMldev$1(fromObject) {
@@ -10221,27 +10236,16 @@ function toolToMldev$1(fromObject) {
10221
10236
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
10222
10237
  throw new Error('retrieval parameter is not supported in Gemini API.');
10223
10238
  }
10224
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10225
- if (fromGoogleSearch != null) {
10226
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
10227
- }
10228
10239
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10229
10240
  'googleSearchRetrieval',
10230
10241
  ]);
10231
10242
  if (fromGoogleSearchRetrieval != null) {
10232
10243
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10233
10244
  }
10234
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10235
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10236
- }
10237
10245
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10238
10246
  if (fromGoogleMaps != null) {
10239
10247
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
10240
10248
  }
10241
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10242
- if (fromUrlContext != null) {
10243
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
10244
- }
10245
10249
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10246
10250
  if (fromComputerUse != null) {
10247
10251
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10252,6 +10256,17 @@ function toolToMldev$1(fromObject) {
10252
10256
  if (fromCodeExecution != null) {
10253
10257
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10254
10258
  }
10259
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10260
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10261
+ }
10262
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10263
+ if (fromGoogleSearch != null) {
10264
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
10265
+ }
10266
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10267
+ if (fromUrlContext != null) {
10268
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
10269
+ }
10255
10270
  return toObject;
10256
10271
  }
10257
10272
  function toolToVertex(fromObject) {
@@ -10272,30 +10287,16 @@ function toolToVertex(fromObject) {
10272
10287
  if (fromRetrieval != null) {
10273
10288
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
10274
10289
  }
10275
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10276
- if (fromGoogleSearch != null) {
10277
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
10278
- }
10279
10290
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10280
10291
  'googleSearchRetrieval',
10281
10292
  ]);
10282
10293
  if (fromGoogleSearchRetrieval != null) {
10283
10294
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10284
10295
  }
10285
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
10286
- 'enterpriseWebSearch',
10287
- ]);
10288
- if (fromEnterpriseWebSearch != null) {
10289
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
10290
- }
10291
10296
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10292
10297
  if (fromGoogleMaps != null) {
10293
10298
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
10294
10299
  }
10295
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10296
- if (fromUrlContext != null) {
10297
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
10298
- }
10299
10300
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10300
10301
  if (fromComputerUse != null) {
10301
10302
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10306,6 +10307,20 @@ function toolToVertex(fromObject) {
10306
10307
  if (fromCodeExecution != null) {
10307
10308
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10308
10309
  }
10310
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
10311
+ 'enterpriseWebSearch',
10312
+ ]);
10313
+ if (fromEnterpriseWebSearch != null) {
10314
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
10315
+ }
10316
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10317
+ if (fromGoogleSearch != null) {
10318
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
10319
+ }
10320
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10321
+ if (fromUrlContext != null) {
10322
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
10323
+ }
10309
10324
  return toObject;
10310
10325
  }
10311
10326
  function tunedModelInfoFromMldev(fromObject) {
@@ -10409,6 +10424,18 @@ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
10409
10424
  if (parentObject !== undefined && fromOutputGcsUri != null) {
10410
10425
  setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
10411
10426
  }
10427
+ const fromSafetyFilterLevel = getValueByPath(fromObject, [
10428
+ 'safetyFilterLevel',
10429
+ ]);
10430
+ if (parentObject !== undefined && fromSafetyFilterLevel != null) {
10431
+ setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
10432
+ }
10433
+ const fromPersonGeneration = getValueByPath(fromObject, [
10434
+ 'personGeneration',
10435
+ ]);
10436
+ if (parentObject !== undefined && fromPersonGeneration != null) {
10437
+ setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
10438
+ }
10412
10439
  const fromIncludeRaiReason = getValueByPath(fromObject, [
10413
10440
  'includeRaiReason',
10414
10441
  ]);
@@ -10615,7 +10642,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
10615
10642
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
10616
10643
  const USER_AGENT_HEADER = 'User-Agent';
10617
10644
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
10618
- const SDK_VERSION = '1.26.0'; // x-release-please-version
10645
+ const SDK_VERSION = '1.28.0'; // x-release-please-version
10619
10646
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
10620
10647
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
10621
10648
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10804,7 +10831,7 @@ class ApiClient {
10804
10831
  else {
10805
10832
  requestInit.body = request.body;
10806
10833
  }
10807
- requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, request.abortSignal);
10834
+ requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, url.toString(), request.abortSignal);
10808
10835
  return this.unaryApiCall(url, requestInit, request.httpMethod);
10809
10836
  }
10810
10837
  patchHttpOptions(baseHttpOptions, requestHttpOptions) {
@@ -10838,10 +10865,10 @@ class ApiClient {
10838
10865
  }
10839
10866
  let requestInit = {};
10840
10867
  requestInit.body = request.body;
10841
- requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, request.abortSignal);
10868
+ requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, url.toString(), request.abortSignal);
10842
10869
  return this.streamApiCall(url, requestInit, request.httpMethod);
10843
10870
  }
10844
- async includeExtraHttpOptionsToRequestInit(requestInit, httpOptions, abortSignal) {
10871
+ async includeExtraHttpOptionsToRequestInit(requestInit, httpOptions, url, abortSignal) {
10845
10872
  if ((httpOptions && httpOptions.timeout) || abortSignal) {
10846
10873
  const abortController = new AbortController();
10847
10874
  const signal = abortController.signal;
@@ -10865,7 +10892,7 @@ class ApiClient {
10865
10892
  if (httpOptions && httpOptions.extraBody !== null) {
10866
10893
  includeExtraBodyToRequestInit(requestInit, httpOptions.extraBody);
10867
10894
  }
10868
- requestInit.headers = await this.getHeadersInternal(httpOptions);
10895
+ requestInit.headers = await this.getHeadersInternal(httpOptions, url);
10869
10896
  return requestInit;
10870
10897
  }
10871
10898
  async unaryApiCall(url, requestInit, httpMethod) {
@@ -10978,7 +11005,7 @@ class ApiClient {
10978
11005
  headers[CONTENT_TYPE_HEADER] = 'application/json';
10979
11006
  return headers;
10980
11007
  }
10981
- async getHeadersInternal(httpOptions) {
11008
+ async getHeadersInternal(httpOptions, url) {
10982
11009
  const headers = new Headers();
10983
11010
  if (httpOptions && httpOptions.headers) {
10984
11011
  for (const [key, value] of Object.entries(httpOptions.headers)) {
@@ -10990,7 +11017,7 @@ class ApiClient {
10990
11017
  headers.append(SERVER_TIMEOUT_HEADER, String(Math.ceil(httpOptions.timeout / 1000)));
10991
11018
  }
10992
11019
  }
10993
- await this.clientOptions.auth.addAuthHeaders(headers);
11020
+ await this.clientOptions.auth.addAuthHeaders(headers, url);
10994
11021
  return headers;
10995
11022
  }
10996
11023
  /**
@@ -10999,13 +11026,13 @@ class ApiClient {
10999
11026
  *
11000
11027
  * @param file The string path to the file to be uploaded or a Blob object.
11001
11028
  * @param config Optional parameters specified in the `UploadFileConfig`
11002
- * interface. @see {@link UploadFileConfig}
11029
+ * interface. @see {@link types.UploadFileConfig}
11003
11030
  * @return A promise that resolves to a `File` object.
11004
11031
  * @throws An error if called on a Vertex AI client.
11005
11032
  * @throws An error if the `mimeType` is not provided and can not be inferred,
11006
11033
  */
11007
11034
  async uploadFile(file, config) {
11008
- var _a;
11035
+ var _a, _b;
11009
11036
  const fileToUpload = {};
11010
11037
  if (config != null) {
11011
11038
  fileToUpload.mimeType = config.mimeType;
@@ -11023,20 +11050,25 @@ class ApiClient {
11023
11050
  throw new Error('Can not determine mimeType. Please provide mimeType in the config.');
11024
11051
  }
11025
11052
  fileToUpload.mimeType = mimeType;
11026
- const uploadUrl = await this.fetchUploadUrl(fileToUpload, config);
11053
+ let fileName = '';
11054
+ if (typeof file === 'string') {
11055
+ fileName = file.replace(/[/\\]+$/, '');
11056
+ fileName = (_b = fileName.split(/[/\\]/).pop()) !== null && _b !== void 0 ? _b : '';
11057
+ }
11058
+ const uploadUrl = await this.fetchUploadUrl(fileToUpload, fileName, config);
11027
11059
  return uploader.upload(file, uploadUrl, this);
11028
11060
  }
11029
11061
  /**
11030
11062
  * Downloads a file asynchronously to the specified path.
11031
11063
  *
11032
11064
  * @params params - The parameters for the download request, see {@link
11033
- * DownloadFileParameters}
11065
+ * types.DownloadFileParameters}
11034
11066
  */
11035
11067
  async downloadFile(params) {
11036
11068
  const downloader = this.clientOptions.downloader;
11037
11069
  await downloader.download(params, this);
11038
11070
  }
11039
- async fetchUploadUrl(file, config) {
11071
+ async fetchUploadUrl(file, fileName, config) {
11040
11072
  var _a;
11041
11073
  let httpOptions = {};
11042
11074
  if (config === null || config === void 0 ? void 0 : config.httpOptions) {
@@ -11045,13 +11077,7 @@ class ApiClient {
11045
11077
  else {
11046
11078
  httpOptions = {
11047
11079
  apiVersion: '',
11048
- headers: {
11049
- 'Content-Type': 'application/json',
11050
- 'X-Goog-Upload-Protocol': 'resumable',
11051
- 'X-Goog-Upload-Command': 'start',
11052
- 'X-Goog-Upload-Header-Content-Length': `${file.sizeBytes}`,
11053
- 'X-Goog-Upload-Header-Content-Type': `${file.mimeType}`,
11054
- },
11080
+ headers: Object.assign({ 'Content-Type': 'application/json', 'X-Goog-Upload-Protocol': 'resumable', 'X-Goog-Upload-Command': 'start', 'X-Goog-Upload-Header-Content-Length': `${file.sizeBytes}`, 'X-Goog-Upload-Header-Content-Type': `${file.mimeType}` }, (fileName ? { 'X-Goog-Upload-File-Name': fileName } : {})),
11055
11081
  };
11056
11082
  }
11057
11083
  const body = {
@@ -11703,7 +11729,7 @@ class Live {
11703
11729
  const headers = mapToHeaders(clientHeaders);
11704
11730
  if (this.apiClient.isVertexAI()) {
11705
11731
  url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
11706
- await this.auth.addAuthHeaders(headers);
11732
+ await this.auth.addAuthHeaders(headers, url);
11707
11733
  }
11708
11734
  else {
11709
11735
  const apiKey = this.apiClient.getApiKey();
@@ -13754,13 +13780,13 @@ class Operations extends BaseModule {
13754
13780
  */
13755
13781
  function blobToMldev(fromObject) {
13756
13782
  const toObject = {};
13757
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13758
- throw new Error('displayName parameter is not supported in Gemini API.');
13759
- }
13760
13783
  const fromData = getValueByPath(fromObject, ['data']);
13761
13784
  if (fromData != null) {
13762
13785
  setValueByPath(toObject, ['data'], fromData);
13763
13786
  }
13787
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13788
+ throw new Error('displayName parameter is not supported in Gemini API.');
13789
+ }
13764
13790
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
13765
13791
  if (fromMimeType != null) {
13766
13792
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -13851,15 +13877,15 @@ function googleMapsToMldev(fromObject) {
13851
13877
  }
13852
13878
  function googleSearchToMldev(fromObject) {
13853
13879
  const toObject = {};
13880
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13881
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
13882
+ }
13854
13883
  const fromTimeRangeFilter = getValueByPath(fromObject, [
13855
13884
  'timeRangeFilter',
13856
13885
  ]);
13857
13886
  if (fromTimeRangeFilter != null) {
13858
13887
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
13859
13888
  }
13860
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13861
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
13862
- }
13863
13889
  return toObject;
13864
13890
  }
13865
13891
  function liveConnectConfigToMldev(fromObject, parentObject) {
@@ -13986,30 +14012,6 @@ function liveConnectConstraintsToMldev(apiClient, fromObject) {
13986
14012
  }
13987
14013
  function partToMldev(fromObject) {
13988
14014
  const toObject = {};
13989
- const fromVideoMetadata = getValueByPath(fromObject, [
13990
- 'videoMetadata',
13991
- ]);
13992
- if (fromVideoMetadata != null) {
13993
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
13994
- }
13995
- const fromThought = getValueByPath(fromObject, ['thought']);
13996
- if (fromThought != null) {
13997
- setValueByPath(toObject, ['thought'], fromThought);
13998
- }
13999
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
14000
- if (fromInlineData != null) {
14001
- setValueByPath(toObject, ['inlineData'], blobToMldev(fromInlineData));
14002
- }
14003
- const fromFileData = getValueByPath(fromObject, ['fileData']);
14004
- if (fromFileData != null) {
14005
- setValueByPath(toObject, ['fileData'], fileDataToMldev(fromFileData));
14006
- }
14007
- const fromThoughtSignature = getValueByPath(fromObject, [
14008
- 'thoughtSignature',
14009
- ]);
14010
- if (fromThoughtSignature != null) {
14011
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
14012
- }
14013
14015
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
14014
14016
  if (fromFunctionCall != null) {
14015
14017
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -14026,16 +14028,40 @@ function partToMldev(fromObject) {
14026
14028
  if (fromExecutableCode != null) {
14027
14029
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
14028
14030
  }
14031
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
14032
+ if (fromFileData != null) {
14033
+ setValueByPath(toObject, ['fileData'], fileDataToMldev(fromFileData));
14034
+ }
14029
14035
  const fromFunctionResponse = getValueByPath(fromObject, [
14030
14036
  'functionResponse',
14031
14037
  ]);
14032
14038
  if (fromFunctionResponse != null) {
14033
14039
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
14034
14040
  }
14041
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
14042
+ if (fromInlineData != null) {
14043
+ setValueByPath(toObject, ['inlineData'], blobToMldev(fromInlineData));
14044
+ }
14035
14045
  const fromText = getValueByPath(fromObject, ['text']);
14036
14046
  if (fromText != null) {
14037
14047
  setValueByPath(toObject, ['text'], fromText);
14038
14048
  }
14049
+ const fromThought = getValueByPath(fromObject, ['thought']);
14050
+ if (fromThought != null) {
14051
+ setValueByPath(toObject, ['thought'], fromThought);
14052
+ }
14053
+ const fromThoughtSignature = getValueByPath(fromObject, [
14054
+ 'thoughtSignature',
14055
+ ]);
14056
+ if (fromThoughtSignature != null) {
14057
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
14058
+ }
14059
+ const fromVideoMetadata = getValueByPath(fromObject, [
14060
+ 'videoMetadata',
14061
+ ]);
14062
+ if (fromVideoMetadata != null) {
14063
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
14064
+ }
14039
14065
  return toObject;
14040
14066
  }
14041
14067
  function sessionResumptionConfigToMldev(fromObject) {
@@ -14066,27 +14092,16 @@ function toolToMldev(fromObject) {
14066
14092
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
14067
14093
  throw new Error('retrieval parameter is not supported in Gemini API.');
14068
14094
  }
14069
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
14070
- if (fromGoogleSearch != null) {
14071
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
14072
- }
14073
14095
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14074
14096
  'googleSearchRetrieval',
14075
14097
  ]);
14076
14098
  if (fromGoogleSearchRetrieval != null) {
14077
14099
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14078
14100
  }
14079
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
14080
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
14081
- }
14082
14101
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14083
14102
  if (fromGoogleMaps != null) {
14084
14103
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
14085
14104
  }
14086
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14087
- if (fromUrlContext != null) {
14088
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
14089
- }
14090
14105
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
14091
14106
  if (fromComputerUse != null) {
14092
14107
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -14097,6 +14112,17 @@ function toolToMldev(fromObject) {
14097
14112
  if (fromCodeExecution != null) {
14098
14113
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
14099
14114
  }
14115
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
14116
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
14117
+ }
14118
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
14119
+ if (fromGoogleSearch != null) {
14120
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
14121
+ }
14122
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14123
+ if (fromUrlContext != null) {
14124
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
14125
+ }
14100
14126
  return toObject;
14101
14127
  }
14102
14128
 
@@ -14386,7 +14412,7 @@ class NodeAuth {
14386
14412
  const vertexAuthOptions = buildGoogleAuthOptions(opts.googleAuthOptions);
14387
14413
  this.googleAuth = new googleAuthLibrary.GoogleAuth(vertexAuthOptions);
14388
14414
  }
14389
- async addAuthHeaders(headers) {
14415
+ async addAuthHeaders(headers, url) {
14390
14416
  if (this.apiKey !== undefined) {
14391
14417
  if (this.apiKey.startsWith('auth_tokens/')) {
14392
14418
  throw new Error('Ephemeral tokens are only supported by the live API.');
@@ -14394,7 +14420,7 @@ class NodeAuth {
14394
14420
  this.addKeyHeader(headers);
14395
14421
  return;
14396
14422
  }
14397
- return this.addGoogleAuthHeaders(headers);
14423
+ return this.addGoogleAuthHeaders(headers, url);
14398
14424
  }
14399
14425
  addKeyHeader(headers) {
14400
14426
  if (headers.get(GOOGLE_API_KEY_HEADER) !== null) {
@@ -14407,15 +14433,15 @@ class NodeAuth {
14407
14433
  }
14408
14434
  headers.append(GOOGLE_API_KEY_HEADER, this.apiKey);
14409
14435
  }
14410
- async addGoogleAuthHeaders(headers) {
14436
+ async addGoogleAuthHeaders(headers, url) {
14411
14437
  if (this.googleAuth === undefined) {
14412
14438
  // This should never happen, addGoogleAuthHeaders should only be
14413
14439
  // called when there is no apiKey set and in these cases googleAuth
14414
14440
  // is set.
14415
14441
  throw new Error('Trying to set google-auth headers but googleAuth is unset');
14416
14442
  }
14417
- const authHeaders = await this.googleAuth.getRequestHeaders();
14418
- for (const [key, value] of Object.entries(authHeaders)) {
14443
+ const authHeaders = await this.googleAuth.getRequestHeaders(url);
14444
+ for (const [key, value] of authHeaders) {
14419
14445
  if (headers.get(key) !== null) {
14420
14446
  continue;
14421
14447
  }
@@ -14458,14 +14484,19 @@ class NodeDownloader {
14458
14484
  const response = await downloadFile(params, apiClient);
14459
14485
  if (response instanceof HttpResponse) {
14460
14486
  const writer = fs.createWriteStream(params.downloadPath);
14461
- node_stream.Readable.fromWeb(response.responseInternal.body).pipe(writer);
14487
+ const body = node_stream.Readable.fromWeb(response.responseInternal.body);
14488
+ body.pipe(writer);
14489
+ await promises.finished(writer);
14462
14490
  }
14463
14491
  else {
14464
- fs.writeFile(params.downloadPath, response, { encoding: 'base64' }, (error) => {
14465
- if (error) {
14466
- throw new Error(`Failed to write file to ${params.downloadPath}: ${error}`);
14467
- }
14468
- });
14492
+ try {
14493
+ await fs$1.writeFile(params.downloadPath, response, {
14494
+ encoding: 'base64',
14495
+ });
14496
+ }
14497
+ catch (error) {
14498
+ throw new Error(`Failed to write file to ${params.downloadPath}: ${error}`);
14499
+ }
14469
14500
  }
14470
14501
  }
14471
14502
  }
@@ -14550,7 +14581,7 @@ class NodeWebSocket {
14550
14581
  * SPDX-License-Identifier: Apache-2.0
14551
14582
  */
14552
14583
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
14553
- function cancelTuningJobParametersToMldev(fromObject) {
14584
+ function cancelTuningJobParametersToMldev(fromObject, _rootObject) {
14554
14585
  const toObject = {};
14555
14586
  const fromName = getValueByPath(fromObject, ['name']);
14556
14587
  if (fromName != null) {
@@ -14558,7 +14589,7 @@ function cancelTuningJobParametersToMldev(fromObject) {
14558
14589
  }
14559
14590
  return toObject;
14560
14591
  }
14561
- function cancelTuningJobParametersToVertex(fromObject) {
14592
+ function cancelTuningJobParametersToVertex(fromObject, _rootObject) {
14562
14593
  const toObject = {};
14563
14594
  const fromName = getValueByPath(fromObject, ['name']);
14564
14595
  if (fromName != null) {
@@ -14566,7 +14597,7 @@ function cancelTuningJobParametersToVertex(fromObject) {
14566
14597
  }
14567
14598
  return toObject;
14568
14599
  }
14569
- function createTuningJobConfigToMldev(fromObject, parentObject) {
14600
+ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
14570
14601
  const toObject = {};
14571
14602
  if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
14572
14603
  throw new Error('validationDataset parameter is not supported in Gemini API.');
@@ -14612,15 +14643,35 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
14612
14643
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
14613
14644
  throw new Error('labels parameter is not supported in Gemini API.');
14614
14645
  }
14646
+ if (getValueByPath(fromObject, ['beta']) !== undefined) {
14647
+ throw new Error('beta parameter is not supported in Gemini API.');
14648
+ }
14615
14649
  return toObject;
14616
14650
  }
14617
- function createTuningJobConfigToVertex(fromObject, parentObject) {
14651
+ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
14618
14652
  const toObject = {};
14619
- const fromValidationDataset = getValueByPath(fromObject, [
14620
- 'validationDataset',
14653
+ let discriminatorValidationDataset = getValueByPath(rootObject, [
14654
+ 'config',
14655
+ 'method',
14621
14656
  ]);
14622
- if (parentObject !== undefined && fromValidationDataset != null) {
14623
- setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
14657
+ if (discriminatorValidationDataset === undefined) {
14658
+ discriminatorValidationDataset = 'SUPERVISED_FINE_TUNING';
14659
+ }
14660
+ if (discriminatorValidationDataset === 'SUPERVISED_FINE_TUNING') {
14661
+ const fromValidationDataset = getValueByPath(fromObject, [
14662
+ 'validationDataset',
14663
+ ]);
14664
+ if (parentObject !== undefined && fromValidationDataset != null) {
14665
+ setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
14666
+ }
14667
+ }
14668
+ else if (discriminatorValidationDataset === 'PREFERENCE_TUNING') {
14669
+ const fromValidationDataset = getValueByPath(fromObject, [
14670
+ 'validationDataset',
14671
+ ]);
14672
+ if (parentObject !== undefined && fromValidationDataset != null) {
14673
+ setValueByPath(parentObject, ['preferenceOptimizationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
14674
+ }
14624
14675
  }
14625
14676
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
14626
14677
  'tunedModelDisplayName',
@@ -14632,25 +14683,90 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
14632
14683
  if (parentObject !== undefined && fromDescription != null) {
14633
14684
  setValueByPath(parentObject, ['description'], fromDescription);
14634
14685
  }
14635
- const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14636
- if (parentObject !== undefined && fromEpochCount != null) {
14637
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14686
+ let discriminatorEpochCount = getValueByPath(rootObject, [
14687
+ 'config',
14688
+ 'method',
14689
+ ]);
14690
+ if (discriminatorEpochCount === undefined) {
14691
+ discriminatorEpochCount = 'SUPERVISED_FINE_TUNING';
14638
14692
  }
14639
- const fromLearningRateMultiplier = getValueByPath(fromObject, [
14640
- 'learningRateMultiplier',
14693
+ if (discriminatorEpochCount === 'SUPERVISED_FINE_TUNING') {
14694
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14695
+ if (parentObject !== undefined && fromEpochCount != null) {
14696
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14697
+ }
14698
+ }
14699
+ else if (discriminatorEpochCount === 'PREFERENCE_TUNING') {
14700
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14701
+ if (parentObject !== undefined && fromEpochCount != null) {
14702
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14703
+ }
14704
+ }
14705
+ let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
14706
+ 'config',
14707
+ 'method',
14641
14708
  ]);
14642
- if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14643
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
14709
+ if (discriminatorLearningRateMultiplier === undefined) {
14710
+ discriminatorLearningRateMultiplier = 'SUPERVISED_FINE_TUNING';
14711
+ }
14712
+ if (discriminatorLearningRateMultiplier === 'SUPERVISED_FINE_TUNING') {
14713
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
14714
+ 'learningRateMultiplier',
14715
+ ]);
14716
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14717
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
14718
+ }
14719
+ }
14720
+ else if (discriminatorLearningRateMultiplier === 'PREFERENCE_TUNING') {
14721
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
14722
+ 'learningRateMultiplier',
14723
+ ]);
14724
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14725
+ setValueByPath(parentObject, [
14726
+ 'preferenceOptimizationSpec',
14727
+ 'hyperParameters',
14728
+ 'learningRateMultiplier',
14729
+ ], fromLearningRateMultiplier);
14730
+ }
14644
14731
  }
14645
- const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14646
- 'exportLastCheckpointOnly',
14732
+ let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
14733
+ if (discriminatorExportLastCheckpointOnly === undefined) {
14734
+ discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
14735
+ }
14736
+ if (discriminatorExportLastCheckpointOnly === 'SUPERVISED_FINE_TUNING') {
14737
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14738
+ 'exportLastCheckpointOnly',
14739
+ ]);
14740
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14741
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14742
+ }
14743
+ }
14744
+ else if (discriminatorExportLastCheckpointOnly === 'PREFERENCE_TUNING') {
14745
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14746
+ 'exportLastCheckpointOnly',
14747
+ ]);
14748
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14749
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14750
+ }
14751
+ }
14752
+ let discriminatorAdapterSize = getValueByPath(rootObject, [
14753
+ 'config',
14754
+ 'method',
14647
14755
  ]);
14648
- if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14649
- setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14756
+ if (discriminatorAdapterSize === undefined) {
14757
+ discriminatorAdapterSize = 'SUPERVISED_FINE_TUNING';
14758
+ }
14759
+ if (discriminatorAdapterSize === 'SUPERVISED_FINE_TUNING') {
14760
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14761
+ if (parentObject !== undefined && fromAdapterSize != null) {
14762
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14763
+ }
14650
14764
  }
14651
- const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14652
- if (parentObject !== undefined && fromAdapterSize != null) {
14653
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14765
+ else if (discriminatorAdapterSize === 'PREFERENCE_TUNING') {
14766
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14767
+ if (parentObject !== undefined && fromAdapterSize != null) {
14768
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14769
+ }
14654
14770
  }
14655
14771
  if (getValueByPath(fromObject, ['batchSize']) !== undefined) {
14656
14772
  throw new Error('batchSize parameter is not supported in Vertex AI.');
@@ -14662,9 +14778,13 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
14662
14778
  if (parentObject !== undefined && fromLabels != null) {
14663
14779
  setValueByPath(parentObject, ['labels'], fromLabels);
14664
14780
  }
14781
+ const fromBeta = getValueByPath(fromObject, ['beta']);
14782
+ if (parentObject !== undefined && fromBeta != null) {
14783
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'beta'], fromBeta);
14784
+ }
14665
14785
  return toObject;
14666
14786
  }
14667
- function createTuningJobParametersPrivateToMldev(fromObject) {
14787
+ function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
14668
14788
  const toObject = {};
14669
14789
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
14670
14790
  if (fromBaseModel != null) {
@@ -14680,7 +14800,7 @@ function createTuningJobParametersPrivateToMldev(fromObject) {
14680
14800
  'trainingDataset',
14681
14801
  ]);
14682
14802
  if (fromTrainingDataset != null) {
14683
- setValueByPath(toObject, ['tuningTask', 'trainingData'], tuningDatasetToMldev(fromTrainingDataset));
14803
+ tuningDatasetToMldev(fromTrainingDataset);
14684
14804
  }
14685
14805
  const fromConfig = getValueByPath(fromObject, ['config']);
14686
14806
  if (fromConfig != null) {
@@ -14688,7 +14808,7 @@ function createTuningJobParametersPrivateToMldev(fromObject) {
14688
14808
  }
14689
14809
  return toObject;
14690
14810
  }
14691
- function createTuningJobParametersPrivateToVertex(fromObject) {
14811
+ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
14692
14812
  const toObject = {};
14693
14813
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
14694
14814
  if (fromBaseModel != null) {
@@ -14704,15 +14824,15 @@ function createTuningJobParametersPrivateToVertex(fromObject) {
14704
14824
  'trainingDataset',
14705
14825
  ]);
14706
14826
  if (fromTrainingDataset != null) {
14707
- setValueByPath(toObject, ['supervisedTuningSpec', 'trainingDatasetUri'], tuningDatasetToVertex(fromTrainingDataset, toObject));
14827
+ tuningDatasetToVertex(fromTrainingDataset, toObject, rootObject);
14708
14828
  }
14709
14829
  const fromConfig = getValueByPath(fromObject, ['config']);
14710
14830
  if (fromConfig != null) {
14711
- createTuningJobConfigToVertex(fromConfig, toObject);
14831
+ createTuningJobConfigToVertex(fromConfig, toObject, rootObject);
14712
14832
  }
14713
14833
  return toObject;
14714
14834
  }
14715
- function getTuningJobParametersToMldev(fromObject) {
14835
+ function getTuningJobParametersToMldev(fromObject, _rootObject) {
14716
14836
  const toObject = {};
14717
14837
  const fromName = getValueByPath(fromObject, ['name']);
14718
14838
  if (fromName != null) {
@@ -14720,7 +14840,7 @@ function getTuningJobParametersToMldev(fromObject) {
14720
14840
  }
14721
14841
  return toObject;
14722
14842
  }
14723
- function getTuningJobParametersToVertex(fromObject) {
14843
+ function getTuningJobParametersToVertex(fromObject, _rootObject) {
14724
14844
  const toObject = {};
14725
14845
  const fromName = getValueByPath(fromObject, ['name']);
14726
14846
  if (fromName != null) {
@@ -14728,7 +14848,7 @@ function getTuningJobParametersToVertex(fromObject) {
14728
14848
  }
14729
14849
  return toObject;
14730
14850
  }
14731
- function listTuningJobsConfigToMldev(fromObject, parentObject) {
14851
+ function listTuningJobsConfigToMldev(fromObject, parentObject, _rootObject) {
14732
14852
  const toObject = {};
14733
14853
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
14734
14854
  if (parentObject !== undefined && fromPageSize != null) {
@@ -14744,7 +14864,7 @@ function listTuningJobsConfigToMldev(fromObject, parentObject) {
14744
14864
  }
14745
14865
  return toObject;
14746
14866
  }
14747
- function listTuningJobsConfigToVertex(fromObject, parentObject) {
14867
+ function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
14748
14868
  const toObject = {};
14749
14869
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
14750
14870
  if (parentObject !== undefined && fromPageSize != null) {
@@ -14760,7 +14880,7 @@ function listTuningJobsConfigToVertex(fromObject, parentObject) {
14760
14880
  }
14761
14881
  return toObject;
14762
14882
  }
14763
- function listTuningJobsParametersToMldev(fromObject) {
14883
+ function listTuningJobsParametersToMldev(fromObject, rootObject) {
14764
14884
  const toObject = {};
14765
14885
  const fromConfig = getValueByPath(fromObject, ['config']);
14766
14886
  if (fromConfig != null) {
@@ -14768,7 +14888,7 @@ function listTuningJobsParametersToMldev(fromObject) {
14768
14888
  }
14769
14889
  return toObject;
14770
14890
  }
14771
- function listTuningJobsParametersToVertex(fromObject) {
14891
+ function listTuningJobsParametersToVertex(fromObject, rootObject) {
14772
14892
  const toObject = {};
14773
14893
  const fromConfig = getValueByPath(fromObject, ['config']);
14774
14894
  if (fromConfig != null) {
@@ -14776,7 +14896,7 @@ function listTuningJobsParametersToVertex(fromObject) {
14776
14896
  }
14777
14897
  return toObject;
14778
14898
  }
14779
- function listTuningJobsResponseFromMldev(fromObject) {
14899
+ function listTuningJobsResponseFromMldev(fromObject, rootObject) {
14780
14900
  const toObject = {};
14781
14901
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14782
14902
  'sdkHttpResponse',
@@ -14802,7 +14922,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
14802
14922
  }
14803
14923
  return toObject;
14804
14924
  }
14805
- function listTuningJobsResponseFromVertex(fromObject) {
14925
+ function listTuningJobsResponseFromVertex(fromObject, rootObject) {
14806
14926
  const toObject = {};
14807
14927
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14808
14928
  'sdkHttpResponse',
@@ -14828,7 +14948,7 @@ function listTuningJobsResponseFromVertex(fromObject) {
14828
14948
  }
14829
14949
  return toObject;
14830
14950
  }
14831
- function tunedModelFromMldev(fromObject) {
14951
+ function tunedModelFromMldev(fromObject, _rootObject) {
14832
14952
  const toObject = {};
14833
14953
  const fromModel = getValueByPath(fromObject, ['name']);
14834
14954
  if (fromModel != null) {
@@ -14840,7 +14960,7 @@ function tunedModelFromMldev(fromObject) {
14840
14960
  }
14841
14961
  return toObject;
14842
14962
  }
14843
- function tuningDatasetToMldev(fromObject) {
14963
+ function tuningDatasetToMldev(fromObject, _rootObject) {
14844
14964
  const toObject = {};
14845
14965
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
14846
14966
  throw new Error('gcsUri parameter is not supported in Gemini API.');
@@ -14860,24 +14980,56 @@ function tuningDatasetToMldev(fromObject) {
14860
14980
  }
14861
14981
  return toObject;
14862
14982
  }
14863
- function tuningDatasetToVertex(fromObject, parentObject) {
14983
+ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
14864
14984
  const toObject = {};
14865
- const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14866
- if (parentObject !== undefined && fromGcsUri != null) {
14867
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
14985
+ let discriminatorGcsUri = getValueByPath(rootObject, [
14986
+ 'config',
14987
+ 'method',
14988
+ ]);
14989
+ if (discriminatorGcsUri === undefined) {
14990
+ discriminatorGcsUri = 'SUPERVISED_FINE_TUNING';
14868
14991
  }
14869
- const fromVertexDatasetResource = getValueByPath(fromObject, [
14870
- 'vertexDatasetResource',
14992
+ if (discriminatorGcsUri === 'SUPERVISED_FINE_TUNING') {
14993
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14994
+ if (parentObject !== undefined && fromGcsUri != null) {
14995
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
14996
+ }
14997
+ }
14998
+ else if (discriminatorGcsUri === 'PREFERENCE_TUNING') {
14999
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
15000
+ if (parentObject !== undefined && fromGcsUri != null) {
15001
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromGcsUri);
15002
+ }
15003
+ }
15004
+ let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
15005
+ 'config',
15006
+ 'method',
14871
15007
  ]);
14872
- if (parentObject !== undefined && fromVertexDatasetResource != null) {
14873
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
15008
+ if (discriminatorVertexDatasetResource === undefined) {
15009
+ discriminatorVertexDatasetResource = 'SUPERVISED_FINE_TUNING';
15010
+ }
15011
+ if (discriminatorVertexDatasetResource === 'SUPERVISED_FINE_TUNING') {
15012
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
15013
+ 'vertexDatasetResource',
15014
+ ]);
15015
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
15016
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
15017
+ }
15018
+ }
15019
+ else if (discriminatorVertexDatasetResource === 'PREFERENCE_TUNING') {
15020
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
15021
+ 'vertexDatasetResource',
15022
+ ]);
15023
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
15024
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
15025
+ }
14874
15026
  }
14875
15027
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
14876
15028
  throw new Error('examples parameter is not supported in Vertex AI.');
14877
15029
  }
14878
15030
  return toObject;
14879
15031
  }
14880
- function tuningJobFromMldev(fromObject) {
15032
+ function tuningJobFromMldev(fromObject, rootObject) {
14881
15033
  const toObject = {};
14882
15034
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14883
15035
  'sdkHttpResponse',
@@ -14929,7 +15081,7 @@ function tuningJobFromMldev(fromObject) {
14929
15081
  }
14930
15082
  return toObject;
14931
15083
  }
14932
- function tuningJobFromVertex(fromObject) {
15084
+ function tuningJobFromVertex(fromObject, _rootObject) {
14933
15085
  const toObject = {};
14934
15086
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14935
15087
  'sdkHttpResponse',
@@ -14989,6 +15141,12 @@ function tuningJobFromVertex(fromObject) {
14989
15141
  if (fromSupervisedTuningSpec != null) {
14990
15142
  setValueByPath(toObject, ['supervisedTuningSpec'], fromSupervisedTuningSpec);
14991
15143
  }
15144
+ const fromPreferenceOptimizationSpec = getValueByPath(fromObject, [
15145
+ 'preferenceOptimizationSpec',
15146
+ ]);
15147
+ if (fromPreferenceOptimizationSpec != null) {
15148
+ setValueByPath(toObject, ['preferenceOptimizationSpec'], fromPreferenceOptimizationSpec);
15149
+ }
14992
15150
  const fromTuningDataStats = getValueByPath(fromObject, [
14993
15151
  'tuningDataStats',
14994
15152
  ]);
@@ -15049,7 +15207,7 @@ function tuningJobFromVertex(fromObject) {
15049
15207
  }
15050
15208
  return toObject;
15051
15209
  }
15052
- function tuningOperationFromMldev(fromObject) {
15210
+ function tuningOperationFromMldev(fromObject, _rootObject) {
15053
15211
  const toObject = {};
15054
15212
  const fromSdkHttpResponse = getValueByPath(fromObject, [
15055
15213
  'sdkHttpResponse',
@@ -15075,7 +15233,7 @@ function tuningOperationFromMldev(fromObject) {
15075
15233
  }
15076
15234
  return toObject;
15077
15235
  }
15078
- function tuningValidationDatasetToVertex(fromObject, parentObject) {
15236
+ function tuningValidationDatasetToVertex(fromObject, _rootObject) {
15079
15237
  const toObject = {};
15080
15238
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
15081
15239
  if (fromGcsUri != null) {
@@ -15084,8 +15242,8 @@ function tuningValidationDatasetToVertex(fromObject, parentObject) {
15084
15242
  const fromVertexDatasetResource = getValueByPath(fromObject, [
15085
15243
  'vertexDatasetResource',
15086
15244
  ]);
15087
- if (parentObject !== undefined && fromVertexDatasetResource != null) {
15088
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
15245
+ if (fromVertexDatasetResource != null) {
15246
+ setValueByPath(toObject, ['validationDatasetUri'], fromVertexDatasetResource);
15089
15247
  }
15090
15248
  return toObject;
15091
15249
  }
@@ -15355,7 +15513,7 @@ class Tunings extends BaseModule {
15355
15513
  let path = '';
15356
15514
  let queryParams = {};
15357
15515
  if (this.apiClient.isVertexAI()) {
15358
- const body = createTuningJobParametersPrivateToVertex(params);
15516
+ const body = createTuningJobParametersPrivateToVertex(params, params);
15359
15517
  path = formatMap('tuningJobs', body['_url']);
15360
15518
  queryParams = body['_query'];
15361
15519
  delete body['_url'];
@@ -15773,6 +15931,9 @@ class GoogleGenAI {
15773
15931
  ' precedence over the API key from the environment variables.');
15774
15932
  this.apiKey = undefined;
15775
15933
  }
15934
+ if (!this.location && !this.apiKey) {
15935
+ this.location = 'global';
15936
+ }
15776
15937
  }
15777
15938
  const baseUrl = getBaseUrl(options.httpOptions, options.vertexai, getEnv('GOOGLE_VERTEX_BASE_URL'), getEnv('GOOGLE_GEMINI_BASE_URL'));
15778
15939
  if (baseUrl) {