@google/genai 2.10.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.
@@ -862,7 +862,7 @@ exports.PhishBlockThreshold = void 0;
862
862
  */
863
863
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
864
864
  })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
865
- /** 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. */
865
+ /** 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. */
866
866
  exports.Behavior = void 0;
867
867
  (function (Behavior) {
868
868
  /**
@@ -1376,6 +1376,110 @@ exports.Modality = void 0;
1376
1376
  */
1377
1377
  Modality["VIDEO"] = "VIDEO";
1378
1378
  })(exports.Modality || (exports.Modality = {}));
1379
+ /** Delivery mode for the generated content. */
1380
+ exports.Delivery = void 0;
1381
+ (function (Delivery) {
1382
+ /**
1383
+ * Default value. This value is unused.
1384
+ */
1385
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1386
+ /**
1387
+ * Generated bytes are returned inline in the response.
1388
+ */
1389
+ Delivery["INLINE"] = "INLINE";
1390
+ /**
1391
+ * Generated content is stored and a URI is returned.
1392
+ */
1393
+ Delivery["URI"] = "URI";
1394
+ })(exports.Delivery || (exports.Delivery = {}));
1395
+ /** The aspect ratio for the image output. */
1396
+ exports.AspectRatio = void 0;
1397
+ (function (AspectRatio) {
1398
+ /**
1399
+ * Default value. This value is unused.
1400
+ */
1401
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1402
+ /**
1403
+ * 1:1 aspect ratio.
1404
+ */
1405
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1406
+ /**
1407
+ * 2:3 aspect ratio.
1408
+ */
1409
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1410
+ /**
1411
+ * 3:2 aspect ratio.
1412
+ */
1413
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1414
+ /**
1415
+ * 3:4 aspect ratio.
1416
+ */
1417
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1418
+ /**
1419
+ * 4:3 aspect ratio.
1420
+ */
1421
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1422
+ /**
1423
+ * 4:5 aspect ratio.
1424
+ */
1425
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1426
+ /**
1427
+ * 5:4 aspect ratio.
1428
+ */
1429
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1430
+ /**
1431
+ * 9:16 aspect ratio.
1432
+ */
1433
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1434
+ /**
1435
+ * 16:9 aspect ratio.
1436
+ */
1437
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1438
+ /**
1439
+ * 21:9 aspect ratio.
1440
+ */
1441
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1442
+ /**
1443
+ * 1:8 aspect ratio.
1444
+ */
1445
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1446
+ /**
1447
+ * 8:1 aspect ratio.
1448
+ */
1449
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1450
+ /**
1451
+ * 1:4 aspect ratio.
1452
+ */
1453
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1454
+ /**
1455
+ * 4:1 aspect ratio.
1456
+ */
1457
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1458
+ })(exports.AspectRatio || (exports.AspectRatio = {}));
1459
+ /** The size of the image output. */
1460
+ exports.ImageSize = void 0;
1461
+ (function (ImageSize) {
1462
+ /**
1463
+ * Default value. This value is unused.
1464
+ */
1465
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1466
+ /**
1467
+ * 512px image size.
1468
+ */
1469
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1470
+ /**
1471
+ * 1K image size.
1472
+ */
1473
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1474
+ /**
1475
+ * 2K image size.
1476
+ */
1477
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1478
+ /**
1479
+ * 4K image size.
1480
+ */
1481
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1482
+ })(exports.ImageSize || (exports.ImageSize = {}));
1379
1483
  /** Tuning mode. This enum is not supported in Gemini API. */
1380
1484
  exports.TuningMode = void 0;
1381
1485
  (function (TuningMode) {
@@ -1424,6 +1528,58 @@ exports.AdapterSize = void 0;
1424
1528
  */
1425
1529
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1426
1530
  })(exports.AdapterSize || (exports.AdapterSize = {}));
