@google/genai 1.46.0 → 1.48.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.
@@ -704,38 +704,18 @@ exports.Type = void 0;
704
704
  */
705
705
  Type["NULL"] = "NULL";
706
706
  })(exports.Type || (exports.Type = {}));
707
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
708
- exports.PhishBlockThreshold = void 0;
709
- (function (PhishBlockThreshold) {
710
- /**
711
- * Defaults to unspecified.
712
- */
713
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
714
- /**
715
- * Blocks Low and above confidence URL that is risky.
716
- */
717
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
718
- /**
719
- * Blocks Medium and above confidence URL that is risky.
720
- */
721
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
722
- /**
723
- * Blocks High and above confidence URL that is risky.
724
- */
725
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
726
- /**
727
- * Blocks Higher and above confidence URL that is risky.
728
- */
729
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
707
+ /** The environment being operated. */
708
+ exports.Environment = void 0;
709
+ (function (Environment) {
730
710
  /**
731
- * Blocks Very high and above confidence URL that is risky.
711
+ * Defaults to browser.
732
712
  */
733
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
713
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
734
714
  /**
735
- * Blocks Extremely high confidence URL that is risky.
715
+ * Operates in a web browser.
736
716
  */
737
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
738
- })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
717
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
718
+ })(exports.Environment || (exports.Environment = {}));
739
719
  /** Type of auth scheme. This enum is not supported in Gemini API. */
740
720
  exports.AuthType = void 0;
741
721
  (function (AuthType) {
@@ -806,6 +786,38 @@ exports.ApiSpec = void 0;
806
786
  */
807
787
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
808
788
  })(exports.ApiSpec || (exports.ApiSpec = {}));
789
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
790
+ exports.PhishBlockThreshold = void 0;
791
+ (function (PhishBlockThreshold) {
792
+ /**
793
+ * Defaults to unspecified.
794
+ */
795
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
796
+ /**
797
+ * Blocks Low and above confidence URL that is risky.
798
+ */
799
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
800
+ /**
801
+ * Blocks Medium and above confidence URL that is risky.
802
+ */
803
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
804
+ /**
805
+ * Blocks High and above confidence URL that is risky.
806
+ */
807
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
808
+ /**
809
+ * Blocks Higher and above confidence URL that is risky.
810
+ */
811
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
812
+ /**
813
+ * Blocks Very high and above confidence URL that is risky.
814
+ */
815
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
816
+ /**
817
+ * Blocks Extremely high confidence URL that is risky.
818
+ */
819
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
820
+ })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
809
821
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
810
822
  exports.Behavior = void 0;
811
823
  (function (Behavior) {
@@ -865,6 +877,10 @@ exports.ThinkingLevel = void 0;
865
877
  * Unspecified thinking level.
866
878
  */
867
879
  ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
880
+ /**
881
+ * MINIMAL thinking level.
882
+ */
883
+ ThinkingLevel["MINIMAL"] = "MINIMAL";
868
884
  /**
869
885
  * Low thinking level.
870
886
  */
@@ -877,10 +893,6 @@ exports.ThinkingLevel = void 0;
877
893
  * High thinking level.
878
894
  */
879
895
  ThinkingLevel["HIGH"] = "HIGH";
880
- /**
881
- * MINIMAL thinking level.
882
- */
883
- ThinkingLevel["MINIMAL"] = "MINIMAL";
884
896
  })(exports.ThinkingLevel || (exports.ThinkingLevel = {}));
885
897
  /** Enum that controls the generation of people. */
886
898
  exports.PersonGeneration = void 0;
@@ -898,6 +910,22 @@ exports.PersonGeneration = void 0;
898
910
  */
899
911
  PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
900
912
  })(exports.PersonGeneration || (exports.PersonGeneration = {}));
913
+ /** Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This enum is not supported in Gemini API. */
914
+ exports.ProminentPeople = void 0;
915
+ (function (ProminentPeople) {
916
+ /**
917
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
918
+ */
919
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
920
+ /**
921
+ * Allows the model to generate images of prominent people.
922
+ */
923
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
924
+ /**
925
+ * Prevents the model from generating images of prominent people.
926
+ */
927
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
928
+ })(exports.ProminentPeople || (exports.ProminentPeople = {}));
901
929
  /** The harm category to be blocked. */
