@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.
@@ -500,7 +500,7 @@ function videoFromVertex$1(fromObject) {
500
500
  * Copyright 2025 Google LLC
501
501
  * SPDX-License-Identifier: Apache-2.0
502
502
  */
503
- /** Required. Outcome of the code execution. */
503
+ /** Outcome of the code execution. */
504
504
  var Outcome;
505
505
  (function (Outcome) {
506
506
  /**
@@ -520,7 +520,7 @@ var Outcome;
520
520
  */
521
521
  Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
522
522
  })(Outcome || (Outcome = {}));
523
- /** Required. Programming language of the `code`. */
523
+ /** Programming language of the `code`. */
524
524
  var Language;
525
525
  (function (Language) {
526
526
  /**
@@ -552,7 +552,7 @@ var FunctionResponseScheduling;
552
552
  */
553
553
  FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
554
554
  })(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
555
- /** Optional. The type of the data. */
555
+ /** The type of the data. */
556
556
  var Type;
557
557
  (function (Type) {
558
558
  /**
@@ -588,7 +588,64 @@ var Type;
588
588
  */
589
589
  Type["NULL"] = "NULL";
590
590
  })(Type || (Type = {}));
591
- /** Required. Harm category. */
591
+ /** The mode of the predictor to be used in dynamic retrieval. */
592
+ var Mode;
593
+ (function (Mode) {
594
+ /**
595
+ * Always trigger retrieval.
596
+ */
597
+ Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
598
+ /**
599
+ * Run retrieval only when system decides it is necessary.
600
+ */
601
+ Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
602
+ })(Mode || (Mode = {}));
603
+ /** Type of auth scheme. This enum is not supported in Gemini API. */
604
+ var AuthType;
605
+ (function (AuthType) {
606
+ AuthType["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
607
+ /**
608
+ * No Auth.
609
+ */
610
+ AuthType["NO_AUTH"] = "NO_AUTH";
611
+ /**
612
+ * API Key Auth.
613
+ */
614
+ AuthType["API_KEY_AUTH"] = "API_KEY_AUTH";
615
+ /**
616
+ * HTTP Basic Auth.
617
+ */
618
+ AuthType["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
619
+ /**
620
+ * Google Service Account Auth.
621
+ */
622
+ AuthType["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
623
+ /**
624
+ * OAuth auth.
625
+ */
626
+ AuthType["OAUTH"] = "OAUTH";
627
+ /**
628
+ * OpenID Connect (OIDC) Auth.
629
+ */
630
+ AuthType["OIDC_AUTH"] = "OIDC_AUTH";
631
+ })(AuthType || (AuthType = {}));
632
+ /** The API spec that the external API implements. This enum is not supported in Gemini API. */
633
+ var ApiSpec;
634
+ (function (ApiSpec) {
635
+ /**
636
+ * Unspecified API spec. This value should not be used.
637
+ */
638
+ ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
639
+ /**
640
+ * Simple search API spec.
641
+ */
642
+ ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
643
+ /**
644
+ * Elastic search API spec.
645
+ */
646
+ ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
647
+ })(ApiSpec || (ApiSpec = {}));
648
+ /** Harm category. */
592
649
  var HarmCategory;
593
650
  (function (HarmCategory) {
594
651
  /**
@@ -616,27 +673,27 @@ var HarmCategory;
616
673
  */
617
674
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
618
675
  /**
619
- * The harm category is image hate.
676
+ * The harm category is image hate. This enum value is not supported in Gemini API.
620
677
  */
621
678
  HarmCategory["HARM_CATEGORY_IMAGE_HATE"] = "HARM_CATEGORY_IMAGE_HATE";
622
679
  /**
623
- * The harm category is image dangerous content.
680
+ * The harm category is image dangerous content. This enum value is not supported in Gemini API.
624
681
  */
625
682
  HarmCategory["HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT"] = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT";
626
683
  /**
627
- * The harm category is image harassment.
684
+ * The harm category is image harassment. This enum value is not supported in Gemini API.
628
685
  */
629
686
  HarmCategory["HARM_CATEGORY_IMAGE_HARASSMENT"] = "HARM_CATEGORY_IMAGE_HARASSMENT";
630
687
  /**
631
- * The harm category is image sexually explicit content.
688
+ * The harm category is image sexually explicit content. This enum value is not supported in Gemini API.
632
689
  */
633
690
  HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
634
691
  /**
635
- * The harm category is for jailbreak prompts.
692
+ * The harm category is for jailbreak prompts. This enum value is not supported in Gemini API.
636
693
  */
637
694
  HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
638
695
  })(HarmCategory || (HarmCategory = {}));
639
- /** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
696
+ /** 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. */
640
697
  var HarmBlockMethod;
641
698
  (function (HarmBlockMethod) {
642
699
  /**
@@ -652,7 +709,7 @@ var HarmBlockMethod;
652
709
  */
653
710
  HarmBlockMethod["PROBABILITY"] = "PROBABILITY";
654
711
  })(HarmBlockMethod || (HarmBlockMethod = {}));
655
- /** Required. The harm block threshold. */
712
+ /** The harm block threshold. */
656
713
  var HarmBlockThreshold;
657
714
  (function (HarmBlockThreshold) {
658
715
  /**
@@ -680,87 +737,6 @@ var HarmBlockThreshold;
680
737
  */
681
738
  HarmBlockThreshold["OFF"] = "OFF";
682
739
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
683
- /** The mode of the predictor to be used in dynamic retrieval. */
684
- var Mode;
685
- (function (Mode) {
686
- /**
687
- * Always trigger retrieval.
688
- */
689
- Mode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
690
- /**
691
- * Run retrieval only when system decides it is necessary.
692
- */
693
- Mode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
694
- })(Mode || (Mode = {}));
695
- /** Type of auth scheme. */
696
- var AuthType;
697
- (function (AuthType) {
698
- AuthType["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
699
- /**
700
- * No Auth.
701
- */
702
- AuthType["NO_AUTH"] = "NO_AUTH";
703
- /**
704
- * API Key Auth.
705
- */
706
- AuthType["API_KEY_AUTH"] = "API_KEY_AUTH";
707
- /**
708
- * HTTP Basic Auth.
709
- */
710
- AuthType["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
711
- /**
712
- * Google Service Account Auth.
713
- */
714
- AuthType["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
715
- /**
716
- * OAuth auth.
717
- */
718
- AuthType["OAUTH"] = "OAUTH";
719
- /**
720
- * OpenID Connect (OIDC) Auth.
721
- */
722
- AuthType["OIDC_AUTH"] = "OIDC_AUTH";
723
- })(AuthType || (AuthType = {}));
724
- /** The API spec that the external API implements. */
725
- var ApiSpec;
726
- (function (ApiSpec) {
727
- /**
728
- * Unspecified API spec. This value should not be used.
729
- */
730
- ApiSpec["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
731
- /**
732
- * Simple search API spec.
733
- */
734
- ApiSpec["SIMPLE_SEARCH"] = "SIMPLE_SEARCH";
735
- /**
736
- * Elastic search API spec.
737
- */
738
- ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
739
- })(ApiSpec || (ApiSpec = {}));
740
- /** Status of the url retrieval. */
741
- var UrlRetrievalStatus;
742
- (function (UrlRetrievalStatus) {
743
- /**
744
- * Default value. This value is unused
745
- */
746
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
747
- /**
748
- * Url retrieval is successful.
749
- */
750
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
751
- /**
752
- * Url retrieval is failed due to error.
753
- */
754
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
755
- /**
756
- * Url retrieval is failed because the content is behind paywall.
757
- */
758
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
759
- /**
760
- * Url retrieval is failed because the content is unsafe.
761
- */
762
- UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
763
- })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
764
740
  /** Output only. The reason why the model stopped generating tokens.
765
741
 
766
742
  If empty, the model has not stopped generating the tokens. */
@@ -851,7 +827,7 @@ var HarmProbability;
851
827
  */
852
828
  HarmProbability["HIGH"] = "HIGH";
853
829
  })(HarmProbability || (HarmProbability = {}));
854
- /** Output only. Harm severity levels in the content. */
830
+ /** Output only. Harm severity levels in the content. This enum is not supported in Gemini API. */
855
831
  var HarmSeverity;
856
832
  (function (HarmSeverity) {
857
833
  /**
@@ -875,6 +851,30 @@ var HarmSeverity;
875
851
  */
876
852
  HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
877
853
  })(HarmSeverity || (HarmSeverity = {}));
854
+ /** Status of the url retrieval. */
855
+ var UrlRetrievalStatus;
856
+ (function (UrlRetrievalStatus) {
857
+ /**
858
+ * Default value. This value is unused.
859
+ */
860
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSPECIFIED"] = "URL_RETRIEVAL_STATUS_UNSPECIFIED";
861
+ /**
862
+ * Url retrieval is successful.
863
+ */
864
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_SUCCESS"] = "URL_RETRIEVAL_STATUS_SUCCESS";
865
+ /**
866
+ * Url retrieval is failed due to error.
867
+ */
868
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
869
+ /**
870
+ * Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI.
871
+ */
872
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
873
+ /**
874
+ * Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI.
875
+ */
876
+ UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
877
+ })(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
878
878
  /** Output only. The reason why the prompt was blocked. */
879
879
  var BlockedReason;
880
880
  (function (BlockedReason) {
@@ -903,15 +903,15 @@ var BlockedReason;
903
903
  */
904
904
  BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
905
905
  /**
906
- * The prompt was blocked by Model Armor.
906
+ * The prompt was blocked by Model Armor. This enum value is not supported in Gemini API.
907
907
  */
908
908
  BlockedReason["MODEL_ARMOR"] = "MODEL_ARMOR";
909
909
  /**
910
- * The prompt was blocked as a jailbreak attempt.
910
+ * The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API.
911
911
  */
912
912
  BlockedReason["JAILBREAK"] = "JAILBREAK";
913
913
  })(BlockedReason || (BlockedReason = {}));
914
- /** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
914
+ /** 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. */
915
915
  var TrafficType;
916
916
  (function (TrafficType) {
917
917
  /**
@@ -967,6 +967,54 @@ var MediaResolution;
967
967
  */
968
968
  MediaResolution["MEDIA_RESOLUTION_HIGH"] = "MEDIA_RESOLUTION_HIGH";
969
969
  })(MediaResolution || (MediaResolution = {}));
970
+ /** Tuning mode. This enum is not supported in Gemini API. */
971
+ var TuningMode;
972
+ (function (TuningMode) {
973
+ /**
974
+ * Tuning mode is unspecified.
975
+ */
976
+ TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
977
+ /**
978
+ * Full fine-tuning mode.
979
+ */
980
+ TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
981
+ /**
982
+ * PEFT adapter tuning mode.
983
+ */
984
+ TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
985
+ })(TuningMode || (TuningMode = {}));
986
+ /** Adapter size for tuning. This enum is not supported in Gemini API. */
987
+ var AdapterSize;
988
+ (function (AdapterSize) {
989
+ /**
990
+ * Adapter size is unspecified.
991
+ */
992
+ AdapterSize["ADAPTER_SIZE_UNSPECIFIED"] = "ADAPTER_SIZE_UNSPECIFIED";
993
+ /**
994
+ * Adapter size 1.
995
+ */
996
+ AdapterSize["ADAPTER_SIZE_ONE"] = "ADAPTER_SIZE_ONE";
997
+ /**
998
+ * Adapter size 2.
999
+ */
1000
+ AdapterSize["ADAPTER_SIZE_TWO"] = "ADAPTER_SIZE_TWO";
1001
+ /**
1002
+ * Adapter size 4.
1003
+ */
1004
+ AdapterSize["ADAPTER_SIZE_FOUR"] = "ADAPTER_SIZE_FOUR";
1005
+ /**
1006
+ * Adapter size 8.
1007
+ */
1008
+ AdapterSize["ADAPTER_SIZE_EIGHT"] = "ADAPTER_SIZE_EIGHT";
1009
+ /**
1010
+ * Adapter size 16.
1011
+ */
1012
+ AdapterSize["ADAPTER_SIZE_SIXTEEN"] = "ADAPTER_SIZE_SIXTEEN";
1013
+ /**
1014
+ * Adapter size 32.
1015
+ */
1016
+ AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1017
+ })(AdapterSize || (AdapterSize = {}));
970
1018
  /** Job state. */
971
1019
  var JobState;
972
1020
  (function (JobState) {
@@ -1019,55 +1067,7 @@ var JobState;
1019
1067
  */
1020
1068
  JobState["JOB_STATE_PARTIALLY_SUCCEEDED"] = "JOB_STATE_PARTIALLY_SUCCEEDED";
1021
1069
  })(JobState || (JobState = {}));
1022
- /** Tuning mode. */
1023
- var TuningMode;
1024
- (function (TuningMode) {
1025
- /**
1026
- * Tuning mode is unspecified.
1027
- */
1028
- TuningMode["TUNING_MODE_UNSPECIFIED"] = "TUNING_MODE_UNSPECIFIED";
1029
- /**
1030
- * Full fine-tuning mode.
1031
- */
1032
- TuningMode["TUNING_MODE_FULL"] = "TUNING_MODE_FULL";
1033
- /**
1034
- * PEFT adapter tuning mode.
1035
- */
1036
- TuningMode["TUNING_MODE_PEFT_ADAPTER"] = "TUNING_MODE_PEFT_ADAPTER";
1037
- })(TuningMode || (TuningMode = {}));
1038
- /** Optional. Adapter size for tuning. */
1039
- var AdapterSize;
1040
- (function (AdapterSize) {
1041
- /**
1042
- * Adapter size is unspecified.
1043
- */
1044
- AdapterSize["ADAPTER_SIZE_UNSPECIFIED"] = "ADAPTER_SIZE_UNSPECIFIED";
1045
- /**
1046
- * Adapter size 1.
1047
- */
1048
- AdapterSize["ADAPTER_SIZE_ONE"] = "ADAPTER_SIZE_ONE";
1049
- /**
1050
- * Adapter size 2.
1051
- */
1052
- AdapterSize["ADAPTER_SIZE_TWO"] = "ADAPTER_SIZE_TWO";
1053
- /**
1054
- * Adapter size 4.
1055
- */
1056
- AdapterSize["ADAPTER_SIZE_FOUR"] = "ADAPTER_SIZE_FOUR";
1057
- /**
1058
- * Adapter size 8.
1059
- */
1060
- AdapterSize["ADAPTER_SIZE_EIGHT"] = "ADAPTER_SIZE_EIGHT";
1061
- /**
1062
- * Adapter size 16.
1063
- */
1064
- AdapterSize["ADAPTER_SIZE_SIXTEEN"] = "ADAPTER_SIZE_SIXTEEN";
1065
- /**
1066
- * Adapter size 32.
1067
- */
1068
- AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1069
- })(AdapterSize || (AdapterSize = {}));
1070
- /** Optional. The tuning task. Either I2V or T2V. */
1070
+ /** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
1071
1071
  var TuningTask;
1072
1072
  (function (TuningTask) {
1073
1073
  /**
@@ -1317,6 +1317,18 @@ var VideoCompressionQuality;
1317
1317
  */
1318
1318
  VideoCompressionQuality["LOSSLESS"] = "LOSSLESS";
1319
1319
  })(VideoCompressionQuality || (VideoCompressionQuality = {}));
1320
+ /** Enum representing the tuning method. */
1321
+ var TuningMethod;
1322
+ (function (TuningMethod) {
1323
+ /**
1324
+ * Supervised fine tuning.
1325
+ */
1326
+ TuningMethod["SUPERVISED_FINE_TUNING"] = "SUPERVISED_FINE_TUNING";
1327
+ /**
1328
+ * Preference optimization tuning.
1329
+ */
1330
+ TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
1331
+ })(TuningMethod || (TuningMethod = {}));
1320
1332
  /** State for the lifecycle of a File. */
1321
1333
  var FileState;
1322
1334
  (function (FileState) {
@@ -1744,7 +1756,7 @@ class HttpResponse {
1744
1756
  /** 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. */
1745
1757
  class GenerateContentResponsePromptFeedback {
1746
1758
  }
1747
- /** Usage metadata about response(s). */
1759
+ /** Usage metadata about response(s). This data type is not supported in Gemini API. */
1748
1760
  class GenerateContentResponseUsageMetadata {
1749
1761
  }
1750
1762
  /** Response message for PredictionService.GenerateContent. */
@@ -3336,13 +3348,13 @@ function batchJobSourceToVertex(fromObject) {
3336
3348
  }
3337
3349
  function blobToMldev$4(fromObject) {
3338
3350
  const toObject = {};
3339
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
3340
- throw new Error('displayName parameter is not supported in Gemini API.');
3341
- }
3342
3351
  const fromData = getValueByPath(fromObject, ['data']);
3343
3352
  if (fromData != null) {
3344
3353
  setValueByPath(toObject, ['data'], fromData);
3345
3354
  }
3355
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
3356
+ throw new Error('displayName parameter is not supported in Gemini API.');
3357
+ }
3346
3358
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
3347
3359
  if (fromMimeType != null) {
3348
3360
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -3385,12 +3397,6 @@ function candidateFromMldev$1(fromObject) {
3385
3397
  if (fromFinishReason != null) {
3386
3398
  setValueByPath(toObject, ['finishReason'], fromFinishReason);
3387
3399
  }
3388
- const fromUrlContextMetadata = getValueByPath(fromObject, [
3389
- 'urlContextMetadata',
3390
- ]);
3391
- if (fromUrlContextMetadata != null) {
3392
- setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
3393
- }
3394
3400
  const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
3395
3401
  if (fromAvgLogprobs != null) {
3396
3402
  setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
@@ -3423,6 +3429,12 @@ function candidateFromMldev$1(fromObject) {
3423
3429
  }
3424
3430
  setValueByPath(toObject, ['safetyRatings'], transformedList);
3425
3431
  }
3432
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
3433
+ 'urlContextMetadata',
3434
+ ]);
3435
+ if (fromUrlContextMetadata != null) {
3436
+ setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
3437
+ }
3426
3438
  return toObject;
3427
3439
  }
3428
3440
  function citationMetadataFromMldev$1(fromObject) {
@@ -3891,15 +3903,15 @@ function googleMapsToMldev$4(fromObject) {
3891
3903
  }
3892
3904
  function googleSearchToMldev$4(fromObject) {
3893
3905
  const toObject = {};
3906
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
3907
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
3908
+ }
3894
3909
  const fromTimeRangeFilter = getValueByPath(fromObject, [
3895
3910
  'timeRangeFilter',
3896
3911
  ]);
3897
3912
  if (fromTimeRangeFilter != null) {
3898
3913
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
3899
3914
  }
3900
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
3901
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
3902
- }
3903
3915
  return toObject;
3904
3916
  }
3905
3917
  function inlinedRequestToMldev(apiClient, fromObject) {
@@ -4043,30 +4055,6 @@ function listBatchJobsResponseFromVertex(fromObject) {
4043
4055
  }
4044
4056
  function partToMldev$4(fromObject) {
4045
4057
  const toObject = {};
4046
- const fromVideoMetadata = getValueByPath(fromObject, [
4047
- 'videoMetadata',
4048
- ]);
4049
- if (fromVideoMetadata != null) {
4050
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4051
- }
4052
- const fromThought = getValueByPath(fromObject, ['thought']);
4053
- if (fromThought != null) {
4054
- setValueByPath(toObject, ['thought'], fromThought);
4055
- }
4056
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
4057
- if (fromInlineData != null) {
4058
- setValueByPath(toObject, ['inlineData'], blobToMldev$4(fromInlineData));
4059
- }
4060
- const fromFileData = getValueByPath(fromObject, ['fileData']);
4061
- if (fromFileData != null) {
4062
- setValueByPath(toObject, ['fileData'], fileDataToMldev$4(fromFileData));
4063
- }
4064
- const fromThoughtSignature = getValueByPath(fromObject, [
4065
- 'thoughtSignature',
4066
- ]);
4067
- if (fromThoughtSignature != null) {
4068
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
4069
- }
4070
4058
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
4071
4059
  if (fromFunctionCall != null) {
4072
4060
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -4083,27 +4071,51 @@ function partToMldev$4(fromObject) {
4083
4071
  if (fromExecutableCode != null) {
4084
4072
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
4085
4073
  }
4074
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
4075
+ if (fromFileData != null) {
4076
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$4(fromFileData));
4077
+ }
4086
4078
  const fromFunctionResponse = getValueByPath(fromObject, [
4087
4079
  'functionResponse',
4088
4080
  ]);
4089
4081
  if (fromFunctionResponse != null) {
4090
4082
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
4091
4083
  }
4084
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
4085
+ if (fromInlineData != null) {
4086
+ setValueByPath(toObject, ['inlineData'], blobToMldev$4(fromInlineData));
4087
+ }
4092
4088
  const fromText = getValueByPath(fromObject, ['text']);
4093
4089
  if (fromText != null) {
4094
4090
  setValueByPath(toObject, ['text'], fromText);
4095
4091
  }
4092
+ const fromThought = getValueByPath(fromObject, ['thought']);
4093
+ if (fromThought != null) {
4094
+ setValueByPath(toObject, ['thought'], fromThought);
4095
+ }
4096
+ const fromThoughtSignature = getValueByPath(fromObject, [
4097
+ 'thoughtSignature',
4098
+ ]);
4099
+ if (fromThoughtSignature != null) {
4100
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
4101
+ }
4102
+ const fromVideoMetadata = getValueByPath(fromObject, [
4103
+ 'videoMetadata',
4104
+ ]);
4105
+ if (fromVideoMetadata != null) {
4106
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4107
+ }
4096
4108
  return toObject;
4097
4109
  }
4098
4110
  function safetySettingToMldev$1(fromObject) {
4099
4111
  const toObject = {};
4100
- if (getValueByPath(fromObject, ['method']) !== undefined) {
4101
- throw new Error('method parameter is not supported in Gemini API.');
4102
- }
4103
4112
  const fromCategory = getValueByPath(fromObject, ['category']);
4104
4113
  if (fromCategory != null) {
4105
4114
  setValueByPath(toObject, ['category'], fromCategory);
4106
4115
  }
4116
+ if (getValueByPath(fromObject, ['method']) !== undefined) {
4117
+ throw new Error('method parameter is not supported in Gemini API.');
4118
+ }
4107
4119
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
4108
4120
  if (fromThreshold != null) {
4109
4121
  setValueByPath(toObject, ['threshold'], fromThreshold);
@@ -4127,36 +4139,36 @@ function toolToMldev$4(fromObject) {
4127
4139
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
4128
4140
  throw new Error('retrieval parameter is not supported in Gemini API.');
4129
4141
  }
4130
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
4131
- if (fromGoogleSearch != null) {
4132
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4133
- }
4134
4142
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
4135
4143
  'googleSearchRetrieval',
4136
4144
  ]);
4137
4145
  if (fromGoogleSearchRetrieval != null) {
4138
4146
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
4139
4147
  }
4140
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4141
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4142
- }
4143
4148
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4144
4149
  if (fromGoogleMaps != null) {
4145
4150
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4146
4151
  }
4147
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4148
- if (fromUrlContext != null) {
4149
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
4150
- }
4151
4152
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
4152
4153
  if (fromComputerUse != null) {
4153
4154
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
4154
4155
  }
4155
- const fromCodeExecution = getValueByPath(fromObject, [
4156
- 'codeExecution',
4157
- ]);
4158
- if (fromCodeExecution != null) {
4159
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4156
+ const fromCodeExecution = getValueByPath(fromObject, [
4157
+ 'codeExecution',
4158
+ ]);
4159
+ if (fromCodeExecution != null) {
4160
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
4161
+ }
4162
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4163
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4164
+ }
4165
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
4166
+ if (fromGoogleSearch != null) {
4167
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$4(fromGoogleSearch));
4168
+ }
4169
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4170
+ if (fromUrlContext != null) {
4171
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
4160
4172
  }
4161
4173
  return toObject;
4162
4174
  }
@@ -4173,6 +4185,8 @@ var PagedItem;
4173
4185
  PagedItem["PAGED_ITEM_TUNING_JOBS"] = "tuningJobs";
4174
4186
  PagedItem["PAGED_ITEM_FILES"] = "files";
4175
4187
  PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
4188
+ PagedItem["PAGED_ITEM_RAG_STORES"] = "ragStores";
4189
+ PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
4176
4190
  })(PagedItem || (PagedItem = {}));
4177
4191
  /**
4178
4192
  * Pager class for iterating through paginated results.
@@ -4853,13 +4867,13 @@ class Batches extends BaseModule {
4853
4867
  */
4854
4868
  function blobToMldev$3(fromObject) {
4855
4869
  const toObject = {};
4856
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4857
- throw new Error('displayName parameter is not supported in Gemini API.');
4858
- }
4859
4870
  const fromData = getValueByPath(fromObject, ['data']);
4860
4871
  if (fromData != null) {
4861
4872
  setValueByPath(toObject, ['data'], fromData);
4862
4873
  }
4874
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
4875
+ throw new Error('displayName parameter is not supported in Gemini API.');
4876
+ }
4863
4877
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
4864
4878
  if (fromMimeType != null) {
4865
4879
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -5122,15 +5136,15 @@ function googleMapsToMldev$3(fromObject) {
5122
5136
  }
5123
5137
  function googleSearchToMldev$3(fromObject) {
5124
5138
  const toObject = {};
5139
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5140
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
5141
+ }
5125
5142
  const fromTimeRangeFilter = getValueByPath(fromObject, [
5126
5143
  'timeRangeFilter',
5127
5144
  ]);
5128
5145
  if (fromTimeRangeFilter != null) {
5129
5146
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
5130
5147
  }
5131
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
5132
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
5133
- }
5134
5148
  return toObject;
5135
5149
  }
5136
5150
  function listCachedContentsConfigToMldev(fromObject, parentObject) {
@@ -5231,30 +5245,6 @@ function listCachedContentsResponseFromVertex(fromObject) {
5231
5245
  }
5232
5246
  function partToMldev$3(fromObject) {
5233
5247
  const toObject = {};
5234
- const fromVideoMetadata = getValueByPath(fromObject, [
5235
- 'videoMetadata',
5236
- ]);
5237
- if (fromVideoMetadata != null) {
5238
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
5239
- }
5240
- const fromThought = getValueByPath(fromObject, ['thought']);
5241
- if (fromThought != null) {
5242
- setValueByPath(toObject, ['thought'], fromThought);
5243
- }
5244
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
5245
- if (fromInlineData != null) {
5246
- setValueByPath(toObject, ['inlineData'], blobToMldev$3(fromInlineData));
5247
- }
5248
- const fromFileData = getValueByPath(fromObject, ['fileData']);
5249
- if (fromFileData != null) {
5250
- setValueByPath(toObject, ['fileData'], fileDataToMldev$3(fromFileData));
5251
- }
5252
- const fromThoughtSignature = getValueByPath(fromObject, [
5253
- 'thoughtSignature',
5254
- ]);
5255
- if (fromThoughtSignature != null) {
5256
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5257
- }
5258
5248
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
5259
5249
  if (fromFunctionCall != null) {
5260
5250
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -5271,16 +5261,40 @@ function partToMldev$3(fromObject) {
5271
5261
  if (fromExecutableCode != null) {
5272
5262
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
5273
5263
  }
5264
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
5265
+ if (fromFileData != null) {
5266
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$3(fromFileData));
5267
+ }
5274
5268
  const fromFunctionResponse = getValueByPath(fromObject, [
5275
5269
  'functionResponse',
5276
5270
  ]);
5277
5271
  if (fromFunctionResponse != null) {
5278
5272
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
5279
5273
  }
5274
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
5275
+ if (fromInlineData != null) {
5276
+ setValueByPath(toObject, ['inlineData'], blobToMldev$3(fromInlineData));
5277
+ }
5280
5278
  const fromText = getValueByPath(fromObject, ['text']);
5281
5279
  if (fromText != null) {
5282
5280
  setValueByPath(toObject, ['text'], fromText);
5283
5281
  }
5282
+ const fromThought = getValueByPath(fromObject, ['thought']);
5283
+ if (fromThought != null) {
5284
+ setValueByPath(toObject, ['thought'], fromThought);
5285
+ }
5286
+ const fromThoughtSignature = getValueByPath(fromObject, [
5287
+ 'thoughtSignature',
5288
+ ]);
5289
+ if (fromThoughtSignature != null) {
5290
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5291
+ }
5292
+ const fromVideoMetadata = getValueByPath(fromObject, [
5293
+ 'videoMetadata',
5294
+ ]);
5295
+ if (fromVideoMetadata != null) {
5296
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
5297
+ }
5284
5298
  return toObject;
5285
5299
  }
5286
5300
  function toolToMldev$3(fromObject) {
@@ -5300,27 +5314,16 @@ function toolToMldev$3(fromObject) {
5300
5314
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
5301
5315
  throw new Error('retrieval parameter is not supported in Gemini API.');
5302
5316
  }
5303
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5304
- if (fromGoogleSearch != null) {
5305
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5306
- }
5307
5317
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5308
5318
  'googleSearchRetrieval',
5309
5319
  ]);
5310
5320
  if (fromGoogleSearchRetrieval != null) {
5311
5321
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5312
5322
  }
5313
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5314
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5315
- }
5316
5323
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5317
5324
  if (fromGoogleMaps != null) {
5318
5325
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5319
5326
  }
5320
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5321
- if (fromUrlContext != null) {
5322
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
5323
- }
5324
5327
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5325
5328
  if (fromComputerUse != null) {
5326
5329
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5331,6 +5334,17 @@ function toolToMldev$3(fromObject) {
5331
5334
  if (fromCodeExecution != null) {
5332
5335
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5333
5336
  }
5337
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5338
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5339
+ }
5340
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5341
+ if (fromGoogleSearch != null) {
5342
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(fromGoogleSearch));
5343
+ }
5344
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5345
+ if (fromUrlContext != null) {
5346
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
5347
+ }
5334
5348
  return toObject;
5335
5349
  }
5336
5350
  function toolToVertex$2(fromObject) {
@@ -5351,30 +5365,16 @@ function toolToVertex$2(fromObject) {
5351
5365
  if (fromRetrieval != null) {
5352
5366
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
5353
5367
  }
5354
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5355
- if (fromGoogleSearch != null) {
5356
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5357
- }
5358
5368
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
5359
5369
  'googleSearchRetrieval',
5360
5370
  ]);
5361
5371
  if (fromGoogleSearchRetrieval != null) {
5362
5372
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
5363
5373
  }
5364
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
5365
- 'enterpriseWebSearch',
5366
- ]);
5367
- if (fromEnterpriseWebSearch != null) {
5368
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5369
- }
5370
5374
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5371
5375
  if (fromGoogleMaps != null) {
5372
5376
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
5373
5377
  }
