@google/genai 2.9.0 → 2.11.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.
@@ -682,26 +682,6 @@ var Type;
682
682
  */
683
683
  Type["NULL"] = "NULL";
684
684
  })(Type || (Type = {}));
685
- /** The environment being operated. */
686
- var Environment;
687
- (function (Environment) {
688
- /**
689
- * Defaults to browser.
690
- */
691
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
692
- /**
693
- * Operates in a web browser.
694
- */
695
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
696
- /**
697
- * Operates in a mobile environment.
698
- */
699
- Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
700
- /**
701
- * Operates in a desktop environment.
702
- */
703
- Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
704
- })(Environment || (Environment = {}));
705
685
  /** Type of auth scheme. This enum is not supported in Gemini API. */
706
686
  var AuthType;
707
687
  (function (AuthType) {
@@ -772,6 +752,62 @@ var ApiSpec;
772
752
  */
773
753
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
774
754
  })(ApiSpec || (ApiSpec = {}));
755
+ /** The environment being operated. */
756
+ var Environment;
757
+ (function (Environment) {
758
+ /**
759
+ * Defaults to browser.
760
+ */
761
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
762
+ /**
763
+ * Operates in a web browser.
764
+ */
765
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
766
+ /**
767
+ * Operates in a mobile environment.
768
+ */
769
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
770
+ /**
771
+ * Operates in a desktop environment.
772
+ */
773
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
774
+ })(Environment || (Environment = {}));
775
+ /** SafetyPolicy */
776
+ var SafetyPolicy;
777
+ (function (SafetyPolicy) {
778
+ /**
779
+ * Unspecified safety policy.
780
+ */
781
+ SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
782
+ /**
783
+ * Safety policy for financial transactions.
784
+ */
785
+ SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
786
+ /**
787
+ * Safety policy for sensitive data modification.
788
+ */
789
+ SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
790
+ /**
791
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
792
+ */
793
+ SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
794
+ /**
795
+ * Safety policy for account creation.
796
+ */
797
+ SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
798
+ /**
799
+ * Safety policy for data modification.
800
+ */
801
+ SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
802
+ /**
803
+ * Safety policy for user consent management.
804
+ */
805
+ SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
806
+ /**
807
+ * Safety policy for legal terms and agreements.
808
+ */
809
+ SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
810
+ })(SafetyPolicy || (SafetyPolicy = {}));
775
811
  /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
776
812
  var PhishBlockThreshold;
777
813
  (function (PhishBlockThreshold) {
@@ -804,7 +840,7 @@ var PhishBlockThreshold;
804
840
  */
805
841
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
806
842
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
807
- /** Specifies the function Behavior. Currently only non-blocking functions are supported. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
843
+ /** Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
808
844
  var Behavior;
809
845
  (function (Behavior) {
810
846
  /**
@@ -1318,6 +1354,110 @@ var Modality;
1318
1354
  */
1319
1355
  Modality["VIDEO"] = "VIDEO";
1320
1356
  })(Modality || (Modality = {}));
1357
+ /** Delivery mode for the generated content. */
1358
+ var Delivery;
1359
+ (function (Delivery) {
1360
+ /**
1361
+ * Default value. This value is unused.
1362
+ */
1363
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1364
+ /**
1365
+ * Generated bytes are returned inline in the response.
1366
+ */
1367
+ Delivery["INLINE"] = "INLINE";
1368
+ /**
1369
+ * Generated content is stored and a URI is returned.
1370
+ */
1371
+ Delivery["URI"] = "URI";
1372
+ })(Delivery || (Delivery = {}));
1373
+ /** The aspect ratio for the image output. */
1374
+ var AspectRatio;
1375
+ (function (AspectRatio) {
1376
+ /**
1377
+ * Default value. This value is unused.
1378
+ */
1379
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1380
+ /**
1381
+ * 1:1 aspect ratio.
1382
+ */
1383
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1384
+ /**
1385
+ * 2:3 aspect ratio.
1386
+ */
1387
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1388
+ /**
1389
+ * 3:2 aspect ratio.
1390
+ */
1391
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1392
+ /**
1393
+ * 3:4 aspect ratio.
1394
+ */
1395
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1396
+ /**
1397
+ * 4:3 aspect ratio.
1398
+ */
1399
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1400
+ /**
1401
+ * 4:5 aspect ratio.
1402
+ */
1403
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1404
+ /**
1405
+ * 5:4 aspect ratio.
1406
+ */
1407
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1408
+ /**
1409
+ * 9:16 aspect ratio.
1410
+ */
1411
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1412
+ /**
1413
+ * 16:9 aspect ratio.
1414
+ */
1415
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1416
+ /**
1417
+ * 21:9 aspect ratio.
1418
+ */
1419
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1420
+ /**
1421
+ * 1:8 aspect ratio.
1422
+ */
1423
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1424
+ /**
1425
+ * 8:1 aspect ratio.
1426
+ */
1427
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1428
+ /**
1429
+ * 1:4 aspect ratio.
1430
+ */
1431
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1432
+ /**
1433
+ * 4:1 aspect ratio.
1434
+ */
1435
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1436
+ })(AspectRatio || (AspectRatio = {}));
1437
+ /** The size of the image output. */
1438
+ var ImageSize;
1439
+ (function (ImageSize) {
1440
+ /**
1441
+ * Default value. This value is unused.
1442
+ */
1443
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1444
+ /**
1445
+ * 512px image size.
1446
+ */
1447
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1448
+ /**
1449
+ * 1K image size.
1450
+ */
1451
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1452
+ /**
1453
+ * 2K image size.
1454
+ */
1455
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1456
+ /**
1457
+ * 4K image size.
1458
+ */
1459
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1460
+ })(ImageSize || (ImageSize = {}));
1321
1461
  /** Tuning mode. This enum is not supported in Gemini API. */
