@google/genai 1.45.0 → 1.47.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.
@@ -616,6 +616,18 @@ function videoFromVertex$1(fromObject) {
616
616
  * Copyright 2025 Google LLC
617
617
  * SPDX-License-Identifier: Apache-2.0
618
618
  */
619
+ /** Programming language of the `code`. */
620
+ exports.Language = void 0;
621
+ (function (Language) {
622
+ /**
623
+ * Unspecified language. This value should not be used.
624
+ */
625
+ Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
626
+ /**
627
+ * Python >= 3.10, with numpy and simpy available.
628
+ */
629
+ Language["PYTHON"] = "PYTHON";
630
+ })(exports.Language || (exports.Language = {}));
619
631
  /** Outcome of the code execution. */
620
632
  exports.Outcome = void 0;
621
633
  (function (Outcome) {
@@ -636,18 +648,6 @@ exports.Outcome = void 0;
636
648
  */
637
649
  Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
638
650
  })(exports.Outcome || (exports.Outcome = {}));
639
- /** Programming language of the `code`. */
640
- exports.Language = void 0;
641
- (function (Language) {
642
- /**
643
- * Unspecified language. This value should not be used.
644
- */
645
- Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
646
- /**
647
- * Python >= 3.10, with numpy and simpy available.
648
- */
649
- Language["PYTHON"] = "PYTHON";
650
- })(exports.Language || (exports.Language = {}));
651
651
  /** Specifies how the response should be scheduled in the conversation. */
652
652
  exports.FunctionResponseScheduling = void 0;
653
653
  (function (FunctionResponseScheduling) {
@@ -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) {
@@ -1476,6 +1560,34 @@ exports.PartMediaResolutionLevel = void 0;
1476
1560
  */
1477
1561
  PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
1478
1562
  })(exports.PartMediaResolutionLevel || (exports.PartMediaResolutionLevel = {}));
1563
+ /** The type of tool in the function call. */
1564
+ exports.ToolType = void 0;
1565
+ (function (ToolType) {
1566
+ /**
1567
+ * Unspecified tool type.
1568
+ */
1569
+ ToolType["TOOL_TYPE_UNSPECIFIED"] = "TOOL_TYPE_UNSPECIFIED";
1570
+ /**
1571
+ * Google search tool, maps to Tool.google_search.search_types.web_search.
1572
+ */
1573
+ ToolType["GOOGLE_SEARCH_WEB"] = "GOOGLE_SEARCH_WEB";
1574
+ /**
1575
+ * Image search tool, maps to Tool.google_search.search_types.image_search.
1576
+ */
1577
+ ToolType["GOOGLE_SEARCH_IMAGE"] = "GOOGLE_SEARCH_IMAGE";
1578
+ /**
1579
+ * URL context tool, maps to Tool.url_context.
1580
+ */
1581
+ ToolType["URL_CONTEXT"] = "URL_CONTEXT";
1582
+ /**
1583
+ * Google maps tool, maps to Tool.google_maps.
1584
+ */
1585
+ ToolType["GOOGLE_MAPS"] = "GOOGLE_MAPS";
1586
+ /**
1587
+ * File search tool, maps to Tool.file_search.
1588
+ */
1589
+ ToolType["FILE_SEARCH"] = "FILE_SEARCH";
1590
+ })(exports.ToolType || (exports.ToolType = {}));
1479
1591
  /** Resource scope. */
1480
1592
  exports.ResourceScope = void 0;
1481
1593
  (function (ResourceScope) {
@@ -1488,42 +1600,34 @@ exports.ResourceScope = void 0;
1488
1600
  */
1489
1601
  ResourceScope["COLLECTION"] = "COLLECTION";
1490
1602
  })(exports.ResourceScope || (exports.ResourceScope = {}));
1491
- /** Options for feature selection preference. */
1492
- exports.FeatureSelectionPreference = void 0;
1493
- (function (FeatureSelectionPreference) {
1494
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1495
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1496
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1497
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1498
- })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1499
- /** The environment being operated. */
1500
- exports.Environment = void 0;
1501
- (function (Environment) {
1502
- /**
1503
- * Defaults to browser.
1504
- */
1505
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1603
+ /** Pricing and performance service tier. */
1604
+ exports.ServiceTier = void 0;
1605
+ (function (ServiceTier) {
1506
1606
  /**
1507
- * Operates in a web browser.
1607
+ * Default service tier, which is standard.
1508
1608
  */
1509
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1510
- })(exports.Environment || (exports.Environment = {}));
1511
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1512
- exports.ProminentPeople = void 0;
1513
- (function (ProminentPeople) {
1609
+ ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
1514
1610
  /**
1515
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1611
+ * Flex service tier.
1516
1612
  */
1517
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1613
+ ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
1518
1614
  /**
1519
- * Allows the model to generate images of prominent people.
1615
+ * Standard service tier.
1520
1616
  */
1521
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1617
+ ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
1522
1618
  /**
1523
- * Prevents the model from generating images of prominent people.
1619
+ * Priority service tier.
1524
1620
  */
1525
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1526
- })(exports.ProminentPeople || (exports.ProminentPeople = {}));
1621
+ ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_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 = {}));
1527
1631
  /** Enum representing the Vertex embedding API to use. */
1528
1632
  exports.EmbeddingApiType = void 0;
1529
1633
  (function (EmbeddingApiType) {
@@ -1698,14 +1802,6 @@ exports.TuningMethod = void 0;
1698
1802
  */
1699
1803
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1700
1804
  })(exports.TuningMethod || (exports.TuningMethod = {}));
1701
- /** State for the lifecycle of a Document. */
1702
- exports.DocumentState = void 0;
1703
- (function (DocumentState) {
1704
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1705
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1706
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1707
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1708
- })(exports.DocumentState || (exports.DocumentState = {}));
1709
1805
  /** State for the lifecycle of a File. */
1710
1806
  exports.FileState = void 0;
1711
1807
  (function (FileState) {
@@ -1865,6 +1961,10 @@ exports.TurnCoverage = void 0;
1865
1961
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1866
1962
  */
1867
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";
1868
1968
  })(exports.TurnCoverage || (exports.TurnCoverage = {}));
1869
1969
  /** Scale of the generated music. */
1870
1970
  exports.Scale = void 0;
@@ -1971,6 +2071,14 @@ exports.LiveMusicPlaybackControl = void 0;
1971
2071
  */
1972
2072
  LiveMusicPlaybackControl["RESET_CONTEXT"] = "RESET_CONTEXT";
1973
2073
  })(exports.LiveMusicPlaybackControl || (exports.LiveMusicPlaybackControl = {}));
