@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.
package/dist/index.cjs CHANGED
@@ -646,38 +646,18 @@ exports.Type = void 0;
646
646
  */
647
647
  Type["NULL"] = "NULL";
648
648
  })(exports.Type || (exports.Type = {}));
649
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
650
- exports.PhishBlockThreshold = void 0;
651
- (function (PhishBlockThreshold) {
652
- /**
653
- * Defaults to unspecified.
654
- */
655
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
656
- /**
657
- * Blocks Low and above confidence URL that is risky.
658
- */
659
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
660
- /**
661
- * Blocks Medium and above confidence URL that is risky.
662
- */
663
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
664
- /**
665
- * Blocks High and above confidence URL that is risky.
666
- */
667
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
668
- /**
669
- * Blocks Higher and above confidence URL that is risky.
670
- */
671
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
649
+ /** The environment being operated. */
650
+ exports.Environment = void 0;
651
+ (function (Environment) {
672
652
  /**
673
- * Blocks Very high and above confidence URL that is risky.
653
+ * Defaults to browser.
674
654
  */
675
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
655
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
676
656
  /**
677
- * Blocks Extremely high confidence URL that is risky.
657
+ * Operates in a web browser.
678
658
  */
679
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
680
- })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
659
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
660
+ })(exports.Environment || (exports.Environment = {}));
681
661
  /** Type of auth scheme. This enum is not supported in Gemini API. */
682
662
  exports.AuthType = void 0;
683
663
  (function (AuthType) {
@@ -748,6 +728,38 @@ exports.ApiSpec = void 0;
748
728
  */
749
729
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
750
730
  })(exports.ApiSpec || (exports.ApiSpec = {}));
731
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
732
+ exports.PhishBlockThreshold = void 0;
733
+ (function (PhishBlockThreshold) {
734
+ /**
735
+ * Defaults to unspecified.
736
+ */
737
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
738
+ /**
739
+ * Blocks Low and above confidence URL that is risky.
740
+ */
741
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
742
+ /**
743
+ * Blocks Medium and above confidence URL that is risky.
744
+ */
745
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
746
+ /**
747
+ * Blocks High and above confidence URL that is risky.
748
+ */
749
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
750
+ /**
751
+ * Blocks Higher and above confidence URL that is risky.
752
+ */
753
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
754
+ /**
755
+ * Blocks Very high and above confidence URL that is risky.
756
+ */
757
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
758
+ /**
759
+ * Blocks Extremely high confidence URL that is risky.
760
+ */
761
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
762
+ })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
751
763
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
752
764
  exports.Behavior = void 0;
753
765
  (function (Behavior) {
@@ -807,6 +819,10 @@ exports.ThinkingLevel = void 0;
807
819
  * Unspecified thinking level.
808
820
  */
809
821
  ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
822
+ /**
823
+ * MINIMAL thinking level.
824
+ */
825
+ ThinkingLevel["MINIMAL"] = "MINIMAL";
810
826
  /**
811
827
  * Low thinking level.
812
828
  */
@@ -819,10 +835,6 @@ exports.ThinkingLevel = void 0;
819
835
  * High thinking level.
820
836
  */
821
837
  ThinkingLevel["HIGH"] = "HIGH";
822
- /**
823
- * MINIMAL thinking level.
824
- */
825
- ThinkingLevel["MINIMAL"] = "MINIMAL";
826
838
  })(exports.ThinkingLevel || (exports.ThinkingLevel = {}));
827
839
  /** Enum that controls the generation of people. */
828
840
  exports.PersonGeneration = void 0;
@@ -840,6 +852,22 @@ exports.PersonGeneration = void 0;
840
852
  */
841
853
  PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
842
854
  })(exports.PersonGeneration || (exports.PersonGeneration = {}));
855
+ /** 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. */
856
+ exports.ProminentPeople = void 0;
857
+ (function (ProminentPeople) {
858
+ /**
859
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
860
+ */
861
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
862
+ /**
863
+ * Allows the model to generate images of prominent people.
864
+ */
865
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
866
+ /**
867
+ * Prevents the model from generating images of prominent people.
868
+ */
869
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
870
+ })(exports.ProminentPeople || (exports.ProminentPeople = {}));
843
871
  /** The harm category to be blocked. */
