@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.
package/dist/index.cjs CHANGED
@@ -558,6 +558,18 @@ function videoFromVertex$1(fromObject) {
558
558
  * Copyright 2025 Google LLC
559
559
  * SPDX-License-Identifier: Apache-2.0
560
560
  */
561
+ /** Programming language of the `code`. */
562
+ exports.Language = void 0;
563
+ (function (Language) {
564
+ /**
565
+ * Unspecified language. This value should not be used.
566
+ */
567
+ Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
568
+ /**
569
+ * Python >= 3.10, with numpy and simpy available.
570
+ */
571
+ Language["PYTHON"] = "PYTHON";
572
+ })(exports.Language || (exports.Language = {}));
561
573
  /** Outcome of the code execution. */
562
574
  exports.Outcome = void 0;
563
575
  (function (Outcome) {
@@ -578,18 +590,6 @@ exports.Outcome = void 0;
578
590
  */
579
591
  Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
580
592
  })(exports.Outcome || (exports.Outcome = {}));
581
- /** Programming language of the `code`. */
582
- exports.Language = void 0;
583
- (function (Language) {
584
- /**
585
- * Unspecified language. This value should not be used.
586
- */
587
- Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
588
- /**
589
- * Python >= 3.10, with numpy and simpy available.
590
- */
591
- Language["PYTHON"] = "PYTHON";
592
- })(exports.Language || (exports.Language = {}));
593
593
  /** Specifies how the response should be scheduled in the conversation. */
594
594
  exports.FunctionResponseScheduling = void 0;
595
595
  (function (FunctionResponseScheduling) {
@@ -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) {
@@ -1418,6 +1502,34 @@ exports.PartMediaResolutionLevel = void 0;
1418
1502
  */
1419
1503
  PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
1420
1504
  })(exports.PartMediaResolutionLevel || (exports.PartMediaResolutionLevel = {}));
1505
+ /** The type of tool in the function call. */
1506
+ exports.ToolType = void 0;
1507
+ (function (ToolType) {
1508
+ /**
1509
+ * Unspecified tool type.
1510
+ */
1511
+ ToolType["TOOL_TYPE_UNSPECIFIED"] = "TOOL_TYPE_UNSPECIFIED";
1512
+ /**
1513
+ * Google search tool, maps to Tool.google_search.search_types.web_search.
1514
+ */
1515
+ ToolType["GOOGLE_SEARCH_WEB"] = "GOOGLE_SEARCH_WEB";
1516
+ /**
1517
+ * Image search tool, maps to Tool.google_search.search_types.image_search.
1518
+ */
1519
+ ToolType["GOOGLE_SEARCH_IMAGE"] = "GOOGLE_SEARCH_IMAGE";
1520
+ /**
1521
+ * URL context tool, maps to Tool.url_context.
1522
+ */
1523
+ ToolType["URL_CONTEXT"] = "URL_CONTEXT";
1524
+ /**
1525
+ * Google maps tool, maps to Tool.google_maps.
1526
+ */
1527
+ ToolType["GOOGLE_MAPS"] = "GOOGLE_MAPS";
1528
+ /**
1529
+ * File search tool, maps to Tool.file_search.
1530
+ */
1531
+ ToolType["FILE_SEARCH"] = "FILE_SEARCH";
1532
+ })(exports.ToolType || (exports.ToolType = {}));
1421
1533
  /** Resource scope. */
1422
1534
  exports.ResourceScope = void 0;
1423
1535
  (function (ResourceScope) {
@@ -1430,42 +1542,34 @@ exports.ResourceScope = void 0;
1430
1542
  */
1431
1543
  ResourceScope["COLLECTION"] = "COLLECTION";
1432
1544
  })(exports.ResourceScope || (exports.ResourceScope = {}));
1433
- /** Options for feature selection preference. */
1434
- exports.FeatureSelectionPreference = void 0;
1435
- (function (FeatureSelectionPreference) {
1436
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1437
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1438
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1439
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1440
- })(exports.FeatureSelectionPreference || (exports.FeatureSelectionPreference = {}));
1441
- /** The environment being operated. */
1442
- exports.Environment = void 0;
1443
- (function (Environment) {
1545
+ /** Pricing and performance service tier. */
1546
+ exports.ServiceTier = void 0;
1547
+ (function (ServiceTier) {
1444
1548
  /**
1445
- * Defaults to browser.
1549
+ * Default service tier, which is standard.
1446
1550
  */
1447
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1551
+ ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
1448
1552
  /**
1449
- * Operates in a web browser.
1553
+ * Flex service tier.
1450
1554
  */
1451
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1452
- })(exports.Environment || (exports.Environment = {}));
1453
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1454
- exports.ProminentPeople = void 0;
1455
- (function (ProminentPeople) {
1555
+ ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
1456
1556
  /**
1457
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1557
+ * Standard service tier.
1458
1558
  */
1459
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1559
+ ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
1460
1560
  /**
1461
- * Allows the model to generate images of prominent people.
1561
+ * Priority service tier.
1462
1562
  */
1463
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1464
- /**
1465
- * Prevents the model from generating images of prominent people.
1466
- */
1467
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1468
- })(exports.ProminentPeople || (exports.ProminentPeople = {}));
1563
+ ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_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 = {}));
1469
1573
  /** Enum representing the Vertex embedding API to use. */
1470
1574
  exports.EmbeddingApiType = void 0;
1471
1575
  (function (EmbeddingApiType) {
@@ -1640,14 +1744,6 @@ exports.TuningMethod = void 0;
1640
1744
  */
1641
1745
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1642
1746
  })(exports.TuningMethod || (exports.TuningMethod = {}));
1643
- /** State for the lifecycle of a Document. */
1644
- exports.DocumentState = void 0;
1645
- (function (DocumentState) {
1646
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1647
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1648
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1649
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1650
- })(exports.DocumentState || (exports.DocumentState = {}));
1651
1747
  /** State for the lifecycle of a File. */
1652
1748
  exports.FileState = void 0;
1653
1749
  (function (FileState) {
@@ -1807,6 +1903,10 @@ exports.TurnCoverage = void 0;
1807
1903
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1808
1904
  */
1809
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";
1810
1910
  })(exports.TurnCoverage || (exports.TurnCoverage = {}));
1811
1911
  /** Scale of the generated music. */
1812
1912
  exports.Scale = void 0;
@@ -1913,6 +2013,14 @@ exports.LiveMusicPlaybackControl = void 0;
1913
2013
  */
1914
2014
  LiveMusicPlaybackControl["RESET_CONTEXT"] = "RESET_CONTEXT";
1915
2015
  })(exports.LiveMusicPlaybackControl || (exports.LiveMusicPlaybackControl = {}));