902
930
  exports.HarmCategory = void 0;
903
931
  (function (HarmCategory) {
@@ -1216,6 +1244,42 @@ exports.Modality = void 0;
1216
1244
  */
1217
1245
  Modality["AUDIO"] = "AUDIO";
1218
1246
  })(exports.Modality || (exports.Modality = {}));
1247
+ /** The stage of the underlying model. This enum is not supported in Vertex AI. */
1248
+ exports.ModelStage = void 0;
1249
+ (function (ModelStage) {
1250
+ /**
1251
+ * Unspecified model stage.
1252
+ */
1253
+ ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
1254
+ /**
1255
+ * The underlying model is subject to lots of tunings.
1256
+ */
1257
+ ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
1258
+ /**
1259
+ * Models in this stage are for experimental purposes only.
1260
+ */
1261
+ ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
1262
+ /**
1263
+ * Models in this stage are more mature than experimental models.
1264
+ */
1265
+ ModelStage["PREVIEW"] = "PREVIEW";
1266
+ /**
1267
+ * Models in this stage are considered stable and ready for production use.
1268
+ */
1269
+ ModelStage["STABLE"] = "STABLE";
1270
+ /**
1271
+ * If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.
1272
+ */
1273
+ ModelStage["LEGACY"] = "LEGACY";
1274
+ /**
1275
+ * Models in this stage are deprecated. These models cannot be used.
1276
+ */
1277
+ ModelStage["DEPRECATED"] = "DEPRECATED";
1278
+ /**
1279
+ * Models in this stage are retired. These models cannot be used.
1280
+ */
1281
+ ModelStage["RETIRED"] = "RETIRED";
1282
+ })(exports.ModelStage || (exports.ModelStage = {}));
1219
1283
  /** The media resolution to use. */
1220
1284
  exports.MediaResolution = void 0;
1221
1285
  (function (MediaResolution) {
@@ -1452,6 +1516,26 @@ exports.TuningTask = void 0;
1452
1516
  */
1453
1517
  TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
1454
1518
  })(exports.TuningTask || (exports.TuningTask = {}));
1519
+ /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
1520
+ exports.DocumentState = void 0;
1521
+ (function (DocumentState) {
1522
+ /**
1523
+ * The default value. This value is used if the state is omitted.
1524
+ */
1525
+ DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1526
+ /**
1527
+ * Some `Chunks` of the `Document` are being processed (embedding and vector storage).
1528
+ */
1529
+ DocumentState["STATE_PENDING"] = "STATE_PENDING";
1530
+ /**
1531
+ * All `Chunks` of the `Document` is processed and available for querying.
1532
+ */
1533
+ DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1534
+ /**
1535
+ * Some `Chunks` of the `Document` failed processing.
1536
+ */
1537
+ DocumentState["STATE_FAILED"] = "STATE_FAILED";
1538
+ })(exports.DocumentState || (exports.DocumentState = {}));
1455
1539
  /** The tokenization quality used for given media. */
1456
1540
  exports.PartMediaResolutionLevel = void 0;
1457
1541
  (function (PartMediaResolutionLevel) {
@@ -1516,42 +1600,34 @@ exports.ResourceScope = void 0;
1516
1600
  */
1517
1601
  ResourceScope["COLLECTION"] = "COLLECTION";
1518
1602
  })(exports.ResourceScope || (exports.ResourceScope = {}));