844
872
  exports.HarmCategory = void 0;
845
873
  (function (HarmCategory) {
@@ -1158,6 +1186,42 @@ exports.Modality = void 0;
1158
1186
  */
1159
1187
  Modality["AUDIO"] = "AUDIO";
1160
1188
  })(exports.Modality || (exports.Modality = {}));
1189
+ /** The stage of the underlying model. This enum is not supported in Vertex AI. */
1190
+ exports.ModelStage = void 0;
1191
+ (function (ModelStage) {
1192
+ /**
1193
+ * Unspecified model stage.
1194
+ */
1195
+ ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
1196
+ /**
1197
+ * The underlying model is subject to lots of tunings.
1198
+ */
1199
+ ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
1200
+ /**
1201
+ * Models in this stage are for experimental purposes only.
1202
+ */
1203
+ ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
1204
+ /**
1205
+ * Models in this stage are more mature than experimental models.
1206
+ */
1207
+ ModelStage["PREVIEW"] = "PREVIEW";
1208
+ /**
1209
+ * Models in this stage are considered stable and ready for production use.
1210
+ */
1211
+ ModelStage["STABLE"] = "STABLE";
1212
+ /**
1213
+ * 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.
1214
+ */
1215
+ ModelStage["LEGACY"] = "LEGACY";
1216
+ /**
1217
+ * Models in this stage are deprecated. These models cannot be used.
1218
+ */
1219
+ ModelStage["DEPRECATED"] = "DEPRECATED";
1220
+ /**
1221
+ * Models in this stage are retired. These models cannot be used.
1222
+ */
1223
+ ModelStage["RETIRED"] = "RETIRED";
1224
+ })(exports.ModelStage || (exports.ModelStage = {}));
1161
1225
  /** The media resolution to use. */
1162
1226
  exports.MediaResolution = void 0;
1163
1227
  (function (MediaResolution) {
@@ -1394,6 +1458,26 @@ exports.TuningTask = void 0;
1394
1458
  */
1395
1459
  TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
1396
1460
  })(exports.TuningTask || (exports.TuningTask = {}));
1461
+ /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
1462
+ exports.DocumentState = void 0;
1463
+ (function (DocumentState) {
1464
+ /**
1465
+ * The default value. This value is used if the state is omitted.
1466
+ */
1467
+ DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1468
+ /**
1469
+ * Some `Chunks` of the `Document` are being processed (embedding and vector storage).
1470
+ */
1471
+ DocumentState["STATE_PENDING"] = "STATE_PENDING";
1472
+ /**
1473
+ * All `Chunks` of the `Document` is processed and available for querying.
1474
+ */
1475
+ DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1476
+ /**
1477
+ * Some `Chunks` of the `Document` failed processing.
1478
+ */
1479
+ DocumentState["STATE_FAILED"] = "STATE_FAILED";
1480
+ })(exports.DocumentState || (exports.DocumentState = {}));
1397
1481
  /** The tokenization quality used for given media. */
1398
1482
  exports.PartMediaResolutionLevel = void 0;
1399
1483
  (function (PartMediaResolutionLevel) {
@@ -1458,42 +1542,34 @@ exports.ResourceScope = void 0;
1458
1542
  */
1459
1543
  ResourceScope["COLLECTION"] = "COLLECTION";
1460
1544
  })(exports.ResourceScope || (exports.ResourceScope = {}));