2016
+ /** The output from a server-side `ToolCall` execution.
2017
+
2018
+ This message contains the results of a tool invocation that was initiated by a
2019
+ `ToolCall` from the model. The client should pass this `ToolResponse` back to
2020
+ the API in a subsequent turn within a `Content` message, along with the
2021
+ corresponding `ToolCall`. */
2022
+ class ToolResponse {
2023
+ }
1916
2024
  /** Raw media bytes for function response.
1917
2025
 
1918
2026
  Text should not be sent as raw bytes, use the FunctionResponse.response
@@ -2368,7 +2476,6 @@ class GenerateVideosResponse {
2368
2476
  class GenerateVideosOperation {
2369
2477
  /**
2370
2478
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2371
- * @internal
2372
2479
  */
2373
2480
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2374
2481
  const operation = new GenerateVideosOperation();
@@ -2414,7 +2521,6 @@ class ImportFileResponse {
2414
2521
  class ImportFileOperation {
2415
2522
  /**
2416
2523
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2417
- * @internal
2418
2524
  */
2419
2525
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2420
2526
  const operation = new ImportFileOperation();
@@ -2669,7 +2775,6 @@ class UploadToFileSearchStoreResponse {
2669
2775
  class UploadToFileSearchStoreOperation {
2670
2776
  /**
2671
2777
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
2672
- * @internal
2673
2778
  */
2674
2779
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
2675
2780
  const operation = new UploadToFileSearchStoreOperation();
@@ -4322,6 +4427,10 @@ function generateContentConfigToMldev$1(apiClient, fromObject, parentObject) {
4322
4427
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
4323
4428
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
4324
4429
  }
4430
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
4431
+ if (parentObject !== undefined && fromServiceTier != null) {
4432
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
4433
+ }
4325
4434
  return toObject;
4326
4435
  }
4327
4436
  function generateContentResponseFromMldev$1(fromObject) {
@@ -4362,6 +4471,10 @@ function generateContentResponseFromMldev$1(fromObject) {
4362
4471
  if (fromUsageMetadata != null) {
4363
4472
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
4364
4473
  }
4474
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
4475
+ if (fromModelStatus != null) {
4476
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
4477
+ }
4365
4478
  return toObject;
4366
4479
  }
4367
4480
  function getBatchJobParametersToMldev(apiClient, fromObject) {
@@ -4641,6 +4754,18 @@ function partToMldev$4(fromObject) {
4641
4754
  if (fromVideoMetadata != null) {
4642
4755
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
4643
4756
  }
4757
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
4758
+ if (fromToolCall != null) {
4759
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
4760
+ }
4761
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
4762
+ if (fromToolResponse != null) {
4763
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
4764
+ }
4765
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
4766
+ if (fromPartMetadata != null) {
4767
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
4768
+ }
4644
4769
  return toObject;
4645
4770
  }
4646
4771
  function safetySettingToMldev$1(fromObject) {
@@ -4672,6 +4797,10 @@ function toolConfigToMldev$2(fromObject) {
4672
4797
  if (fromFunctionCallingConfig != null) {
4673
4798
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$2(fromFunctionCallingConfig));
4674
4799
  }
4800
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
4801
+ if (fromIncludeServerSideToolInvocations != null) {
4802
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
4803
+ }
4675
4804
  return toObject;
4676
4805
  }
4677
4806
  function toolToMldev$4(fromObject) {
@@ -5494,6 +5623,24 @@ function contentToMldev$3(fromObject) {
5494
5623
  }
5495
5624
  return toObject;
5496
5625
  }
5626
+ function contentToVertex$2(fromObject) {
5627
+ const toObject = {};
5628
+ const fromParts = getValueByPath(fromObject, ['parts']);
5629
+ if (fromParts != null) {
5630
+ let transformedList = fromParts;
5631
+ if (Array.isArray(transformedList)) {
5632
+ transformedList = transformedList.map((item) => {
5633
+ return partToVertex$2(item);
5634
+ });
5635
+ }
5636
+ setValueByPath(toObject, ['parts'], transformedList);
5637
+ }
5638
+ const fromRole = getValueByPath(fromObject, ['role']);
5639
+ if (fromRole != null) {
5640
+ setValueByPath(toObject, ['role'], fromRole);
5641
+ }
5642
+ return toObject;
5643
+ }
5497
5644
  function createCachedContentConfigToMldev(fromObject, parentObject) {
5498
5645
  const toObject = {};
5499
5646
  const fromTtl = getValueByPath(fromObject, ['ttl']);
@@ -5562,7 +5709,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5562
5709
  let transformedList = tContents(fromContents);
5563
5710
  if (Array.isArray(transformedList)) {
5564
5711
  transformedList = transformedList.map((item) => {
5565
- return item;
5712
+ return contentToVertex$2(item);
5566
5713
  });
5567
5714
  }
5568
5715
  setValueByPath(parentObject, ['contents'], transformedList);
@@ -5571,7 +5718,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5571
5718
  'systemInstruction',
5572
5719
  ]);
5573
5720
  if (parentObject !== undefined && fromSystemInstruction != null) {
5574
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
5721
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex$2(tContent(fromSystemInstruction)));
5575
5722
  }
5576
5723
  const fromTools = getValueByPath(fromObject, ['tools']);
5577
5724
  if (parentObject !== undefined && fromTools != null) {
@@ -5585,7 +5732,7 @@ function createCachedContentConfigToVertex(fromObject, parentObject) {
5585
5732
  }
5586
5733
  const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
5587
5734
  if (parentObject !== undefined && fromToolConfig != null) {
5588
- setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
5735
+ setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex$1(fromToolConfig));
5589
5736
  }
5590
5737
  const fromKmsKeyName = getValueByPath(fromObject, ['kmsKeyName']);
5591
5738
  if (parentObject !== undefined && fromKmsKeyName != null) {
@@ -5945,6 +6092,87 @@ function partToMldev$3(fromObject) {
5945
6092
  if (fromVideoMetadata != null) {
5946
6093
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
5947
6094
  }
6095
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
6096
+ if (fromToolCall != null) {
6097
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
6098
+ }
6099
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
6100
+ if (fromToolResponse != null) {
6101
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
6102
+ }
6103
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
6104
+ if (fromPartMetadata != null) {
6105
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
6106
+ }
6107
+ return toObject;
6108
+ }
6109
+ function partToVertex$2(fromObject) {
6110
+ const toObject = {};
6111
+ const fromMediaResolution = getValueByPath(fromObject, [
6112
+ 'mediaResolution',
6113
+ ]);
6114
+ if (fromMediaResolution != null) {
6115
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
6116
+ }
6117
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
6118
+ 'codeExecutionResult',
6119
+ ]);
6120
+ if (fromCodeExecutionResult != null) {
6121
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
6122
+ }
6123
+ const fromExecutableCode = getValueByPath(fromObject, [
6124
+ 'executableCode',
6125
+ ]);
6126
+ if (fromExecutableCode != null) {
6127
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
6128
+ }
6129
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
6130
+ if (fromFileData != null) {
6131
+ setValueByPath(toObject, ['fileData'], fromFileData);
6132
+ }
6133
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
6134
+ if (fromFunctionCall != null) {
6135
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
6136
+ }
6137
+ const fromFunctionResponse = getValueByPath(fromObject, [
6138
+ 'functionResponse',
6139
+ ]);
6140
+ if (fromFunctionResponse != null) {
6141
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
6142
+ }
6143
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
6144
+ if (fromInlineData != null) {
6145
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
6146
+ }
6147
+ const fromText = getValueByPath(fromObject, ['text']);
6148
+ if (fromText != null) {
6149
+ setValueByPath(toObject, ['text'], fromText);
6150
+ }
6151
+ const fromThought = getValueByPath(fromObject, ['thought']);
6152
+ if (fromThought != null) {
6153
+ setValueByPath(toObject, ['thought'], fromThought);
6154
+ }
6155
+ const fromThoughtSignature = getValueByPath(fromObject, [
6156
+ 'thoughtSignature',
6157
+ ]);
6158
+ if (fromThoughtSignature != null) {
6159
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
6160
+ }
6161
+ const fromVideoMetadata = getValueByPath(fromObject, [
6162
+ 'videoMetadata',
6163
+ ]);
6164
+ if (fromVideoMetadata != null) {
6165
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
6166
+ }
6167
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
6168
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
6169
+ }
6170
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
6171
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
6172
+ }
6173
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
6174
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
6175
+ }
5948
6176
  return toObject;