1531
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1532
+ exports.ResponseParseType = void 0;
1533
+ (function (ResponseParseType) {
1534
+ /**
1535
+ * Default value. Fallback to IDENTITY
1536
+ */
1537
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1538
+ /**
1539
+ * Returns the sample response as is.
1540
+ */
1541
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1542
+ /**
1543
+ * 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.
1544
+ */
1545
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1546
+ })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1547
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1548
+ exports.MatchOperation = void 0;
1549
+ (function (MatchOperation) {
1550
+ /**
1551
+ * Default value. A user error will be returned if not set.
1552
+ */
1553
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1554
+ /**
1555
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1556
+ */
1557
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1558
+ /**
1559
+ * The match operation returns `true` if expression is a substring of the target.
1560
+ */
1561
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1562
+ /**
1563
+ * The match operation returns `true` expression is an exact match of the target.
1564
+ */
1565
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1566
+ })(exports.MatchOperation || (exports.MatchOperation = {}));
1567
+ /** Represents how much to think for the tuning job. */
1568
+ exports.ReinforcementTuningThinkingLevel = void 0;
1569
+ (function (ReinforcementTuningThinkingLevel) {
1570
+ /**
1571
+ * Unspecified thinking level.
1572
+ */
1573
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1574
+ /**
1575
+ * Little to no thinking.
1576
+ */
1577
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1578
+ /**
1579
+ * High thinking level.
1580
+ */
1581
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1582
+ })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1427
1583
  /** Job state. */
1428
1584
  exports.JobState = void 0;
1429
1585
  (function (JobState) {
@@ -1908,58 +2064,6 @@ exports.ImageResizeMode = void 0;
1908
2064
  */
1909
2065
  ImageResizeMode["PAD"] = "PAD";
1910
2066
  })(exports.ImageResizeMode || (exports.ImageResizeMode = {}));
1911
- /** Defines how to parse sample response. */
1912
- exports.ResponseParseType = void 0;
1913
- (function (ResponseParseType) {
1914
- /**
1915
- * Default value. This value is unused.
1916
- */
1917
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1918
- /**
1919
- * Use the sample response as is.
1920
- */
1921
- ResponseParseType["IDENTITY"] = "IDENTITY";
1922
- /**
1923
- * Use regex to extract the important part of sample response.
1924
- */
1925
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1926
- })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1927
- /** Match operation to use for evaluation. */
1928
- exports.MatchOperation = void 0;
1929
- (function (MatchOperation) {
1930
- /**
1931
- * Default value. This value is unused.
1932
- */
1933
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1934
- /**
1935
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1936
- */
1937
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1938
- /**
1939
- * `expression` is a substring of target.
1940
- */
1941
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1942
- /**
1943
- * `expression` is an exact match of target.
1944
- */
1945
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1946
- })(exports.MatchOperation || (exports.MatchOperation = {}));
1947
- /** Represents how much to think for the tuning job. */
1948
- exports.ReinforcementTuningThinkingLevel = void 0;
1949
- (function (ReinforcementTuningThinkingLevel) {
1950
- /**
1951
- * Unspecified thinking level.
1952
- */
1953
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1954
- /**
1955
- * Little to no thinking.
1956
- */
1957
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1958
- /**
1959
- * High thinking level.
1960
- */
1961
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1962
- })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1963
2067
  /** Enum representing the tuning method. */
1964
2068
  exports.TuningMethod = void 0;
1965
2069
  (function (TuningMethod) {
@@ -2756,6 +2860,21 @@ class ListModelsResponse {
2756
2860
  }
2757
2861
  class DeleteModelResponse {
2758
2862
  }
2863
+ /** Configuration for audio-specific output formatting. */
2864
+ class AudioResponseFormat {
2865
+ }
2866
+ /** Configuration for image-specific output formatting. */
2867
+ class ImageResponseFormat {
2868
+ }
2869
+ /** Configuration for text-specific output formatting. */
2870
+ class TextResponseFormat {
2871
+ }
2872
+ /** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
2873
+ class VideoResponseFormat {
2874
+ }
2875
+ /** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
2876
+ class ResponseFormat {
2877
+ }
2759
2878
  /** Response for counting tokens. */
2760
2879
  class CountTokensResponse {
2761
2880
  }
@@ -2784,10 +2903,10 @@ class GenerateVideosOperation {
2784
2903
  return operation;
2785
2904
  }
2786
2905
  }
2787
- /** Defines how to parse sample response for reinforcement tuning. */
2906
+ /** 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. */
2788
2907
  class ReinforcementTuningParseResponseConfig {
2789
2908
  }
2790
- /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
2909
+ /** 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. */
2791
2910
  class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
2792
2911
  }