1461
- /** Options for feature selection preference. */
1462
- exports.FeatureSelectionPreference = void 0;
1463
- (function (FeatureSelectionPreference) {
1464
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1465
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1466
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1467
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1468
- })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1469
- /** The environment being operated. */
1470
- exports.Environment = void 0;
1471
- (function (Environment) {
1545
+ /** Pricing and performance service tier. */
1546
+ exports.ServiceTier = void 0;
1547
+ (function (ServiceTier) {
1472
1548
  /**
1473
- * Defaults to browser.
1549
+ * Default service tier, which is standard.
1474
1550
  */
1475
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1551
+ ServiceTier["UNSPECIFIED"] = "unspecified";
1476
1552
  /**
1477
- * Operates in a web browser.
1553
+ * Flex service tier.
1478
1554
  */
1479
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1480
- })(exports.Environment || (exports.Environment = {}));
1481
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1482
- exports.ProminentPeople = void 0;
1483
- (function (ProminentPeople) {
1555
+ ServiceTier["FLEX"] = "flex";
1484
1556
  /**
1485
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1557
+ * Standard service tier.
1486
1558
  */
1487
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1559
+ ServiceTier["STANDARD"] = "standard";
1488
1560
  /**
1489
- * Allows the model to generate images of prominent people.
1561
+ * Priority service tier.
1490
1562
  */
1491
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1492
- /**
1493
- * Prevents the model from generating images of prominent people.
1494
- */
1495
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1496
- })(exports.ProminentPeople || (exports.ProminentPeople = {}));
1563
+ ServiceTier["PRIORITY"] = "priority";
1564
+ })(exports.ServiceTier || (exports.ServiceTier = {}));
1565
+ /** Options for feature selection preference. */
1566
+ exports.FeatureSelectionPreference = void 0;
1567
+ (function (FeatureSelectionPreference) {
1568
+ FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1569
+ FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1570
+ FeatureSelectionPreference["BALANCED"] = "BALANCED";
1571
+ FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1572
+ })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1497
1573
  /** Enum representing the Vertex embedding API to use. */
1498
1574
  exports.EmbeddingApiType = void 0;
1499
1575
  (function (EmbeddingApiType) {
@@ -1668,14 +1744,6 @@ exports.TuningMethod = void 0;
1668
1744
  */
1669
1745
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1670
1746
  })(exports.TuningMethod || (exports.TuningMethod = {}));
1671
- /** State for the lifecycle of a Document. */
1672
- exports.DocumentState = void 0;
1673
- (function (DocumentState) {
1674
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1675
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1676
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1677
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1678
- })(exports.DocumentState || (exports.DocumentState = {}));
1679
1747
  /** State for the lifecycle of a File. */
1680
1748
  exports.FileState = void 0;
1681
1749
  (function (FileState) {
@@ -1835,6 +1903,10 @@ exports.TurnCoverage = void 0;
1835
1903
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1836
1904
  */
1837
1905
  TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
1906
+ /**
1907
+ * Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
1908
+ */
1909
+ TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
1838
1910
  })(exports.TurnCoverage || (exports.TurnCoverage = {}));
1839
1911
  /** Scale of the generated music. */
1840
1912
  exports.Scale = void 0;