5949
6177
  }
5950
6178
  function toolConfigToMldev$1(fromObject) {
@@ -5961,6 +6189,30 @@ function toolConfigToMldev$1(fromObject) {
5961
6189
  if (fromFunctionCallingConfig != null) {
5962
6190
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev$1(fromFunctionCallingConfig));
5963
6191
  }
6192
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
6193
+ if (fromIncludeServerSideToolInvocations != null) {
6194
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
6195
+ }
6196
+ return toObject;
6197
+ }
6198
+ function toolConfigToVertex$1(fromObject) {
6199
+ const toObject = {};
6200
+ const fromRetrievalConfig = getValueByPath(fromObject, [
6201
+ 'retrievalConfig',
6202
+ ]);
6203
+ if (fromRetrievalConfig != null) {
6204
+ setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
6205
+ }
6206
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
6207
+ 'functionCallingConfig',
6208
+ ]);
6209
+ if (fromFunctionCallingConfig != null) {
6210
+ setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
6211
+ }
6212
+ if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
6213
+ undefined) {
6214
+ throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
6215
+ }
5964
6216
  return toObject;
5965
6217
  }
5966
6218
  function toolToMldev$3(fromObject) {
@@ -7177,7 +7429,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7177
7429
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7178
7430
  const USER_AGENT_HEADER = 'User-Agent';
7179
7431
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7180
- const SDK_VERSION = '1.45.0'; // x-release-please-version
7432
+ const SDK_VERSION = '1.47.0'; // x-release-please-version
7181
7433
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7182
7434
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7183
7435
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -7237,6 +7489,11 @@ class ApiClient {
7237
7489
  // Vertex Express or global endpoint case.
7238
7490
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
7239
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
+ }
7240
7497
  else if (this.clientOptions.project && this.clientOptions.location) {
7241
7498
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
7242
7499
  }
@@ -7875,20 +8132,20 @@ const INITIAL_RETRY_DELAY_MS = 1000;
7875
8132
  const DELAY_MULTIPLIER = 2;
7876
8133
  const X_GOOG_UPLOAD_STATUS_HEADER_FIELD = 'x-goog-upload-status';
7877
8134
  class CrossUploader {
7878
- async upload(file, uploadUrl, apiClient) {
8135
+ async upload(file, uploadUrl, apiClient, httpOptions) {
7879
8136
  if (typeof file === 'string') {
7880
8137
  throw crossError();
7881
8138
  }
7882
8139
  else {
7883
- return uploadBlob(file, uploadUrl, apiClient);
8140
+ return uploadBlob(file, uploadUrl, apiClient, httpOptions);
7884
8141
  }
7885
8142
  }
7886
- async uploadToFileSearchStore(file, uploadUrl, apiClient) {
8143
+ async uploadToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
7887
8144
  if (typeof file === 'string') {
7888
8145
  throw crossError();
7889
8146
  }
7890
8147
  else {
7891
- return uploadBlobToFileSearchStore(file, uploadUrl, apiClient);
8148
+ return uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions);
7892
8149
  }
7893
8150
  }
7894
8151
  async stat(file) {
@@ -7900,18 +8157,18 @@ class CrossUploader {
7900
8157
  }
7901
8158
  }
7902
8159
  }
7903
- async function uploadBlob(file, uploadUrl, apiClient) {
8160
+ async function uploadBlob(file, uploadUrl, apiClient, httpOptions) {
7904
8161
  var _a;
7905
- const response = await uploadBlobInternal(file, uploadUrl, apiClient);
8162
+ const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
7906
8163
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
7907
8164
  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') {
7908
8165
  throw new Error('Failed to upload file: Upload status is not finalized.');
7909
8166
  }
7910
8167
  return responseJson['file'];
7911
8168
  }
7912
- async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
8169
+ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient, httpOptions) {
7913
8170
  var _a;
7914
- const response = await uploadBlobInternal(file, uploadUrl, apiClient);
8171
+ const response = await uploadBlobInternal(file, uploadUrl, apiClient, httpOptions);
7915
8172
  const responseJson = (await (response === null || response === void 0 ? void 0 : response.json()));
7916
8173
  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') {
7917
8174
  throw new Error('Failed to upload file: Upload status is not finalized.');
@@ -7921,8 +8178,18 @@ async function uploadBlobToFileSearchStore(file, uploadUrl, apiClient) {
7921
8178
  Object.assign(typedResp, resp);
7922
8179
  return typedResp;
7923
8180
  }
7924
- async function uploadBlobInternal(file, uploadUrl, apiClient) {
7925
- var _a, _b;
8181
+ async function uploadBlobInternal(file, uploadUrl, apiClient, httpOptions) {
8182
+ var _a, _b, _c;
8183
+ let finalUrl = uploadUrl;
8184
+ const effectiveBaseUrl = (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.baseUrl) || ((_a = apiClient.clientOptions.httpOptions) === null || _a === void 0 ? void 0 : _a.baseUrl);
8185
+ if (effectiveBaseUrl) {
8186
+ const baseUri = new URL(effectiveBaseUrl);
8187
+ const uploadUri = new URL(uploadUrl);
8188
+ uploadUri.protocol = baseUri.protocol;
8189
+ uploadUri.host = baseUri.host;
8190
+ uploadUri.port = baseUri.port;
8191
+ finalUrl = uploadUri.toString();
8192
+ }
7926
8193
  let fileSize = 0;
7927
8194
  let offset = 0;
7928
8195
  let response = new HttpResponse(new Response());
@@ -7937,21 +8204,14 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
7937
8204
  let retryCount = 0;
7938
8205
  let currentDelayMs = INITIAL_RETRY_DELAY_MS;
7939
8206
  while (retryCount < MAX_RETRY_COUNT) {
8207
+ 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) });
7940
8208
  response = await apiClient.request({
7941
8209
  path: '',
7942
8210
  body: chunk,
7943
8211
  httpMethod: 'POST',
7944
- httpOptions: {
7945
- apiVersion: '',
7946
- baseUrl: uploadUrl,
7947
- headers: {
7948
- 'X-Goog-Upload-Command': uploadCommand,
7949
- 'X-Goog-Upload-Offset': String(offset),
7950
- 'Content-Length': String(chunkSize),
7951
- },
7952
- },
8212
+ httpOptions: Object.assign(Object.assign({}, httpOptions), { apiVersion: '', baseUrl: finalUrl, headers: mergedHeaders }),
7953
8213
  });
7954
- if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
8214
+ if ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b[X_GOOG_UPLOAD_STATUS_HEADER_FIELD]) {
7955
8215
  break;
7956
8216
  }