1519
- /** Options for feature selection preference. */
1520
- exports.FeatureSelectionPreference = void 0;
1521
- (function (FeatureSelectionPreference) {
1522
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1523
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1524
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1525
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1526
- })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1527
- /** The environment being operated. */
1528
- exports.Environment = void 0;
1529
- (function (Environment) {
1603
+ /** Pricing and performance service tier. */
1604
+ exports.ServiceTier = void 0;
1605
+ (function (ServiceTier) {
1530
1606
  /**
1531
- * Defaults to browser.
1607
+ * Default service tier, which is standard.
1532
1608
  */
1533
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1609
+ ServiceTier["UNSPECIFIED"] = "unspecified";
1534
1610
  /**
1535
- * Operates in a web browser.
1611
+ * Flex service tier.
1536
1612
  */
1537
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1538
- })(exports.Environment || (exports.Environment = {}));
1539
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1540
- exports.ProminentPeople = void 0;
1541
- (function (ProminentPeople) {
1613
+ ServiceTier["FLEX"] = "flex";
1542
1614
  /**
1543
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1615
+ * Standard service tier.
1544
1616
  */
1545
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1617
+ ServiceTier["STANDARD"] = "standard";
1546
1618
  /**
1547
- * Allows the model to generate images of prominent people.
1619
+ * Priority service tier.
1548
1620
  */
1549
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1550
- /**
1551
- * Prevents the model from generating images of prominent people.
1552
- */
1553
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1554
- })(exports.ProminentPeople || (exports.ProminentPeople = {}));
1621
+ ServiceTier["PRIORITY"] = "priority";
1622
+ })(exports.ServiceTier || (exports.ServiceTier = {}));
1623
+ /** Options for feature selection preference. */
1624
+ exports.FeatureSelectionPreference = void 0;
1625
+ (function (FeatureSelectionPreference) {
1626
+ FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1627
+ FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1628
+ FeatureSelectionPreference["BALANCED"] = "BALANCED";
1629
+ FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1630
+ })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1555
1631
  /** Enum representing the Vertex embedding API to use. */
1556
1632
  exports.EmbeddingApiType = void 0;
1557
1633
  (function (EmbeddingApiType) {
@@ -1726,14 +1802,6 @@ exports.TuningMethod = void 0;
1726
1802
  */
1727
1803
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1728
1804
  })(exports.TuningMethod || (exports.TuningMethod = {}));
1729
- /** State for the lifecycle of a Document. */
1730
- exports.DocumentState = void 0;
1731
- (function (DocumentState) {
1732
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1733
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1734
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1735
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1736
- })(exports.DocumentState || (exports.DocumentState = {}));
1737
1805
  /** State for the lifecycle of a File. */
1738
1806
  exports.FileState = void 0;
1739
1807
  (function (FileState) {
@@ -1893,6 +1961,10 @@ exports.TurnCoverage = void 0;
1893
1961
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1894
1962
  */
1895
1963
  TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
1964
+ /**
1965
+ * Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
1966
+ */
1967
+ TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
1896
1968
  })(exports.TurnCoverage || (exports.TurnCoverage = {}));
1897
1969
  /** Scale of the generated music. */
1898
1970
  exports.Scale = void 0;