@@ -2404,7 +2476,6 @@ class GenerateVideosResponse {
2404
2476
  class GenerateVideosOperation {
2405
2477
  /**
2406
2478
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2407
- * @internal
2408
2479
  */
2409
2480
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2410
2481
  const operation = new GenerateVideosOperation();
@@ -2450,7 +2521,6 @@ class ImportFileResponse {
2450
2521
  class ImportFileOperation {
2451
2522
  /**
2452
2523
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2453
- * @internal
2454
2524
  */
2455
2525
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2456
2526
  const operation = new ImportFileOperation();
@@ -2705,7 +2775,6 @@ class UploadToFileSearchStoreResponse {
2705
2775
  class UploadToFileSearchStoreOperation {
2706
2776
  /**
2707
2777
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2708
- * @internal
2709
2778
  */
2710
2779
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2711
2780
  const operation = new UploadToFileSearchStoreOperation();
@@ -4358,6 +4427,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4358
4427
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4359
4428
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4360
4429
  }
4430
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4431
+ if (parentObject !== undefined && fromServiceTier != null) {
4432
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
4433
+ }
4361
4434
  return toObject;
4362
4435
  }
4363
4436
  function generateContentResponseFromMldev$1(fromObject) {
@@ -4398,6 +4471,10 @@ function generateContentResponseFromMldev$1(fromObject) {
4398
4471
  if (fromUsageMetadata != null) {
4399
4472
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
4400
4473
  }
4474
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
4475
+ if (fromModelStatus != null) {
4476
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
4477
+ }
4401
4478
  return toObject;
4402
4479
  }
4403
4480
  function getBatchJobParametersToMldev(apiClient, fromObject) {
@@ -4685,6 +4762,10 @@ function partToMldev$4(fromObject) {
4685
4762
  if (fromToolResponse != null) {
4686
4763
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
4687
4764
  }
4765
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
4766
+ if (fromPartMetadata != null) {
4767
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
4768
+ }
4688
4769
  return toObject;
4689
4770
  }
4690
4771
  function safetySettingToMldev$1(fromObject) {
@@ -6019,6 +6100,10 @@ function partToMldev$3(fromObject) {
6019
6100
  if (fromToolResponse != null) {
6020
6101
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
6021
6102
  }
6103
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
6104
+ if (fromPartMetadata != null) {
6105
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
6106
+ }
6022
6107
  return toObject;
6023
6108
  }
6024
6109
  function partToVertex$2(fromObject) {
@@ -6085,6 +6170,9 @@ function partToVertex$2(fromObject) {
6085
6170
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6086
6171
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
6087
6172
  }
6173
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6174
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
6175
+ }
6088
6176
  return toObject;
6089
6177
  }
6090
6178
  function toolConfigToMldev$1(fromObject) {
@@ -7341,7 +7429,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7341
7429
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7342
7430
  const USER_AGENT_HEADER = 'User-Agent';
7343
7431
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7344
- const SDK_VERSION = '1.46.0'; // x-release-please-version
7432
+ const SDK_VERSION = '1.48.0'; // x-release-please-version
7345
7433
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7346
7434
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7347
7435
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7401,6 +7489,11 @@ class ApiClient {
7401
7489
  // Vertex Express or global endpoint case.
7402
7490
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
7403
7491
  }
7492
+ else if (this.clientOptions.project &&
7493
+ this.clientOptions.location &&
7494
+ this.clientOptions.location === 'us') {
7495
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
7496
+ }
7404
7497
  else if (this.clientOptions.project && this.clientOptions.location) {
7405
7498
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
7406
7499
  }
@@ -11209,7 +11302,7 @@ function generationConfigToVertex$1(fromObject) {
11209
11302
  }
11210
11303
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11211
11304
  if (fromSpeechConfig != null) {
11212
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11305
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
11213
11306
  }
11214
11307
  const fromStopSequences = getValueByPath(fromObject, [
11215
11308
  'stopSequences',
@@ -11430,7 +11523,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
11430
11523
  }
11431
11524
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11432
11525
  if (parentObject !== undefined && fromSpeechConfig != null) {
11433
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
11526
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
11434
11527
  }
11435
11528
  const fromThinkingConfig = getValueByPath(fromObject, [
11436
11529
  'thinkingConfig',
@@ -11690,6 +11783,22 @@ function liveServerMessageFromVertex(fromObject) {
11690
11783
  }
11691
11784
  return toObject;
11692
11785
  }
11786
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
11787
+ const toObject = {};
11788
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
11789
+ 'speakerVoiceConfigs',
11790
+ ]);
11791
+ if (fromSpeakerVoiceConfigs != null) {
11792
+ let transformedList = fromSpeakerVoiceConfigs;
11793
+ if (Array.isArray(transformedList)) {
11794
+ transformedList = transformedList.map((item) => {
11795
+ return speakerVoiceConfigToVertex$1(item);
11796
+ });
11797
+ }
11798
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
11799
+ }
11800
+ return toObject;
11801
+ }
11693
11802
  function partToMldev$2(fromObject) {
11694
11803
  const toObject = {};
11695
11804
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -11756,6 +11865,10 @@ function partToMldev$2(fromObject) {
11756
11865
  if (fromToolResponse != null) {
11757
11866
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
11758
11867
  }
11868
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
11869
+ if (fromPartMetadata != null) {
11870
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
11871
+ }
11759
11872
  return toObject;
11760
11873
  }
11761
11874
  function partToVertex$1(fromObject) {
@@ -11822,6 +11935,23 @@ function partToVertex$1(fromObject) {
11822
11935
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11823
11936
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
11824
11937
  }
11938
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
11939
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
11940
+ }
11941
+ return toObject;
11942
+ }
11943
+ function replicatedVoiceConfigToVertex$1(fromObject) {
11944
+ const toObject = {};
11945
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
11946
+ if (fromMimeType != null) {
11947
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
11948
+ }
11949
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
11950
+ 'voiceSampleAudio',
11951
+ ]);
11952
+ if (fromVoiceSampleAudio != null) {
11953
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
11954
+ }
11825
11955
  return toObject;
11826
11956
  }
11827
11957
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -11835,6 +11965,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
11835
11965
  }
11836
11966
  return toObject;
11837
11967
  }
11968
+ function speakerVoiceConfigToVertex$1(fromObject) {
11969
+ const toObject = {};
11970
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
11971
+ if (fromSpeaker != null) {
11972
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
11973
+ }
11974
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
11975
+ if (fromVoiceConfig != null) {
11976
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
11977
+ }
11978
+ return toObject;
11979
+ }
11980
+ function speechConfigToVertex$1(fromObject) {
11981
+ const toObject = {};
11982
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
11983
+ if (fromVoiceConfig != null) {
11984
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
11985
+ }
11986
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
11987
+ if (fromLanguageCode != null) {
11988
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
11989
+ }
11990
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
11991
+ 'multiSpeakerVoiceConfig',
11992
+ ]);
11993
+ if (fromMultiSpeakerVoiceConfig != null) {
11994
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
11995
+ }
11996
+ return toObject;
11997
+ }
11838
11998
  function toolToMldev$2(fromObject) {
11839
11999
  const toObject = {};
11840
12000
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -12068,6 +12228,22 @@ function voiceActivityFromVertex(fromObject) {
12068
12228
  }
12069
12229
  return toObject;
12070
12230
  }