5374
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5375
- if (fromUrlContext != null) {
5376
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
5377
- }
5378
5378
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
5379
5379
  if (fromComputerUse != null) {
5380
5380
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -5385,6 +5385,20 @@ function toolToVertex$2(fromObject) {
5385
5385
  if (fromCodeExecution != null) {
5386
5386
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
5387
5387
  }
5388
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
5389
+ 'enterpriseWebSearch',
5390
+ ]);
5391
+ if (fromEnterpriseWebSearch != null) {
5392
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
5393
+ }
5394
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
5395
+ if (fromGoogleSearch != null) {
5396
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
5397
+ }
5398
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5399
+ if (fromUrlContext != null) {
5400
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
5401
+ }
5388
5402
  return toObject;
5389
5403
  }
5390
5404
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -6593,13 +6607,13 @@ class Files extends BaseModule {
6593
6607
  */
6594
6608
  function blobToMldev$2(fromObject) {
6595
6609
  const toObject = {};
6596
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6597
- throw new Error('displayName parameter is not supported in Gemini API.');
6598
- }
6599
6610
  const fromData = getValueByPath(fromObject, ['data']);
6600
6611
  if (fromData != null) {
6601
6612
  setValueByPath(toObject, ['data'], fromData);
6602
6613
  }
6614
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
6615
+ throw new Error('displayName parameter is not supported in Gemini API.');
6616
+ }
6603
6617
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6604
6618
  if (fromMimeType != null) {
6605
6619
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -6815,15 +6829,15 @@ function googleMapsToMldev$2(fromObject) {
6815
6829
  }
6816
6830
  function googleSearchToMldev$2(fromObject) {
6817
6831
  const toObject = {};
6832
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6833
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
6834
+ }
6818
6835
  const fromTimeRangeFilter = getValueByPath(fromObject, [
6819
6836
  'timeRangeFilter',
6820
6837
  ]);
6821
6838
  if (fromTimeRangeFilter != null) {
6822
6839
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
6823
6840
  }
6824
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
6825
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
6826
- }
6827
6841
  return toObject;