1322
1462
  var TuningMode;
1323
1463
  (function (TuningMode) {
@@ -1366,6 +1506,58 @@ var AdapterSize;
1366
1506
  */
1367
1507
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1368
1508
  })(AdapterSize || (AdapterSize = {}));
1509
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1510
+ var ResponseParseType;
1511
+ (function (ResponseParseType) {
1512
+ /**
1513
+ * Default value. Fallback to IDENTITY
1514
+ */
1515
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1516
+ /**
1517
+ * Returns the sample response as is.
1518
+ */
1519
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1520
+ /**
1521
+ * Uses regex to extract the important part of sample response. Similar to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract) `REGEX_EXTRACT(response, regex_extract_expression)`, but different in that if there are multiple matches, the last match will be returned.
1522
+ */
1523
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1524
+ })(ResponseParseType || (ResponseParseType = {}));
1525
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1526
+ var MatchOperation;
1527
+ (function (MatchOperation) {
1528
+ /**
1529
+ * Default value. A user error will be returned if not set.
1530
+ */
1531
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1532
+ /**
1533
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1534
+ */
1535
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1536
+ /**
1537
+ * The match operation returns `true` if expression is a substring of the target.
1538
+ */
1539
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1540
+ /**
1541
+ * The match operation returns `true` expression is an exact match of the target.
1542
+ */
1543
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1544
+ })(MatchOperation || (MatchOperation = {}));
1545
+ /** Represents how much to think for the tuning job. */
1546
+ var ReinforcementTuningThinkingLevel;
1547
+ (function (ReinforcementTuningThinkingLevel) {
1548
+ /**
1549
+ * Unspecified thinking level.
1550
+ */
1551
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1552
+ /**
1553
+ * Little to no thinking.
1554
+ */
1555
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1556
+ /**
1557
+ * High thinking level.
1558
+ */
1559
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1560
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1369
1561
  /** Job state. */
1370
1562
  var JobState;
1371
1563
  (function (JobState) {
@@ -1850,58 +2042,6 @@ var ImageResizeMode;
1850
2042
  */
1851
2043
  ImageResizeMode["PAD"] = "PAD";
1852
2044
  })(ImageResizeMode || (ImageResizeMode = {}));
1853
- /** Defines how to parse sample response. */
1854
- var ResponseParseType;
1855
- (function (ResponseParseType) {
1856
- /**
1857
- * Default value. This value is unused.
1858
- */
1859
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1860
- /**
1861
- * Use the sample response as is.
1862
- */
1863
- ResponseParseType["IDENTITY"] = "IDENTITY";
1864
- /**
1865
- * Use regex to extract the important part of sample response.
1866
- */
1867
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1868
- })(ResponseParseType || (ResponseParseType = {}));
1869
- /** Match operation to use for evaluation. */
1870
- var MatchOperation;
1871
- (function (MatchOperation) {
1872
- /**
1873
- * Default value. This value is unused.
1874
- */
1875
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1876
- /**
1877
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1878
- */
1879
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1880
- /**
1881
- * `expression` is a substring of target.
1882
- */
1883
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1884
- /**
1885
- * `expression` is an exact match of target.
1886
- */
1887
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1888
- })(MatchOperation || (MatchOperation = {}));
1889
- /** Represents how much to think for the tuning job. */
1890
- var ReinforcementTuningThinkingLevel;
1891
- (function (ReinforcementTuningThinkingLevel) {
1892
- /**
1893
- * Unspecified thinking level.
1894
- */
1895
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1896
- /**
1897
- * Little to no thinking.
1898
- */
1899
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1900
- /**
1901
- * High thinking level.
1902
- */
1903
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1904
- })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1905
2045
  /** Enum representing the tuning method. */
1906
2046
  var TuningMethod;
1907
2047
  (function (TuningMethod) {
@@ -2698,6 +2838,21 @@ class ListModelsResponse {
2698
2838
  }
2699
2839
  class DeleteModelResponse {
2700
2840
  }
2841
+ /** Configuration for audio-specific output formatting. */
2842
+ class AudioResponseFormat {
2843
+ }
2844
+ /** Configuration for image-specific output formatting. */
2845
+ class ImageResponseFormat {
2846
+ }
2847
+ /** Configuration for text-specific output formatting. */
2848
+ class TextResponseFormat {
2849
+ }
2850
+ /** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
2851
+ class VideoResponseFormat {
2852
+ }
2853
+ /** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
2854
+ class ResponseFormat {
2855
+ }
2701
2856
  /** Response for counting tokens. */
2702
2857
  class CountTokensResponse {
2703
2858
  }
@@ -2726,10 +2881,10 @@ class GenerateVideosOperation {
2726
2881
  return operation;
2727
2882
  }
2728
2883
  }
2729
- /** Defines how to parse sample response for reinforcement tuning. */
2884
+ /** Defines how to parse sample response config for reinforcement tuning. The parsed response (i.e., substring) will be passed to the reward functions. For example, the input prompt might be: > "Perform step-by-step thoughts first to problem A, finally output answer in the <ans> </ans> block." The sample response from the model under tuning might look like: > "<ans>Yes</ans>" Here, users can define the following parse config: ``` { "parseType": "REGEX_EXTRACT", "regexExtractExpression": ".*(.*?)" } ``` The resulting parsed response would be `"Yes"` and will be passed to the reward functions for evaluating rewards. This data type is not supported in Gemini API. */
2730
2885
  class ReinforcementTuningParseResponseConfig {
2731
2886
  }
2732
- /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
2887
+ /** Scores responses by directly converting the parsed autorater response to a float reward. Note: Reward is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
2733
2888
  class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
2734
2889
  }
2735
2890
  /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
@@ -5169,6 +5324,9 @@ function toolToMldev$4(fromObject) {
5169
5324
  }
5170
5325
  setValueByPath(toObject, ['mcpServers'], transformedList);
5171
5326
  }
5327
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
5328
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5329
+ }
5172
5330
  return toObject;
5173
5331
  }
5174
5332
  function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
@@ -5951,6 +6109,29 @@ function codeExecutionResultToVertex$3(fromObject) {
5951
6109
  }
5952
6110
  return toObject;
5953
6111
  }
6112
+ function computerUseToVertex$2(fromObject) {
6113
+ const toObject = {};
6114
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
6115
+ if (fromEnvironment != null) {
6116
+ setValueByPath(toObject, ['environment'], fromEnvironment);
6117
+ }
6118
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
6119
+ 'excludedPredefinedFunctions',
6120
+ ]);
6121
+ if (fromExcludedPredefinedFunctions != null) {
6122
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
6123
+ }
6124
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
6125
+ 'enablePromptInjectionDetection',
6126
+ ]);
6127
+ if (fromEnablePromptInjectionDetection != null) {
6128
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
6129
+ }
6130
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
6131
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6132
+ }
6133
+ return toObject;
6134
+ }
5954
6135
  function contentToMldev$3(fromObject) {
5955
6136
  const toObject = {};
5956
6137
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -6616,6 +6797,9 @@ function toolToMldev$3(fromObject) {
6616
6797
  }
6617
6798
  setValueByPath(toObject, ['mcpServers'], transformedList);
6618
6799
  }
6800
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
6801
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6802
+ }
6619
6803
  return toObject;
6620
6804
  }
6621
6805
  function toolToVertex$2(fromObject) {
@@ -6626,7 +6810,7 @@ function toolToVertex$2(fromObject) {
6626
6810
  }
6627
6811
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
6628
6812
  if (fromComputerUse != null) {
6629
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
6813
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex$2(fromComputerUse));
6630
6814
  }
6631
6815
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
6632
6816
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -6689,6 +6873,10 @@ function toolToVertex$2(fromObject) {
6689
6873
  }
6690
6874
  setValueByPath(toObject, ['mcpServers'], transformedList);
6691
6875
  }
6876
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
6877
+ if (fromExaAiSearch != null) {
6878
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
6879
+ }
6692
6880
  return toObject;
6693
6881
  }
6694
6882
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -7693,7 +7881,7 @@ class Files extends BaseModule {
7693
7881
  * file extension.
7694
7882
  * - For Blob object inputs, the `mimeType` will be set to the Blob's `type`
7695
7883
  * property.
7696
- * Somex eamples for file extension to mimeType mapping:
7884
+ * Some examples for file extension to mimeType mapping:
7697
7885
  * .txt -> text/plain
7698
7886
  * .json -> application/json
7699
7887
  * .jpg -> image/jpeg
@@ -8056,6 +8244,29 @@ function codeExecutionResultToVertex$2(fromObject) {
8056
8244
  }
8057
8245
  return toObject;
8058
8246
  }
8247
+ function computerUseToVertex$1(fromObject) {
8248
+ const toObject = {};
8249
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
8250
+ if (fromEnvironment != null) {
8251
+ setValueByPath(toObject, ['environment'], fromEnvironment);
8252
+ }
8253
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
8254
+ 'excludedPredefinedFunctions',
8255
+ ]);
8256
+ if (fromExcludedPredefinedFunctions != null) {
8257
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
8258
+ }
8259
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
8260
+ 'enablePromptInjectionDetection',
8261
+ ]);
8262
+ if (fromEnablePromptInjectionDetection != null) {
8263
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
8264
+ }
8265
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
8266
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8267
+ }
8268
+ return toObject;
8269
+ }
8059
8270
  function contentToMldev$2(fromObject) {
8060
8271
  const toObject = {};
8061
8272
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -8240,7 +8451,7 @@ function generationConfigToVertex$1(fromObject) {
8240
8451
  }
8241
8452
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8242
8453
  if (fromSpeechConfig != null) {
8243
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
8454
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
8244
8455
  }
8245
8456
  const fromStopSequences = getValueByPath(fromObject, [
8246
8457
  'stopSequences',
@@ -8270,6 +8481,21 @@ function generationConfigToVertex$1(fromObject) {
8270
8481
  undefined) {
8271
8482
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8272
8483
  }
8484
+ const fromResponseFormat = getValueByPath(fromObject, [
8485
+ 'responseFormat',
8486
+ ]);
8487
+ if (fromResponseFormat != null) {
8488
+ let transformedList = fromResponseFormat;
8489
+ if (Array.isArray(transformedList)) {
8490
+ transformedList = transformedList.map((item) => {
8491
+ return item;
8492
+ });
8493
+ }
8494
+ setValueByPath(toObject, ['responseFormat'], transformedList);
8495
+ }
8496
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
8497
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8498
+ }
8273
8499
  return toObject;
8274
8500
  }
8275
8501
  function googleMapsToMldev$2(fromObject) {
@@ -8483,7 +8709,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
8483
8709
  }
8484
8710
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8485
8711
  if (parentObject !== undefined && fromSpeechConfig != null) {
8486
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
8712
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8487
8713
  }
8488
8714
  const fromThinkingConfig = getValueByPath(fromObject, [
8489
8715
  'thinkingConfig',
@@ -8772,6 +8998,22 @@ function mcpServerToVertex$1(fromObject) {
8772
8998
  }
8773
8999
  return toObject;
8774
9000
  }
9001
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
9002
+ const toObject = {};
9003
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
9004
+ 'speakerVoiceConfigs',
9005
+ ]);
9006
+ if (fromSpeakerVoiceConfigs != null) {
9007
+ let transformedList = fromSpeakerVoiceConfigs;
9008
+ if (Array.isArray(transformedList)) {
9009
+ transformedList = transformedList.map((item) => {
9010
+ return speakerVoiceConfigToVertex$1(item);
9011
+ });
9012
+ }
9013
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
9014
+ }
9015
+ return toObject;
9016
+ }
8775
9017
  function partToMldev$2(fromObject) {
8776
9018
  const toObject = {};
8777
9019
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -8913,6 +9155,26 @@ function partToVertex$2(fromObject) {
8913
9155
  }
8914
9156
  return toObject;
8915
9157
  }
9158
+ function replicatedVoiceConfigToVertex$1(fromObject) {
9159
+ const toObject = {};
9160
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9161
+ if (fromMimeType != null) {
9162
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9163
+ }
9164
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
9165
+ 'voiceSampleAudio',
9166
+ ]);
9167
+ if (fromVoiceSampleAudio != null) {
9168
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
9169
+ }
9170
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
9171
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9172
+ }
9173
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
9174
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9175
+ }
9176
+ return toObject;
9177
+ }
8916
9178
  function safetySettingToMldev$2(fromObject) {
8917
9179
  const toObject = {};
8918
9180
  const fromCategory = getValueByPath(fromObject, ['category']);
@@ -8939,6 +9201,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8939
9201
  }
8940
9202
  return toObject;
8941
9203
  }
9204
+ function speakerVoiceConfigToVertex$1(fromObject) {
9205
+ const toObject = {};
9206
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
9207
+ if (fromSpeaker != null) {
9208
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
9209
+ }
9210
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9211
+ if (fromVoiceConfig != null) {
9212
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9213
+ }
9214
+ return toObject;
9215
+ }
9216
+ function speechConfigToVertex$1(fromObject) {
9217
+ const toObject = {};
9218
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9219
+ if (fromVoiceConfig != null) {
9220
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9221
+ }
9222
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
9223
+ if (fromLanguageCode != null) {
9224
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
9225
+ }
9226
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
9227
+ 'multiSpeakerVoiceConfig',
9228
+ ]);
9229
+ if (fromMultiSpeakerVoiceConfig != null) {
9230
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
9231
+ }
9232
+ return toObject;
9233
+ }
8942
9234
  function toolToMldev$2(fromObject) {
8943
9235
  const toObject = {};
8944
9236
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -9004,6 +9296,9 @@ function toolToMldev$2(fromObject) {
9004
9296
  }
9005
9297
  setValueByPath(toObject, ['mcpServers'], transformedList);
9006
9298
  }
9299
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
9300
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9301
+ }
9007
9302
  return toObject;
9008
9303
  }
9009
9304
  function toolToVertex$1(fromObject) {
@@ -9014,7 +9309,7 @@ function toolToVertex$1(fromObject) {
9014
9309
  }
9015
9310
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
9016
9311
  if (fromComputerUse != null) {
9017
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
9312
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex$1(fromComputerUse));
9018
9313
  }
9019
9314
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
9020
9315
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -9077,6 +9372,10 @@ function toolToVertex$1(fromObject) {
9077
9372
  }
9078
9373
  setValueByPath(toObject, ['mcpServers'], transformedList);
9079
9374
  }
9375
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
9376
+ if (fromExaAiSearch != null) {
9377
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
9378
+ }
9080
9379
  return toObject;
9081
9380
  }
9082
9381
  function usageMetadataFromVertex(fromObject) {
@@ -9183,6 +9482,22 @@ function voiceActivityFromVertex(fromObject) {
9183
9482
  }
9184
9483
  return toObject;
9185
9484
  }
9485
+ function voiceConfigToVertex$1(fromObject) {
9486
+ const toObject = {};
9487
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
9488
+ 'replicatedVoiceConfig',
9489
+ ]);
9490
+ if (fromReplicatedVoiceConfig != null) {
9491
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
9492
+ }
9493
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
9494
+ 'prebuiltVoiceConfig',
9495
+ ]);
9496
+ if (fromPrebuiltVoiceConfig != null) {
9497
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
9498
+ }
9499
+ return toObject;
9500
+ }
9186
9501
 
9187
9502
  /**
9188
9503
  * @license
@@ -9358,6 +9673,29 @@ function computeTokensResponseFromVertex(fromObject, _rootObject) {
9358
9673
  }
9359
9674
  return toObject;
9360
9675
  }
9676
+ function computerUseToVertex(fromObject, _rootObject) {
9677
+ const toObject = {};
9678
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
9679
+ if (fromEnvironment != null) {
9680
+ setValueByPath(toObject, ['environment'], fromEnvironment);
9681
+ }
9682
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
9683
+ 'excludedPredefinedFunctions',
9684
+ ]);
9685
+ if (fromExcludedPredefinedFunctions != null) {
9686
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
9687
+ }
9688
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
9689
+ 'enablePromptInjectionDetection',
9690
+ ]);
9691
+ if (fromEnablePromptInjectionDetection != null) {
9692
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
9693
+ }
9694
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
9695
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9696
+ }
9697
+ return toObject;
9698
+ }
9361
9699
  function contentEmbeddingFromVertex(fromObject, rootObject) {
9362
9700
  const toObject = {};
9363
9701
  const fromValues = getValueByPath(fromObject, ['values']);
@@ -10413,7 +10751,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
10413
10751
  }
10414
10752
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
10415
10753
  if (fromSpeechConfig != null) {
10416
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10754
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
10417
10755
  }
10418
10756
  const fromAudioTimestamp = getValueByPath(fromObject, [
10419
10757
  'audioTimestamp',
@@ -11300,7 +11638,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
11300
11638
  }
11301
11639
  return toObject;
11302
11640
  }
11303
- function generationConfigToVertex(fromObject, _rootObject) {
11641
+ function generationConfigToVertex(fromObject, rootObject) {
11304
11642
  const toObject = {};
11305
11643
  const fromModelSelectionConfig = getValueByPath(fromObject, [
11306
11644
  'modelSelectionConfig',
@@ -11396,7 +11734,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
11396
11734
  }
11397
11735
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11398
11736
  if (fromSpeechConfig != null) {
11399
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11737
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
11400
11738
  }
11401
11739
  const fromStopSequences = getValueByPath(fromObject, [
11402
11740
  'stopSequences',
@@ -11426,6 +11764,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
11426
11764
  undefined) {
11427
11765
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11428
11766
  }
11767
+ const fromResponseFormat = getValueByPath(fromObject, [
11768
+ 'responseFormat',
11769
+ ]);
11770
+ if (fromResponseFormat != null) {
11771
+ let transformedList = fromResponseFormat;
11772
+ if (Array.isArray(transformedList)) {
11773
+ transformedList = transformedList.map((item) => {
11774
+ return item;
11775
+ });
11776
+ }
11777
+ setValueByPath(toObject, ['responseFormat'], transformedList);
11778
+ }
11779
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
11780
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11781
+ }
11429
11782
  return toObject;
11430
11783
  }
11431
11784
  function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
@@ -11863,6 +12216,22 @@ function modelFromVertex(fromObject, rootObject) {
11863
12216
  }
11864
12217
  return toObject;
11865
12218
  }
12219
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
12220
+ const toObject = {};
12221
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
12222
+ 'speakerVoiceConfigs',
12223
+ ]);
12224
+ if (fromSpeakerVoiceConfigs != null) {
12225
+ let transformedList = fromSpeakerVoiceConfigs;
12226
+ if (Array.isArray(transformedList)) {
12227
+ transformedList = transformedList.map((item) => {
12228
+ return speakerVoiceConfigToVertex(item);
12229
+ });
12230
+ }
12231
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
12232
+ }
12233
+ return toObject;
12234
+ }
11866
12235
  function partToMldev$1(fromObject, rootObject) {
11867
12236
  const toObject = {};
11868
12237
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -12172,6 +12541,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
12172
12541
  }
12173
12542
  return toObject;
12174
12543
  }
12544
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
12545
+ const toObject = {};
12546
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
12547
+ if (fromMimeType != null) {
12548
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
12549
+ }
12550
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
12551
+ 'voiceSampleAudio',
12552
+ ]);
12553
+ if (fromVoiceSampleAudio != null) {
12554
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
12555
+ }
12556
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
12557
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12558
+ }
12559
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
12560
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12561
+ }
12562
+ return toObject;
12563
+ }
12175
12564
  function safetyAttributesFromMldev(fromObject, _rootObject) {
12176
12565
  const toObject = {};
12177
12566
  const fromCategories = getValueByPath(fromObject, [
@@ -12321,6 +12710,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
12321
12710
  }
12322
12711
  return toObject;
12323
12712
  }
12713
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
12714
+ const toObject = {};
12715
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
12716
+ if (fromSpeaker != null) {
12717
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
12718
+ }
12719
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12720
+ if (fromVoiceConfig != null) {
12721
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12722
+ }
12723
+ return toObject;
12724
+ }
12725
+ function speechConfigToVertex(fromObject, rootObject) {
12726
+ const toObject = {};
12727
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12728
+ if (fromVoiceConfig != null) {
12729
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12730
+ }
12731
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
12732
+ if (fromLanguageCode != null) {
12733
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
12734
+ }
12735
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
12736
+ 'multiSpeakerVoiceConfig',
12737
+ ]);
12738
+ if (fromMultiSpeakerVoiceConfig != null) {
12739
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
12740
+ }
12741
+ return toObject;
12742
+ }
12324
12743
  function toolConfigToMldev(fromObject, rootObject) {
12325
12744
  const toObject = {};
12326
12745
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -12426,6 +12845,9 @@ function toolToMldev$1(fromObject, rootObject) {
12426
12845
  }
12427
12846
  setValueByPath(toObject, ['mcpServers'], transformedList);
12428
12847
  }
12848
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
12849
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12850
+ }
12429
12851
  return toObject;
12430
12852
  }
12431
12853
  function toolToVertex(fromObject, rootObject) {
@@ -12436,7 +12858,7 @@ function toolToVertex(fromObject, rootObject) {
12436
12858
  }
12437
12859
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
12438
12860
  if (fromComputerUse != null) {
12439
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
12861
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex(fromComputerUse));
12440
12862
  }
12441
12863
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
12442
12864
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -12499,6 +12921,10 @@ function toolToVertex(fromObject, rootObject) {
12499
12921
  }
12500
12922
  setValueByPath(toObject, ['mcpServers'], transformedList);
12501
12923
  }
12924
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
12925
+ if (fromExaAiSearch != null) {
12926
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
12927
+ }
12502
12928
  return toObject;
12503
12929
  }
12504
12930
  function tunedModelInfoFromMldev(fromObject, _rootObject) {
@@ -12810,6 +13236,22 @@ function videoToVertex(fromObject, _rootObject) {
12810
13236
  }
12811
13237
  return toObject;
12812
13238
  }
13239
+ function voiceConfigToVertex(fromObject, rootObject) {
13240
+ const toObject = {};
13241
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
13242
+ 'replicatedVoiceConfig',
13243
+ ]);
13244
+ if (fromReplicatedVoiceConfig != null) {
13245
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
13246
+ }
13247
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
13248
+ 'prebuiltVoiceConfig',
13249
+ ]);
13250
+ if (fromPrebuiltVoiceConfig != null) {
13251
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
13252
+ }
13253
+ return toObject;
13254
+ }
12813
13255
 
12814
13256
  /**
12815
13257
  * @license
@@ -13060,7 +13502,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
13060
13502
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
13061
13503
  const USER_AGENT_HEADER = 'User-Agent';
13062
13504
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
13063
- const SDK_VERSION = '2.9.0'; // x-release-please-version
13505
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
13064
13506
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
13065
13507
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
13066
13508
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14314,10 +14756,27 @@ class Live {
14314
14756
  onopenResolve({});
14315
14757
  };
14316
14758
  const apiClient = this.apiClient;
14759
+ let sessionResolved = false;
14760
+ const messageQueue = [];
14761
+ let setupCompleteResolve = () => { };
14762
+ const setupCompletePromise = new Promise((resolve) => {
14763
+ setupCompleteResolve = resolve;
14764
+ });
14317
14765
  const websocketCallbacks = {
14318
14766
  onopen: onopenAwaitedCallback,
14319
14767
  onmessage: (event) => {
14320
- void handleWebSocketMessage(apiClient, callbacks.onmessage, event);
14768
+ void handleWebSocketMessage(apiClient, (msg) => {
14769
+ if (msg.setupComplete && !session.setupComplete) {
14770
+ session.setupComplete = msg.setupComplete;
14771
+ setupCompleteResolve({});
14772
+ }
14773
+ if (sessionResolved) {
14774
+ callbacks.onmessage(msg);
14775
+ }
14776
+ else {
14777
+ messageQueue.push(msg);
14778
+ }
14779
+ }, event);
14321
14780
  },
14322
14781
  onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
14323
14782
  },
@@ -14379,8 +14838,14 @@ class Live {
14379
14838
  clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
14380
14839
  }
14381
14840
  delete clientMessage['config'];
14841
+ const session = new Session(conn, this.apiClient);
14382
14842
  conn.send(JSON.stringify(clientMessage));
14383
- return new Session(conn, this.apiClient);
14843
+ await setupCompletePromise;
14844
+ sessionResolved = true;
14845
+ for (const msg of messageQueue) {
14846
+ callbacks.onmessage(msg);
14847
+ }
14848
+ return session;
14384
14849
  }
14385
14850
  // TODO: b/416041229 - Abstract this method to a common place.
14386
14851
  isCallableTool(tool) {
@@ -14774,7 +15239,7 @@ class Models extends BaseModule {
14774
15239
  this.generateContent = async (params) => {
14775
15240
  var _a, _b, _c, _d, _e;
14776
15241
  const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14777
- this.maybeMoveToResponseJsonSchem(params);
15242
+ this.maybeMoveToResponseJsonSchema(params);
14778
15243
  if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
14779
15244
  return await this.generateContentInternal(transformedParams);
14780
15245
  }
@@ -14866,7 +15331,7 @@ class Models extends BaseModule {
14866
15331
  */
14867
15332
  this.generateContentStream = async (params) => {
14868
15333
  var _a, _b, _c, _d, _e;
14869
- this.maybeMoveToResponseJsonSchem(params);
15334
+ this.maybeMoveToResponseJsonSchema(params);
14870
15335
  if (shouldDisableAfc(params.config)) {
14871
15336
  const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
14872
15337
  return await this.generateContentStreamInternal(transformedParams);
@@ -15091,7 +15556,7 @@ class Models extends BaseModule {
15091
15556
  * To maintain backward compatibility, we move the data that was treated as
15092
15557
  * JSON schema from the responseSchema field to the responseJsonSchema field.
15093
15558
  */
15094
- maybeMoveToResponseJsonSchem(params) {
15559
+ maybeMoveToResponseJsonSchema(params) {
15095
15560
  if (params.config && params.config.responseSchema) {
15096
15561
  if (!params.config.responseJsonSchema) {
15097
15562
  if (Object.keys(params.config.responseSchema).includes('$schema')) {
@@ -15193,7 +15658,7 @@ class Models extends BaseModule {
15193
15658
  throw new Error('Function call name was not returned by the model.');
15194
15659
  }
15195
15660
  if (!afcTools.has(part.functionCall.name)) {
15196
- throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${afcTools.keys()}, mising tool: ${part.functionCall.name}`);
15661
+ throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${afcTools.keys()}, missing tool: ${part.functionCall.name}`);
15197
15662
  }
15198
15663
  else {
15199
15664
  const responseParts = yield __await(afcTools
@@ -16909,6 +17374,9 @@ function toolToMldev(fromObject) {
16909
17374
  }
16910
17375
  setValueByPath(toObject, ['mcpServers'], transformedList);
16911
17376
  }
17377
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
17378
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
17379
+ }
16912
17380
  return toObject;
16913
17381
  }
16914
17382
 
@@ -17760,17 +18228,14 @@ function env() {
17760
18228
  * Populates global parameters with environment variables.
17761
18229
  */
17762
18230
  function fillGlobals(options) {
17763
- var _a, _b, _c;
18231
+ var _a, _b;
17764
18232
  const clone = Object.assign({}, options);
17765
18233
  const envVars = env();
17766
18234
  if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
17767
18235
  (_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
17768
18236
  }
17769
- if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
17770
- (_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
17771
- }
17772
18237
  if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
17773
- (_c = clone.user_project) !== null && _c !== void 0 ? _c : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
18238
+ (_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
17774
18239
  }
17775
18240
  return clone;
17776
18241
  }
@@ -17782,7 +18247,6 @@ function fillGlobals(options) {
17782
18247
  *
17783
18248
  * g3-prettier-ignore-file
17784
18249
  */
17785
- const GOOGLE_GENAI_API_REVISION = "2026-05-20";
17786
18250
  class GoogleGenAISecurityProvider {
17787
18251
  constructor(options) {
17788
18252
  this.options = options;
@@ -17800,7 +18264,6 @@ class GoogleGenAIAuthHook {
17800
18264
  }
17801
18265
  async beforeRequest(hookCtx, request) {
17802
18266
  applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
17803
- applyApiRevision(hookCtx, request.headers);
17804
18267
  applyUserProject(hookCtx, request.headers);
17805
18268
  if (hasAuthHeaders(request.headers)) {
17806
18269
  return request;
@@ -17880,12 +18343,6 @@ function applyDefaultHeaders(target, source) {
17880
18343
  }
17881
18344
  }
17882
18345
  }
17883
- function applyApiRevision(hookCtx, headers) {
17884
- var _a;
17885
- if (headers.get("api-revision") === null) {
17886
- headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
17887
- }
17888
- }
17889
18346
  function applyUserProject(hookCtx, headers) {
17890
18347
  if (hookCtx.options.user_project !== undefined &&
17891
18348
  headers.get("x-goog-user-project") === null) {
@@ -18417,7 +18874,7 @@ function serverURLFromOptions(options) {
18417
18874
  return new URL(u);
18418
18875
  }
18419
18876
  const SDK_METADATA = {
18420
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai",
18877
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
18421
18878
  };
18422
18879
 
18423
18880
  /**
@@ -23066,6 +23523,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
23066
23523
  if (fromTopP != null) {
23067
23524
  setValueByPath(toObject, ['topP'], fromTopP);
23068
23525
  }
23526
+ const fromResponseFormat = getValueByPath(fromObject, [
23527
+ 'responseFormat',
23528
+ ]);
23529
+ if (fromResponseFormat != null) {
23530
+ let transformedList = fromResponseFormat;
23531
+ if (Array.isArray(transformedList)) {
23532
+ transformedList = transformedList.map((item) => {
23533
+ return item;
23534
+ });
23535
+ }
23536
+ setValueByPath(toObject, ['responseFormat'], transformedList);
23537
+ }
23069
23538
  return toObject;
23070
23539
  }
23071
23540
  function getTuningJobParametersToMldev(fromObject, _rootObject) {
@@ -24614,5 +25083,5 @@ function getApiKeyFromEnv() {
24614
25083
  return envGoogleApiKey || envGeminiApiKey || undefined;
24615
25084
  }
24616
25085
 
24617
- export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseParseType, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
25086
+ export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AspectRatio, AudioResponseFormat, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, Delivery, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImageResponseFormat, ImageSize, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseFormat, ResponseParseType, SafetyFilterLevel, SafetyPolicy, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TextResponseFormat, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VideoResponseFormat, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
24618
25087
  //# sourceMappingURL=index.mjs.map