@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.
package/dist/index.cjs CHANGED
@@ -804,7 +804,7 @@ exports.PhishBlockThreshold = void 0;
804
804
  */
805
805
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
806
806
  })(exports.PhishBlockThreshold || (exports.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. */
807
+ /** 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
808
  exports.Behavior = void 0;
809
809
  (function (Behavior) {
810
810
  /**
@@ -1318,6 +1318,110 @@ exports.Modality = void 0;
1318
1318
  */
1319
1319
  Modality["VIDEO"] = "VIDEO";
1320
1320
  })(exports.Modality || (exports.Modality = {}));
1321
+ /** Delivery mode for the generated content. */
1322
+ exports.Delivery = void 0;
1323
+ (function (Delivery) {
1324
+ /**
1325
+ * Default value. This value is unused.
1326
+ */
1327
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1328
+ /**
1329
+ * Generated bytes are returned inline in the response.
1330
+ */
1331
+ Delivery["INLINE"] = "INLINE";
1332
+ /**
1333
+ * Generated content is stored and a URI is returned.
1334
+ */
1335
+ Delivery["URI"] = "URI";
1336
+ })(exports.Delivery || (exports.Delivery = {}));
1337
+ /** The aspect ratio for the image output. */
1338
+ exports.AspectRatio = void 0;
1339
+ (function (AspectRatio) {
1340
+ /**
1341
+ * Default value. This value is unused.
1342
+ */
1343
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1344
+ /**
1345
+ * 1:1 aspect ratio.
1346
+ */
1347
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1348
+ /**
1349
+ * 2:3 aspect ratio.
1350
+ */
1351
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1352
+ /**
1353
+ * 3:2 aspect ratio.
1354
+ */
1355
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1356
+ /**
1357
+ * 3:4 aspect ratio.
1358
+ */
1359
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1360
+ /**
1361
+ * 4:3 aspect ratio.
1362
+ */
1363
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1364
+ /**
1365
+ * 4:5 aspect ratio.
1366
+ */
1367
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1368
+ /**
1369
+ * 5:4 aspect ratio.
1370
+ */
1371
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1372
+ /**
1373
+ * 9:16 aspect ratio.
1374
+ */
1375
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1376
+ /**
1377
+ * 16:9 aspect ratio.
1378
+ */
1379
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1380
+ /**
1381
+ * 21:9 aspect ratio.
1382
+ */
1383
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1384
+ /**
1385
+ * 1:8 aspect ratio.
1386
+ */
1387
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1388
+ /**
1389
+ * 8:1 aspect ratio.
1390
+ */
1391
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1392
+ /**
1393
+ * 1:4 aspect ratio.
1394
+ */
1395
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1396
+ /**
1397
+ * 4:1 aspect ratio.
1398
+ */
1399
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1400
+ })(exports.AspectRatio || (exports.AspectRatio = {}));
1401
+ /** The size of the image output. */
1402
+ exports.ImageSize = void 0;
1403
+ (function (ImageSize) {
1404
+ /**
1405
+ * Default value. This value is unused.
1406
+ */
1407
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1408
+ /**
1409
+ * 512px image size.
1410
+ */
1411
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1412
+ /**
1413
+ * 1K image size.
1414
+ */
1415
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1416
+ /**
1417
+ * 2K image size.
1418
+ */
1419
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1420
+ /**
1421
+ * 4K image size.
1422
+ */
1423
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1424
+ })(exports.ImageSize || (exports.ImageSize = {}));
1321
1425
  /** Tuning mode. This enum is not supported in Gemini API. */
1322
1426
  exports.TuningMode = void 0;
1323
1427
  (function (TuningMode) {
@@ -1366,6 +1470,58 @@ exports.AdapterSize = void 0;
1366
1470
  */
1367
1471
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1368
1472
  })(exports.AdapterSize || (exports.AdapterSize = {}));