6828
6842
  }
6829
6843
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
@@ -7224,30 +7238,6 @@ function liveServerMessageFromVertex(fromObject) {
7224
7238
  }
7225
7239
  function partToMldev$2(fromObject) {
7226
7240
  const toObject = {};
7227
- const fromVideoMetadata = getValueByPath(fromObject, [
7228
- 'videoMetadata',
7229
- ]);
7230
- if (fromVideoMetadata != null) {
7231
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
7232
- }
7233
- const fromThought = getValueByPath(fromObject, ['thought']);
7234
- if (fromThought != null) {
7235
- setValueByPath(toObject, ['thought'], fromThought);
7236
- }
7237
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7238
- if (fromInlineData != null) {
7239
- setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
7240
- }
7241
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7242
- if (fromFileData != null) {
7243
- setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
7244
- }
7245
- const fromThoughtSignature = getValueByPath(fromObject, [
7246
- 'thoughtSignature',
7247
- ]);
7248
- if (fromThoughtSignature != null) {
7249
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7250
- }
7251
7241
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7252
7242
  if (fromFunctionCall != null) {
7253
7243
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -7264,16 +7254,40 @@ function partToMldev$2(fromObject) {
7264
7254
  if (fromExecutableCode != null) {
7265
7255
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7266
7256
  }
7257
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
7258
+ if (fromFileData != null) {
7259
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
7260
+ }
7267
7261
  const fromFunctionResponse = getValueByPath(fromObject, [
7268
7262
  'functionResponse',
7269
7263
  ]);
7270
7264
  if (fromFunctionResponse != null) {
7271
7265
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7272
7266
  }
7267
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7268
+ if (fromInlineData != null) {
7269
+ setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
7270
+ }
7273
7271
  const fromText = getValueByPath(fromObject, ['text']);
7274
7272
  if (fromText != null) {
7275
7273
  setValueByPath(toObject, ['text'], fromText);
7276
7274
  }
7275
+ const fromThought = getValueByPath(fromObject, ['thought']);
7276
+ if (fromThought != null) {
7277
+ setValueByPath(toObject, ['thought'], fromThought);
7278
+ }
7279
+ const fromThoughtSignature = getValueByPath(fromObject, [
7280
+ 'thoughtSignature',
7281
+ ]);
7282
+ if (fromThoughtSignature != null) {
7283
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7284
+ }
7285
+ const fromVideoMetadata = getValueByPath(fromObject, [
7286
+ 'videoMetadata',
7287
+ ]);
7288
+ if (fromVideoMetadata != null) {
7289
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
7290
+ }
7277
7291
  return toObject;
7278
7292
  }
7279
7293
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -7289,6 +7303,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7289
7303
  }
7290
7304
  function speechConfigToVertex$1(fromObject) {
7291
7305
  const toObject = {};
7306
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7307
+ if (fromLanguageCode != null) {
7308
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7309
+ }
7292
7310
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7293
7311
  if (fromVoiceConfig != null) {
7294
7312
  setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
@@ -7296,10 +7314,6 @@ function speechConfigToVertex$1(fromObject) {
7296
7314
  if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7297
7315
  throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7298
7316
  }
7299
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7300
- if (fromLanguageCode != null) {
7301
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7302
- }
7303
7317
  return toObject;
7304
7318
  }
7305
7319
  function toolToMldev$2(fromObject) {
@@ -7319,27 +7333,16 @@ function toolToMldev$2(fromObject) {
7319
7333
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
7320
7334
  throw new Error('retrieval parameter is not supported in Gemini API.');
7321
7335
  }
7322
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7323
- if (fromGoogleSearch != null) {
7324
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
7325
- }
7326
7336
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7327
7337
  'googleSearchRetrieval',
7328
7338
  ]);
7329
7339
  if (fromGoogleSearchRetrieval != null) {
7330
7340
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7331
7341
  }
7332
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7333
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7334
- }
7335
7342
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7336
7343
  if (fromGoogleMaps != null) {
7337
7344
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
7338
7345
  }