2793
2912
  /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
@@ -5227,6 +5346,9 @@ function toolToMldev$4(fromObject) {
5227
5346
  }
5228
5347
  setValueByPath(toObject, ['mcpServers'], transformedList);
5229
5348
  }
5349
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
5350
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5351
+ }
5230
5352
  return toObject;
5231
5353
  }
5232
5354
  function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
@@ -6697,6 +6819,9 @@ function toolToMldev$3(fromObject) {
6697
6819
  }
6698
6820
  setValueByPath(toObject, ['mcpServers'], transformedList);
6699
6821
  }
6822
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
6823
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6824
+ }
6700
6825
  return toObject;
6701
6826
  }
6702
6827
  function toolToVertex$2(fromObject) {
@@ -6770,6 +6895,10 @@ function toolToVertex$2(fromObject) {
6770
6895
  }
6771
6896
  setValueByPath(toObject, ['mcpServers'], transformedList);
6772
6897
  }
6898
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
6899
+ if (fromExaAiSearch != null) {
6900
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
6901
+ }
6773
6902
  return toObject;
6774
6903
  }
6775
6904
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -8344,7 +8473,7 @@ function generationConfigToVertex$1(fromObject) {
8344
8473
  }
8345
8474
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8346
8475
  if (fromSpeechConfig != null) {
8347
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
8476
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
8348
8477
  }
8349
8478
  const fromStopSequences = getValueByPath(fromObject, [
8350
8479
  'stopSequences',
@@ -8374,6 +8503,21 @@ function generationConfigToVertex$1(fromObject) {
8374
8503
  undefined) {
8375
8504
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8376
8505
  }
8506
+ const fromResponseFormat = getValueByPath(fromObject, [
8507
+ 'responseFormat',
8508
+ ]);
8509
+ if (fromResponseFormat != null) {
8510
+ let transformedList = fromResponseFormat;
8511
+ if (Array.isArray(transformedList)) {
8512
+ transformedList = transformedList.map((item) => {
8513
+ return item;
8514
+ });
8515
+ }
8516
+ setValueByPath(toObject, ['responseFormat'], transformedList);
8517
+ }
8518
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
8519
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8520
+ }
8377
8521
  return toObject;
8378
8522
  }
8379
8523
  function googleMapsToMldev$2(fromObject) {
@@ -8587,7 +8731,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
8587
8731
  }
8588
8732
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8589
8733
  if (parentObject !== undefined && fromSpeechConfig != null) {
8590
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
8734
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8591
8735
  }
8592
8736
  const fromThinkingConfig = getValueByPath(fromObject, [
8593
8737
  'thinkingConfig',
@@ -8876,6 +9020,22 @@ function mcpServerToVertex$1(fromObject) {
8876
9020
  }
8877
9021
  return toObject;
8878
9022
  }
9023
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
9024
+ const toObject = {};
9025
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
9026
+ 'speakerVoiceConfigs',
9027
+ ]);
9028
+ if (fromSpeakerVoiceConfigs != null) {
9029
+ let transformedList = fromSpeakerVoiceConfigs;
9030
+ if (Array.isArray(transformedList)) {
9031
+ transformedList = transformedList.map((item) => {
9032
+ return speakerVoiceConfigToVertex$1(item);
9033
+ });
9034
+ }
9035
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
9036
+ }
9037
+ return toObject;
9038
+ }
8879
9039
  function partToMldev$2(fromObject) {
8880
9040
  const toObject = {};
8881
9041
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -9017,6 +9177,26 @@ function partToVertex$2(fromObject) {
9017
9177
  }
9018
9178
  return toObject;
9019
9179
  }
9180
+ function replicatedVoiceConfigToVertex$1(fromObject) {
9181
+ const toObject = {};
9182
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9183
+ if (fromMimeType != null) {
9184
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9185
+ }
9186
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
9187
+ 'voiceSampleAudio',
9188
+ ]);
9189
+ if (fromVoiceSampleAudio != null) {
9190
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
9191
+ }
9192
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
9193
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9194
+ }
9195
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
9196
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9197
+ }
9198
+ return toObject;
9199
+ }
9020
9200
  function safetySettingToMldev$2(fromObject) {
9021
9201
  const toObject = {};
9022
9202
  const fromCategory = getValueByPath(fromObject, ['category']);
@@ -9043,6 +9223,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
9043
9223
  }