1473
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1474
+ exports.ResponseParseType = void 0;
1475
+ (function (ResponseParseType) {
1476
+ /**
1477
+ * Default value. Fallback to IDENTITY
1478
+ */
1479
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1480
+ /**
1481
+ * Returns the sample response as is.
1482
+ */
1483
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1484
+ /**
1485
+ * 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.
1486
+ */
1487
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1488
+ })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1489
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1490
+ exports.MatchOperation = void 0;
1491
+ (function (MatchOperation) {
1492
+ /**
1493
+ * Default value. A user error will be returned if not set.
1494
+ */
1495
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1496
+ /**
1497
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1498
+ */
1499
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1500
+ /**
1501
+ * The match operation returns `true` if expression is a substring of the target.
1502
+ */
1503
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1504
+ /**
1505
+ * The match operation returns `true` expression is an exact match of the target.
1506
+ */
1507
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1508
+ })(exports.MatchOperation || (exports.MatchOperation = {}));
1509
+ /** Represents how much to think for the tuning job. */
1510
+ exports.ReinforcementTuningThinkingLevel = void 0;
1511
+ (function (ReinforcementTuningThinkingLevel) {
1512
+ /**
1513
+ * Unspecified thinking level.
1514
+ */
1515
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1516
+ /**
1517
+ * Little to no thinking.
1518
+ */
1519
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1520
+ /**
1521
+ * High thinking level.
1522
+ */
1523
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1524
+ })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1369
1525
  /** Job state. */
1370
1526
  exports.JobState = void 0;
1371
1527
  (function (JobState) {
@@ -1850,58 +2006,6 @@ exports.ImageResizeMode = void 0;
1850
2006
  */
1851
2007
  ImageResizeMode["PAD"] = "PAD";
1852
2008
  })(exports.ImageResizeMode || (exports.ImageResizeMode = {}));
1853
- /** Defines how to parse sample response. */
1854
- exports.ResponseParseType = void 0;
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
- })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1869
- /** Match operation to use for evaluation. */
1870
- exports.MatchOperation = void 0;
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
- })(exports.MatchOperation || (exports.MatchOperation = {}));
1889
- /** Represents how much to think for the tuning job. */
1890
- exports.ReinforcementTuningThinkingLevel = void 0;
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
- })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1905
2009
  /** Enum representing the tuning method. */
1906
2010
  exports.TuningMethod = void 0;