12231
+ function voiceConfigToVertex$1(fromObject) {
12232
+ const toObject = {};
12233
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
12234
+ 'replicatedVoiceConfig',
12235
+ ]);
12236
+ if (fromReplicatedVoiceConfig != null) {
12237
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
12238
+ }
12239
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
12240
+ 'prebuiltVoiceConfig',
12241
+ ]);
12242
+ if (fromPrebuiltVoiceConfig != null) {
12243
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
12244
+ }
12245
+ return toObject;
12246
+ }
12071
12247
 
12072
12248
  /**
12073
12249
  * @license
@@ -13121,6 +13297,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
13121
13297
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
13122
13298
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
13123
13299
  }
13300
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
13301
+ if (parentObject !== undefined && fromServiceTier != null) {
13302
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
13303
+ }
13124
13304
  return toObject;
13125
13305
  }
13126
13306
  function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
@@ -13267,7 +13447,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
13267
13447
  }
13268
13448
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
13269
13449
  if (fromSpeechConfig != null) {
13270
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
13450
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
13271
13451
  }
13272
13452
  const fromAudioTimestamp = getValueByPath(fromObject, [
13273
13453
  'audioTimestamp',
@@ -13295,6 +13475,10 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
13295
13475
  if (parentObject !== undefined && fromModelArmorConfig != null) {
13296
13476
  setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
13297
13477
  }
13478
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
13479
+ if (parentObject !== undefined && fromServiceTier != null) {
13480
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
13481
+ }
13298
13482
  return toObject;
13299
13483
  }
13300
13484
  function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
@@ -13379,6 +13563,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
13379
13563
  if (fromUsageMetadata != null) {
13380
13564
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
13381
13565
  }
13566
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
13567
+ if (fromModelStatus != null) {
13568
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
13569
+ }
13382
13570
  return toObject;
13383
13571
  }
13384
13572
  function generateContentResponseFromVertex(fromObject, _rootObject) {
@@ -13764,6 +13952,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
13764
13952
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
13765
13953
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
13766
13954
  }
13955
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
13956
+ throw new Error('labels parameter is not supported in Gemini API.');
13957
+ }
13767
13958
  return toObject;
13768
13959
  }
13769
13960
  function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
@@ -13854,6 +14045,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
13854
14045
  if (parentObject !== undefined && fromCompressionQuality != null) {
13855
14046
  setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
13856
14047
  }
14048
+ const fromLabels = getValueByPath(fromObject, ['labels']);
14049
+ if (parentObject !== undefined && fromLabels != null) {
14050
+ setValueByPath(parentObject, ['labels'], fromLabels);
14051
+ }
13857
14052
  return toObject;
13858
14053
  }
13859
14054
  function generateVideosOperationFromMldev(fromObject, rootObject) {
@@ -14123,7 +14318,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
14123
14318
  }
14124
14319
  return toObject;
14125
14320
  }
14126
- function generationConfigToVertex(fromObject, _rootObject) {
14321
+ function generationConfigToVertex(fromObject, rootObject) {
14127
14322
  const toObject = {};
14128
14323
  const fromModelSelectionConfig = getValueByPath(fromObject, [
14129
14324
  'modelSelectionConfig',
@@ -14219,7 +14414,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
14219
14414
  }
14220
14415
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14221
14416
  if (fromSpeechConfig != null) {
14222
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
14417
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
14223
14418
  }
14224
14419
  const fromStopSequences = getValueByPath(fromObject, [
14225
14420
  'stopSequences',
@@ -14676,6 +14871,22 @@ function modelFromVertex(fromObject, rootObject) {
14676
14871
  }
14677
14872
  return toObject;
14678
14873
  }
14874
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
14875
+ const toObject = {};
14876
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
14877
+ 'speakerVoiceConfigs',
14878
+ ]);
14879
+ if (fromSpeakerVoiceConfigs != null) {
14880
+ let transformedList = fromSpeakerVoiceConfigs;
14881
+ if (Array.isArray(transformedList)) {
14882
+ transformedList = transformedList.map((item) => {
14883
+ return speakerVoiceConfigToVertex(item);
14884
+ });
14885
+ }
14886
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
14887
+ }
14888
+ return toObject;
14889
+ }
14679
14890
  function partToMldev$1(fromObject, rootObject) {
14680
14891
  const toObject = {};
14681
14892
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -14742,6 +14953,10 @@ function partToMldev$1(fromObject, rootObject) {
14742
14953
  if (fromToolResponse != null) {
14743
14954
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
14744
14955
  }
14956
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
14957
+ if (fromPartMetadata != null) {
14958
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
14959
+ }
14745
14960
  return toObject;
14746
14961
  }
14747
14962
  function partToVertex(fromObject, _rootObject) {
@@ -14808,6 +15023,9 @@ function partToVertex(fromObject, _rootObject) {
14808
15023
  if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
14809
15024
  throw new Error('toolResponse parameter is not supported in Vertex AI.');
14810
15025
  }
15026
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
15027
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
15028
+ }
14811
15029
  return toObject;
14812
15030
  }
14813
15031
  function productImageToVertex(fromObject, rootObject) {
@@ -14978,6 +15196,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
14978
15196
  }
14979
15197
  return toObject;
14980
15198
  }
15199
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
15200
+ const toObject = {};
15201
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15202
+ if (fromMimeType != null) {
15203
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
15204
+ }
15205
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
15206
+ 'voiceSampleAudio',
15207
+ ]);
15208
+ if (fromVoiceSampleAudio != null) {
15209
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
15210
+ }
15211
+ return toObject;
15212
+ }
14981
15213
  function safetyAttributesFromMldev(fromObject, _rootObject) {
14982
15214
  const toObject = {};
14983
15215
  const fromCategories = getValueByPath(fromObject, [
@@ -15127,6 +15359,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
15127
15359
  }
15128
15360
  return toObject;
15129
15361
  }
15362
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
15363
+ const toObject = {};
15364
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
15365
+ if (fromSpeaker != null) {
15366
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
15367
+ }
15368
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15369
+ if (fromVoiceConfig != null) {
15370
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
15371
+ }
15372
+ return toObject;
15373
+ }
15374
+ function speechConfigToVertex(fromObject, rootObject) {
15375
+ const toObject = {};
15376
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15377
+ if (fromVoiceConfig != null) {
15378
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
15379
+ }
15380
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
15381
+ if (fromLanguageCode != null) {
15382
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
15383
+ }
15384
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
15385
+ 'multiSpeakerVoiceConfig',
15386
+ ]);
15387
+ if (fromMultiSpeakerVoiceConfig != null) {
15388
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
15389
+ }
15390
+ return toObject;
15391
+ }
15130
15392
  function toolConfigToMldev(fromObject, rootObject) {
15131
15393
  const toObject = {};
15132
15394
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -15609,6 +15871,22 @@ function videoToVertex(fromObject, _rootObject) {
15609
15871
  }
15610
15872
  return toObject;
15611
15873
  }
15874
+ function voiceConfigToVertex(fromObject, rootObject) {
15875
+ const toObject = {};
15876
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
15877
+ 'replicatedVoiceConfig',
15878
+ ]);
15879
+ if (fromReplicatedVoiceConfig != null) {
15880
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
15881
+ }
15882
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
15883
+ 'prebuiltVoiceConfig',
15884
+ ]);
15885
+ if (fromPrebuiltVoiceConfig != null) {
15886
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
15887
+ }
15888
+ return toObject;
15889
+ }
15612
15890
 
15613
15891
  /**
15614
15892
  * @license
@@ -18641,6 +18919,10 @@ function partToMldev(fromObject) {
18641
18919
  if (fromToolResponse != null) {
18642
18920
  setValueByPath(toObject, ['toolResponse'], fromToolResponse);
18643
18921
  }
18922
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
18923
+ if (fromPartMetadata != null) {
18924
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
18925
+ }
18644
18926
  return toObject;
18645
18927
  }
18646
18928
  function sessionResumptionConfigToMldev(fromObject) {
@@ -19275,6 +19557,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19275
19557
  setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
19276
19558
  }
19277
19559
  }
19560
+ else if (discriminatorTuningMode === 'DISTILLATION') {
19561
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
19562
+ if (parentObject !== undefined && fromTuningMode != null) {
19563
+ setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
19564
+ }
19565
+ }
19278
19566
  const fromCustomBaseModel = getValueByPath(fromObject, [
19279
19567
  'customBaseModel',
19280
19568
  ]);
@@ -19294,6 +19582,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19294
19582
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19295
19583
  }
19296
19584
  }
19585
+ else if (discriminatorBatchSize === 'DISTILLATION') {
19586
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19587
+ if (parentObject !== undefined && fromBatchSize != null) {
19588
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19589
+ }
19590
+ }
19297
19591
  let discriminatorLearningRate = getValueByPath(rootObject, [
19298
19592
  'config',
19299
19593
  'method',
@@ -19309,6 +19603,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19309
19603
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19310
19604
  }
19311
19605
  }
19606
+ else if (discriminatorLearningRate === 'DISTILLATION') {
19607
+ const fromLearningRate = getValueByPath(fromObject, [
19608
+ 'learningRate',
19609
+ ]);
19610
+ if (parentObject !== undefined && fromLearningRate != null) {
19611
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19612
+ }
19613
+ }
19312
19614
  const fromLabels = getValueByPath(fromObject, ['labels']);
19313
19615
  if (parentObject !== undefined && fromLabels != null) {
19314
19616
  setValueByPath(parentObject, ['labels'], fromLabels);
@@ -19812,6 +20114,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19812
20114
  if (fromVeoTuningSpec != null) {
19813
20115
  setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
19814
20116
  }
20117
+ const fromDistillationSamplingSpec = getValueByPath(fromObject, [
20118
+ 'distillationSamplingSpec',
20119
+ ]);
20120
+ if (fromDistillationSamplingSpec != null) {
20121
+ setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
20122
+ }
20123
+ const fromTuningJobMetadata = getValueByPath(fromObject, [
20124
+ 'tuningJobMetadata',
20125
+ ]);
20126
+ if (fromTuningJobMetadata != null) {
20127
+ setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
20128
+ }
19815
20129
  return toObject;
19816
20130
  }
19817
20131
  function tuningOperationFromMldev(fromObject, _rootObject) {