9044
9224
  return toObject;
9045
9225
  }
9226
+ function speakerVoiceConfigToVertex$1(fromObject) {
9227
+ const toObject = {};
9228
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
9229
+ if (fromSpeaker != null) {
9230
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
9231
+ }
9232
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9233
+ if (fromVoiceConfig != null) {
9234
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9235
+ }
9236
+ return toObject;
9237
+ }
9238
+ function speechConfigToVertex$1(fromObject) {
9239
+ const toObject = {};
9240
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9241
+ if (fromVoiceConfig != null) {
9242
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9243
+ }
9244
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
9245
+ if (fromLanguageCode != null) {
9246
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
9247
+ }
9248
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
9249
+ 'multiSpeakerVoiceConfig',
9250
+ ]);
9251
+ if (fromMultiSpeakerVoiceConfig != null) {
9252
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
9253
+ }
9254
+ return toObject;
9255
+ }
9046
9256
  function toolToMldev$2(fromObject) {
9047
9257
  const toObject = {};
9048
9258
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -9108,6 +9318,9 @@ function toolToMldev$2(fromObject) {
9108
9318
  }
9109
9319
  setValueByPath(toObject, ['mcpServers'], transformedList);
9110
9320
  }
9321
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
9322
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9323
+ }
9111
9324
  return toObject;
9112
9325
  }
9113
9326
  function toolToVertex$1(fromObject) {
@@ -9181,6 +9394,10 @@ function toolToVertex$1(fromObject) {
9181
9394
  }
9182
9395
  setValueByPath(toObject, ['mcpServers'], transformedList);
9183
9396
  }
9397
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
9398
+ if (fromExaAiSearch != null) {
9399
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
9400
+ }
9184
9401
  return toObject;
9185
9402
  }
9186
9403
  function usageMetadataFromVertex(fromObject) {
@@ -9287,6 +9504,22 @@ function voiceActivityFromVertex(fromObject) {
9287
9504
  }
9288
9505
  return toObject;
9289
9506
  }
9507
+ function voiceConfigToVertex$1(fromObject) {
9508
+ const toObject = {};
9509
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
9510
+ 'replicatedVoiceConfig',
9511
+ ]);
9512
+ if (fromReplicatedVoiceConfig != null) {
9513
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
9514
+ }
9515
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
9516
+ 'prebuiltVoiceConfig',
9517
+ ]);
9518
+ if (fromPrebuiltVoiceConfig != null) {
9519
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
9520
+ }
9521
+ return toObject;
9522
+ }
9290
9523
 