1907
2011
  (function (TuningMethod) {
@@ -2698,6 +2802,21 @@ class ListModelsResponse {
2698
2802
  }
2699
2803
  class DeleteModelResponse {
2700
2804
  }
2805
+ /** Configuration for audio-specific output formatting. */
2806
+ class AudioResponseFormat {
2807
+ }
2808
+ /** Configuration for image-specific output formatting. */
2809
+ class ImageResponseFormat {
2810
+ }
2811
+ /** Configuration for text-specific output formatting. */
2812
+ class TextResponseFormat {
2813
+ }
2814
+ /** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
2815
+ class VideoResponseFormat {
2816
+ }
2817
+ /** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
2818
+ class ResponseFormat {
2819
+ }
2701
2820
  /** Response for counting tokens. */
2702
2821
  class CountTokensResponse {
2703
2822
  }
@@ -2726,10 +2845,10 @@ class GenerateVideosOperation {
2726
2845
  return operation;
2727
2846
  }
2728
2847
  }
2729
- /** Defines how to parse sample response for reinforcement tuning. */
2848
+ /** 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
2849
  class ReinforcementTuningParseResponseConfig {
2731
2850
  }
2732
- /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
2851
+ /** 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
2852
  class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
2734
2853
  }
2735
2854
  /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
@@ -5169,6 +5288,9 @@ function toolToMldev$4(fromObject) {
5169
5288
  }
5170
5289
  setValueByPath(toObject, ['mcpServers'], transformedList);
5171
5290
  }
5291
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
5292
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5293
+ }
5172
5294
  return toObject;
5173
5295
  }
5174
5296
  function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
@@ -6639,6 +6761,9 @@ function toolToMldev$3(fromObject) {
6639
6761
  }
6640
6762
  setValueByPath(toObject, ['mcpServers'], transformedList);
6641
6763
  }
6764
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
6765
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6766
+ }
6642
6767
  return toObject;
6643
6768
  }
6644
6769
  function toolToVertex$2(fromObject) {
@@ -6712,6 +6837,10 @@ function toolToVertex$2(fromObject) {
6712
6837
  }
6713
6838
  setValueByPath(toObject, ['mcpServers'], transformedList);
6714
6839
  }
6840
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
6841
+ if (fromExaAiSearch != null) {
6842
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
6843
+ }
6715
6844
  return toObject;
6716
6845
  }
6717
6846
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -7800,7 +7929,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7800
7929
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7801
7930
  const USER_AGENT_HEADER = 'User-Agent';
7802
7931
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7803
- const SDK_VERSION = '2.10.0'; // x-release-please-version
7932
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
7804
7933
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7805
7934
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7806
7935
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -9665,17 +9794,14 @@ function env() {
9665
9794
  * Populates global parameters with environment variables.
9666
9795
  */
9667
9796
  function fillGlobals(options) {
9668
- var _a, _b, _c;
9797
+ var _a, _b;
9669
9798
  const clone = Object.assign({}, options);
9670
9799
  const envVars = env();
9671
9800
  if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
9672
9801
  (_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
9673
9802
  }
9674
- if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
9675
- (_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
9676
- }
9677
9803
  if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
9678
- (_c = clone.user_project) !== null && _c !== void 0 ? _c : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
9804
+ (_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
9679
9805
  }
9680
9806
  return clone;
9681
9807
  }
@@ -9687,7 +9813,6 @@ function fillGlobals(options) {
9687
9813
  *
9688
9814
  * g3-prettier-ignore-file
9689
9815
  */
9690
- const GOOGLE_GENAI_API_REVISION = "2026-05-20";
9691
9816
  class GoogleGenAISecurityProvider {
9692
9817
  constructor(options) {
9693
9818
  this.options = options;
@@ -9705,7 +9830,6 @@ class GoogleGenAIAuthHook {
9705
9830
  }
9706
9831
  async beforeRequest(hookCtx, request) {
9707
9832
  applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
9708
- applyApiRevision(hookCtx, request.headers);
9709
9833
  applyUserProject(hookCtx, request.headers);
9710
9834
  if (hasAuthHeaders(request.headers)) {
9711
9835
  return request;
@@ -9785,12 +9909,6 @@ function applyDefaultHeaders(target, source) {
9785
9909
  }
9786
9910
  }
9787
9911
  }
9788
- function applyApiRevision(hookCtx, headers) {
9789
- var _a;
9790
- if (headers.get("api-revision") === null) {
9791
- headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
9792
- }
9793
- }
9794
9912
  function applyUserProject(hookCtx, headers) {
9795
9913
  if (hookCtx.options.user_project !== undefined &&
9796
9914
  headers.get("x-goog-user-project") === null) {
@@ -10322,7 +10440,7 @@ function serverURLFromOptions(options) {
10322
10440
  return new URL(u);
10323
10441
  }
10324
10442
  const SDK_METADATA = {
10325
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai",
10443
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
10326
10444
  };
10327
10445
 
10328
10446
  /**
@@ -14263,7 +14381,7 @@ function generationConfigToVertex$1(fromObject) {
14263
14381
  }
14264
14382
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14265
14383
  if (fromSpeechConfig != null) {
14266
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
14384
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
14267
14385
  }
14268
14386
  const fromStopSequences = getValueByPath(fromObject, [
14269
14387
  'stopSequences',
@@ -14293,6 +14411,21 @@ function generationConfigToVertex$1(fromObject) {
14293
14411
  undefined) {
14294
14412
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14295
14413
  }
14414
+ const fromResponseFormat = getValueByPath(fromObject, [
14415
+ 'responseFormat',
14416
+ ]);
14417
+ if (fromResponseFormat != null) {
14418
+ let transformedList = fromResponseFormat;
14419
+ if (Array.isArray(transformedList)) {
14420
+ transformedList = transformedList.map((item) => {
14421
+ return item;
14422
+ });
14423
+ }
14424
+ setValueByPath(toObject, ['responseFormat'], transformedList);
14425
+ }
14426
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
14427
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14428
+ }
14296
14429
  return toObject;
14297
14430
  }
14298
14431
  function googleMapsToMldev$2(fromObject) {
@@ -14506,7 +14639,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
14506
14639
  }
14507
14640
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14508
14641
  if (parentObject !== undefined && fromSpeechConfig != null) {
14509
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
14642
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
14510
14643
  }
14511
14644
  const fromThinkingConfig = getValueByPath(fromObject, [
14512
14645
  'thinkingConfig',
@@ -14795,6 +14928,22 @@ function mcpServerToVertex$1(fromObject) {
14795
14928
  }
14796
14929
  return toObject;
14797
14930
  }
14931
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
14932
+ const toObject = {};
14933
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
14934
+ 'speakerVoiceConfigs',
14935
+ ]);
14936
+ if (fromSpeakerVoiceConfigs != null) {
14937
+ let transformedList = fromSpeakerVoiceConfigs;
14938
+ if (Array.isArray(transformedList)) {
14939
+ transformedList = transformedList.map((item) => {
14940
+ return speakerVoiceConfigToVertex$1(item);
14941
+ });
14942
+ }
14943
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
14944
+ }
14945
+ return toObject;
14946
+ }
14798
14947
  function partToMldev$2(fromObject) {
14799
14948
  const toObject = {};
14800
14949
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -14936,6 +15085,26 @@ function partToVertex$2(fromObject) {
14936
15085
  }
14937
15086
  return toObject;
14938
15087
  }
15088
+ function replicatedVoiceConfigToVertex$1(fromObject) {
15089
+ const toObject = {};
15090
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15091
+ if (fromMimeType != null) {
15092
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
15093
+ }
15094
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
15095
+ 'voiceSampleAudio',
15096
+ ]);
15097
+ if (fromVoiceSampleAudio != null) {
15098
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
15099
+ }
15100
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
15101
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
15102
+ }
15103
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
15104
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
15105
+ }
15106
+ return toObject;
15107
+ }
14939
15108
  function safetySettingToMldev$2(fromObject) {
14940
15109
  const toObject = {};
14941
15110
  const fromCategory = getValueByPath(fromObject, ['category']);
@@ -14962,6 +15131,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
14962
15131
  }
14963
15132
  return toObject;
14964
15133
  }
15134
+ function speakerVoiceConfigToVertex$1(fromObject) {
15135
+ const toObject = {};
15136
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
15137
+ if (fromSpeaker != null) {
15138
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
15139
+ }
15140
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15141
+ if (fromVoiceConfig != null) {
15142
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
15143
+ }
15144
+ return toObject;
15145
+ }
15146
+ function speechConfigToVertex$1(fromObject) {
15147
+ const toObject = {};
15148
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15149
+ if (fromVoiceConfig != null) {
15150
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
15151
+ }
15152
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
15153
+ if (fromLanguageCode != null) {
15154
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
15155
+ }
15156
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
15157
+ 'multiSpeakerVoiceConfig',
15158
+ ]);
15159
+ if (fromMultiSpeakerVoiceConfig != null) {
15160
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
15161
+ }
15162
+ return toObject;
15163
+ }
14965
15164
  function toolToMldev$2(fromObject) {
14966
15165
  const toObject = {};
14967
15166
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -15027,6 +15226,9 @@ function toolToMldev$2(fromObject) {
15027
15226
  }
15028
15227
  setValueByPath(toObject, ['mcpServers'], transformedList);
15029
15228
  }
15229
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
15230
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
15231
+ }
15030
15232
  return toObject;
15031
15233
  }
15032
15234
  function toolToVertex$1(fromObject) {
@@ -15100,6 +15302,10 @@ function toolToVertex$1(fromObject) {
15100
15302
  }
15101
15303
  setValueByPath(toObject, ['mcpServers'], transformedList);
15102
15304
  }
15305
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
15306
+ if (fromExaAiSearch != null) {
15307
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
15308
+ }
15103
15309
  return toObject;
15104
15310
  }
15105
15311
  function usageMetadataFromVertex(fromObject) {
@@ -15206,6 +15412,22 @@ function voiceActivityFromVertex(fromObject) {
15206
15412
  }
15207
15413
  return toObject;
15208
15414
  }
15415
+ function voiceConfigToVertex$1(fromObject) {
15416
+ const toObject = {};
15417
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
15418
+ 'replicatedVoiceConfig',
15419
+ ]);
15420
+ if (fromReplicatedVoiceConfig != null) {
15421
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
15422
+ }
15423
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
15424
+ 'prebuiltVoiceConfig',
15425
+ ]);
15426
+ if (fromPrebuiltVoiceConfig != null) {
15427
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
15428
+ }
15429
+ return toObject;
15430
+ }
15209
15431
 
15210
15432
  /**
15211
15433
  * @license
@@ -16459,7 +16681,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
16459
16681
  }
16460
16682
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
16461
16683
  if (fromSpeechConfig != null) {
16462
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
16684
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
16463
16685
  }
16464
16686
  const fromAudioTimestamp = getValueByPath(fromObject, [
16465
16687
  'audioTimestamp',
@@ -17346,7 +17568,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
17346
17568
  }
17347
17569
  return toObject;
17348
17570
  }
17349
- function generationConfigToVertex(fromObject, _rootObject) {
17571
+ function generationConfigToVertex(fromObject, rootObject) {
17350
17572
  const toObject = {};
17351
17573
  const fromModelSelectionConfig = getValueByPath(fromObject, [
17352
17574
  'modelSelectionConfig',
@@ -17442,7 +17664,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
17442
17664
  }
17443
17665
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
17444
17666
  if (fromSpeechConfig != null) {
17445
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
17667
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
17446
17668
  }
17447
17669
  const fromStopSequences = getValueByPath(fromObject, [
17448
17670
  'stopSequences',
@@ -17472,6 +17694,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
17472
17694
  undefined) {
17473
17695
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
17474
17696
  }
17697
+ const fromResponseFormat = getValueByPath(fromObject, [
17698
+ 'responseFormat',
17699
+ ]);
17700
+ if (fromResponseFormat != null) {
17701
+ let transformedList = fromResponseFormat;
17702
+ if (Array.isArray(transformedList)) {
17703
+ transformedList = transformedList.map((item) => {
17704
+ return item;
17705
+ });
17706
+ }
17707
+ setValueByPath(toObject, ['responseFormat'], transformedList);
17708
+ }
17709
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
17710
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
17711
+ }
17475
17712
  return toObject;
17476
17713
  }
17477
17714
  function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
@@ -17909,6 +18146,22 @@ function modelFromVertex(fromObject, rootObject) {
17909
18146
  }
17910
18147
  return toObject;
17911
18148
  }
18149
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
18150
+ const toObject = {};
18151
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
18152
+ 'speakerVoiceConfigs',
18153
+ ]);
18154
+ if (fromSpeakerVoiceConfigs != null) {
18155
+ let transformedList = fromSpeakerVoiceConfigs;
18156
+ if (Array.isArray(transformedList)) {
18157
+ transformedList = transformedList.map((item) => {
18158
+ return speakerVoiceConfigToVertex(item);
18159
+ });
18160
+ }
18161
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
18162
+ }
18163
+ return toObject;
18164
+ }
17912
18165
  function partToMldev$1(fromObject, rootObject) {
17913
18166
  const toObject = {};
17914
18167
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -18218,6 +18471,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
18218
18471
  }
18219
18472
  return toObject;
18220
18473
  }
18474
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
18475
+ const toObject = {};
18476
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
18477
+ if (fromMimeType != null) {
18478
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
18479
+ }
18480
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
18481
+ 'voiceSampleAudio',
18482
+ ]);
18483
+ if (fromVoiceSampleAudio != null) {
18484
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
18485
+ }
18486
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
18487
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
18488
+ }
18489
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
18490
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
18491
+ }
18492
+ return toObject;
18493
+ }
18221
18494
  function safetyAttributesFromMldev(fromObject, _rootObject) {
18222
18495
  const toObject = {};
18223
18496
  const fromCategories = getValueByPath(fromObject, [
@@ -18367,6 +18640,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
18367
18640
  }
18368
18641
  return toObject;
18369
18642
  }
18643
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
18644
+ const toObject = {};
18645
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
18646
+ if (fromSpeaker != null) {
18647
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
18648
+ }
18649
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
18650
+ if (fromVoiceConfig != null) {
18651
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
18652
+ }
18653
+ return toObject;
18654
+ }
18655
+ function speechConfigToVertex(fromObject, rootObject) {
18656
+ const toObject = {};
18657
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
18658
+ if (fromVoiceConfig != null) {
18659
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
18660
+ }
18661
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
18662
+ if (fromLanguageCode != null) {
18663
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
18664
+ }
18665
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
18666
+ 'multiSpeakerVoiceConfig',
18667
+ ]);
18668
+ if (fromMultiSpeakerVoiceConfig != null) {
18669
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
18670
+ }
18671
+ return toObject;
18672
+ }
18370
18673
  function toolConfigToMldev(fromObject, rootObject) {
18371
18674
  const toObject = {};
18372
18675
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -18472,6 +18775,9 @@ function toolToMldev$1(fromObject, rootObject) {
18472
18775
  }
18473
18776
  setValueByPath(toObject, ['mcpServers'], transformedList);
18474
18777
  }
18778
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
18779
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
18780
+ }
18475
18781
  return toObject;
18476
18782
  }
18477
18783
  function toolToVertex(fromObject, rootObject) {
@@ -18545,6 +18851,10 @@ function toolToVertex(fromObject, rootObject) {
18545
18851
  }
18546
18852
  setValueByPath(toObject, ['mcpServers'], transformedList);
18547
18853
  }
18854
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
18855
+ if (fromExaAiSearch != null) {
18856
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
18857
+ }
18548
18858
  return toObject;
18549
18859
  }
18550
18860
  function tunedModelInfoFromMldev(fromObject, _rootObject) {
@@ -18856,6 +19166,22 @@ function videoToVertex(fromObject, _rootObject) {
18856
19166
  }
18857
19167
  return toObject;
18858
19168
  }
19169
+ function voiceConfigToVertex(fromObject, rootObject) {
19170
+ const toObject = {};
19171
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
19172
+ 'replicatedVoiceConfig',
19173
+ ]);
19174
+ if (fromReplicatedVoiceConfig != null) {
19175
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
19176
+ }
19177
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
19178
+ 'prebuiltVoiceConfig',
19179
+ ]);
19180
+ if (fromPrebuiltVoiceConfig != null) {
19181
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
19182
+ }
19183
+ return toObject;
19184
+ }
18859
19185
 
18860
19186
  /**
18861
19187
  * @license
@@ -19418,10 +19744,27 @@ class Live {
19418
19744
  onopenResolve({});
19419
19745
  };
19420
19746
  const apiClient = this.apiClient;
19747
+ let sessionResolved = false;
19748
+ const messageQueue = [];
19749
+ let setupCompleteResolve = () => { };
19750
+ const setupCompletePromise = new Promise((resolve) => {
19751
+ setupCompleteResolve = resolve;
19752
+ });
19421
19753
  const websocketCallbacks = {
19422
19754
  onopen: onopenAwaitedCallback,
19423
19755
  onmessage: (event) => {
19424
- void handleWebSocketMessage(apiClient, callbacks.onmessage, event);
19756
+ void handleWebSocketMessage(apiClient, (msg) => {
19757
+ if (msg.setupComplete && !session.setupComplete) {
19758
+ session.setupComplete = msg.setupComplete;
19759
+ setupCompleteResolve({});
19760
+ }
19761
+ if (sessionResolved) {
19762
+ callbacks.onmessage(msg);
19763
+ }
19764
+ else {
19765
+ messageQueue.push(msg);
19766
+ }
19767
+ }, event);
19425
19768
  },
19426
19769
  onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
19427
19770
  },
@@ -19483,8 +19826,14 @@ class Live {
19483
19826
  clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
19484
19827
  }
19485
19828
  delete clientMessage['config'];
19829
+ const session = new Session(conn, this.apiClient);
19486
19830
  conn.send(JSON.stringify(clientMessage));
19487
- return new Session(conn, this.apiClient);
19831
+ await setupCompletePromise;
19832
+ sessionResolved = true;
19833
+ for (const msg of messageQueue) {
19834
+ callbacks.onmessage(msg);
19835
+ }
19836
+ return session;
19488
19837
  }
19489
19838
  // TODO: b/416041229 - Abstract this method to a common place.
19490
19839
  isCallableTool(tool) {
@@ -22013,6 +22362,9 @@ function toolToMldev(fromObject) {
22013
22362
  }
22014
22363
  setValueByPath(toObject, ['mcpServers'], transformedList);
22015
22364
  }
22365
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
22366
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
22367
+ }
22016
22368
  return toObject;
22017
22369
  }
22018
22370
 
@@ -23107,6 +23459,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
23107
23459
  if (fromTopP != null) {
23108
23460
  setValueByPath(toObject, ['topP'], fromTopP);
23109
23461
  }
23462
+ const fromResponseFormat = getValueByPath(fromObject, [
23463
+ 'responseFormat',
23464
+ ]);
23465
+ if (fromResponseFormat != null) {
23466
+ let transformedList = fromResponseFormat;
23467
+ if (Array.isArray(transformedList)) {
23468
+ transformedList = transformedList.map((item) => {
23469
+ return item;
23470
+ });
23471
+ }
23472
+ setValueByPath(toObject, ['responseFormat'], transformedList);
23473
+ }
23110
23474
  return toObject;
23111
23475
  }
23112
23476
  function getTuningJobParametersToMldev(fromObject, _rootObject) {
@@ -24231,6 +24595,7 @@ class GoogleGenAI {
24231
24595
  }
24232
24596
 
24233
24597
  exports.ApiError = ApiError;
24598
+ exports.AudioResponseFormat = AudioResponseFormat;
24234
24599
  exports.Batches = Batches;
24235
24600
  exports.Caches = Caches;
24236
24601
  exports.CancelTuningJobResponse = CancelTuningJobResponse;
@@ -24260,6 +24625,7 @@ exports.GenerateVideosOperation = GenerateVideosOperation;
24260
24625
  exports.GenerateVideosResponse = GenerateVideosResponse;
24261
24626
  exports.GoogleGenAI = GoogleGenAI;
24262
24627
  exports.HttpResponse = HttpResponse;
24628
+ exports.ImageResponseFormat = ImageResponseFormat;
24263
24629
  exports.ImportFileOperation = ImportFileOperation;
24264
24630
  exports.ImportFileResponse = ImportFileResponse;
24265
24631
  exports.InlinedEmbedContentResponse = InlinedEmbedContentResponse;
@@ -24286,11 +24652,13 @@ exports.RegisterFilesResponse = RegisterFilesResponse;
24286
24652
  exports.ReinforcementTuningAutoraterScorerParsedResponseConversionScorer = ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
24287
24653
  exports.ReinforcementTuningParseResponseConfig = ReinforcementTuningParseResponseConfig;
24288
24654
  exports.ReplayResponse = ReplayResponse;
24655
+ exports.ResponseFormat = ResponseFormat;
24289
24656
  exports.SegmentImageResponse = SegmentImageResponse;
24290
24657
  exports.Session = Session;
24291
24658
  exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
24292
24659
  exports.StyleReferenceImage = StyleReferenceImage;
24293
24660
  exports.SubjectReferenceImage = SubjectReferenceImage;
24661
+ exports.TextResponseFormat = TextResponseFormat;
24294
24662
  exports.Tokens = Tokens;
24295
24663
  exports.ToolResponse = ToolResponse;
24296
24664
  exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
@@ -24298,6 +24666,7 @@ exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
24298
24666
  exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;
24299
24667
  exports.UpscaleImageResponse = UpscaleImageResponse;
24300
24668
  exports.ValidateRewardResponse = ValidateRewardResponse;
24669
+ exports.VideoResponseFormat = VideoResponseFormat;
24301
24670
  exports.createFunctionResponsePartFromBase64 = createFunctionResponsePartFromBase64;
24302
24671
  exports.createFunctionResponsePartFromUri = createFunctionResponsePartFromUri;
24303
24672
  exports.createModelContent = createModelContent;