7339
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7340
- if (fromUrlContext != null) {
7341
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
7342
- }
7343
7346
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7344
7347
  if (fromComputerUse != null) {
7345
7348
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7350,6 +7353,17 @@ function toolToMldev$2(fromObject) {
7350
7353
  if (fromCodeExecution != null) {
7351
7354
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7352
7355
  }
7356
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7357
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7358
+ }
7359
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7360
+ if (fromGoogleSearch != null) {
7361
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(fromGoogleSearch));
7362
+ }
7363
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7364
+ if (fromUrlContext != null) {
7365
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
7366
+ }
7353
7367
  return toObject;
7354
7368
  }
7355
7369
  function toolToVertex$1(fromObject) {
@@ -7370,30 +7384,16 @@ function toolToVertex$1(fromObject) {
7370
7384
  if (fromRetrieval != null) {
7371
7385
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
7372
7386
  }
7373
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7374
- if (fromGoogleSearch != null) {
7375
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
7376
- }
7377
7387
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7378
7388
  'googleSearchRetrieval',
7379
7389
  ]);
7380
7390
  if (fromGoogleSearchRetrieval != null) {
7381
7391
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
7382
7392
  }
7383
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7384
- 'enterpriseWebSearch',
7385
- ]);
7386
- if (fromEnterpriseWebSearch != null) {
7387
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
7388
- }
7389
7393
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7390
7394
  if (fromGoogleMaps != null) {
7391
7395
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
7392
7396
  }
7393
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7394
- if (fromUrlContext != null) {
7395
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
7396
- }
7397
7397
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7398
7398
  if (fromComputerUse != null) {
7399
7399
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -7404,6 +7404,20 @@ function toolToVertex$1(fromObject) {
7404
7404
  if (fromCodeExecution != null) {
7405
7405
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7406
7406
  }
7407
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7408
+ 'enterpriseWebSearch',
7409
+ ]);
7410
+ if (fromEnterpriseWebSearch != null) {
7411
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
7412
+ }
7413
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7414
+ if (fromGoogleSearch != null) {
7415
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
7416
+ }
7417
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7418
+ if (fromUrlContext != null) {
7419
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
7420
+ }
7407
7421
  return toObject;
7408
7422
  }
7409
7423
  function usageMetadataFromVertex(fromObject) {
@@ -7506,13 +7520,13 @@ function usageMetadataFromVertex(fromObject) {
7506
7520
  */
7507
7521
  function blobToMldev$1(fromObject) {
7508
7522
  const toObject = {};
7509
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7510
- throw new Error('displayName parameter is not supported in Gemini API.');
7511
- }
7512
7523
  const fromData = getValueByPath(fromObject, ['data']);
7513
7524
  if (fromData != null) {
7514
7525
  setValueByPath(toObject, ['data'], fromData);
7515
7526
  }
7527
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7528
+ throw new Error('displayName parameter is not supported in Gemini API.');
7529
+ }
7516
7530
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7517
7531
  if (fromMimeType != null) {
7518
7532
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -7539,12 +7553,6 @@ function candidateFromMldev(fromObject) {
7539
7553
  if (fromFinishReason != null) {
7540
7554
  setValueByPath(toObject, ['finishReason'], fromFinishReason);
7541
7555
  }
7542
- const fromUrlContextMetadata = getValueByPath(fromObject, [
7543
- 'urlContextMetadata',
7544
- ]);
7545
- if (fromUrlContextMetadata != null) {
7546
- setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
7547
- }
7548
7556
  const fromAvgLogprobs = getValueByPath(fromObject, ['avgLogprobs']);
7549
7557
  if (fromAvgLogprobs != null) {
7550
7558
  setValueByPath(toObject, ['avgLogprobs'], fromAvgLogprobs);
@@ -7577,6 +7585,12 @@ function candidateFromMldev(fromObject) {
7577
7585
  }
7578
7586
  setValueByPath(toObject, ['safetyRatings'], transformedList);
7579
7587
  }
7588
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
7589
+ 'urlContextMetadata',
7590
+ ]);
7591
+ if (fromUrlContextMetadata != null) {
7592
+ setValueByPath(toObject, ['urlContextMetadata'], fromUrlContextMetadata);
7593
+ }
7580
7594
  return toObject;
7581
7595
  }
7582
7596
  function citationMetadataFromMldev(fromObject) {
@@ -9494,15 +9508,15 @@ function googleMapsToMldev$1(fromObject) {
9494
9508
  }
9495
9509
  function googleSearchToMldev$1(fromObject) {
9496
9510
  const toObject = {};
9511
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9512
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
9513
+ }
9497
9514
  const fromTimeRangeFilter = getValueByPath(fromObject, [
9498
9515
  'timeRangeFilter',
9499
9516
  ]);
9500
9517
  if (fromTimeRangeFilter != null) {
9501
9518
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
9502
9519
  }
9503
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
9504
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
9505
- }
9506
9520
  return toObject;
9507
9521
  }