9291
9524
  /**
9292
9525
  * @license
@@ -10540,7 +10773,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
10540
10773
  }
10541
10774
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
10542
10775
  if (fromSpeechConfig != null) {
10543
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10776
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
10544
10777
  }
10545
10778
  const fromAudioTimestamp = getValueByPath(fromObject, [
10546
10779
  'audioTimestamp',
@@ -11427,7 +11660,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
11427
11660
  }
11428
11661
  return toObject;
11429
11662
  }
11430
- function generationConfigToVertex(fromObject, _rootObject) {
11663
+ function generationConfigToVertex(fromObject, rootObject) {
11431
11664
  const toObject = {};
11432
11665
  const fromModelSelectionConfig = getValueByPath(fromObject, [
11433
11666
  'modelSelectionConfig',
@@ -11523,7 +11756,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
11523
11756
  }
11524
11757
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11525
11758
  if (fromSpeechConfig != null) {
11526
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11759
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
11527
11760
  }
11528
11761
  const fromStopSequences = getValueByPath(fromObject, [
11529
11762
  'stopSequences',
@@ -11553,6 +11786,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
11553
11786
  undefined) {
11554
11787
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11555
11788
  }
11789
+ const fromResponseFormat = getValueByPath(fromObject, [
11790
+ 'responseFormat',
11791
+ ]);
11792
+ if (fromResponseFormat != null) {
11793
+ let transformedList = fromResponseFormat;
11794
+ if (Array.isArray(transformedList)) {
11795
+ transformedList = transformedList.map((item) => {
11796
+ return item;
11797
+ });
11798
+ }
11799
+ setValueByPath(toObject, ['responseFormat'], transformedList);
11800
+ }
11801
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
11802
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11803
+ }
11556
11804
  return toObject;
11557
11805
  }
11558
11806
  function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
@@ -11990,6 +12238,22 @@ function modelFromVertex(fromObject, rootObject) {
11990
12238
  }
11991
12239
  return toObject;
11992
12240
  }
12241
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
12242
+ const toObject = {};
12243
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
12244
+ 'speakerVoiceConfigs',
12245
+ ]);
12246
+ if (fromSpeakerVoiceConfigs != null) {
12247
+ let transformedList = fromSpeakerVoiceConfigs;
12248
+ if (Array.isArray(transformedList)) {
12249
+ transformedList = transformedList.map((item) => {
12250
+ return speakerVoiceConfigToVertex(item);
12251
+ });
12252
+ }
12253
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
12254
+ }
12255
+ return toObject;
12256
+ }
11993
12257
  function partToMldev$1(fromObject, rootObject) {
11994
12258
  const toObject = {};
11995
12259
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -12299,6 +12563,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
12299
12563
  }
12300
12564
  return toObject;
12301
12565
  }
12566
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
12567
+ const toObject = {};
12568
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
12569
+ if (fromMimeType != null) {
12570
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
12571
+ }
12572
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
12573
+ 'voiceSampleAudio',
12574
+ ]);
12575
+ if (fromVoiceSampleAudio != null) {
12576
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
12577
+ }
12578
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
12579
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12580
+ }
12581
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
12582
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12583
+ }
12584
+ return toObject;
12585
+ }
12302
12586
  function safetyAttributesFromMldev(fromObject, _rootObject) {
12303
12587
  const toObject = {};
12304
12588
  const fromCategories = getValueByPath(fromObject, [
@@ -12448,6 +12732,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
12448
12732
  }
12449
12733
  return toObject;
12450
12734
  }
12735
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
12736
+ const toObject = {};
12737
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
12738
+ if (fromSpeaker != null) {
12739
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
12740
+ }
12741
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12742
+ if (fromVoiceConfig != null) {
12743
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12744
+ }
12745
+ return toObject;
12746
+ }
12747
+ function speechConfigToVertex(fromObject, rootObject) {
12748
+ const toObject = {};
12749
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12750
+ if (fromVoiceConfig != null) {
12751
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12752
+ }
12753
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
12754
+ if (fromLanguageCode != null) {
12755
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
12756
+ }
12757
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
12758
+ 'multiSpeakerVoiceConfig',
12759
+ ]);
12760
+ if (fromMultiSpeakerVoiceConfig != null) {
12761
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
12762
+ }
12763
+ return toObject;
12764
+ }
12451
12765
  function toolConfigToMldev(fromObject, rootObject) {
12452
12766
  const toObject = {};
12453
12767
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -12553,6 +12867,9 @@ function toolToMldev$1(fromObject, rootObject) {
12553
12867
  }
12554
12868
  setValueByPath(toObject, ['mcpServers'], transformedList);
12555
12869
  }
12870
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
12871
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12872
+ }
12556
12873
  return toObject;
12557
12874
  }
12558
12875
  function toolToVertex(fromObject, rootObject) {
@@ -12626,6 +12943,10 @@ function toolToVertex(fromObject, rootObject) {
12626
12943
  }
12627
12944
  setValueByPath(toObject, ['mcpServers'], transformedList);
12628
12945
  }
12946
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
12947
+ if (fromExaAiSearch != null) {
12948
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
12949
+ }
12629
12950
  return toObject;
12630
12951
  }
12631
12952
  function tunedModelInfoFromMldev(fromObject, _rootObject) {
@@ -12937,6 +13258,22 @@ function videoToVertex(fromObject, _rootObject) {
12937
13258
  }
12938
13259
  return toObject;
12939
13260
  }
13261
+ function voiceConfigToVertex(fromObject, rootObject) {
13262
+ const toObject = {};
13263
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
13264
+ 'replicatedVoiceConfig',
13265
+ ]);
13266
+ if (fromReplicatedVoiceConfig != null) {
13267
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
13268
+ }
13269
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
13270
+ 'prebuiltVoiceConfig',
13271
+ ]);
13272
+ if (fromPrebuiltVoiceConfig != null) {
13273
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
13274
+ }
13275
+ return toObject;
13276
+ }
12940
13277
 
12941
13278
  /**
12942
13279
  * @license
@@ -13187,7 +13524,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
13187
13524
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
13188
13525
  const USER_AGENT_HEADER = 'User-Agent';
13189
13526
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
13190
- const SDK_VERSION = '2.10.0'; // x-release-please-version
13527
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
13191
13528
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
13192
13529
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
13193
13530
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14441,10 +14778,27 @@ class Live {
14441
14778
  onopenResolve({});
14442
14779
  };
14443
14780
  const apiClient = this.apiClient;
14781
+ let sessionResolved = false;
14782
+ const messageQueue = [];
14783
+ let setupCompleteResolve = () => { };
14784
+ const setupCompletePromise = new Promise((resolve) => {
14785
+ setupCompleteResolve = resolve;
14786
+ });
14444
14787
  const websocketCallbacks = {
14445
14788
  onopen: onopenAwaitedCallback,
14446
14789
  onmessage: (event) => {
14447
- void handleWebSocketMessage(apiClient, callbacks.onmessage, event);
14790
+ void handleWebSocketMessage(apiClient, (msg) => {
14791
+ if (msg.setupComplete && !session.setupComplete) {
14792
+ session.setupComplete = msg.setupComplete;
14793
+ setupCompleteResolve({});
14794
+ }
14795
+ if (sessionResolved) {
14796
+ callbacks.onmessage(msg);
14797
+ }
14798
+ else {
14799
+ messageQueue.push(msg);
14800
+ }
14801
+ }, event);
14448
14802
  },
14449
14803
  onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
14450
14804
  },
@@ -14506,8 +14860,14 @@ class Live {
14506
14860
  clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
14507
14861
  }
14508
14862
  delete clientMessage['config'];
14863
+ const session = new Session(conn, this.apiClient);
14509
14864
  conn.send(JSON.stringify(clientMessage));
14510
- return new Session(conn, this.apiClient);
14865
+ await setupCompletePromise;
14866
+ sessionResolved = true;
14867
+ for (const msg of messageQueue) {
14868
+ callbacks.onmessage(msg);
14869
+ }
14870
+ return session;
14511
14871
  }
14512
14872
  // TODO: b/416041229 - Abstract this method to a common place.
14513
14873
  isCallableTool(tool) {
@@ -17036,6 +17396,9 @@ function toolToMldev(fromObject) {
17036
17396
  }
17037
17397
  setValueByPath(toObject, ['mcpServers'], transformedList);
17038
17398
  }
17399
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
17400
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
17401
+ }
17039
17402
  return toObject;
17040
17403
  }
17041
17404
 
@@ -17887,17 +18250,14 @@ function env() {
17887
18250
  * Populates global parameters with environment variables.
17888
18251
  */