2074
+ /** The output from a server-side `ToolCall` execution.
2075
+
2076
+ This message contains the results of a tool invocation that was initiated by a
2077
+ `ToolCall` from the model. The client should pass this `ToolResponse` back to
2078
+ the API in a subsequent turn within a `Content` message, along with the
2079
+ corresponding `ToolCall`. */
2080
+ class ToolResponse {
2081
+ }
1974
2082
  /** Raw media bytes for function response.
1975
2083
 
1976
2084
  Text should not be sent as raw bytes, use the FunctionResponse.response
@@ -2426,7 +2534,6 @@ class GenerateVideosResponse {
2426
2534
  class GenerateVideosOperation {
2427
2535
  /**
2428
2536
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2429
- * @internal
2430
2537
  */
2431
2538
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2432
2539
  const operation = new GenerateVideosOperation();
@@ -2472,7 +2579,6 @@ class ImportFileResponse {
2472
2579
  class ImportFileOperation {
2473
2580
  /**
2474
2581
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2475
- * @internal
2476
2582
  */
2477
2583
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2478
2584
  const operation = new ImportFileOperation();
@@ -2727,7 +2833,6 @@ class UploadToFileSearchStoreResponse {
2727
2833
  class UploadToFileSearchStoreOperation {
2728
2834
  /**
2729
2835
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2730
- * @internal
2731
2836
  */
2732
2837
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2733
2838
  const operation = new UploadToFileSearchStoreOperation();
@@ -4380,6 +4485,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4380
4485
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4381
4486
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4382
4487
  }
4488
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4489
+ if (parentObject !== undefined && fromServiceTier != null) {
4490
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
4491
+ }
4383
4492
  return toObject;
4384
4493
  }
4385
4494
  function generateContentResponseFromMldev$1(fromObject) {
@@ -4420,6 +4529,10 @@ function generateContentResponseFromMldev$1(fromObject) {
4420
4529
  if (fromUsageMetadata != null) {
4421
4530
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
4422
4531
  }
4532
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
4533
+ if (fromModelStatus != null) {
4534
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
4535
+ }
4423
4536
  return toObject;
4424
4537
  }
4425
4538
  function getBatchJobParametersToMldev(apiClient, fromObject) {
@@ -4699,6 +4812,18 @@ function partToMldev$4(fromObject) {
4699
4812
  if (fromVideoMetadata != null) {
4700
4813
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4701
4814
  }
4815
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
4816
+ if (fromToolCall != null) {
4817
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
4818
+ }
4819
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
4820
+ if (fromToolResponse != null) {
4821
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
4822
+ }
4823
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
4824
+ if (fromPartMetadata != null) {
4825
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
4826
+ }
4702
4827
  return toObject;
4703
4828
  }
4704
4829
  function safetySettingToMldev$1(fromObject) {
@@ -4730,6 +4855,10 @@ function toolConfigToMldev$2(fromObject) {
4730
4855
  if (fromFunctionCallingConfig != null) {
4731
4856
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4732
4857
  }
4858
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
4859
+ if (fromIncludeServerSideToolInvocations != null) {
4860
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
4861
+ }
4733
4862
  return toObject;
4734
4863
  }
4735
4864
  function toolToMldev$4(fromObject) {
@@ -5552,6 +5681,24 @@ function contentToMldev$3(fromObject) {
5552
5681
  }
5553
5682
  return toObject;
5554
5683
  }
5684
+ function contentToVertex$2(fromObject) {
5685
+ const toObject = {};
5686
+ const fromParts = getValueByPath(fromObject, ['parts']);
5687
+ if (fromParts != null) {
5688
+ let transformedList = fromParts;
5689
+ if (Array.isArray(transformedList)) {
5690
+ transformedList = transformedList.map((item) => {
5691
+ return partToVertex$2(item);
5692
+ });
5693
+ }
5694
+ setValueByPath(toObject, ['parts'], transformedList);
5695
+ }
5696
+ const fromRole = getValueByPath(fromObject, ['role']);
5697
+ if (fromRole != null) {
5698
+ setValueByPath(toObject, ['role'], fromRole);
5699
+ }
5700
+ return toObject;
5701
+ }
5555
5702
  function createCachedContentConfigToMldev(fromObject, parentObject) {
5556
5703
  const toObject = {};
5557
5704
  const fromTtl = getValueByPath(fromObject, ['ttl']);
@@ -5620,7 +5767,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5620
5767
  let transformedList = tContents(fromContents);
5621
5768
  if (Array.isArray(transformedList)) {
5622
5769
  transformedList = transformedList.map((item) => {
5623
- return item;
5770
+ return contentToVertex$2(item);
5624
5771
  });
5625
5772
  }
5626
5773
  setValueByPath(parentObject, ['contents'], transformedList);
@@ -5629,7 +5776,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5629
5776
  'systemInstruction',
5630
5777
  ]);
5631
5778
  if (parentObject !== undefined && fromSystemInstruction != null) {
5632
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
5779
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
5633
5780
  }
5634
5781
  const fromTools = getValueByPath(fromObject, ['tools']);
5635
5782
  if (parentObject !== undefined && fromTools != null) {
@@ -5643,7 +5790,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5643
5790
  }
5644
5791
  const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
5645
5792
  if (parentObject !== undefined && fromToolConfig != null) {
5646
- setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
5793
+ setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex$1(fromToolConfig));
5647
5794
  }
5648
5795
  const fromKmsKeyName = getValueByPath(fromObject, ['kmsKeyName']);
5649
5796
  if (parentObject !== undefined && fromKmsKeyName != null) {
@@ -6003,6 +6150,87 @@ function partToMldev$3(fromObject) {
6003
6150
  if (fromVideoMetadata != null) {
6004
6151
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
6005
6152
  }
6153
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
6154
+ if (fromToolCall != null) {
6155
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
6156
+ }
6157
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
6158
+ if (fromToolResponse != null) {
6159
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
6160
+ }
6161
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
6162
+ if (fromPartMetadata != null) {
6163
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
6164
+ }
6165
+ return toObject;
6166
+ }
6167
+ function partToVertex$2(fromObject) {
6168
+ const toObject = {};
6169
+ const fromMediaResolution = getValueByPath(fromObject, [
6170
+ 'mediaResolution',
6171
+ ]);
6172
+ if (fromMediaResolution != null) {
6173
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
6174
+ }
6175
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
6176
+ 'codeExecutionResult',
6177
+ ]);
6178
+ if (fromCodeExecutionResult != null) {
6179
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
6180
+ }
6181
+ const fromExecutableCode = getValueByPath(fromObject, [
6182
+ 'executableCode',
6183
+ ]);
6184
+ if (fromExecutableCode != null) {
6185
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
6186
+ }
6187
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
6188
+ if (fromFileData != null) {
6189
+ setValueByPath(toObject, ['fileData'], fromFileData);
6190
+ }
6191
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
6192
+ if (fromFunctionCall != null) {
6193
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
6194
+ }
6195
+ const fromFunctionResponse = getValueByPath(fromObject, [
6196
+ 'functionResponse',
6197
+ ]);
6198
+ if (fromFunctionResponse != null) {
6199
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
6200
+ }
6201
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
6202
+ if (fromInlineData != null) {
6203
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
6204
+ }
6205
+ const fromText = getValueByPath(fromObject, ['text']);
6206
+ if (fromText != null) {
6207
+ setValueByPath(toObject, ['text'], fromText);
6208
+ }
6209
+ const fromThought = getValueByPath(fromObject, ['thought']);
6210
+ if (fromThought != null) {
6211
+ setValueByPath(toObject, ['thought'], fromThought);
6212
+ }
6213
+ const fromThoughtSignature = getValueByPath(fromObject, [
6214
+ 'thoughtSignature',
6215
+ ]);
6216
+ if (fromThoughtSignature != null) {
6217
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
6218
+ }
6219
+ const fromVideoMetadata = getValueByPath(fromObject, [
6220
+ 'videoMetadata',
6221
+ ]);
6222
+ if (fromVideoMetadata != null) {
6223
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
6224
+ }
6225
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
6226
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
6227
+ }
6228
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6229
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
6230
+ }
6231
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6232
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
6233
+ }
6006
6234
  return toObject;