9508
9522
  function imageFromMldev(fromObject) {
@@ -9792,30 +9806,6 @@ function modelFromVertex(fromObject) {
9792
9806
  }
9793
9807
  function partToMldev$1(fromObject) {
9794
9808
  const toObject = {};
9795
- const fromVideoMetadata = getValueByPath(fromObject, [
9796
- 'videoMetadata',
9797
- ]);
9798
- if (fromVideoMetadata != null) {
9799
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
9800
- }
9801
- const fromThought = getValueByPath(fromObject, ['thought']);
9802
- if (fromThought != null) {
9803
- setValueByPath(toObject, ['thought'], fromThought);
9804
- }
9805
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9806
- if (fromInlineData != null) {
9807
- setValueByPath(toObject, ['inlineData'], blobToMldev$1(fromInlineData));
9808
- }
9809
- const fromFileData = getValueByPath(fromObject, ['fileData']);
9810
- if (fromFileData != null) {
9811
- setValueByPath(toObject, ['fileData'], fileDataToMldev$1(fromFileData));
9812
- }
9813
- const fromThoughtSignature = getValueByPath(fromObject, [
9814
- 'thoughtSignature',
9815
- ]);
9816
- if (fromThoughtSignature != null) {
9817
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
9818
- }
9819
9809
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
9820
9810
  if (fromFunctionCall != null) {
9821
9811
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -9832,16 +9822,40 @@ function partToMldev$1(fromObject) {
9832
9822
  if (fromExecutableCode != null) {
9833
9823
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
9834
9824
  }
9825
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
9826
+ if (fromFileData != null) {
9827
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$1(fromFileData));
9828
+ }
9835
9829
  const fromFunctionResponse = getValueByPath(fromObject, [
9836
9830
  'functionResponse',
9837
9831
  ]);
9838
9832
  if (fromFunctionResponse != null) {
9839
9833
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
9840
9834
  }
9835
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9836
+ if (fromInlineData != null) {
9837
+ setValueByPath(toObject, ['inlineData'], blobToMldev$1(fromInlineData));
9838
+ }
9841
9839
  const fromText = getValueByPath(fromObject, ['text']);
9842
9840
  if (fromText != null) {
9843
9841
  setValueByPath(toObject, ['text'], fromText);
9844
9842
  }
9843
+ const fromThought = getValueByPath(fromObject, ['thought']);
9844
+ if (fromThought != null) {
9845
+ setValueByPath(toObject, ['thought'], fromThought);
9846
+ }
9847
+ const fromThoughtSignature = getValueByPath(fromObject, [
9848
+ 'thoughtSignature',
9849
+ ]);
9850
+ if (fromThoughtSignature != null) {
9851
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
9852
+ }
9853
+ const fromVideoMetadata = getValueByPath(fromObject, [
9854
+ 'videoMetadata',
9855
+ ]);
9856
+ if (fromVideoMetadata != null) {
9857
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
9858
+ }
9845
9859
  return toObject;
9846
9860
  }
9847
9861
  function productImageToVertex(fromObject) {
@@ -10058,13 +10072,13 @@ function safetyAttributesFromVertex(fromObject) {
10058
10072
  }
10059
10073
  function safetySettingToMldev(fromObject) {
10060
10074
  const toObject = {};
10061
- if (getValueByPath(fromObject, ['method']) !== undefined) {
10062
- throw new Error('method parameter is not supported in Gemini API.');
10063
- }
10064
10075
  const fromCategory = getValueByPath(fromObject, ['category']);
10065
10076
  if (fromCategory != null) {
10066
10077
  setValueByPath(toObject, ['category'], fromCategory);
10067
10078
  }
10079
+ if (getValueByPath(fromObject, ['method']) !== undefined) {
10080
+ throw new Error('method parameter is not supported in Gemini API.');
10081
+ }
10068
10082
  const fromThreshold = getValueByPath(fromObject, ['threshold']);
10069
10083
  if (fromThreshold != null) {
10070
10084
  setValueByPath(toObject, ['threshold'], fromThreshold);
@@ -10163,6 +10177,10 @@ function segmentImageSourceToVertex(fromObject, parentObject) {
10163
10177
  }
10164
10178
  function speechConfigToVertex(fromObject) {
10165
10179
  const toObject = {};
10180
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
10181
+ if (fromLanguageCode != null) {
10182
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
10183
+ }
10166
10184
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
10167
10185
  if (fromVoiceConfig != null) {
10168
10186
  setValueByPath(toObject, ['voiceConfig'], fromVoiceConfig);
@@ -10170,10 +10188,6 @@ function speechConfigToVertex(fromObject) {
10170
10188
  if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
10171
10189
  throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
10172
10190
  }
10173
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
10174
- if (fromLanguageCode != null) {
10175
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
10176
- }
10177
10191
  return toObject;
10178
10192
  }
10179
10193
  function toolToMldev$1(fromObject) {
@@ -10193,27 +10207,16 @@ function toolToMldev$1(fromObject) {
10193
10207
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
10194
10208
  throw new Error('retrieval parameter is not supported in Gemini API.');
10195
10209
  }
10196
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10197
- if (fromGoogleSearch != null) {
10198
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
10199
- }
10200
10210
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10201
10211
  'googleSearchRetrieval',
10202
10212
  ]);
10203
10213
  if (fromGoogleSearchRetrieval != null) {
10204
10214
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10205
10215
  }
10206
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10207
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10208
- }
10209
10216
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10210
10217
  if (fromGoogleMaps != null) {
10211
10218
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
10212
10219
  }
10213
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10214
- if (fromUrlContext != null) {
10215
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
10216
- }
10217
10220
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10218
10221
  if (fromComputerUse != null) {
10219
10222
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10224,6 +10227,17 @@ function toolToMldev$1(fromObject) {
10224
10227
  if (fromCodeExecution != null) {
10225
10228
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10226
10229
  }
10230
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10231
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10232
+ }
10233
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10234
+ if (fromGoogleSearch != null) {
10235
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(fromGoogleSearch));
10236
+ }
10237
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10238
+ if (fromUrlContext != null) {
10239
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
10240
+ }
10227
10241
  return toObject;
10228
10242
  }
10229
10243
  function toolToVertex(fromObject) {
@@ -10244,30 +10258,16 @@ function toolToVertex(fromObject) {
10244
10258
  if (fromRetrieval != null) {
10245
10259
  setValueByPath(toObject, ['retrieval'], fromRetrieval);
10246
10260
  }
10247
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10248
- if (fromGoogleSearch != null) {
10249
- setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
10250
- }
10251
10261
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
10252
10262
  'googleSearchRetrieval',
10253
10263
  ]);
10254
10264
  if (fromGoogleSearchRetrieval != null) {
10255
10265
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
10256
10266
  }
10257
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
10258
- 'enterpriseWebSearch',
10259
- ]);
10260
- if (fromEnterpriseWebSearch != null) {
10261
- setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
10262
- }
10263
10267
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10264
10268
  if (fromGoogleMaps != null) {
10265
10269
  setValueByPath(toObject, ['googleMaps'], fromGoogleMaps);
10266
10270
  }
10267
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10268
- if (fromUrlContext != null) {
10269
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
10270
- }
10271
10271
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
10272
10272
  if (fromComputerUse != null) {
10273
10273
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -10278,6 +10278,20 @@ function toolToVertex(fromObject) {
10278
10278
  if (fromCodeExecution != null) {
10279
10279
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
10280
10280
  }
10281
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
10282
+ 'enterpriseWebSearch',
10283
+ ]);
10284
+ if (fromEnterpriseWebSearch != null) {
10285
+ setValueByPath(toObject, ['enterpriseWebSearch'], fromEnterpriseWebSearch);
10286
+ }
10287
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
10288
+ if (fromGoogleSearch != null) {
10289
+ setValueByPath(toObject, ['googleSearch'], fromGoogleSearch);
10290
+ }
10291
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10292
+ if (fromUrlContext != null) {
10293
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
10294
+ }
10281
10295
  return toObject;
10282
10296
  }
10283
10297
  function tunedModelInfoFromMldev(fromObject) {
@@ -10381,6 +10395,18 @@ function upscaleImageAPIConfigInternalToVertex(fromObject, parentObject) {
10381
10395
  if (parentObject !== undefined && fromOutputGcsUri != null) {
10382
10396
  setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
10383
10397
  }
10398
+ const fromSafetyFilterLevel = getValueByPath(fromObject, [
10399
+ 'safetyFilterLevel',
10400
+ ]);
10401
+ if (parentObject !== undefined && fromSafetyFilterLevel != null) {
10402
+ setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
10403
+ }
10404
+ const fromPersonGeneration = getValueByPath(fromObject, [
10405
+ 'personGeneration',
10406
+ ]);
10407
+ if (parentObject !== undefined && fromPersonGeneration != null) {
10408
+ setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
10409
+ }
10384
10410
  const fromIncludeRaiReason = getValueByPath(fromObject, [
10385
10411
  'includeRaiReason',
10386
10412
  ]);
@@ -10587,7 +10613,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
10587
10613
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
10588
10614
  const USER_AGENT_HEADER = 'User-Agent';
10589
10615
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
10590
- const SDK_VERSION = '1.26.0'; // x-release-please-version
10616
+ const SDK_VERSION = '1.28.0'; // x-release-please-version
10591
10617
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
10592
10618
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
10593
10619
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10776,7 +10802,7 @@ class ApiClient {
10776
10802
  else {
10777
10803
  requestInit.body = request.body;
10778
10804
  }
10779
- requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, request.abortSignal);
10805
+ requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, url.toString(), request.abortSignal);
10780
10806
  return this.unaryApiCall(url, requestInit, request.httpMethod);
10781
10807
  }
10782
10808
  patchHttpOptions(baseHttpOptions, requestHttpOptions) {
@@ -10810,10 +10836,10 @@ class ApiClient {
10810
10836
  }
10811
10837
  let requestInit = {};
10812
10838
  requestInit.body = request.body;
10813
- requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, request.abortSignal);
10839
+ requestInit = await this.includeExtraHttpOptionsToRequestInit(requestInit, patchedHttpOptions, url.toString(), request.abortSignal);
10814
10840
  return this.streamApiCall(url, requestInit, request.httpMethod);
10815
10841
  }