17889
18252
  function fillGlobals(options) {
17890
- var _a, _b, _c;
18253
+ var _a, _b;
17891
18254
  const clone = Object.assign({}, options);
17892
18255
  const envVars = env();
17893
18256
  if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
17894
18257
  (_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
17895
18258
  }
17896
- if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
17897
- (_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
17898
- }
17899
18259
  if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
17900
- (_c = clone.user_project) !== null && _c !== void 0 ? _c : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
18260
+ (_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
17901
18261
  }
17902
18262
  return clone;
17903
18263
  }
@@ -17909,7 +18269,6 @@ function fillGlobals(options) {
17909
18269
  *
17910
18270
  * g3-prettier-ignore-file
17911
18271
  */
17912
- const GOOGLE_GENAI_API_REVISION = "2026-05-20";
17913
18272
  class GoogleGenAISecurityProvider {
17914
18273
  constructor(options) {
17915
18274
  this.options = options;
@@ -17927,7 +18286,6 @@ class GoogleGenAIAuthHook {
17927
18286
  }
17928
18287
  async beforeRequest(hookCtx, request) {
17929
18288
  applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
17930
- applyApiRevision(hookCtx, request.headers);
17931
18289
  applyUserProject(hookCtx, request.headers);
17932
18290
  if (hasAuthHeaders(request.headers)) {
17933
18291
  return request;
@@ -18007,12 +18365,6 @@ function applyDefaultHeaders(target, source) {
18007
18365
  }
18008
18366
  }
18009
18367
  }
18010
- function applyApiRevision(hookCtx, headers) {
18011
- var _a;
18012
- if (headers.get("api-revision") === null) {
18013
- headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
18014
- }
18015
- }
18016
18368
  function applyUserProject(hookCtx, headers) {
18017
18369
  if (hookCtx.options.user_project !== undefined &&
18018
18370
  headers.get("x-goog-user-project") === null) {
@@ -18544,7 +18896,7 @@ function serverURLFromOptions(options) {
18544
18896
  return new URL(u);
18545
18897
  }
18546
18898
  const SDK_METADATA = {
18547
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai",
18899
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
18548
18900
  };
18549
18901
 
18550
18902
  /**
@@ -23193,6 +23545,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
23193
23545
  if (fromTopP != null) {
23194
23546
  setValueByPath(toObject, ['topP'], fromTopP);
23195
23547
  }
23548
+ const fromResponseFormat = getValueByPath(fromObject, [
23549
+ 'responseFormat',
23550
+ ]);
23551
+ if (fromResponseFormat != null) {
23552
+ let transformedList = fromResponseFormat;
23553
+ if (Array.isArray(transformedList)) {
23554
+ transformedList = transformedList.map((item) => {
23555
+ return item;
23556
+ });
23557
+ }
23558
+ setValueByPath(toObject, ['responseFormat'], transformedList);
23559
+ }
23196
23560
  return toObject;
23197
23561
  }
23198
23562
  function getTuningJobParametersToMldev(fromObject, _rootObject) {
@@ -24742,6 +25106,7 @@ function getApiKeyFromEnv() {
24742
25106
  }
24743
25107
 
24744
25108
  exports.ApiError = ApiError;
25109
+ exports.AudioResponseFormat = AudioResponseFormat;
24745
25110
  exports.Batches = Batches;
24746
25111
  exports.Caches = Caches;
24747
25112
  exports.CancelTuningJobResponse = CancelTuningJobResponse;
@@ -24771,6 +25136,7 @@ exports.GenerateVideosOperation = GenerateVideosOperation;
24771
25136
  exports.GenerateVideosResponse = GenerateVideosResponse;
24772
25137
  exports.GoogleGenAI = GoogleGenAI;
24773
25138
  exports.HttpResponse = HttpResponse;
25139
+ exports.ImageResponseFormat = ImageResponseFormat;
24774
25140
  exports.ImportFileOperation = ImportFileOperation;
24775
25141
  exports.ImportFileResponse = ImportFileResponse;
24776
25142
  exports.InlinedEmbedContentResponse = InlinedEmbedContentResponse;
@@ -24797,11 +25163,13 @@ exports.RegisterFilesResponse = RegisterFilesResponse;
24797
25163
  exports.ReinforcementTuningAutoraterScorerParsedResponseConversionScorer = ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
24798
25164
  exports.ReinforcementTuningParseResponseConfig = ReinforcementTuningParseResponseConfig;
24799
25165
  exports.ReplayResponse = ReplayResponse;
25166
+ exports.ResponseFormat = ResponseFormat;
24800
25167
  exports.SegmentImageResponse = SegmentImageResponse;
24801
25168
  exports.Session = Session;
24802
25169
  exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
24803
25170
  exports.StyleReferenceImage = StyleReferenceImage;
24804
25171
  exports.SubjectReferenceImage = SubjectReferenceImage;
25172
+ exports.TextResponseFormat = TextResponseFormat;
24805
25173
  exports.Tokens = Tokens;
24806
25174
  exports.ToolResponse = ToolResponse;
24807
25175
  exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
@@ -24809,6 +25177,7 @@ exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
24809
25177
  exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;
24810
25178
  exports.UpscaleImageResponse = UpscaleImageResponse;
24811
25179
  exports.ValidateRewardResponse = ValidateRewardResponse;
25180
+ exports.VideoResponseFormat = VideoResponseFormat;
24812
25181
  exports.createFunctionResponsePartFromBase64 = createFunctionResponsePartFromBase64;
24813
25182
  exports.createFunctionResponsePartFromUri = createFunctionResponsePartFromUri;
24814
25183
  exports.createModelContent = createModelContent;