7957
8217
  retryCount++;
@@ -7961,7 +8221,7 @@ async function uploadBlobInternal(file, uploadUrl, apiClient) {
7961
8221
  offset += chunkSize;
7962
8222
  // The `x-goog-upload-status` header field can be `active`, `final` and
7963
8223
  //`cancelled` in resposne.
7964
- 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') {
8224
+ 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') {
7965
8225
  break;
7966
8226
  }
7967
8227
  // TODO(b/401391430) Investigate why the upload status is not finalized
@@ -10856,6 +11116,24 @@ function contentToMldev$2(fromObject) {
10856
11116
  }
10857
11117
  return toObject;
10858
11118
  }
11119
+ function contentToVertex$1(fromObject) {
11120
+ const toObject = {};
11121
+ const fromParts = getValueByPath(fromObject, ['parts']);
11122
+ if (fromParts != null) {
11123
+ let transformedList = fromParts;
11124
+ if (Array.isArray(transformedList)) {
11125
+ transformedList = transformedList.map((item) => {
11126
+ return partToVertex$1(item);
11127
+ });
11128
+ }
11129
+ setValueByPath(toObject, ['parts'], transformedList);
11130
+ }
11131
+ const fromRole = getValueByPath(fromObject, ['role']);
11132
+ if (fromRole != null) {
11133
+ setValueByPath(toObject, ['role'], fromRole);
11134
+ }
11135
+ return toObject;
11136
+ }
10859
11137
  function fileDataToMldev$2(fromObject) {
10860
11138
  const toObject = {};
10861
11139
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -11024,7 +11302,7 @@ function generationConfigToVertex$1(fromObject) {
11024
11302
  }
11025
11303
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11026
11304
  if (fromSpeechConfig != null) {
11027
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11305
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
11028
11306
  }
11029
11307
  const fromStopSequences = getValueByPath(fromObject, [
11030
11308
  'stopSequences',
@@ -11245,7 +11523,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
11245
11523
  }
11246
11524
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11247
11525
  if (parentObject !== undefined && fromSpeechConfig != null) {
11248
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
11526
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
11249
11527
  }
11250
11528
  const fromThinkingConfig = getValueByPath(fromObject, [
11251
11529
  'thinkingConfig',
@@ -11263,7 +11541,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
11263
11541
  'systemInstruction',
11264
11542
  ]);
11265
11543
  if (parentObject !== undefined && fromSystemInstruction != null) {
11266
- setValueByPath(parentObject, ['setup', 'systemInstruction'], tContent(fromSystemInstruction));
11544
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
11267
11545
  }
11268
11546
  const fromTools = getValueByPath(fromObject, ['tools']);
11269
11547
  if (parentObject !== undefined && fromTools != null) {
@@ -11456,56 +11734,144 @@ function liveServerMessageFromVertex(fromObject) {
11456
11734
  const fromSetupComplete = getValueByPath(fromObject, [
11457
11735
  'setupComplete',
11458
11736
  ]);
11459
- if (fromSetupComplete != null) {
11460
- setValueByPath(toObject, ['setupComplete'], fromSetupComplete);
11737
+ if (fromSetupComplete != null) {
11738
+ setValueByPath(toObject, ['setupComplete'], fromSetupComplete);
11739
+ }
11740
+ const fromServerContent = getValueByPath(fromObject, [
11741
+ 'serverContent',
11742
+ ]);
11743
+ if (fromServerContent != null) {
11744
+ setValueByPath(toObject, ['serverContent'], fromServerContent);
11745
+ }
11746
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
11747
+ if (fromToolCall != null) {
11748
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
11749
+ }
11750
+ const fromToolCallCancellation = getValueByPath(fromObject, [
11751
+ 'toolCallCancellation',
11752
+ ]);
11753
+ if (fromToolCallCancellation != null) {
11754
+ setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
11755
+ }
11756
+ const fromUsageMetadata = getValueByPath(fromObject, [
11757
+ 'usageMetadata',
11758
+ ]);
11759
+ if (fromUsageMetadata != null) {
11760
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
11761
+ }
11762
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
11763
+ if (fromGoAway != null) {
11764
+ setValueByPath(toObject, ['goAway'], fromGoAway);
11765
+ }
11766
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
11767
+ 'sessionResumptionUpdate',
11768
+ ]);
11769
+ if (fromSessionResumptionUpdate != null) {
11770
+ setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
11771
+ }
11772
+ const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
11773
+ 'voiceActivityDetectionSignal',
11774
+ ]);
11775
+ if (fromVoiceActivityDetectionSignal != null) {
11776
+ setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
11777
+ }
11778
+ const fromVoiceActivity = getValueByPath(fromObject, [
11779
+ 'voiceActivity',
11780
+ ]);
11781
+ if (fromVoiceActivity != null) {
11782
+ setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
11783
+ }
11784
+ return toObject;
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
+ }
11802
+ function partToMldev$2(fromObject) {
11803
+ const toObject = {};
11804
+ const fromMediaResolution = getValueByPath(fromObject, [
11805
+ 'mediaResolution',
11806
+ ]);
11807
+ if (fromMediaResolution != null) {
11808
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
11809
+ }
11810
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
11811
+ 'codeExecutionResult',
11812
+ ]);
11813
+ if (fromCodeExecutionResult != null) {
11814
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
11815
+ }
11816
+ const fromExecutableCode = getValueByPath(fromObject, [
11817
+ 'executableCode',
11818
+ ]);
11819
+ if (fromExecutableCode != null) {
11820
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
11821
+ }
11822
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
11823
+ if (fromFileData != null) {
11824
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
11825
+ }
11826
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
11827
+ if (fromFunctionCall != null) {
11828
+ setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
11829
+ }
11830
+ const fromFunctionResponse = getValueByPath(fromObject, [
11831
+ 'functionResponse',
11832
+ ]);
11833
+ if (fromFunctionResponse != null) {
11834
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
11835
+ }
11836
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
11837
+ if (fromInlineData != null) {
11838
+ setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
11839
+ }
11840
+ const fromText = getValueByPath(fromObject, ['text']);
11841
+ if (fromText != null) {
11842
+ setValueByPath(toObject, ['text'], fromText);
11843
+ }
11844
+ const fromThought = getValueByPath(fromObject, ['thought']);
11845
+ if (fromThought != null) {
11846
+ setValueByPath(toObject, ['thought'], fromThought);
11847
+ }
11848
+ const fromThoughtSignature = getValueByPath(fromObject, [
11849
+ 'thoughtSignature',
11850
+ ]);
11851
+ if (fromThoughtSignature != null) {
11852
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
11461
11853
  }