10816
- async includeExtraHttpOptionsToRequestInit(requestInit, httpOptions, abortSignal) {
10842
+ async includeExtraHttpOptionsToRequestInit(requestInit, httpOptions, url, abortSignal) {
10817
10843
  if ((httpOptions && httpOptions.timeout) || abortSignal) {
10818
10844
  const abortController = new AbortController();
10819
10845
  const signal = abortController.signal;
@@ -10837,7 +10863,7 @@ class ApiClient {
10837
10863
  if (httpOptions && httpOptions.extraBody !== null) {
10838
10864
  includeExtraBodyToRequestInit(requestInit, httpOptions.extraBody);
10839
10865
  }
10840
- requestInit.headers = await this.getHeadersInternal(httpOptions);
10866
+ requestInit.headers = await this.getHeadersInternal(httpOptions, url);
10841
10867
  return requestInit;
10842
10868
  }
10843
10869
  async unaryApiCall(url, requestInit, httpMethod) {
@@ -10950,7 +10976,7 @@ class ApiClient {
10950
10976
  headers[CONTENT_TYPE_HEADER] = 'application/json';
10951
10977
  return headers;
10952
10978
  }
10953
- async getHeadersInternal(httpOptions) {
10979
+ async getHeadersInternal(httpOptions, url) {
10954
10980
  const headers = new Headers();
10955
10981
  if (httpOptions && httpOptions.headers) {
10956
10982
  for (const [key, value] of Object.entries(httpOptions.headers)) {
@@ -10962,7 +10988,7 @@ class ApiClient {
10962
10988
  headers.append(SERVER_TIMEOUT_HEADER, String(Math.ceil(httpOptions.timeout / 1000)));
10963
10989
  }
10964
10990
  }
10965
- await this.clientOptions.auth.addAuthHeaders(headers);
10991
+ await this.clientOptions.auth.addAuthHeaders(headers, url);
10966
10992
  return headers;
10967
10993
  }
10968
10994
  /**
@@ -10971,13 +10997,13 @@ class ApiClient {
10971
10997
  *
10972
10998
  * @param file The string path to the file to be uploaded or a Blob object.
10973
10999
  * @param config Optional parameters specified in the `UploadFileConfig`
10974
- * interface. @see {@link UploadFileConfig}
11000
+ * interface. @see {@link types.UploadFileConfig}
10975
11001
  * @return A promise that resolves to a `File` object.
10976
11002
  * @throws An error if called on a Vertex AI client.
10977
11003
  * @throws An error if the `mimeType` is not provided and can not be inferred,
10978
11004
  */
10979
11005
  async uploadFile(file, config) {
10980
- var _a;
11006
+ var _a, _b;
10981
11007
  const fileToUpload = {};
10982
11008
  if (config != null) {
10983
11009
  fileToUpload.mimeType = config.mimeType;
@@ -10995,20 +11021,25 @@ class ApiClient {
10995
11021
  throw new Error('Can not determine mimeType. Please provide mimeType in the config.');
10996
11022
  }
10997
11023
  fileToUpload.mimeType = mimeType;
10998
- const uploadUrl = await this.fetchUploadUrl(fileToUpload, config);
11024
+ let fileName = '';
11025
+ if (typeof file === 'string') {
11026
+ fileName = file.replace(/[/\\]+$/, '');
11027
+ fileName = (_b = fileName.split(/[/\\]/).pop()) !== null && _b !== void 0 ? _b : '';
11028
+ }
11029
+ const uploadUrl = await this.fetchUploadUrl(fileToUpload, fileName, config);
10999
11030
  return uploader.upload(file, uploadUrl, this);
11000
11031
  }
11001
11032
  /**
11002
11033
  * Downloads a file asynchronously to the specified path.
11003
11034
  *
11004
11035
  * @params params - The parameters for the download request, see {@link
11005
- * DownloadFileParameters}
11036
+ * types.DownloadFileParameters}
11006
11037
  */
11007
11038
  async downloadFile(params) {
11008
11039
  const downloader = this.clientOptions.downloader;
11009
11040
  await downloader.download(params, this);
11010
11041
  }
11011
- async fetchUploadUrl(file, config) {
11042
+ async fetchUploadUrl(file, fileName, config) {
11012
11043
  var _a;
11013
11044
  let httpOptions = {};
11014
11045
  if (config === null || config === void 0 ? void 0 : config.httpOptions) {
@@ -11017,13 +11048,7 @@ class ApiClient {
11017
11048
  else {
11018
11049
  httpOptions = {
11019
11050
  apiVersion: '',
11020
- headers: {
11021
- 'Content-Type': 'application/json',
11022
- 'X-Goog-Upload-Protocol': 'resumable',
11023
- 'X-Goog-Upload-Command': 'start',
11024
- 'X-Goog-Upload-Header-Content-Length': `${file.sizeBytes}`,
11025
- 'X-Goog-Upload-Header-Content-Type': `${file.mimeType}`,
11026
- },
11051
+ 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 } : {})),
11027
11052
  };
11028
11053
  }
11029
11054
  const body = {
@@ -11675,7 +11700,7 @@ class Live {
11675
11700
  const headers = mapToHeaders(clientHeaders);
11676
11701
  if (this.apiClient.isVertexAI()) {
11677
11702
  url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
11678
- await this.auth.addAuthHeaders(headers);
11703
+ await this.auth.addAuthHeaders(headers, url);
11679
11704
  }
11680
11705
  else {
11681
11706
  const apiKey = this.apiClient.getApiKey();
@@ -13726,13 +13751,13 @@ class Operations extends BaseModule {
13726
13751
  */
13727
13752
  function blobToMldev(fromObject) {
13728
13753
  const toObject = {};
13729
- if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13730
- throw new Error('displayName parameter is not supported in Gemini API.');
13731
- }
13732
13754
  const fromData = getValueByPath(fromObject, ['data']);
13733
13755
  if (fromData != null) {
13734
13756
  setValueByPath(toObject, ['data'], fromData);
13735
13757
  }
13758
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13759
+ throw new Error('displayName parameter is not supported in Gemini API.');
13760
+ }
13736
13761
  const fromMimeType = getValueByPath(fromObject, ['mimeType']);
13737
13762
  if (fromMimeType != null) {
13738
13763
  setValueByPath(toObject, ['mimeType'], fromMimeType);
@@ -13823,15 +13848,15 @@ function googleMapsToMldev(fromObject) {
13823
13848
  }
13824
13849
  function googleSearchToMldev(fromObject) {
13825
13850
  const toObject = {};
13851
+ if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13852
+ throw new Error('excludeDomains parameter is not supported in Gemini API.');
13853
+ }
13826
13854
  const fromTimeRangeFilter = getValueByPath(fromObject, [
13827
13855
  'timeRangeFilter',
13828
13856
  ]);
13829
13857
  if (fromTimeRangeFilter != null) {
13830
13858
  setValueByPath(toObject, ['timeRangeFilter'], fromTimeRangeFilter);
13831
13859
  }
13832
- if (getValueByPath(fromObject, ['excludeDomains']) !== undefined) {
13833
- throw new Error('excludeDomains parameter is not supported in Gemini API.');
13834
- }
13835
13860
  return toObject;
13836
13861
  }
13837
13862
  function liveConnectConfigToMldev(fromObject, parentObject) {
@@ -13958,30 +13983,6 @@ function liveConnectConstraintsToMldev(apiClient, fromObject) {
13958
13983
  }
13959
13984
  function partToMldev(fromObject) {
13960
13985
  const toObject = {};
13961
- const fromVideoMetadata = getValueByPath(fromObject, [
13962
- 'videoMetadata',
13963
- ]);
13964
- if (fromVideoMetadata != null) {
13965
- setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
13966
- }
13967
- const fromThought = getValueByPath(fromObject, ['thought']);
13968
- if (fromThought != null) {
13969
- setValueByPath(toObject, ['thought'], fromThought);
13970
- }
13971
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
13972
- if (fromInlineData != null) {
13973
- setValueByPath(toObject, ['inlineData'], blobToMldev(fromInlineData));
13974
- }
13975
- const fromFileData = getValueByPath(fromObject, ['fileData']);
13976
- if (fromFileData != null) {
13977
- setValueByPath(toObject, ['fileData'], fileDataToMldev(fromFileData));
13978
- }
13979
- const fromThoughtSignature = getValueByPath(fromObject, [
13980
- 'thoughtSignature',
13981
- ]);
13982
- if (fromThoughtSignature != null) {
13983
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
13984
- }
13985
13986
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
13986
13987
  if (fromFunctionCall != null) {
13987
13988
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -13998,16 +13999,40 @@ function partToMldev(fromObject) {
13998
13999
  if (fromExecutableCode != null) {
13999
14000
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
14000
14001
  }
14002
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
14003
+ if (fromFileData != null) {
14004
+ setValueByPath(toObject, ['fileData'], fileDataToMldev(fromFileData));
14005
+ }
14001
14006
  const fromFunctionResponse = getValueByPath(fromObject, [
14002
14007
  'functionResponse',
14003
14008
  ]);
14004
14009
  if (fromFunctionResponse != null) {
14005
14010
  setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
14006
14011
  }
14012
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
14013
+ if (fromInlineData != null) {
14014
+ setValueByPath(toObject, ['inlineData'], blobToMldev(fromInlineData));
14015
+ }
14007
14016
  const fromText = getValueByPath(fromObject, ['text']);
14008
14017
  if (fromText != null) {
14009
14018
  setValueByPath(toObject, ['text'], fromText);
14010
14019
  }
14020
+ const fromThought = getValueByPath(fromObject, ['thought']);
14021
+ if (fromThought != null) {
14022
+ setValueByPath(toObject, ['thought'], fromThought);
14023
+ }
14024
+ const fromThoughtSignature = getValueByPath(fromObject, [
14025
+ 'thoughtSignature',
14026
+ ]);
14027
+ if (fromThoughtSignature != null) {
14028
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
14029
+ }
14030
+ const fromVideoMetadata = getValueByPath(fromObject, [
14031
+ 'videoMetadata',
14032
+ ]);
14033
+ if (fromVideoMetadata != null) {
14034
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
14035
+ }
14011
14036
  return toObject;
14012
14037
  }
14013
14038
  function sessionResumptionConfigToMldev(fromObject) {
@@ -14038,27 +14063,16 @@ function toolToMldev(fromObject) {
14038
14063
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
14039
14064
  throw new Error('retrieval parameter is not supported in Gemini API.');
14040
14065
  }
14041
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
14042
- if (fromGoogleSearch != null) {
14043
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
14044
- }
14045
14066
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
14046
14067
  'googleSearchRetrieval',
14047
14068
  ]);
14048
14069
  if (fromGoogleSearchRetrieval != null) {
14049
14070
  setValueByPath(toObject, ['googleSearchRetrieval'], fromGoogleSearchRetrieval);
14050
14071
  }
14051
- if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
14052
- throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
14053
- }
14054
14072
  const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14055
14073
  if (fromGoogleMaps != null) {
14056
14074
  setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
14057
14075
  }
14058
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14059
- if (fromUrlContext != null) {
14060
- setValueByPath(toObject, ['urlContext'], fromUrlContext);
14061
- }
14062
14076
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
14063
14077
  if (fromComputerUse != null) {
14064
14078
  setValueByPath(toObject, ['computerUse'], fromComputerUse);
@@ -14069,6 +14083,17 @@ function toolToMldev(fromObject) {
14069
14083
  if (fromCodeExecution != null) {
14070
14084
  setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
14071
14085
  }
14086
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
14087
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
14088
+ }
14089
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
14090
+ if (fromGoogleSearch != null) {
14091
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(fromGoogleSearch));
14092
+ }
14093
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14094
+ if (fromUrlContext != null) {
14095
+ setValueByPath(toObject, ['urlContext'], fromUrlContext);
14096
+ }
14072
14097
  return toObject;
14073
14098
  }
14074
14099
 
@@ -14348,7 +14373,7 @@ class Tokens extends BaseModule {
14348
14373
  * SPDX-License-Identifier: Apache-2.0
14349
14374
  */
14350
14375
  // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
14351
- function cancelTuningJobParametersToMldev(fromObject) {
14376
+ function cancelTuningJobParametersToMldev(fromObject, _rootObject) {
14352
14377
  const toObject = {};
14353
14378
  const fromName = getValueByPath(fromObject, ['name']);
14354
14379
  if (fromName != null) {
@@ -14356,7 +14381,7 @@ function cancelTuningJobParametersToMldev(fromObject) {
14356
14381
  }
14357
14382
  return toObject;
14358
14383
  }
14359
- function cancelTuningJobParametersToVertex(fromObject) {
14384
+ function cancelTuningJobParametersToVertex(fromObject, _rootObject) {
14360
14385
  const toObject = {};
14361
14386
  const fromName = getValueByPath(fromObject, ['name']);
14362
14387
  if (fromName != null) {
@@ -14364,7 +14389,7 @@ function cancelTuningJobParametersToVertex(fromObject) {
14364
14389
  }
14365
14390
  return toObject;
14366
14391
  }
14367
- function createTuningJobConfigToMldev(fromObject, parentObject) {
14392
+ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
14368
14393
  const toObject = {};
14369
14394
  if (getValueByPath(fromObject, ['validationDataset']) !== undefined) {
14370
14395
  throw new Error('validationDataset parameter is not supported in Gemini API.');
@@ -14410,15 +14435,35 @@ function createTuningJobConfigToMldev(fromObject, parentObject) {
14410
14435
  if (getValueByPath(fromObject, ['labels']) !== undefined) {
14411
14436
  throw new Error('labels parameter is not supported in Gemini API.');
14412
14437
  }
14438
+ if (getValueByPath(fromObject, ['beta']) !== undefined) {
14439
+ throw new Error('beta parameter is not supported in Gemini API.');
14440
+ }
14413
14441
  return toObject;
14414
14442
  }
14415
- function createTuningJobConfigToVertex(fromObject, parentObject) {
14443
+ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
14416
14444
  const toObject = {};
14417
- const fromValidationDataset = getValueByPath(fromObject, [
14418
- 'validationDataset',
14445
+ let discriminatorValidationDataset = getValueByPath(rootObject, [
14446
+ 'config',
14447
+ 'method',
14419
14448
  ]);
14420
- if (parentObject !== undefined && fromValidationDataset != null) {
14421
- setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset, toObject));
14449
+ if (discriminatorValidationDataset === undefined) {
14450
+ discriminatorValidationDataset = 'SUPERVISED_FINE_TUNING';
14451
+ }
14452
+ if (discriminatorValidationDataset === 'SUPERVISED_FINE_TUNING') {
14453
+ const fromValidationDataset = getValueByPath(fromObject, [
14454
+ 'validationDataset',
14455
+ ]);
14456
+ if (parentObject !== undefined && fromValidationDataset != null) {
14457
+ setValueByPath(parentObject, ['supervisedTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
14458
+ }
14459
+ }
14460
+ else if (discriminatorValidationDataset === 'PREFERENCE_TUNING') {
14461
+ const fromValidationDataset = getValueByPath(fromObject, [
14462
+ 'validationDataset',
14463
+ ]);
14464
+ if (parentObject !== undefined && fromValidationDataset != null) {
14465
+ setValueByPath(parentObject, ['preferenceOptimizationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
14466
+ }
14422
14467
  }
14423
14468
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
14424
14469
  'tunedModelDisplayName',
@@ -14430,25 +14475,90 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
14430
14475
  if (parentObject !== undefined && fromDescription != null) {
14431
14476
  setValueByPath(parentObject, ['description'], fromDescription);
14432
14477
  }
14433
- const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14434
- if (parentObject !== undefined && fromEpochCount != null) {
14435
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14478
+ let discriminatorEpochCount = getValueByPath(rootObject, [
14479
+ 'config',
14480
+ 'method',
14481
+ ]);
14482
+ if (discriminatorEpochCount === undefined) {
14483
+ discriminatorEpochCount = 'SUPERVISED_FINE_TUNING';
14436
14484
  }
14437
- const fromLearningRateMultiplier = getValueByPath(fromObject, [
14438
- 'learningRateMultiplier',
14485
+ if (discriminatorEpochCount === 'SUPERVISED_FINE_TUNING') {
14486
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14487
+ if (parentObject !== undefined && fromEpochCount != null) {
14488
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14489
+ }
14490
+ }
14491
+ else if (discriminatorEpochCount === 'PREFERENCE_TUNING') {
14492
+ const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
14493
+ if (parentObject !== undefined && fromEpochCount != null) {
14494
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
14495
+ }
14496
+ }
14497
+ let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
14498
+ 'config',
14499
+ 'method',
14439
14500
  ]);
14440
- if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14441
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
14501
+ if (discriminatorLearningRateMultiplier === undefined) {
14502
+ discriminatorLearningRateMultiplier = 'SUPERVISED_FINE_TUNING';
14503
+ }
14504
+ if (discriminatorLearningRateMultiplier === 'SUPERVISED_FINE_TUNING') {
14505
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
14506
+ 'learningRateMultiplier',
14507
+ ]);
14508
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14509
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
14510
+ }
14511
+ }
14512
+ else if (discriminatorLearningRateMultiplier === 'PREFERENCE_TUNING') {
14513
+ const fromLearningRateMultiplier = getValueByPath(fromObject, [
14514
+ 'learningRateMultiplier',
14515
+ ]);
14516
+ if (parentObject !== undefined && fromLearningRateMultiplier != null) {
14517
+ setValueByPath(parentObject, [
14518
+ 'preferenceOptimizationSpec',
14519
+ 'hyperParameters',
14520
+ 'learningRateMultiplier',
14521
+ ], fromLearningRateMultiplier);
14522
+ }
14523
+ }
14524
+ let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
14525
+ if (discriminatorExportLastCheckpointOnly === undefined) {
14526
+ discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
14527
+ }
14528
+ if (discriminatorExportLastCheckpointOnly === 'SUPERVISED_FINE_TUNING') {
14529
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14530
+ 'exportLastCheckpointOnly',
14531
+ ]);
14532
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14533
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14534
+ }
14442
14535
  }
14443
- const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14444
- 'exportLastCheckpointOnly',
14536
+ else if (discriminatorExportLastCheckpointOnly === 'PREFERENCE_TUNING') {
14537
+ const fromExportLastCheckpointOnly = getValueByPath(fromObject, [
14538
+ 'exportLastCheckpointOnly',
14539
+ ]);
14540
+ if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14541
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14542
+ }
14543
+ }
14544
+ let discriminatorAdapterSize = getValueByPath(rootObject, [
14545
+ 'config',
14546
+ 'method',
14445
14547
  ]);
14446
- if (parentObject !== undefined && fromExportLastCheckpointOnly != null) {
14447
- setValueByPath(parentObject, ['supervisedTuningSpec', 'exportLastCheckpointOnly'], fromExportLastCheckpointOnly);
14548
+ if (discriminatorAdapterSize === undefined) {
14549
+ discriminatorAdapterSize = 'SUPERVISED_FINE_TUNING';
14550
+ }
14551
+ if (discriminatorAdapterSize === 'SUPERVISED_FINE_TUNING') {
14552
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14553
+ if (parentObject !== undefined && fromAdapterSize != null) {
14554
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14555
+ }
14448
14556
  }
14449
- const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14450
- if (parentObject !== undefined && fromAdapterSize != null) {
14451
- setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14557
+ else if (discriminatorAdapterSize === 'PREFERENCE_TUNING') {
14558
+ const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
14559
+ if (parentObject !== undefined && fromAdapterSize != null) {
14560
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
14561
+ }
14452
14562
  }
14453
14563
  if (getValueByPath(fromObject, ['batchSize']) !== undefined) {
14454
14564
  throw new Error('batchSize parameter is not supported in Vertex AI.');
@@ -14460,9 +14570,13 @@ function createTuningJobConfigToVertex(fromObject, parentObject) {
14460
14570
  if (parentObject !== undefined && fromLabels != null) {
14461
14571
  setValueByPath(parentObject, ['labels'], fromLabels);
14462
14572
  }
14573
+ const fromBeta = getValueByPath(fromObject, ['beta']);
14574
+ if (parentObject !== undefined && fromBeta != null) {
14575
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'hyperParameters', 'beta'], fromBeta);
14576
+ }
14463
14577
  return toObject;
14464
14578
  }
14465
- function createTuningJobParametersPrivateToMldev(fromObject) {
14579
+ function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
14466
14580
  const toObject = {};
14467
14581
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
14468
14582
  if (fromBaseModel != null) {
@@ -14478,7 +14592,7 @@ function createTuningJobParametersPrivateToMldev(fromObject) {
14478
14592
  'trainingDataset',
14479
14593
  ]);
14480
14594
  if (fromTrainingDataset != null) {
14481
- setValueByPath(toObject, ['tuningTask', 'trainingData'], tuningDatasetToMldev(fromTrainingDataset));
14595
+ tuningDatasetToMldev(fromTrainingDataset);
14482
14596
  }
14483
14597
  const fromConfig = getValueByPath(fromObject, ['config']);
14484
14598
  if (fromConfig != null) {
@@ -14486,7 +14600,7 @@ function createTuningJobParametersPrivateToMldev(fromObject) {
14486
14600
  }
14487
14601
  return toObject;
14488
14602
  }
14489
- function createTuningJobParametersPrivateToVertex(fromObject) {
14603
+ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
14490
14604
  const toObject = {};
14491
14605
  const fromBaseModel = getValueByPath(fromObject, ['baseModel']);
14492
14606
  if (fromBaseModel != null) {
@@ -14502,15 +14616,15 @@ function createTuningJobParametersPrivateToVertex(fromObject) {
14502
14616
  'trainingDataset',
14503
14617
  ]);
14504
14618
  if (fromTrainingDataset != null) {
14505
- setValueByPath(toObject, ['supervisedTuningSpec', 'trainingDatasetUri'], tuningDatasetToVertex(fromTrainingDataset, toObject));
14619
+ tuningDatasetToVertex(fromTrainingDataset, toObject, rootObject);
14506
14620
  }
14507
14621
  const fromConfig = getValueByPath(fromObject, ['config']);
14508
14622
  if (fromConfig != null) {
14509
- createTuningJobConfigToVertex(fromConfig, toObject);
14623
+ createTuningJobConfigToVertex(fromConfig, toObject, rootObject);
14510
14624
  }
14511
14625
  return toObject;
14512
14626
  }
14513
- function getTuningJobParametersToMldev(fromObject) {
14627
+ function getTuningJobParametersToMldev(fromObject, _rootObject) {
14514
14628
  const toObject = {};
14515
14629
  const fromName = getValueByPath(fromObject, ['name']);
14516
14630
  if (fromName != null) {
@@ -14518,7 +14632,7 @@ function getTuningJobParametersToMldev(fromObject) {
14518
14632
  }
14519
14633
  return toObject;
14520
14634
  }
14521
- function getTuningJobParametersToVertex(fromObject) {
14635
+ function getTuningJobParametersToVertex(fromObject, _rootObject) {
14522
14636
  const toObject = {};
14523
14637
  const fromName = getValueByPath(fromObject, ['name']);
14524
14638
  if (fromName != null) {
@@ -14526,7 +14640,7 @@ function getTuningJobParametersToVertex(fromObject) {
14526
14640
  }
14527
14641
  return toObject;
14528
14642
  }
14529
- function listTuningJobsConfigToMldev(fromObject, parentObject) {
14643
+ function listTuningJobsConfigToMldev(fromObject, parentObject, _rootObject) {
14530
14644
  const toObject = {};
14531
14645
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
14532
14646
  if (parentObject !== undefined && fromPageSize != null) {
@@ -14542,7 +14656,7 @@ function listTuningJobsConfigToMldev(fromObject, parentObject) {
14542
14656
  }
14543
14657
  return toObject;
14544
14658
  }
14545
- function listTuningJobsConfigToVertex(fromObject, parentObject) {
14659
+ function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
14546
14660
  const toObject = {};
14547
14661
  const fromPageSize = getValueByPath(fromObject, ['pageSize']);
14548
14662
  if (parentObject !== undefined && fromPageSize != null) {
@@ -14558,7 +14672,7 @@ function listTuningJobsConfigToVertex(fromObject, parentObject) {
14558
14672
  }
14559
14673
  return toObject;
14560
14674
  }
14561
- function listTuningJobsParametersToMldev(fromObject) {
14675
+ function listTuningJobsParametersToMldev(fromObject, rootObject) {
14562
14676
  const toObject = {};
14563
14677
  const fromConfig = getValueByPath(fromObject, ['config']);
14564
14678
  if (fromConfig != null) {
@@ -14566,7 +14680,7 @@ function listTuningJobsParametersToMldev(fromObject) {
14566
14680
  }
14567
14681
  return toObject;
14568
14682
  }
14569
- function listTuningJobsParametersToVertex(fromObject) {
14683
+ function listTuningJobsParametersToVertex(fromObject, rootObject) {
14570
14684
  const toObject = {};
14571
14685
  const fromConfig = getValueByPath(fromObject, ['config']);
14572
14686
  if (fromConfig != null) {
@@ -14574,7 +14688,7 @@ function listTuningJobsParametersToVertex(fromObject) {
14574
14688
  }
14575
14689
  return toObject;
14576
14690
  }
14577
- function listTuningJobsResponseFromMldev(fromObject) {
14691
+ function listTuningJobsResponseFromMldev(fromObject, rootObject) {
14578
14692
  const toObject = {};
14579
14693
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14580
14694
  'sdkHttpResponse',
@@ -14600,7 +14714,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
14600
14714
  }
14601
14715
  return toObject;
14602
14716
  }
14603
- function listTuningJobsResponseFromVertex(fromObject) {
14717
+ function listTuningJobsResponseFromVertex(fromObject, rootObject) {
14604
14718
  const toObject = {};
14605
14719
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14606
14720
  'sdkHttpResponse',
@@ -14626,7 +14740,7 @@ function listTuningJobsResponseFromVertex(fromObject) {
14626
14740
  }
14627
14741
  return toObject;
14628
14742
  }
14629
- function tunedModelFromMldev(fromObject) {
14743
+ function tunedModelFromMldev(fromObject, _rootObject) {
14630
14744
  const toObject = {};
14631
14745
  const fromModel = getValueByPath(fromObject, ['name']);
14632
14746
  if (fromModel != null) {
@@ -14638,7 +14752,7 @@ function tunedModelFromMldev(fromObject) {
14638
14752
  }
14639
14753
  return toObject;
14640
14754
  }
14641
- function tuningDatasetToMldev(fromObject) {
14755
+ function tuningDatasetToMldev(fromObject, _rootObject) {
14642
14756
  const toObject = {};
14643
14757
  if (getValueByPath(fromObject, ['gcsUri']) !== undefined) {
14644
14758
  throw new Error('gcsUri parameter is not supported in Gemini API.');
@@ -14658,24 +14772,56 @@ function tuningDatasetToMldev(fromObject) {
14658
14772
  }
14659
14773
  return toObject;
14660
14774
  }
14661
- function tuningDatasetToVertex(fromObject, parentObject) {
14775
+ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
14662
14776
  const toObject = {};
14663
- const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14664
- if (parentObject !== undefined && fromGcsUri != null) {
14665
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
14777
+ let discriminatorGcsUri = getValueByPath(rootObject, [
14778
+ 'config',
14779
+ 'method',
14780
+ ]);
14781
+ if (discriminatorGcsUri === undefined) {
14782
+ discriminatorGcsUri = 'SUPERVISED_FINE_TUNING';
14666
14783
  }
14667
- const fromVertexDatasetResource = getValueByPath(fromObject, [
14668
- 'vertexDatasetResource',
14784
+ if (discriminatorGcsUri === 'SUPERVISED_FINE_TUNING') {
14785
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14786
+ if (parentObject !== undefined && fromGcsUri != null) {
14787
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromGcsUri);
14788
+ }
14789
+ }
14790
+ else if (discriminatorGcsUri === 'PREFERENCE_TUNING') {
14791
+ const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14792
+ if (parentObject !== undefined && fromGcsUri != null) {
14793
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromGcsUri);
14794
+ }
14795
+ }
14796
+ let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
14797
+ 'config',
14798
+ 'method',
14669
14799
  ]);
14670
- if (parentObject !== undefined && fromVertexDatasetResource != null) {
14671
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
14800
+ if (discriminatorVertexDatasetResource === undefined) {
14801
+ discriminatorVertexDatasetResource = 'SUPERVISED_FINE_TUNING';
14802
+ }
14803
+ if (discriminatorVertexDatasetResource === 'SUPERVISED_FINE_TUNING') {
14804
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
14805
+ 'vertexDatasetResource',
14806
+ ]);
14807
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
14808
+ setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
14809
+ }
14810
+ }
14811
+ else if (discriminatorVertexDatasetResource === 'PREFERENCE_TUNING') {
14812
+ const fromVertexDatasetResource = getValueByPath(fromObject, [
14813
+ 'vertexDatasetResource',
14814
+ ]);
14815
+ if (parentObject !== undefined && fromVertexDatasetResource != null) {
14816
+ setValueByPath(parentObject, ['preferenceOptimizationSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
14817
+ }
14672
14818
  }
14673
14819
  if (getValueByPath(fromObject, ['examples']) !== undefined) {
14674
14820
  throw new Error('examples parameter is not supported in Vertex AI.');
14675
14821
  }
14676
14822
  return toObject;
14677
14823
  }
14678
- function tuningJobFromMldev(fromObject) {
14824
+ function tuningJobFromMldev(fromObject, rootObject) {
14679
14825
  const toObject = {};
14680
14826
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14681
14827
  'sdkHttpResponse',
@@ -14727,7 +14873,7 @@ function tuningJobFromMldev(fromObject) {
14727
14873
  }
14728
14874
  return toObject;
14729
14875
  }
14730
- function tuningJobFromVertex(fromObject) {
14876
+ function tuningJobFromVertex(fromObject, _rootObject) {
14731
14877
  const toObject = {};
14732
14878
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14733
14879
  'sdkHttpResponse',
@@ -14787,6 +14933,12 @@ function tuningJobFromVertex(fromObject) {
14787
14933
  if (fromSupervisedTuningSpec != null) {
14788
14934
  setValueByPath(toObject, ['supervisedTuningSpec'], fromSupervisedTuningSpec);
14789
14935
  }
14936
+ const fromPreferenceOptimizationSpec = getValueByPath(fromObject, [
14937
+ 'preferenceOptimizationSpec',
14938
+ ]);
14939
+ if (fromPreferenceOptimizationSpec != null) {
14940
+ setValueByPath(toObject, ['preferenceOptimizationSpec'], fromPreferenceOptimizationSpec);
14941
+ }
14790
14942
  const fromTuningDataStats = getValueByPath(fromObject, [
14791
14943
  'tuningDataStats',
14792
14944
  ]);
@@ -14847,7 +14999,7 @@ function tuningJobFromVertex(fromObject) {
14847
14999
  }
14848
15000
  return toObject;
14849
15001
  }
14850
- function tuningOperationFromMldev(fromObject) {
15002
+ function tuningOperationFromMldev(fromObject, _rootObject) {
14851
15003
  const toObject = {};
14852
15004
  const fromSdkHttpResponse = getValueByPath(fromObject, [
14853
15005
  'sdkHttpResponse',
@@ -14873,7 +15025,7 @@ function tuningOperationFromMldev(fromObject) {
14873
15025
  }
14874
15026
  return toObject;
14875
15027
  }
14876
- function tuningValidationDatasetToVertex(fromObject, parentObject) {
15028
+ function tuningValidationDatasetToVertex(fromObject, _rootObject) {
14877
15029
  const toObject = {};
14878
15030
  const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
14879
15031
  if (fromGcsUri != null) {
@@ -14882,8 +15034,8 @@ function tuningValidationDatasetToVertex(fromObject, parentObject) {
14882
15034
  const fromVertexDatasetResource = getValueByPath(fromObject, [
14883
15035
  'vertexDatasetResource',
14884
15036
  ]);
14885
- if (parentObject !== undefined && fromVertexDatasetResource != null) {
14886
- setValueByPath(parentObject, ['supervisedTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
15037
+ if (fromVertexDatasetResource != null) {
15038
+ setValueByPath(toObject, ['validationDatasetUri'], fromVertexDatasetResource);
14887
15039
  }
14888
15040
  return toObject;
14889
15041
  }
@@ -15153,7 +15305,7 @@ class Tunings extends BaseModule {
15153
15305
  let path = '';
15154
15306
  let queryParams = {};
15155
15307
  if (this.apiClient.isVertexAI()) {
15156
- const body = createTuningJobParametersPrivateToVertex(params);
15308
+ const body = createTuningJobParametersPrivateToVertex(params, params);
15157
15309
  path = formatMap('tuningJobs', body['_url']);
15158
15310
  queryParams = body['_query'];
15159
15311
  delete body['_url'];
@@ -15369,7 +15521,8 @@ class WebAuth {
15369
15521
  constructor(apiKey) {
15370
15522
  this.apiKey = apiKey;
15371
15523
  }
15372
- async addAuthHeaders(headers) {
15524
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15525
+ async addAuthHeaders(headers, url) {
15373
15526
  if (headers.get(GOOGLE_API_KEY_HEADER) !== null) {
15374
15527
  return;
15375
15528
  }
@@ -15473,5 +15626,5 @@ class GoogleGenAI {
15473
15626
  }
15474
15627
  }
15475
15628
 
15476
- export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
15629
+ export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
15477
15630
  //# sourceMappingURL=index.mjs.map