@@ -2462,7 +2534,6 @@ class GenerateVideosResponse {
2462
2534
  class GenerateVideosOperation {
2463
2535
  /**
2464
2536
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2465
- * @internal
2466
2537
  */
2467
2538
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2468
2539
  const operation = new GenerateVideosOperation();
@@ -2508,7 +2579,6 @@ class ImportFileResponse {
2508
2579
  class ImportFileOperation {
2509
2580
  /**
2510
2581
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2511
- * @internal
2512
2582
  */
2513
2583
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2514
2584
  const operation = new ImportFileOperation();
@@ -2763,7 +2833,6 @@ class UploadToFileSearchStoreResponse {
2763
2833
  class UploadToFileSearchStoreOperation {
2764
2834
  /**
2765
2835
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2766
- * @internal
2767
2836
  */
2768
2837
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2769
2838
  const operation = new UploadToFileSearchStoreOperation();
@@ -4416,6 +4485,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4416
4485
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4417
4486
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4418
4487
  }
4488
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4489
+ if (parentObject !== undefined && fromServiceTier != null) {
4490
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
4491
+ }
4419
4492
  return toObject;
4420
4493
  }
4421
4494
  function generateContentResponseFromMldev$1(fromObject) {
@@ -4456,6 +4529,10 @@ function generateContentResponseFromMldev$1(fromObject) {
4456
4529
  if (fromUsageMetadata != null) {
4457
4530
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
4458
4531
  }
4532
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
4533
+ if (fromModelStatus != null) {
4534
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
4535
+ }
4459
4536
  return toObject;
4460
4537
  }
4461
4538
  function getBatchJobParametersToMldev(apiClient, fromObject) {
@@ -4743,6 +4820,10 @@ function partToMldev$4(fromObject) {
4743
4820
  if (fromToolResponse != null) {
4744
4821
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
4745
4822
  }
4823
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
4824
+ if (fromPartMetadata != null) {
4825
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
4826
+ }
4746
4827
  return toObject;
4747
4828
  }
4748
4829
  function safetySettingToMldev$1(fromObject) {
@@ -6077,6 +6158,10 @@ function partToMldev$3(fromObject) {
6077
6158
  if (fromToolResponse != null) {
6078
6159
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
6079
6160
  }
6161
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
6162
+ if (fromPartMetadata != null) {
6163
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
6164
+ }
6080
6165
  return toObject;
6081
6166
  }
6082
6167
  function partToVertex$2(fromObject) {
@@ -6143,6 +6228,9 @@ function partToVertex$2(fromObject) {
6143
6228
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6144
6229
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
6145
6230
  }
6231
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6232
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
6233
+ }
6146
6234
  return toObject;
6147
6235
  }
6148
6236
  function toolConfigToMldev$1(fromObject) {
@@ -7856,7 +7944,7 @@ function generationConfigToVertex$1(fromObject) {
7856
7944
  }
7857
7945
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7858
7946
  if (fromSpeechConfig != null) {
7859
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
7947
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
7860
7948
  }
7861
7949
  const fromStopSequences = getValueByPath(fromObject, [
7862
7950
  'stopSequences',
@@ -8077,7 +8165,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
8077
8165
  }
8078
8166
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8079
8167
  if (parentObject !== undefined && fromSpeechConfig != null) {
8080
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
8168
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8081
8169
  }
8082
8170
  const fromThinkingConfig = getValueByPath(fromObject, [
8083
8171
  'thinkingConfig',
@@ -8337,6 +8425,22 @@ function liveServerMessageFromVertex(fromObject) {
8337
8425
  }
8338
8426
  return toObject;
8339
8427
  }
8428
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
8429
+ const toObject = {};
8430
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
8431
+ 'speakerVoiceConfigs',
8432
+ ]);
8433
+ if (fromSpeakerVoiceConfigs != null) {
8434
+ let transformedList = fromSpeakerVoiceConfigs;
8435
+ if (Array.isArray(transformedList)) {
8436
+ transformedList = transformedList.map((item) => {
8437
+ return speakerVoiceConfigToVertex$1(item);
8438
+ });
8439
+ }
8440
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
8441
+ }
8442
+ return toObject;
8443
+ }
8340
8444
  function partToMldev$2(fromObject) {
8341
8445
  const toObject = {};
8342
8446
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -8403,6 +8507,10 @@ function partToMldev$2(fromObject) {
8403
8507
  if (fromToolResponse != null) {
8404
8508
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
8405
8509
  }
8510
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
8511
+ if (fromPartMetadata != null) {
8512
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
8513
+ }
8406
8514
  return toObject;
8407
8515
  }
8408
8516
  function partToVertex$1(fromObject) {
@@ -8469,6 +8577,23 @@ function partToVertex$1(fromObject) {
8469
8577
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
8470
8578
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
8471
8579
  }
8580
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
8581
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
8582
+ }
8583
+ return toObject;
8584
+ }
8585
+ function replicatedVoiceConfigToVertex$1(fromObject) {
8586
+ const toObject = {};
8587
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8588
+ if (fromMimeType != null) {
8589
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8590
+ }
8591
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
8592
+ 'voiceSampleAudio',
8593
+ ]);
8594
+ if (fromVoiceSampleAudio != null) {
8595
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
8596
+ }
8472
8597
  return toObject;
8473
8598
  }
8474
8599
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -8482,6 +8607,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8482
8607
  }
8483
8608
  return toObject;
8484
8609
  }
8610
+ function speakerVoiceConfigToVertex$1(fromObject) {
8611
+ const toObject = {};
8612
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
8613
+ if (fromSpeaker != null) {
8614
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
8615
+ }
8616
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8617
+ if (fromVoiceConfig != null) {
8618
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8619
+ }
8620
+ return toObject;
8621
+ }
8622
+ function speechConfigToVertex$1(fromObject) {
8623
+ const toObject = {};
8624
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8625
+ if (fromVoiceConfig != null) {
8626
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8627
+ }
8628
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
8629
+ if (fromLanguageCode != null) {
8630
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8631
+ }
8632
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
8633
+ 'multiSpeakerVoiceConfig',
8634
+ ]);
8635
+ if (fromMultiSpeakerVoiceConfig != null) {
8636
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
8637
+ }
8638
+ return toObject;
8639
+ }
8485
8640
  function toolToMldev$2(fromObject) {
8486
8641
  const toObject = {};
8487
8642
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -8715,6 +8870,22 @@ function voiceActivityFromVertex(fromObject) {
8715
8870
  }
8716
8871
  return toObject;
8717
8872
  }