6007
6235
  }
6008
6236
  function toolConfigToMldev$1(fromObject) {
@@ -6019,6 +6247,30 @@ function toolConfigToMldev$1(fromObject) {
6019
6247
  if (fromFunctionCallingConfig != null) {
6020
6248
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
6021
6249
  }
6250
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
6251
+ if (fromIncludeServerSideToolInvocations != null) {
6252
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
6253
+ }
6254
+ return toObject;
6255
+ }
6256
+ function toolConfigToVertex$1(fromObject) {
6257
+ const toObject = {};
6258
+ const fromRetrievalConfig = getValueByPath(fromObject, [
6259
+ 'retrievalConfig',
6260
+ ]);
6261
+ if (fromRetrievalConfig != null) {
6262
+ setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
6263
+ }
6264
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
6265
+ 'functionCallingConfig',
6266
+ ]);
6267
+ if (fromFunctionCallingConfig != null) {
6268
+ setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
6269
+ }
6270
+ if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
6271
+ undefined) {
6272
+ throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
6273
+ }
6022
6274
  return toObject;
6023
6275
  }
6024
6276
  function toolToMldev$3(fromObject) {
@@ -7506,6 +7758,24 @@ function contentToMldev$2(fromObject) {
7506
7758
  }
7507
7759
  return toObject;
7508
7760
  }
7761
+ function contentToVertex$1(fromObject) {
7762
+ const toObject = {};
7763
+ const fromParts = getValueByPath(fromObject, ['parts']);
7764
+ if (fromParts != null) {
7765
+ let transformedList = fromParts;
7766
+ if (Array.isArray(transformedList)) {
7767
+ transformedList = transformedList.map((item) => {
7768
+ return partToVertex$1(item);
7769
+ });
7770
+ }
7771
+ setValueByPath(toObject, ['parts'], transformedList);
7772
+ }
7773
+ const fromRole = getValueByPath(fromObject, ['role']);
7774
+ if (fromRole != null) {
7775
+ setValueByPath(toObject, ['role'], fromRole);
7776
+ }
7777
+ return toObject;
7778
+ }
7509
7779
  function fileDataToMldev$2(fromObject) {
7510
7780
  const toObject = {};
7511
7781
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7674,7 +7944,7 @@ function generationConfigToVertex$1(fromObject) {
7674
7944
  }
7675
7945
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7676
7946
  if (fromSpeechConfig != null) {
7677
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
7947
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
7678
7948
  }
7679
7949
  const fromStopSequences = getValueByPath(fromObject, [
7680
7950
  'stopSequences',
@@ -7895,7 +8165,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
7895
8165
  }
7896
8166
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7897
8167
  if (parentObject !== undefined && fromSpeechConfig != null) {
7898
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
8168
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
7899
8169
  }
7900
8170
  const fromThinkingConfig = getValueByPath(fromObject, [
7901
8171
  'thinkingConfig',
@@ -7913,7 +8183,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
7913
8183
  'systemInstruction',
7914
8184
  ]);
7915
8185
  if (parentObject !== undefined && fromSystemInstruction != null) {
7916
- setValueByPath(parentObject, ['setup', 'systemInstruction'], tContent(fromSystemInstruction));
8186
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
7917
8187
  }
7918
8188
  const fromTools = getValueByPath(fromObject, ['tools']);
7919
8189
  if (parentObject !== undefined && fromTools != null) {
@@ -8119,43 +8389,131 @@ function liveServerMessageFromVertex(fromObject) {
8119
8389
  if (fromToolCall != null) {
8120
8390
  setValueByPath(toObject, ['toolCall'], fromToolCall);
8121
8391
  }
8122
- const fromToolCallCancellation = getValueByPath(fromObject, [
8123
- 'toolCallCancellation',
8392
+ const fromToolCallCancellation = getValueByPath(fromObject, [
8393
+ 'toolCallCancellation',
8394
+ ]);
8395
+ if (fromToolCallCancellation != null) {
8396
+ setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
8397
+ }
8398
+ const fromUsageMetadata = getValueByPath(fromObject, [
8399
+ 'usageMetadata',
8400
+ ]);
8401
+ if (fromUsageMetadata != null) {
8402
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
8403
+ }
8404
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
8405
+ if (fromGoAway != null) {
8406
+ setValueByPath(toObject, ['goAway'], fromGoAway);
8407
+ }
8408
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8409
+ 'sessionResumptionUpdate',
8410
+ ]);
8411
+ if (fromSessionResumptionUpdate != null) {
8412
+ setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
8413
+ }
8414
+ const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
8415
+ 'voiceActivityDetectionSignal',
8416
+ ]);
8417
+ if (fromVoiceActivityDetectionSignal != null) {
8418
+ setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
8419
+ }
8420
+ const fromVoiceActivity = getValueByPath(fromObject, [
8421
+ 'voiceActivity',
8422
+ ]);
8423
+ if (fromVoiceActivity != null) {
8424
+ setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
8425
+ }
8426
+ return toObject;
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
+ }
8444
+ function partToMldev$2(fromObject) {
8445
+ const toObject = {};
8446
+ const fromMediaResolution = getValueByPath(fromObject, [
8447
+ 'mediaResolution',
8448
+ ]);
8449
+ if (fromMediaResolution != null) {
8450
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
8451
+ }
8452
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8453
+ 'codeExecutionResult',
8454
+ ]);
8455
+ if (fromCodeExecutionResult != null) {
8456
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8457
+ }
8458
+ const fromExecutableCode = getValueByPath(fromObject, [
8459
+ 'executableCode',
8460
+ ]);
8461
+ if (fromExecutableCode != null) {
8462
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8463
+ }
8464
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8465
+ if (fromFileData != null) {
8466
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
8467
+ }
8468
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8469
+ if (fromFunctionCall != null) {
8470
+ setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
8471
+ }
8472
+ const fromFunctionResponse = getValueByPath(fromObject, [
8473
+ 'functionResponse',
8474
+ ]);
8475
+ if (fromFunctionResponse != null) {
8476
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8477
+ }
8478
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8479
+ if (fromInlineData != null) {
8480
+ setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
8481
+ }
8482
+ const fromText = getValueByPath(fromObject, ['text']);
8483
+ if (fromText != null) {
8484
+ setValueByPath(toObject, ['text'], fromText);
8485
+ }
8486
+ const fromThought = getValueByPath(fromObject, ['thought']);
8487
+ if (fromThought != null) {
8488
+ setValueByPath(toObject, ['thought'], fromThought);
8489
+ }
8490
+ const fromThoughtSignature = getValueByPath(fromObject, [
8491
+ 'thoughtSignature',
8124
8492
  ]);