11462
- const fromServerContent = getValueByPath(fromObject, [
11463
- 'serverContent',
11854
+ const fromVideoMetadata = getValueByPath(fromObject, [
11855
+ 'videoMetadata',
11464
11856
  ]);
11465
- if (fromServerContent != null) {
11466
- setValueByPath(toObject, ['serverContent'], fromServerContent);
11857
+ if (fromVideoMetadata != null) {
11858
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11467
11859
  }
11468
11860
  const fromToolCall = getValueByPath(fromObject, ['toolCall']);
11469
11861
  if (fromToolCall != null) {
11470
11862
  setValueByPath(toObject, ['toolCall'], fromToolCall);
11471
11863
  }
11472
- const fromToolCallCancellation = getValueByPath(fromObject, [
11473
- 'toolCallCancellation',
11474
- ]);
11475
- if (fromToolCallCancellation != null) {
11476
- setValueByPath(toObject, ['toolCallCancellation'], fromToolCallCancellation);
11477
- }
11478
- const fromUsageMetadata = getValueByPath(fromObject, [
11479
- 'usageMetadata',
11480
- ]);
11481
- if (fromUsageMetadata != null) {
11482
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromVertex(fromUsageMetadata));
11483
- }
11484
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
11485
- if (fromGoAway != null) {
11486
- setValueByPath(toObject, ['goAway'], fromGoAway);
11487
- }
11488
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
11489
- 'sessionResumptionUpdate',
11490
- ]);
11491
- if (fromSessionResumptionUpdate != null) {
11492
- setValueByPath(toObject, ['sessionResumptionUpdate'], fromSessionResumptionUpdate);
11493
- }
11494
- const fromVoiceActivityDetectionSignal = getValueByPath(fromObject, [
11495
- 'voiceActivityDetectionSignal',
11496
- ]);
11497
- if (fromVoiceActivityDetectionSignal != null) {
11498
- setValueByPath(toObject, ['voiceActivityDetectionSignal'], fromVoiceActivityDetectionSignal);
11864
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
11865
+ if (fromToolResponse != null) {
11866
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
11499
11867
  }
11500
- const fromVoiceActivity = getValueByPath(fromObject, [
11501
- 'voiceActivity',
11502
- ]);
11503
- if (fromVoiceActivity != null) {
11504
- setValueByPath(toObject, ['voiceActivity'], voiceActivityFromVertex(fromVoiceActivity));
11868
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
11869
+ if (fromPartMetadata != null) {
11870
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
11505
11871
  }
11506
11872
  return toObject;
11507
11873
  }
11508
- function partToMldev$2(fromObject) {
11874
+ function partToVertex$1(fromObject) {
11509
11875
  const toObject = {};
11510
11876
  const fromMediaResolution = getValueByPath(fromObject, [
11511
11877
  'mediaResolution',
@@ -11527,11 +11893,11 @@ function partToMldev$2(fromObject) {
11527
11893
  }
11528
11894
  const fromFileData = getValueByPath(fromObject, ['fileData']);
11529
11895
  if (fromFileData != null) {
11530
- setValueByPath(toObject, ['fileData'], fileDataToMldev$2(fromFileData));
11896
+ setValueByPath(toObject, ['fileData'], fromFileData);
11531
11897
  }
11532
11898
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
11533
11899
  if (fromFunctionCall != null) {
11534
- setValueByPath(toObject, ['functionCall'], functionCallToMldev$2(fromFunctionCall));
11900
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
11535
11901
  }
11536
11902
  const fromFunctionResponse = getValueByPath(fromObject, [
11537
11903
  'functionResponse',
@@ -11541,7 +11907,7 @@ function partToMldev$2(fromObject) {
11541
11907
  }
11542
11908
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
11543
11909
  if (fromInlineData != null) {
11544
- setValueByPath(toObject, ['inlineData'], blobToMldev$2(fromInlineData));
11910
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
11545
11911
  }
11546
11912
  const fromText = getValueByPath(fromObject, ['text']);
11547
11913
  if (fromText != null) {
@@ -11563,6 +11929,29 @@ function partToMldev$2(fromObject) {
11563
11929
  if (fromVideoMetadata != null) {
11564
11930
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
11565
11931
  }
11932
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
11933
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
11934
+ }
11935
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
11936
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
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
+ }
11566
11955
  return toObject;
11567
11956
  }
11568
11957
  function sessionResumptionConfigToMldev$1(fromObject) {
@@ -11576,6 +11965,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
11576
11965
  }
11577
11966
  return toObject;
11578
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
+ }
11579
11998
  function toolToMldev$2(fromObject) {
11580
11999
  const toObject = {};
11581
12000
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -11809,6 +12228,22 @@ function voiceActivityFromVertex(fromObject) {
11809
12228
  }
11810
12229
  return toObject;
11811
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
+ }
11812
12247
 
11813
12248
  /**
11814
12249
  * @license
@@ -11931,7 +12366,7 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
11931
12366
  }
11932
12367
  return toObject;
11933
12368
  }
11934
- function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
12369
+ function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
11935
12370
  const toObject = {};
11936
12371
  const fromModel = getValueByPath(fromObject, ['model']);
11937
12372
  if (fromModel != null) {
@@ -11942,7 +12377,7 @@ function computeTokensParametersToVertex(apiClient, fromObject, _rootObject) {
11942
12377
  let transformedList = tContents(fromContents);
11943
12378
  if (Array.isArray(transformedList)) {
11944
12379
  transformedList = transformedList.map((item) => {
11945
- return item;
12380
+ return contentToVertex(item);
11946
12381
  });
11947
12382
  }
11948
12383
  setValueByPath(toObject, ['contents'], transformedList);
@@ -12011,6 +12446,24 @@ function contentToMldev$1(fromObject, rootObject) {
12011
12446
  }
12012
12447
  return toObject;
12013
12448
  }
12449
+ function contentToVertex(fromObject, rootObject) {
12450
+ const toObject = {};
12451
+ const fromParts = getValueByPath(fromObject, ['parts']);
12452
+ if (fromParts != null) {
12453
+ let transformedList = fromParts;
12454
+ if (Array.isArray(transformedList)) {
12455
+ transformedList = transformedList.map((item) => {
12456
+ return partToVertex(item);
12457
+ });
12458
+ }
12459
+ setValueByPath(toObject, ['parts'], transformedList);
12460
+ }
12461
+ const fromRole = getValueByPath(fromObject, ['role']);
12462
+ if (fromRole != null) {
12463
+ setValueByPath(toObject, ['role'], fromRole);
12464
+ }
12465
+ return toObject;
12466
+ }
12014
12467
  function controlReferenceConfigToVertex(fromObject, _rootObject) {
12015
12468
  const toObject = {};
12016
12469
  const fromControlType = getValueByPath(fromObject, ['controlType']);
@@ -12044,7 +12497,7 @@ function countTokensConfigToVertex(fromObject, parentObject, rootObject) {
12044
12497
  'systemInstruction',
12045
12498
  ]);
12046
12499
  if (parentObject !== undefined && fromSystemInstruction != null) {
12047
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
12500
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
12048
12501
  }
12049
12502
  const fromTools = getValueByPath(fromObject, ['tools']);
12050
12503
  if (parentObject !== undefined && fromTools != null) {
@@ -12097,7 +12550,7 @@ function countTokensParametersToVertex(apiClient, fromObject, rootObject) {
12097
12550
  let transformedList = tContents(fromContents);
12098
12551
  if (Array.isArray(transformedList)) {
12099
12552
  transformedList = transformedList.map((item) => {
12100
- return item;
12553
+ return contentToVertex(item);
12101
12554
  });
12102
12555
  }
12103
12556
  setValueByPath(toObject, ['contents'], transformedList);
@@ -12501,7 +12954,7 @@ function embedContentParametersPrivateToVertex(apiClient, fromObject, rootObject
12501
12954
  if (discriminatorContent === 'EMBED_CONTENT') {
12502
12955
  const fromContent = getValueByPath(fromObject, ['content']);
12503
12956
  if (fromContent != null) {
12504
- setValueByPath(toObject, ['content'], tContent(fromContent));
12957
+ setValueByPath(toObject, ['content'], contentToVertex(tContent(fromContent)));
12505
12958
  }
12506
12959
  }
12507
12960
  const fromConfig = getValueByPath(fromObject, ['config']);
@@ -12844,6 +13297,10 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject, rootO
12844
13297
  if (getValueByPath(fromObject, ['modelArmorConfig']) !== undefined) {
12845
13298
  throw new Error('modelArmorConfig parameter is not supported in Gemini API.');
12846
13299
  }
13300
+ const fromServiceTier = getValueByPath(fromObject, ['serviceTier']);
13301
+ if (parentObject !== undefined && fromServiceTier != null) {
13302
+ setValueByPath(parentObject, ['serviceTier'], fromServiceTier);
13303
+ }
12847
13304
  return toObject;
12848
13305
  }
12849
13306
  function generateContentConfigToVertex(apiClient, fromObject, parentObject, rootObject) {
@@ -12852,7 +13309,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
12852
13309
  'systemInstruction',
12853
13310
  ]);
12854
13311
  if (parentObject !== undefined && fromSystemInstruction != null) {
12855
- setValueByPath(parentObject, ['systemInstruction'], tContent(fromSystemInstruction));
13312
+ setValueByPath(parentObject, ['systemInstruction'], contentToVertex(tContent(fromSystemInstruction)));
12856
13313
  }
12857
13314
  const fromTemperature = getValueByPath(fromObject, ['temperature']);
12858
13315
  if (fromTemperature != null) {
@@ -12964,7 +13421,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
12964
13421
  }
12965
13422
  const fromToolConfig = getValueByPath(fromObject, ['toolConfig']);
12966
13423
  if (parentObject !== undefined && fromToolConfig != null) {
12967
- setValueByPath(parentObject, ['toolConfig'], fromToolConfig);
13424
+ setValueByPath(parentObject, ['toolConfig'], toolConfigToVertex(fromToolConfig));
12968
13425
  }
12969
13426
  const fromLabels = getValueByPath(fromObject, ['labels']);
12970
13427
  if (parentObject !== undefined && fromLabels != null) {
@@ -12990,7 +13447,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
12990
13447
  }
12991
13448
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
12992
13449
  if (fromSpeechConfig != null) {
12993
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
13450
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
12994
13451
  }
12995
13452
  const fromAudioTimestamp = getValueByPath(fromObject, [
12996
13453
  'audioTimestamp',
@@ -13018,6 +13475,9 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
13018
13475
  if (parentObject !== undefined && fromModelArmorConfig != null) {
13019
13476
  setValueByPath(parentObject, ['modelArmorConfig'], fromModelArmorConfig);
13020
13477
  }
13478
+ if (getValueByPath(fromObject, ['serviceTier']) !== undefined) {
13479
+ throw new Error('serviceTier parameter is not supported in Vertex AI.');
13480
+ }
13021
13481
  return toObject;
13022
13482
  }
13023
13483
  function generateContentParametersToMldev(apiClient, fromObject, rootObject) {
@@ -13053,7 +13513,7 @@ function generateContentParametersToVertex(apiClient, fromObject, rootObject) {
13053
13513
  let transformedList = tContents(fromContents);
13054
13514
  if (Array.isArray(transformedList)) {
13055
13515
  transformedList = transformedList.map((item) => {
13056
- return item;
13516
+ return contentToVertex(item);
13057
13517
  });
13058
13518
  }
13059
13519
  setValueByPath(toObject, ['contents'], transformedList);
@@ -13102,6 +13562,10 @@ function generateContentResponseFromMldev(fromObject, rootObject) {
13102
13562
  if (fromUsageMetadata != null) {
13103
13563
  setValueByPath(toObject, ['usageMetadata'], fromUsageMetadata);
13104
13564
  }
13565
+ const fromModelStatus = getValueByPath(fromObject, ['modelStatus']);
13566
+ if (fromModelStatus != null) {
13567
+ setValueByPath(toObject, ['modelStatus'], fromModelStatus);
13568
+ }
13105
13569
  return toObject;
13106
13570
  }
13107
13571
  function generateContentResponseFromVertex(fromObject, _rootObject) {
@@ -13487,6 +13951,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
13487
13951
  if (getValueByPath(fromObject, ['compressionQuality']) !== undefined) {
13488
13952
  throw new Error('compressionQuality parameter is not supported in Gemini API.');
13489
13953
  }
13954
+ if (getValueByPath(fromObject, ['labels']) !== undefined) {
13955
+ throw new Error('labels parameter is not supported in Gemini API.');
13956
+ }
13490
13957
  return toObject;
13491
13958
  }
13492
13959
  function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
@@ -13577,6 +14044,10 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
13577
14044
  if (parentObject !== undefined && fromCompressionQuality != null) {
13578
14045
  setValueByPath(parentObject, ['parameters', 'compressionQuality'], fromCompressionQuality);
13579
14046
  }
14047
+ const fromLabels = getValueByPath(fromObject, ['labels']);
14048
+ if (parentObject !== undefined && fromLabels != null) {
14049
+ setValueByPath(parentObject, ['labels'], fromLabels);
14050
+ }
13580
14051
  return toObject;
13581
14052
  }
13582
14053
  function generateVideosOperationFromMldev(fromObject, rootObject) {
@@ -13846,7 +14317,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
13846
14317
  }
13847
14318
  return toObject;
13848
14319
  }
13849
- function generationConfigToVertex(fromObject, _rootObject) {
14320
+ function generationConfigToVertex(fromObject, rootObject) {
13850
14321
  const toObject = {};
13851
14322
  const fromModelSelectionConfig = getValueByPath(fromObject, [
13852
14323
  'modelSelectionConfig',
@@ -13942,7 +14413,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
13942
14413
  }
13943
14414
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
13944
14415
  if (fromSpeechConfig != null) {
13945
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
14416
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
13946
14417
  }
13947
14418
  const fromStopSequences = getValueByPath(fromObject, [
13948
14419
  'stopSequences',
@@ -14399,6 +14870,22 @@ function modelFromVertex(fromObject, rootObject) {
14399
14870
  }
14400
14871
  return toObject;
14401
14872
  }
14873
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
14874
+ const toObject = {};
14875
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
14876
+ 'speakerVoiceConfigs',
14877
+ ]);
14878
+ if (fromSpeakerVoiceConfigs != null) {
14879
+ let transformedList = fromSpeakerVoiceConfigs;
14880
+ if (Array.isArray(transformedList)) {
14881
+ transformedList = transformedList.map((item) => {
14882
+ return speakerVoiceConfigToVertex(item);
14883
+ });
14884
+ }
14885
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
14886
+ }
14887
+ return toObject;
14888
+ }
14402
14889
  function partToMldev$1(fromObject, rootObject) {
14403
14890
  const toObject = {};
14404
14891
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -14457,6 +14944,87 @@ function partToMldev$1(fromObject, rootObject) {
14457
14944
  if (fromVideoMetadata != null) {
14458
14945
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
14459
14946
  }
14947
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
14948
+ if (fromToolCall != null) {
14949
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
14950
+ }
14951
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
14952
+ if (fromToolResponse != null) {
14953
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
14954
+ }
14955
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
14956
+ if (fromPartMetadata != null) {
14957
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
14958
+ }
14959
+ return toObject;
14960
+ }
14961
+ function partToVertex(fromObject, _rootObject) {
14962
+ const toObject = {};
14963
+ const fromMediaResolution = getValueByPath(fromObject, [
14964
+ 'mediaResolution',
14965
+ ]);
14966
+ if (fromMediaResolution != null) {
14967
+ setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
14968
+ }
14969
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
14970
+ 'codeExecutionResult',
14971
+ ]);
14972
+ if (fromCodeExecutionResult != null) {
14973
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
14974
+ }
14975
+ const fromExecutableCode = getValueByPath(fromObject, [
14976
+ 'executableCode',
14977
+ ]);
14978
+ if (fromExecutableCode != null) {
14979
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
14980
+ }
14981
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
14982
+ if (fromFileData != null) {
14983
+ setValueByPath(toObject, ['fileData'], fromFileData);
14984
+ }
14985
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
14986
+ if (fromFunctionCall != null) {
14987
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
14988
+ }
14989
+ const fromFunctionResponse = getValueByPath(fromObject, [
14990
+ 'functionResponse',
14991
+ ]);
14992
+ if (fromFunctionResponse != null) {
14993
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
14994
+ }
14995
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
14996
+ if (fromInlineData != null) {
14997
+ setValueByPath(toObject, ['inlineData'], fromInlineData);
14998
+ }
14999
+ const fromText = getValueByPath(fromObject, ['text']);
15000
+ if (fromText != null) {
15001
+ setValueByPath(toObject, ['text'], fromText);
15002
+ }
15003
+ const fromThought = getValueByPath(fromObject, ['thought']);
15004
+ if (fromThought != null) {
15005
+ setValueByPath(toObject, ['thought'], fromThought);
15006
+ }
15007
+ const fromThoughtSignature = getValueByPath(fromObject, [
15008
+ 'thoughtSignature',
15009
+ ]);
15010
+ if (fromThoughtSignature != null) {
15011
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
15012
+ }
15013
+ const fromVideoMetadata = getValueByPath(fromObject, [
15014
+ 'videoMetadata',
15015
+ ]);
15016
+ if (fromVideoMetadata != null) {
15017
+ setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
15018
+ }
15019
+ if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
15020
+ throw new Error('toolCall parameter is not supported in Vertex AI.');
15021
+ }
15022
+ if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
15023
+ throw new Error('toolResponse parameter is not supported in Vertex AI.');
15024
+ }
15025
+ if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
15026
+ throw new Error('partMetadata parameter is not supported in Vertex AI.');
15027
+ }
14460
15028
  return toObject;
14461
15029
  }
14462
15030
  function productImageToVertex(fromObject, rootObject) {
@@ -14627,6 +15195,20 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
14627
15195
  }
14628
15196
  return toObject;
14629
15197
  }
15198
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
15199
+ const toObject = {};
15200
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15201
+ if (fromMimeType != null) {
15202
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
15203
+ }
15204
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
15205
+ 'voiceSampleAudio',
15206
+ ]);
15207
+ if (fromVoiceSampleAudio != null) {
15208
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
15209
+ }
15210
+ return toObject;
15211
+ }
14630
15212
  function safetyAttributesFromMldev(fromObject, _rootObject) {
14631
15213
  const toObject = {};
14632
15214
  const fromCategories = getValueByPath(fromObject, [
@@ -14776,6 +15358,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
14776
15358
  }
14777
15359
  return toObject;
14778
15360
  }
15361
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
15362
+ const toObject = {};
15363
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
15364
+ if (fromSpeaker != null) {
15365
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
15366
+ }
15367
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15368
+ if (fromVoiceConfig != null) {
15369
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
15370
+ }
15371
+ return toObject;
15372
+ }
15373
+ function speechConfigToVertex(fromObject, rootObject) {
15374
+ const toObject = {};
15375
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15376
+ if (fromVoiceConfig != null) {
15377
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
15378
+ }
15379
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
15380
+ if (fromLanguageCode != null) {
15381
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
15382
+ }
15383
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
15384
+ 'multiSpeakerVoiceConfig',
15385
+ ]);
15386
+ if (fromMultiSpeakerVoiceConfig != null) {
15387
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
15388
+ }
15389
+ return toObject;
15390
+ }
14779
15391
  function toolConfigToMldev(fromObject, rootObject) {
14780
15392
  const toObject = {};
14781
15393
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -14790,6 +15402,30 @@ function toolConfigToMldev(fromObject, rootObject) {
14790
15402
  if (fromFunctionCallingConfig != null) {
14791
15403
  setValueByPath(toObject, ['functionCallingConfig'], functionCallingConfigToMldev(fromFunctionCallingConfig));
14792
15404
  }
15405
+ const fromIncludeServerSideToolInvocations = getValueByPath(fromObject, ['includeServerSideToolInvocations']);
15406
+ if (fromIncludeServerSideToolInvocations != null) {
15407
+ setValueByPath(toObject, ['includeServerSideToolInvocations'], fromIncludeServerSideToolInvocations);
15408
+ }
15409
+ return toObject;
15410
+ }
15411
+ function toolConfigToVertex(fromObject, _rootObject) {
15412
+ const toObject = {};
15413
+ const fromRetrievalConfig = getValueByPath(fromObject, [
15414
+ 'retrievalConfig',
15415
+ ]);
15416
+ if (fromRetrievalConfig != null) {
15417
+ setValueByPath(toObject, ['retrievalConfig'], fromRetrievalConfig);
15418
+ }
15419
+ const fromFunctionCallingConfig = getValueByPath(fromObject, [
15420
+ 'functionCallingConfig',
15421
+ ]);
15422
+ if (fromFunctionCallingConfig != null) {
15423
+ setValueByPath(toObject, ['functionCallingConfig'], fromFunctionCallingConfig);
15424
+ }
15425
+ if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
15426
+ undefined) {
15427
+ throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
15428
+ }
14793
15429
  return toObject;
14794
15430
  }
14795
15431
  function toolToMldev$1(fromObject, rootObject) {
@@ -15234,6 +15870,22 @@ function videoToVertex(fromObject, _rootObject) {
15234
15870
  }
15235
15871
  return toObject;
15236
15872
  }
15873
+ function voiceConfigToVertex(fromObject, rootObject) {
15874
+ const toObject = {};
15875
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
15876
+ 'replicatedVoiceConfig',
15877
+ ]);
15878
+ if (fromReplicatedVoiceConfig != null) {
15879
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
15880
+ }
15881
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
15882
+ 'prebuiltVoiceConfig',
15883
+ ]);
15884
+ if (fromPrebuiltVoiceConfig != null) {
15885
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
15886
+ }
15887
+ return toObject;
15888
+ }
15237
15889
 
15238
15890
  /**
15239
15891
  * @license
@@ -15928,7 +16580,7 @@ class Session {
15928
16580
  }
15929
16581
  }
15930
16582
  const clientMessage = {
15931
- toolResponse: { functionResponses: functionResponses },
16583
+ toolResponse: { 'functionResponses': functionResponses },
15932
16584
  };
15933
16585
  return clientMessage;
15934
16586
  }
@@ -18258,6 +18910,18 @@ function partToMldev(fromObject) {
18258
18910
  if (fromVideoMetadata != null) {
18259
18911
  setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
18260
18912
  }
18913
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
18914
+ if (fromToolCall != null) {
18915
+ setValueByPath(toObject, ['toolCall'], fromToolCall);
18916
+ }
18917
+ const fromToolResponse = getValueByPath(fromObject, ['toolResponse']);
18918
+ if (fromToolResponse != null) {
18919
+ setValueByPath(toObject, ['toolResponse'], fromToolResponse);
18920
+ }
18921
+ const fromPartMetadata = getValueByPath(fromObject, ['partMetadata']);
18922
+ if (fromPartMetadata != null) {
18923
+ setValueByPath(toObject, ['partMetadata'], fromPartMetadata);
18924
+ }
18261
18925
  return toObject;
18262
18926
  }
18263
18927
  function sessionResumptionConfigToMldev(fromObject) {
@@ -18892,6 +19556,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18892
19556
  setValueByPath(parentObject, ['supervisedTuningSpec', 'tuningMode'], fromTuningMode);
18893
19557
  }
18894
19558
  }
19559
+ else if (discriminatorTuningMode === 'DISTILLATION') {
19560
+ const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
19561
+ if (parentObject !== undefined && fromTuningMode != null) {
19562
+ setValueByPath(parentObject, ['distillationSpec', 'tuningMode'], fromTuningMode);
19563
+ }
19564
+ }
18895
19565
  const fromCustomBaseModel = getValueByPath(fromObject, [
18896
19566
  'customBaseModel',
18897
19567
  ]);
@@ -18911,6 +19581,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18911
19581
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
18912
19582
  }
18913
19583
  }
19584
+ else if (discriminatorBatchSize === 'DISTILLATION') {
19585
+ const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
19586
+ if (parentObject !== undefined && fromBatchSize != null) {
19587
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
19588
+ }
19589
+ }
18914
19590
  let discriminatorLearningRate = getValueByPath(rootObject, [
18915
19591
  'config',
18916
19592
  'method',
@@ -18926,6 +19602,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
18926
19602
  setValueByPath(parentObject, ['supervisedTuningSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
18927
19603
  }
18928
19604
  }
19605
+ else if (discriminatorLearningRate === 'DISTILLATION') {
19606
+ const fromLearningRate = getValueByPath(fromObject, [
19607
+ 'learningRate',
19608
+ ]);
19609
+ if (parentObject !== undefined && fromLearningRate != null) {
19610
+ setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRate'], fromLearningRate);
19611
+ }
19612
+ }
18929
19613
  const fromLabels = getValueByPath(fromObject, ['labels']);
18930
19614
  if (parentObject !== undefined && fromLabels != null) {
18931
19615
  setValueByPath(parentObject, ['labels'], fromLabels);
@@ -19429,6 +20113,18 @@ function tuningJobFromVertex(fromObject, _rootObject) {
19429
20113
  if (fromVeoTuningSpec != null) {
19430
20114
  setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
19431
20115
  }
20116
+ const fromDistillationSamplingSpec = getValueByPath(fromObject, [
20117
+ 'distillationSamplingSpec',
20118
+ ]);
20119
+ if (fromDistillationSamplingSpec != null) {
20120
+ setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
20121
+ }
20122
+ const fromTuningJobMetadata = getValueByPath(fromObject, [
20123
+ 'tuningJobMetadata',
20124
+ ]);
20125
+ if (fromTuningJobMetadata != null) {
20126
+ setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
20127
+ }
19432
20128
  return toObject;
19433
20129
  }
19434
20130
  function tuningOperationFromMldev(fromObject, _rootObject) {
@@ -20031,6 +20727,7 @@ exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
20031
20727
  exports.StyleReferenceImage = StyleReferenceImage;
20032
20728
  exports.SubjectReferenceImage = SubjectReferenceImage;
20033
20729
  exports.Tokens = Tokens;
20730
+ exports.ToolResponse = ToolResponse;
20034
20731
  exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
20035
20732
  exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
20036
20733
  exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;