8873
+ function voiceConfigToVertex$1(fromObject) {
8874
+ const toObject = {};
8875
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
8876
+ 'replicatedVoiceConfig',
8877
+ ]);
8878
+ if (fromReplicatedVoiceConfig != null) {
8879
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
8880
+ }
8881
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
8882
+ 'prebuiltVoiceConfig',
8883
+ ]);
8884
+ if (fromPrebuiltVoiceConfig != null) {
8885
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
8886
+ }
8887
+ return toObject;
8888
+ }
8718
8889
 
8719
8890
  /**
8720
8891
  * @license
@@ -9768,6 +9939,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
9768
9939
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
9769
9940
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
9770
9941
  }
9942
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
9943
+ if (parentObject !== undefined && fromServiceTier != null) {
9944
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
9945
+ }
9771
9946
  return toObject;
9772
9947
  }
9773
9948
  function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
@@ -9914,7 +10089,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9914
10089
  }
9915
10090
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
9916
10091
  if (fromSpeechConfig != null) {
9917
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10092
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
9918
10093
  }
9919
10094
  const fromAudioTimestamp = getValueByPath(fromObject, [
9920
10095
  'audioTimestamp',
@@ -9942,6 +10117,10 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9942
10117
  if (parentObject !== undefined && fromModelArmorConfig != null) {
9943
10118
  setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
9944
10119
  }
10120
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
10121
+ if (parentObject !== undefined && fromServiceTier != null) {
10122
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
10123
+ }
9945
10124
  return toObject;
9946
10125
  }
9947
10126
  function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
@@ -10026,6 +10205,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
10026
10205
  if (fromUsageMetadata != null) {
10027
10206
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
10028
10207
  }
10208
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
10209
+ if (fromModelStatus != null) {
10210
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
10211
+ }
10029
10212
  return toObject;
10030
10213
  }
10031
10214
  function generateContentResponseFromVertex(fromObject, _rootObject) {
@@ -10411,6 +10594,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10411
10594
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
10412
10595
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
10413
10596
  }
10597
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
10598
+ throw new Error('labels parameter is not supported in Gemini API.');
10599
+ }
10414
10600
  return toObject;
10415
10601
  }
10416
10602
  function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
@@ -10501,6 +10687,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
10501
10687
  if (parentObject !== undefined && fromCompressionQuality != null) {
10502
10688
  setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
10503
10689
  }
10690
+ const fromLabels = getValueByPath(fromObject, ['labels']);
10691
+ if (parentObject !== undefined && fromLabels != null) {
10692
+ setValueByPath(parentObject, ['labels'], fromLabels);
10693
+ }
10504
10694
  return toObject;
10505
10695
  }
10506
10696
  function generateVideosOperationFromMldev(fromObject, rootObject) {
@@ -10770,7 +10960,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
10770
10960
  }
10771
10961
  return toObject;
10772
10962
  }
10773
- function generationConfigToVertex(fromObject, _rootObject) {
10963
+ function generationConfigToVertex(fromObject, rootObject) {
10774
10964
  const toObject = {};
10775
10965
  const fromModelSelectionConfig = getValueByPath(fromObject, [
10776
10966
  'modelSelectionConfig',
@@ -10866,7 +11056,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
10866
11056
  }
10867
11057
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
10868
11058
  if (fromSpeechConfig != null) {
10869
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11059
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
10870
11060
  }
10871
11061
  const fromStopSequences = getValueByPath(fromObject, [
10872
11062
  'stopSequences',
@@ -11323,6 +11513,22 @@ function modelFromVertex(fromObject, rootObject) {
11323
11513
  }
11324
11514
  return toObject;
11325
11515
  }
11516
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
11517
+ const toObject = {};
11518
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
11519
+ 'speakerVoiceConfigs',
11520
+ ]);
11521
+ if (fromSpeakerVoiceConfigs != null) {
11522
+ let transformedList = fromSpeakerVoiceConfigs;
11523
+ if (Array.isArray(transformedList)) {
11524
+ transformedList = transformedList.map((item) => {
11525
+ return speakerVoiceConfigToVertex(item);
11526
+ });
11527
+ }
11528
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
11529
+ }
11530
+ return toObject;
11531
+ }
11326
11532
  function partToMldev$1(fromObject, rootObject) {
11327
11533
  const toObject = {};
11328
11534
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -11389,6 +11595,10 @@ function partToMldev$1(fromObject, rootObject) {
11389
11595
  if (fromToolResponse != null) {
11390
11596
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
11391
11597
  }
11598
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
11599
+ if (fromPartMetadata != null) {
11600
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
11601
+ }
11392
11602
  return toObject;
11393
11603
  }
11394
11604
  function partToVertex(fromObject, _rootObject) {
@@ -11455,6 +11665,9 @@ function partToVertex(fromObject, _rootObject) {
11455
11665
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11456
11666
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
11457
11667
  }
11668
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
11669
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
11670
+ }
11458
11671
  return toObject;
11459
11672
  }
11460
11673
  function productImageToVertex(fromObject, rootObject) {
@@ -11625,6 +11838,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
11625
11838
  }
11626
11839
  return toObject;
11627
11840
  }
11841
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
11842
+ const toObject = {};
11843
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
11844
+ if (fromMimeType != null) {
11845
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
11846
+ }
11847
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
11848
+ 'voiceSampleAudio',
11849
+ ]);
11850
+ if (fromVoiceSampleAudio != null) {
11851
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
11852
+ }
11853
+ return toObject;
11854
+ }
11628
11855
  function safetyAttributesFromMldev(fromObject, _rootObject) {
11629
11856
  const toObject = {};
11630
11857
  const fromCategories = getValueByPath(fromObject, [
@@ -11774,6 +12001,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
11774
12001
  }
11775
12002
  return toObject;
11776
12003
  }
12004
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
12005
+ const toObject = {};
12006
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
12007
+ if (fromSpeaker != null) {
12008
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
12009
+ }
12010
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12011
+ if (fromVoiceConfig != null) {
12012
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12013
+ }
12014
+ return toObject;
12015
+ }
12016
+ function speechConfigToVertex(fromObject, rootObject) {
12017
+ const toObject = {};
12018
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12019
+ if (fromVoiceConfig != null) {
12020
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12021
+ }
12022
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
12023
+ if (fromLanguageCode != null) {
12024
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
12025
+ }
12026
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
12027
+ 'multiSpeakerVoiceConfig',
12028
+ ]);
12029
+ if (fromMultiSpeakerVoiceConfig != null) {
12030
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
12031
+ }
12032
+ return toObject;
12033
+ }
11777
12034
  function toolConfigToMldev(fromObject, rootObject) {
11778
12035
  const toObject = {};
11779
12036
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -12256,6 +12513,22 @@ function videoToVertex(fromObject, _rootObject) {
12256
12513
  }
12257
12514
  return toObject;
12258
12515
  }
12516
+ function voiceConfigToVertex(fromObject, rootObject) {
12517
+ const toObject = {};
12518
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
12519
+ 'replicatedVoiceConfig',
12520
+ ]);
12521
+ if (fromReplicatedVoiceConfig != null) {
12522
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
12523
+ }
12524
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
12525
+ 'prebuiltVoiceConfig',
12526
+ ]);
12527
+ if (fromPrebuiltVoiceConfig != null) {
12528
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
12529
+ }
12530
+ return toObject;
12531
+ }
12259
12532
 
12260
12533
  /**
12261
12534
  * @license
@@ -12501,7 +12774,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12501
12774
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12502
12775
  const USER_AGENT_HEADER = 'User-Agent';
12503
12776
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12504
- const SDK_VERSION = '1.46.0'; // x-release-please-version
12777
+ const SDK_VERSION = '1.48.0'; // x-release-please-version
12505
12778
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12506
12779
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12507
12780
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -12561,6 +12834,11 @@ class ApiClient {
12561
12834
  // Vertex Express or global endpoint case.
12562
12835
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
12563
12836
  }
12837
+ else if (this.clientOptions.project &&
12838
+ this.clientOptions.location &&
12839
+ this.clientOptions.location === 'us') {
12840
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
12841
+ }
12564
12842
  else if (this.clientOptions.project && this.clientOptions.location) {
12565
12843
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
12566
12844
  }
@@ -16198,6 +16476,10 @@ function partToMldev(fromObject) {
16198
16476
  if (fromToolResponse != null) {
16199
16477
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
16200
16478
  }
16479
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
16480
+ if (fromPartMetadata != null) {
16481
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
16482
+ }
16201
16483
  return toObject;
16202
16484
  }
16203
16485
  function sessionResumptionConfigToMldev(fromObject) {
@@ -19361,6 +19643,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19361
19643
  setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
19362
19644
  }
19363
19645
  }
19646
+ else if (discriminatorTuningMode === 'DISTILLATION') {
19647
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
19648
+ if (parentObject !== undefined && fromTuningMode != null) {
19649
+ setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
19650
+ }
19651
+ }
19364
19652
  const fromCustomBaseModel = getValueByPath(fromObject, [
19365
19653
  'customBaseModel',
19366
19654
  ]);
@@ -19380,6 +19668,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19380
19668
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19381
19669
  }
19382
19670
  }
19671
+ else if (discriminatorBatchSize === 'DISTILLATION') {
19672
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19673
+ if (parentObject !== undefined && fromBatchSize != null) {
19674
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19675
+ }
19676
+ }
19383
19677
  let discriminatorLearningRate = getValueByPath(rootObject, [
19384
19678
  'config',
19385
19679
  'method',
@@ -19395,6 +19689,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19395
19689
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19396
19690
  }
19397
19691
  }
19692
+ else if (discriminatorLearningRate === 'DISTILLATION') {
19693
+ const fromLearningRate = getValueByPath(fromObject, [
19694
+ 'learningRate',
19695
+ ]);
19696
+ if (parentObject !== undefined && fromLearningRate != null) {
19697
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19698
+ }
19699
+ }
19398
19700
  const fromLabels = getValueByPath(fromObject, ['labels']);
19399
19701
  if (parentObject !== undefined && fromLabels != null) {
19400
19702
  setValueByPath(parentObject, ['labels'], fromLabels);
@@ -19898,6 +20200,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19898
20200
  if (fromVeoTuningSpec != null) {
19899
20201
  setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
19900
20202
  }
20203
+ const fromDistillationSamplingSpec = getValueByPath(fromObject, [
20204
+ 'distillationSamplingSpec',
20205
+ ]);
20206
+ if (fromDistillationSamplingSpec != null) {
20207
+ setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
20208
+ }
20209
+ const fromTuningJobMetadata = getValueByPath(fromObject, [
20210
+ 'tuningJobMetadata',
20211
+ ]);
20212
+ if (fromTuningJobMetadata != null) {
20213
+ setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
20214
+ }
19901
20215
  return toObject;
19902
20216
  }
19903
20217
  function tuningOperationFromMldev(fromObject, _rootObject) {