8125
- if (fromToolCallCancellation != null) {
8126
- setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
8493
+ if (fromThoughtSignature != null) {
8494
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8127
8495
  }
8128
- const fromUsageMetadata = getValueByPath(fromObject, [
8129
- 'usageMetadata',
8496
+ const fromVideoMetadata = getValueByPath(fromObject, [
8497
+ 'videoMetadata',
8130
8498
  ]);
8131
- if (fromUsageMetadata != null) {
8132
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
8133
- }
8134
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
8135
- if (fromGoAway != null) {
8136
- setValueByPath(toObject, ['goAway'], fromGoAway);
8499
+ if (fromVideoMetadata != null) {
8500
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
8137
8501
  }
8138
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8139
- 'sessionResumptionUpdate',
8140
- ]);
8141
- if (fromSessionResumptionUpdate != null) {
8142
- setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
8502
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8503
+ if (fromToolCall != null) {
8504
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
8143
8505
  }
8144
- const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
8145
- 'voiceActivityDetectionSignal',
8146
- ]);
8147
- if (fromVoiceActivityDetectionSignal != null) {
8148
- setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
8506
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
8507
+ if (fromToolResponse != null) {
8508
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
8149
8509
  }
8150
- const fromVoiceActivity = getValueByPath(fromObject, [
8151
- 'voiceActivity',
8152
- ]);
8153
- if (fromVoiceActivity != null) {
8154
- setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
8510
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
8511
+ if (fromPartMetadata != null) {
8512
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
8155
8513
  }
8156
8514
  return toObject;
8157
8515
  }
8158
- function partToMldev$2(fromObject) {
8516
+ function partToVertex$1(fromObject) {
8159
8517
  const toObject = {};
8160
8518
  const fromMediaResolution = getValueByPath(fromObject, [
8161
8519
  'mediaResolution',
@@ -8177,11 +8535,11 @@ function partToMldev$2(fromObject) {
8177
8535
  }
8178
8536
  const fromFileData = getValueByPath(fromObject, ['fileData']);
8179
8537
  if (fromFileData != null) {
8180
- setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
8538
+ setValueByPath(toObject, ['fileData'], fromFileData);
8181
8539
  }
8182
8540
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8183
8541
  if (fromFunctionCall != null) {
8184
- setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
8542
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8185
8543
  }
8186
8544
  const fromFunctionResponse = getValueByPath(fromObject, [
8187
8545
  'functionResponse',
@@ -8191,7 +8549,7 @@ function partToMldev$2(fromObject) {
8191
8549
  }
8192
8550
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8193
8551
  if (fromInlineData != null) {
8194
- setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
8552
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
8195
8553
  }
8196
8554
  const fromText = getValueByPath(fromObject, ['text']);
8197
8555
  if (fromText != null) {
@@ -8213,6 +8571,29 @@ function partToMldev$2(fromObject) {
8213
8571
  if (fromVideoMetadata != null) {
8214
8572
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
8215
8573
  }
8574
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
8575
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
8576
+ }
8577
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
8578
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
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
+ }
8216
8597
  return toObject;
8217
8598
  }
8218
8599
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -8226,6 +8607,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8226
8607
  }
8227
8608
  return toObject;
8228
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
+ }
8229
8640
  function toolToMldev$2(fromObject) {
8230
8641
  const toObject = {};
8231
8642
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -8459,6 +8870,22 @@ function voiceActivityFromVertex(fromObject) {
8459
8870
  }
8460
8871
  return toObject;
8461
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
+ }
8462
8889
 
8463
8890
  /**
8464
8891
  * @license
@@ -8581,7 +9008,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
8581
9008
  }
8582
9009
  return toObject;
8583
9010
  }
8584
- function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
9011
+ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
8585
9012
  const toObject = {};
8586
9013
  const fromModel = getValueByPath(fromObject, ['model']);
8587
9014
  if (fromModel != null) {
@@ -8592,7 +9019,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
8592
9019
  let transformedList = tContents(fromContents);
8593
9020
  if (Array.isArray(transformedList)) {
8594
9021
  transformedList = transformedList.map((item) => {
8595
- return item;
9022
+ return contentToVertex(item);
8596
9023
  });
8597
9024
  }
8598
9025
  setValueByPath(toObject, ['contents'], transformedList);
@@ -8661,6 +9088,24 @@ function contentToMldev$1(fromObject, rootObject) {
8661
9088
  }
8662
9089
  return toObject;
8663
9090
  }
9091
+ function contentToVertex(fromObject, rootObject) {
9092
+ const toObject = {};
9093
+ const fromParts = getValueByPath(fromObject, ['parts']);
9094
+ if (fromParts != null) {
9095
+ let transformedList = fromParts;
9096
+ if (Array.isArray(transformedList)) {
9097
+ transformedList = transformedList.map((item) => {
9098
+ return partToVertex(item);
9099
+ });
9100
+ }
9101
+ setValueByPath(toObject, ['parts'], transformedList);
9102
+ }
9103
+ const fromRole = getValueByPath(fromObject, ['role']);
9104
+ if (fromRole != null) {
9105
+ setValueByPath(toObject, ['role'], fromRole);
9106
+ }
9107
+ return toObject;
9108
+ }
8664
9109
  function controlReferenceConfigToVertex(fromObject, _rootObject) {
8665
9110
  const toObject = {};
8666
9111
  const fromControlType = getValueByPath(fromObject, ['controlType']);
@@ -8694,7 +9139,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
8694
9139
  'systemInstruction',
8695
9140
  ]);
8696
9141
  if (parentObject !== undefined && fromSystemInstruction != null) {
8697
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
9142
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
8698
9143
  }
8699
9144
  const fromTools = getValueByPath(fromObject, ['tools']);
8700
9145
  if (parentObject !== undefined && fromTools != null) {
@@ -8747,7 +9192,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
8747
9192
  let transformedList = tContents(fromContents);
8748
9193
  if (Array.isArray(transformedList)) {
8749
9194
  transformedList = transformedList.map((item) => {
8750
- return item;
9195
+ return contentToVertex(item);
8751
9196
  });
8752
9197
  }
8753
9198
  setValueByPath(toObject, ['contents'], transformedList);
@@ -9151,7 +9596,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
9151
9596
  if (discriminatorContent === 'EMBED_CONTENT') {
9152
9597
  const fromContent = getValueByPath(fromObject, ['content']);
9153
9598
  if (fromContent != null) {
9154
- setValueByPath(toObject, ['content'], tContent(fromContent));
9599
+ setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
9155
9600
  }
9156
9601
  }
9157
9602
  const fromConfig = getValueByPath(fromObject, ['config']);
@@ -9494,6 +9939,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
9494
9939
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
9495
9940
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
9496
9941
  }
9942
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
9943
+ if (parentObject !== undefined && fromServiceTier != null) {
9944
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
9945
+ }
9497
9946
  return toObject;
9498
9947
  }
9499
9948
  function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
@@ -9502,7 +9951,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9502
9951
  'systemInstruction',
9503
9952
  ]);
9504
9953
  if (parentObject !== undefined && fromSystemInstruction != null) {
9505
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
9954
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
9506
9955
  }
9507
9956
  const fromTemperature = getValueByPath(fromObject, ['temperature']);
9508
9957
  if (fromTemperature != null) {
@@ -9614,7 +10063,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9614
10063
  }
9615
10064
  const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
9616
10065
  if (parentObject !== undefined && fromToolConfig != null) {
9617
- setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
10066
+ setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex(fromToolConfig));
9618
10067
  }
9619
10068
  const fromLabels = getValueByPath(fromObject, ['labels']);
9620
10069
  if (parentObject !== undefined && fromLabels != null) {
@@ -9640,7 +10089,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9640
10089
  }
9641
10090
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
9642
10091
  if (fromSpeechConfig != null) {
9643
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10092
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
9644
10093
  }
9645
10094
  const fromAudioTimestamp = getValueByPath(fromObject, [
9646
10095
  'audioTimestamp',
@@ -9668,6 +10117,9 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
9668
10117
  if (parentObject !== undefined && fromModelArmorConfig != null) {
9669
10118
  setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
9670
10119
  }
10120
+ if (getValueByPath(fromObject, ['serviceTier']) !== undefined) {
10121
+ throw new Error('serviceTier parameter is not supported in Vertex AI.');
10122
+ }
9671
10123
  return toObject;
9672
10124
  }
9673
10125
  function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
@@ -9703,7 +10155,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
9703
10155
  let transformedList = tContents(fromContents);
9704
10156
  if (Array.isArray(transformedList)) {
9705
10157
  transformedList = transformedList.map((item) => {
9706
- return item;
10158
+ return contentToVertex(item);
9707
10159
  });
9708
10160
  }
9709
10161
  setValueByPath(toObject, ['contents'], transformedList);
@@ -9752,6 +10204,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
9752
10204
  if (fromUsageMetadata != null) {
9753
10205
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
9754
10206
  }
10207
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
10208
+ if (fromModelStatus != null) {
10209
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
10210
+ }
9755
10211
  return toObject;
9756
10212
  }
9757
10213
  function generateContentResponseFromVertex(fromObject, _rootObject) {
@@ -10137,6 +10593,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
10137
10593
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
10138
10594
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
10139
10595
  }
10596
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
10597
+ throw new Error('labels parameter is not supported in Gemini API.');
10598
+ }
10140
10599
  return toObject;
10141
10600
  }
10142
10601
  function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
@@ -10227,6 +10686,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
10227
10686
  if (parentObject !== undefined && fromCompressionQuality != null) {
10228
10687
  setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
10229
10688
  }
10689
+ const fromLabels = getValueByPath(fromObject, ['labels']);
10690
+ if (parentObject !== undefined && fromLabels != null) {
10691
+ setValueByPath(parentObject, ['labels'], fromLabels);
10692
+ }
10230
10693
  return toObject;
10231
10694
  }
10232
10695
  function generateVideosOperationFromMldev(fromObject, rootObject) {
@@ -10496,7 +10959,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
10496
10959
  }
10497
10960
  return toObject;
10498
10961
  }
10499
- function generationConfigToVertex(fromObject, _rootObject) {
10962
+ function generationConfigToVertex(fromObject, rootObject) {
10500
10963
  const toObject = {};
10501
10964
  const fromModelSelectionConfig = getValueByPath(fromObject, [
10502
10965
  'modelSelectionConfig',
@@ -10592,7 +11055,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
10592
11055
  }
10593
11056
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
10594
11057
  if (fromSpeechConfig != null) {
10595
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11058
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
10596
11059
  }
10597
11060
  const fromStopSequences = getValueByPath(fromObject, [
10598
11061
  'stopSequences',
@@ -11049,6 +11512,22 @@ function modelFromVertex(fromObject, rootObject) {
11049
11512
  }
11050
11513
  return toObject;
11051
11514
  }
11515
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
11516
+ const toObject = {};
11517
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
11518
+ 'speakerVoiceConfigs',
11519
+ ]);
11520
+ if (fromSpeakerVoiceConfigs != null) {
11521
+ let transformedList = fromSpeakerVoiceConfigs;
11522
+ if (Array.isArray(transformedList)) {
11523
+ transformedList = transformedList.map((item) => {
11524
+ return speakerVoiceConfigToVertex(item);
11525
+ });
11526
+ }
11527
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
11528
+ }
11529
+ return toObject;
11530
+ }
11052
11531
  function partToMldev$1(fromObject, rootObject) {
11053
11532
  const toObject = {};
11054
11533
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -11107,6 +11586,87 @@ function partToMldev$1(fromObject, rootObject) {
11107
11586
  if (fromVideoMetadata != null) {
11108
11587
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11109
11588
  }
11589
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
11590
+ if (fromToolCall != null) {
11591
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
11592
+ }
11593
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
11594
+ if (fromToolResponse != null) {
11595
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
11596
+ }
11597
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
11598
+ if (fromPartMetadata != null) {
11599
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
11600
+ }
11601
+ return toObject;
11602
+ }
11603
+ function partToVertex(fromObject, _rootObject) {
11604
+ const toObject = {};
11605
+ const fromMediaResolution = getValueByPath(fromObject, [
11606
+ 'mediaResolution',
11607
+ ]);
11608
+ if (fromMediaResolution != null) {
11609
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
11610
+ }
11611
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
11612
+ 'codeExecutionResult',
11613
+ ]);
11614
+ if (fromCodeExecutionResult != null) {
11615
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
11616
+ }
11617
+ const fromExecutableCode = getValueByPath(fromObject, [
11618
+ 'executableCode',
11619
+ ]);
11620
+ if (fromExecutableCode != null) {
11621
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
11622
+ }
11623
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
11624
+ if (fromFileData != null) {
11625
+ setValueByPath(toObject, ['fileData'], fromFileData);
11626
+ }
11627
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
11628
+ if (fromFunctionCall != null) {
11629
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
11630
+ }
11631
+ const fromFunctionResponse = getValueByPath(fromObject, [
11632
+ 'functionResponse',
11633
+ ]);
11634
+ if (fromFunctionResponse != null) {
11635
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
11636
+ }
11637
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
11638
+ if (fromInlineData != null) {
11639
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
11640
+ }
11641
+ const fromText = getValueByPath(fromObject, ['text']);
11642
+ if (fromText != null) {
11643
+ setValueByPath(toObject, ['text'], fromText);
11644
+ }
11645
+ const fromThought = getValueByPath(fromObject, ['thought']);
11646
+ if (fromThought != null) {
11647
+ setValueByPath(toObject, ['thought'], fromThought);
11648
+ }
11649
+ const fromThoughtSignature = getValueByPath(fromObject, [
11650
+ 'thoughtSignature',
11651
+ ]);
11652
+ if (fromThoughtSignature != null) {
11653
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
11654
+ }
11655
+ const fromVideoMetadata = getValueByPath(fromObject, [
11656
+ 'videoMetadata',
11657
+ ]);
11658
+ if (fromVideoMetadata != null) {
11659
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11660
+ }
11661
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
11662
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
11663
+ }
11664
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11665
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
11666
+ }
11667
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
11668
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
11669
+ }
11110
11670
  return toObject;
11111
11671
  }
11112
11672
  function productImageToVertex(fromObject, rootObject) {
@@ -11277,6 +11837,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
11277
11837
  }
11278
11838
  return toObject;
11279
11839
  }
11840
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
11841
+ const toObject = {};
11842
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
11843
+ if (fromMimeType != null) {
11844
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
11845
+ }
11846
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
11847
+ 'voiceSampleAudio',
11848
+ ]);
11849
+ if (fromVoiceSampleAudio != null) {
11850
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
11851
+ }
11852
+ return toObject;
11853
+ }
11280
11854
  function safetyAttributesFromMldev(fromObject, _rootObject) {
11281
11855
  const toObject = {};
11282
11856
  const fromCategories = getValueByPath(fromObject, [
@@ -11426,6 +12000,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
11426
12000
  }
11427
12001
  return toObject;
11428
12002
  }
12003
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
12004
+ const toObject = {};
12005
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
12006
+ if (fromSpeaker != null) {
12007
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
12008
+ }
12009
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12010
+ if (fromVoiceConfig != null) {
12011
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12012
+ }
12013
+ return toObject;
12014
+ }
12015
+ function speechConfigToVertex(fromObject, rootObject) {
12016
+ const toObject = {};
12017
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12018
+ if (fromVoiceConfig != null) {
12019
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12020
+ }
12021
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
12022
+ if (fromLanguageCode != null) {
12023
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
12024
+ }
12025
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
12026
+ 'multiSpeakerVoiceConfig',
12027
+ ]);
12028
+ if (fromMultiSpeakerVoiceConfig != null) {
12029
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
12030
+ }
12031
+ return toObject;
12032
+ }
11429
12033
  function toolConfigToMldev(fromObject, rootObject) {
11430
12034
  const toObject = {};
11431
12035
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -11440,6 +12044,30 @@ function toolConfigToMldev(fromObject, rootObject) {
11440
12044
  if (fromFunctionCallingConfig != null) {
11441
12045
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
11442
12046
  }
12047
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
12048
+ if (fromIncludeServerSideToolInvocations != null) {
12049
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
12050
+ }
12051
+ return toObject;
12052
+ }
12053
+ function toolConfigToVertex(fromObject, _rootObject) {
12054
+ const toObject = {};
12055
+ const fromRetrievalConfig = getValueByPath(fromObject, [
12056
+ 'retrievalConfig',
12057
+ ]);
12058
+ if (fromRetrievalConfig != null) {
12059
+ setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
12060
+ }
12061
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
12062
+ 'functionCallingConfig',
12063
+ ]);
12064
+ if (fromFunctionCallingConfig != null) {
12065
+ setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
12066
+ }
12067
+ if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
12068
+ undefined) {
12069
+ throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
12070
+ }
11443
12071
  return toObject;
11444
12072
  }
11445
12073
  function toolToMldev$1(fromObject, rootObject) {
@@ -11884,6 +12512,22 @@ function videoToVertex(fromObject, _rootObject) {
11884
12512
  }
11885
12513
  return toObject;
11886
12514
  }
12515
+ function voiceConfigToVertex(fromObject, rootObject) {
12516
+ const toObject = {};
12517
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
12518
+ 'replicatedVoiceConfig',
12519
+ ]);
12520
+ if (fromReplicatedVoiceConfig != null) {
12521
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
12522
+ }
12523
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
12524
+ 'prebuiltVoiceConfig',
12525
+ ]);
12526
+ if (fromPrebuiltVoiceConfig != null) {
12527
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
12528
+ }
12529
+ return toObject;
12530
+ }
11887
12531
 
11888
12532
  /**
11889
12533
  * @license
@@ -12129,7 +12773,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12129
12773
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12130
12774
  const USER_AGENT_HEADER = 'User-Agent';
12131
12775
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12132
- const SDK_VERSION = '1.45.0'; // x-release-please-version
12776
+ const SDK_VERSION = '1.47.0'; // x-release-please-version
12133
12777
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12134
12778
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12135
12779
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -12189,6 +12833,11 @@ class ApiClient {
12189
12833
  // Vertex Express or global endpoint case.
12190
12834
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
12191
12835
  }
12836
+ else if (this.clientOptions.project &&
12837
+ this.clientOptions.location &&
12838
+ this.clientOptions.location === 'us') {
12839
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
12840
+ }
12192
12841
  else if (this.clientOptions.project && this.clientOptions.location) {
12193
12842
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
12194
12843
  }
@@ -13488,7 +14137,7 @@ class Session {
13488
14137
  }
13489
14138
  }
13490
14139
  const clientMessage = {
13491
- toolResponse: { functionResponses: functionResponses },
14140
+ toolResponse: { 'functionResponses': functionResponses },
13492
14141
  };
13493
14142
  return clientMessage;
13494
14143
  }
@@ -15818,6 +16467,18 @@ function partToMldev(fromObject) {
15818
16467
  if (fromVideoMetadata != null) {
15819
16468
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
15820
16469
  }
16470
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
16471
+ if (fromToolCall != null) {
16472
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
16473
+ }
16474
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
16475
+ if (fromToolResponse != null) {
16476
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
16477
+ }
16478
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
16479
+ if (fromPartMetadata != null) {
16480
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
16481
+ }
15821
16482
  return toObject;
15822
16483
  }
15823
16484
  function sessionResumptionConfigToMldev(fromObject) {
@@ -18981,6 +19642,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18981
19642
  setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
18982
19643
  }
18983
19644
  }
19645
+ else if (discriminatorTuningMode === 'DISTILLATION') {
19646
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
19647
+ if (parentObject !== undefined && fromTuningMode != null) {
19648
+ setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
19649
+ }
19650
+ }
18984
19651
  const fromCustomBaseModel = getValueByPath(fromObject, [
18985
19652
  'customBaseModel',
18986
19653
  ]);
@@ -19000,6 +19667,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19000
19667
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19001
19668
  }
19002
19669
  }
19670
+ else if (discriminatorBatchSize === 'DISTILLATION') {
19671
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19672
+ if (parentObject !== undefined && fromBatchSize != null) {
19673
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19674
+ }
19675
+ }
19003
19676
  let discriminatorLearningRate = getValueByPath(rootObject, [
19004
19677
  'config',
19005
19678
  'method',
@@ -19015,6 +19688,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
19015
19688
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19016
19689
  }
19017
19690
  }
19691
+ else if (discriminatorLearningRate === 'DISTILLATION') {
19692
+ const fromLearningRate = getValueByPath(fromObject, [
19693
+ 'learningRate',
19694
+ ]);
19695
+ if (parentObject !== undefined && fromLearningRate != null) {
19696
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19697
+ }
19698
+ }
19018
19699
  const fromLabels = getValueByPath(fromObject, ['labels']);
19019
19700
  if (parentObject !== undefined && fromLabels != null) {
19020
19701
  setValueByPath(parentObject, ['labels'], fromLabels);
@@ -19518,6 +20199,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19518
20199
  if (fromVeoTuningSpec != null) {
19519
20200
  setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
19520
20201
  }
20202
+ const fromDistillationSamplingSpec = getValueByPath(fromObject, [
20203
+ 'distillationSamplingSpec',
20204
+ ]);
20205
+ if (fromDistillationSamplingSpec != null) {
20206
+ setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
20207
+ }
20208
+ const fromTuningJobMetadata = getValueByPath(fromObject, [
20209
+ 'tuningJobMetadata',
20210
+ ]);
20211
+ if (fromTuningJobMetadata != null) {
20212
+ setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
20213
+ }
19521
20214
  return toObject;
19522
20215
  }
19523
20216
  function tuningOperationFromMldev(fromObject, _rootObject) {
@@ -19941,18 +20634,18 @@ const MAX_RETRY_COUNT = 3;
19941
20634
  const INITIAL_RETRY_DELAY_MS = 1000;
19942
20635
  const DELAY_MULTIPLIER = 2;
19943
20636
  const X_GOOG_UPLOAD_STATUS_HEADER_FIELD = 'x-goog-upload-status';
19944
- async function uploadBlob(file, uploadUrl, apiClient) {
20637
+ async function uploadBlob(file, uploadUrl, apiClient, httpOptions) {
19945
20638
  var _a;
19946
- const response = await uploadBlobInternal(file, uploadUrl, apiClient);
20639
+ const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
19947
20640
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
19948
20641
  if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
19949
20642
  throw new Error('Failed to upload file: Upload status is not finalized.');
19950
20643
  }
19951
20644
  return responseJson['file'];
19952
20645
  }
19953
- async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
20646
+ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
19954
20647
  var _a;
19955
- const response = await uploadBlobInternal(file, uploadUrl, apiClient);
20648
+ const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
19956
20649
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
19957
20650
  if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
19958
20651
  throw new Error('Failed to upload file: Upload status is not finalized.');
@@ -19962,8 +20655,18 @@ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
19962
20655
  Object.assign(typedResp, resp);
19963
20656
  return typedResp;
19964
20657
  }
19965
- async function uploadBlobInternal(file, uploadUrl, apiClient) {
19966
- var _a, _b;
20658
+ async function uploadBlobInternal(file, uploadUrl, apiClient, httpOptions) {
20659
+ var _a, _b, _c;
20660
+ let finalUrl = uploadUrl;
20661
+ const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a = apiClient.clientOptions.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl);
20662
+ if (effectiveBaseUrl) {
20663
+ const baseUri = new URL(effectiveBaseUrl);
20664
+ const uploadUri = new URL(uploadUrl);
20665
+ uploadUri.protocol = baseUri.protocol;
20666
+ uploadUri.host = baseUri.host;
20667
+ uploadUri.port = baseUri.port;
20668
+ finalUrl = uploadUri.toString();
20669
+ }
19967
20670
  let fileSize = 0;
19968
20671
  let offset = 0;
19969
20672
  let response = new HttpResponse(new Response());
@@ -19978,21 +20681,14 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
19978
20681
  let retryCount = 0;
19979
20682
  let currentDelayMs = INITIAL_RETRY_DELAY_MS;
19980
20683
  while (retryCount < MAX_RETRY_COUNT) {
20684
+ const mergedHeaders = Object.assign(Object.assign({}, ((httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.headers) || {})), { 'X-Goog-Upload-Command': uploadCommand, 'X-Goog-Upload-Offset': String(offset), 'Content-Length': String(chunkSize) });
19981
20685
  response = await apiClient.request({
19982
20686
  path: '',
19983
20687
  body: chunk,
19984
20688
  httpMethod: 'POST',
19985
- httpOptions: {
19986
- apiVersion: '',
19987
- baseUrl: uploadUrl,
19988
- headers: {
19989
- 'X-Goog-Upload-Command': uploadCommand,
19990
- 'X-Goog-Upload-Offset': String(offset),
19991
- 'Content-Length': String(chunkSize),
19992
- },
19993
- },
20689
+ httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: '', baseUrl: finalUrl, headers: mergedHeaders }),
19994
20690
  });
19995
- if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
20691
+ if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
19996
20692
  break;
19997
20693
  }
19998
20694
  retryCount++;
@@ -20002,7 +20698,7 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
20002
20698
  offset += chunkSize;
20003
20699
  // The `x-goog-upload-status` header field can be `active`, `final` and
20004
20700
  //`cancelled` in resposne.
20005
- if (((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'active') {
20701
+ if (((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'active') {
20006
20702
  break;
20007
20703
  }
20008
20704
  // TODO(b/401391430) Investigate why the upload status is not finalized
@@ -20039,20 +20735,20 @@ class NodeUploader {
20039
20735
  return await getBlobStat(file);
20040
20736
  }
20041
20737
  }
20042
- async upload(file, uploadUrl, apiClient) {
20738
+ async upload(file, uploadUrl, apiClient, httpOptions) {
20043
20739
  if (typeof file === 'string') {
20044
- return await this.uploadFileFromPath(file, uploadUrl, apiClient);
20740
+ return await this.uploadFileFromPath(file, uploadUrl, apiClient, httpOptions);
20045
20741
  }
20046
20742
  else {
20047
- return uploadBlob(file, uploadUrl, apiClient);
20743
+ return uploadBlob(file, uploadUrl, apiClient, httpOptions);
20048
20744
  }
20049
20745
  }
20050
- async uploadToFileSearchStore(file, uploadUrl, apiClient) {
20746
+ async uploadToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
20051
20747
  if (typeof file === 'string') {
20052
- return await this.uploadFileToFileSearchStoreFromPath(file, uploadUrl, apiClient);
20748
+ return await this.uploadFileToFileSearchStoreFromPath(file, uploadUrl, apiClient, httpOptions);
20053
20749
  }
20054
20750
  else {
20055
- return uploadBlobToFileSearchStore(file, uploadUrl, apiClient);
20751
+ return uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions);
20056
20752
  }
20057
20753
  }
20058
20754
  /**
@@ -20145,18 +20841,18 @@ class NodeUploader {
20145
20841
  // Return the MIME type.
20146
20842
  return mimeType;
20147
20843
  }
20148
- async uploadFileFromPath(file, uploadUrl, apiClient) {
20844
+ async uploadFileFromPath(file, uploadUrl, apiClient, httpOptions) {
20149
20845
  var _a;
20150
- const response = await this.uploadFileFromPathInternal(file, uploadUrl, apiClient);
20846
+ const response = await this.uploadFileFromPathInternal(file, uploadUrl, apiClient, httpOptions);
20151
20847
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
20152
20848
  if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
20153
20849
  throw new Error('Failed to upload file: Upload status is not finalized.');
20154
20850
  }
20155
20851
  return responseJson['file'];
20156
20852
  }
20157
- async uploadFileToFileSearchStoreFromPath(file, uploadUrl, apiClient) {
20853
+ async uploadFileToFileSearchStoreFromPath(file, uploadUrl, apiClient, httpOptions) {
20158
20854
  var _a;
20159
- const response = await this.uploadFileFromPathInternal(file, uploadUrl, apiClient);
20855
+ const response = await this.uploadFileFromPathInternal(file, uploadUrl, apiClient, httpOptions);
20160
20856
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
20161
20857
  if (((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'final') {
20162
20858
  throw new Error('Failed to upload file: Upload status is not finalized.');
@@ -20166,8 +20862,18 @@ class NodeUploader {
20166
20862
  Object.assign(typedResp, resp);
20167
20863
  return typedResp;
20168
20864
  }
20169
- async uploadFileFromPathInternal(file, uploadUrl, apiClient) {
20170
- var _a, _b;
20865
+ async uploadFileFromPathInternal(file, uploadUrl, apiClient, httpOptions) {
20866
+ var _a, _b, _c;
20867
+ let finalUrl = uploadUrl;
20868
+ const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a = apiClient.clientOptions.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl);
20869
+ if (effectiveBaseUrl) {
20870
+ const baseUri = new URL(effectiveBaseUrl);
20871
+ const uploadUri = new URL(uploadUrl);
20872
+ uploadUri.protocol = baseUri.protocol;
20873
+ uploadUri.host = baseUri.host;
20874
+ uploadUri.port = baseUri.port;
20875
+ finalUrl = uploadUri.toString();
20876
+ }
20171
20877
  let fileSize = 0;
20172
20878
  let offset = 0;
20173
20879
  let response = new HttpResponse(new Response());
@@ -20194,22 +20900,14 @@ class NodeUploader {
20194
20900
  let retryCount = 0;
20195
20901
  let currentDelayMs = INITIAL_RETRY_DELAY_MS;
20196
20902
  while (retryCount < MAX_RETRY_COUNT) {
20903
+ const mergedHeaders = Object.assign(Object.assign({}, ((httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.headers) || {})), { 'X-Goog-Upload-Command': uploadCommand, 'X-Goog-Upload-Offset': String(offset), 'Content-Length': String(bytesRead), 'X-Goog-Upload-File-Name': fileName });
20197
20904
  response = await apiClient.request({
20198
20905
  path: '',
20199
20906
  body: chunk,
20200
20907
  httpMethod: 'POST',
20201
- httpOptions: {
20202
- apiVersion: '',
20203
- baseUrl: uploadUrl,
20204
- headers: {
20205
- 'X-Goog-Upload-Command': uploadCommand,
20206
- 'X-Goog-Upload-Offset': String(offset),
20207
- 'Content-Length': String(bytesRead),
20208
- 'X-Goog-Upload-File-Name': fileName,
20209
- },
20210
- },
20908
+ httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: '', baseUrl: finalUrl, headers: mergedHeaders }),
20211
20909
  });
20212
- if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
20910
+ if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
20213
20911
  break;
20214
20912
  }
20215
20913
  retryCount++;
@@ -20219,7 +20917,7 @@ class NodeUploader {
20219
20917
  offset += bytesRead;
20220
20918
  // The `x-goog-upload-status` header field can be `active`, `final` and
20221
20919
  //`cancelled` in resposne.
20222
- if (((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'active') {
20920
+ if (((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) !== 'active') {
20223
20921
  break;
20224
20922
  }
20225
20923
  if (fileSize <= offset) {
@@ -20519,6 +21217,7 @@ exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
20519
21217
  exports.StyleReferenceImage = StyleReferenceImage;
20520
21218
  exports.SubjectReferenceImage = SubjectReferenceImage;
20521
21219
  exports.Tokens = Tokens;
21220
+ exports.ToolResponse = ToolResponse;
20522
21221
  exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
20523
21222
  exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
20524
21223
  exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;