@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.
package/dist/index.mjs CHANGED
@@ -644,26 +644,6 @@ var Type;
644
644
  */
645
645
  Type["NULL"] = "NULL";
646
646
  })(Type || (Type = {}));
647
- /** The environment being operated. */
648
- var Environment;
649
- (function (Environment) {
650
- /**
651
- * Defaults to browser.
652
- */
653
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
654
- /**
655
- * Operates in a web browser.
656
- */
657
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
658
- /**
659
- * Operates in a mobile environment.
660
- */
661
- Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
662
- /**
663
- * Operates in a desktop environment.
664
- */
665
- Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
666
- })(Environment || (Environment = {}));
667
647
  /** Type of auth scheme. This enum is not supported in Gemini API. */
668
648
  var AuthType;
669
649
  (function (AuthType) {
@@ -734,6 +714,62 @@ var ApiSpec;
734
714
  */
735
715
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
736
716
  })(ApiSpec || (ApiSpec = {}));
717
+ /** The environment being operated. */
718
+ var Environment;
719
+ (function (Environment) {
720
+ /**
721
+ * Defaults to browser.
722
+ */
723
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
724
+ /**
725
+ * Operates in a web browser.
726
+ */
727
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
728
+ /**
729
+ * Operates in a mobile environment.
730
+ */
731
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
732
+ /**
733
+ * Operates in a desktop environment.
734
+ */
735
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
736
+ })(Environment || (Environment = {}));
737
+ /** SafetyPolicy */
738
+ var SafetyPolicy;
739
+ (function (SafetyPolicy) {
740
+ /**
741
+ * Unspecified safety policy.
742
+ */
743
+ SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
744
+ /**
745
+ * Safety policy for financial transactions.
746
+ */
747
+ SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
748
+ /**
749
+ * Safety policy for sensitive data modification.
750
+ */
751
+ SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
752
+ /**
753
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
754
+ */
755
+ SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
756
+ /**
757
+ * Safety policy for account creation.
758
+ */
759
+ SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
760
+ /**
761
+ * Safety policy for data modification.
762
+ */
763
+ SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
764
+ /**
765
+ * Safety policy for user consent management.
766
+ */
767
+ SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
768
+ /**
769
+ * Safety policy for legal terms and agreements.
770
+ */
771
+ SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
772
+ })(SafetyPolicy || (SafetyPolicy = {}));
737
773
  /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
738
774
  var PhishBlockThreshold;
739
775
  (function (PhishBlockThreshold) {
@@ -766,7 +802,7 @@ var PhishBlockThreshold;
766
802
  */
767
803
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
768
804
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
769
- /** 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. */
805
+ /** 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. */
770
806
  var Behavior;
771
807
  (function (Behavior) {
772
808
  /**
@@ -1280,6 +1316,110 @@ var Modality;
1280
1316
  */
1281
1317
  Modality["VIDEO"] = "VIDEO";
1282
1318
  })(Modality || (Modality = {}));
1319
+ /** Delivery mode for the generated content. */
1320
+ var Delivery;
1321
+ (function (Delivery) {
1322
+ /**
1323
+ * Default value. This value is unused.
1324
+ */
1325
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1326
+ /**
1327
+ * Generated bytes are returned inline in the response.
1328
+ */
1329
+ Delivery["INLINE"] = "INLINE";
1330
+ /**
1331
+ * Generated content is stored and a URI is returned.
1332
+ */
1333
+ Delivery["URI"] = "URI";
1334
+ })(Delivery || (Delivery = {}));
1335
+ /** The aspect ratio for the image output. */
1336
+ var AspectRatio;
1337
+ (function (AspectRatio) {
1338
+ /**
1339
+ * Default value. This value is unused.
1340
+ */
1341
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1342
+ /**
1343
+ * 1:1 aspect ratio.
1344
+ */
1345
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1346
+ /**
1347
+ * 2:3 aspect ratio.
1348
+ */
1349
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1350
+ /**
1351
+ * 3:2 aspect ratio.
1352
+ */
1353
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1354
+ /**
1355
+ * 3:4 aspect ratio.
1356
+ */
1357
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1358
+ /**
1359
+ * 4:3 aspect ratio.
1360
+ */
1361
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1362
+ /**
1363
+ * 4:5 aspect ratio.
1364
+ */
1365
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1366
+ /**
1367
+ * 5:4 aspect ratio.
1368
+ */
1369
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1370
+ /**
1371
+ * 9:16 aspect ratio.
1372
+ */
1373
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1374
+ /**
1375
+ * 16:9 aspect ratio.
1376
+ */
1377
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1378
+ /**
1379
+ * 21:9 aspect ratio.
1380
+ */
1381
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1382
+ /**
1383
+ * 1:8 aspect ratio.
1384
+ */
1385
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1386
+ /**
1387
+ * 8:1 aspect ratio.
1388
+ */
1389
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1390
+ /**
1391
+ * 1:4 aspect ratio.
1392
+ */
1393
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1394
+ /**
1395
+ * 4:1 aspect ratio.
1396
+ */
1397
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1398
+ })(AspectRatio || (AspectRatio = {}));
1399
+ /** The size of the image output. */
1400
+ var ImageSize;
1401
+ (function (ImageSize) {
1402
+ /**
1403
+ * Default value. This value is unused.
1404
+ */
1405
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1406
+ /**
1407
+ * 512px image size.
1408
+ */
1409
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1410
+ /**
1411
+ * 1K image size.
1412
+ */
1413
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1414
+ /**
1415
+ * 2K image size.
1416
+ */
1417
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1418
+ /**
1419
+ * 4K image size.
1420
+ */
1421
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1422
+ })(ImageSize || (ImageSize = {}));
1283
1423
  /** Tuning mode. This enum is not supported in Gemini API. */
1284
1424
  var TuningMode;
1285
1425
  (function (TuningMode) {
@@ -1328,6 +1468,58 @@ var AdapterSize;
1328
1468
  */
1329
1469
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1330
1470
  })(AdapterSize || (AdapterSize = {}));
1471
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1472
+ var ResponseParseType;
1473
+ (function (ResponseParseType) {
1474
+ /**
1475
+ * Default value. Fallback to IDENTITY
1476
+ */
1477
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1478
+ /**
1479
+ * Returns the sample response as is.
1480
+ */
1481
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1482
+ /**
1483
+ * 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.
1484
+ */
1485
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1486
+ })(ResponseParseType || (ResponseParseType = {}));
1487
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1488
+ var MatchOperation;
1489
+ (function (MatchOperation) {
1490
+ /**
1491
+ * Default value. A user error will be returned if not set.
1492
+ */
1493
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1494
+ /**
1495
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1496
+ */
1497
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1498
+ /**
1499
+ * The match operation returns `true` if expression is a substring of the target.
1500
+ */
1501
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1502
+ /**
1503
+ * The match operation returns `true` expression is an exact match of the target.
1504
+ */
1505
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1506
+ })(MatchOperation || (MatchOperation = {}));
1507
+ /** Represents how much to think for the tuning job. */
1508
+ var ReinforcementTuningThinkingLevel;
1509
+ (function (ReinforcementTuningThinkingLevel) {
1510
+ /**
1511
+ * Unspecified thinking level.
1512
+ */
1513
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1514
+ /**
1515
+ * Little to no thinking.
1516
+ */
1517
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1518
+ /**
1519
+ * High thinking level.
1520
+ */
1521
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1522
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1331
1523
  /** Job state. */
1332
1524
  var JobState;
1333
1525
  (function (JobState) {
@@ -1812,58 +2004,6 @@ var ImageResizeMode;
1812
2004
  */
1813
2005
  ImageResizeMode["PAD"] = "PAD";
1814
2006
  })(ImageResizeMode || (ImageResizeMode = {}));
1815
- /** Defines how to parse sample response. */
1816
- var ResponseParseType;
1817
- (function (ResponseParseType) {
1818
- /**
1819
- * Default value. This value is unused.
1820
- */
1821
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1822
- /**
1823
- * Use the sample response as is.
1824
- */
1825
- ResponseParseType["IDENTITY"] = "IDENTITY";
1826
- /**
1827
- * Use regex to extract the important part of sample response.
1828
- */
1829
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1830
- })(ResponseParseType || (ResponseParseType = {}));
1831
- /** Match operation to use for evaluation. */
1832
- var MatchOperation;
1833
- (function (MatchOperation) {
1834
- /**
1835
- * Default value. This value is unused.
1836
- */
1837
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1838
- /**
1839
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1840
- */
1841
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1842
- /**
1843
- * `expression` is a substring of target.
1844
- */
1845
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1846
- /**
1847
- * `expression` is an exact match of target.
1848
- */
1849
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1850
- })(MatchOperation || (MatchOperation = {}));
1851
- /** Represents how much to think for the tuning job. */
1852
- var ReinforcementTuningThinkingLevel;
1853
- (function (ReinforcementTuningThinkingLevel) {
1854
- /**
1855
- * Unspecified thinking level.
1856
- */
1857
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1858
- /**
1859
- * Little to no thinking.
1860
- */
1861
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1862
- /**
1863
- * High thinking level.
1864
- */
1865
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1866
- })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1867
2007
  /** Enum representing the tuning method. */
1868
2008
  var TuningMethod;
1869
2009
  (function (TuningMethod) {
@@ -2660,6 +2800,21 @@ class ListModelsResponse {
2660
2800
  }
2661
2801
  class DeleteModelResponse {
2662
2802
  }
2803
+ /** Configuration for audio-specific output formatting. */
2804
+ class AudioResponseFormat {
2805
+ }
2806
+ /** Configuration for image-specific output formatting. */
2807
+ class ImageResponseFormat {
2808
+ }
2809
+ /** Configuration for text-specific output formatting. */
2810
+ class TextResponseFormat {
2811
+ }
2812
+ /** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
2813
+ class VideoResponseFormat {
2814
+ }
2815
+ /** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
2816
+ class ResponseFormat {
2817
+ }
2663
2818
  /** Response for counting tokens. */
2664
2819
  class CountTokensResponse {
2665
2820
  }
@@ -2688,10 +2843,10 @@ class GenerateVideosOperation {
2688
2843
  return operation;
2689
2844
  }
2690
2845
  }
2691
- /** Defines how to parse sample response for reinforcement tuning. */
2846
+ /** 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. */
2692
2847
  class ReinforcementTuningParseResponseConfig {
2693
2848
  }
2694
- /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
2849
+ /** 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. */
2695
2850
  class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
2696
2851
  }
2697
2852
  /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
@@ -5131,6 +5286,9 @@ function toolToMldev$4(fromObject) {
5131
5286
  }
5132
5287
  setValueByPath(toObject, ['mcpServers'], transformedList);
5133
5288
  }
5289
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
5290
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5291
+ }
5134
5292
  return toObject;
5135
5293
  }
5136
5294
  function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
@@ -5913,6 +6071,29 @@ function codeExecutionResultToVertex$3(fromObject) {
5913
6071
  }
5914
6072
  return toObject;
5915
6073
  }
6074
+ function computerUseToVertex$2(fromObject) {
6075
+ const toObject = {};
6076
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
6077
+ if (fromEnvironment != null) {
6078
+ setValueByPath(toObject, ['environment'], fromEnvironment);
6079
+ }
6080
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
6081
+ 'excludedPredefinedFunctions',
6082
+ ]);
6083
+ if (fromExcludedPredefinedFunctions != null) {
6084
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
6085
+ }
6086
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
6087
+ 'enablePromptInjectionDetection',
6088
+ ]);
6089
+ if (fromEnablePromptInjectionDetection != null) {
6090
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
6091
+ }
6092
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
6093
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
6094
+ }
6095
+ return toObject;
6096
+ }
5916
6097
  function contentToMldev$3(fromObject) {
5917
6098
  const toObject = {};
5918
6099
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -6578,6 +6759,9 @@ function toolToMldev$3(fromObject) {
6578
6759
  }
6579
6760
  setValueByPath(toObject, ['mcpServers'], transformedList);
6580
6761
  }
6762
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
6763
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6764
+ }
6581
6765
  return toObject;
6582
6766
  }
6583
6767
  function toolToVertex$2(fromObject) {
@@ -6588,7 +6772,7 @@ function toolToVertex$2(fromObject) {
6588
6772
  }
6589
6773
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
6590
6774
  if (fromComputerUse != null) {
6591
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
6775
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex$2(fromComputerUse));
6592
6776
  }
6593
6777
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
6594
6778
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -6651,6 +6835,10 @@ function toolToVertex$2(fromObject) {
6651
6835
  }
6652
6836
  setValueByPath(toObject, ['mcpServers'], transformedList);
6653
6837
  }
6838
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
6839
+ if (fromExaAiSearch != null) {
6840
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
6841
+ }
6654
6842
  return toObject;
6655
6843
  }
6656
6844
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -7739,7 +7927,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7739
7927
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7740
7928
  const USER_AGENT_HEADER = 'User-Agent';
7741
7929
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7742
- const SDK_VERSION = '2.9.0'; // x-release-please-version
7930
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
7743
7931
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7744
7932
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7745
7933
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -8748,7 +8936,7 @@ class Files extends BaseModule {
8748
8936
  * file extension.
8749
8937
  * - For Blob object inputs, the `mimeType` will be set to the Blob's `type`
8750
8938
  * property.
8751
- * Somex eamples for file extension to mimeType mapping:
8939
+ * Some examples for file extension to mimeType mapping:
8752
8940
  * .txt -> text/plain
8753
8941
  * .json -> application/json
8754
8942
  * .jpg -> image/jpeg
@@ -9604,17 +9792,14 @@ function env() {
9604
9792
  * Populates global parameters with environment variables.
9605
9793
  */
9606
9794
  function fillGlobals(options) {
9607
- var _a, _b, _c;
9795
+ var _a, _b;
9608
9796
  const clone = Object.assign({}, options);
9609
9797
  const envVars = env();
9610
9798
  if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
9611
9799
  (_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
9612
9800
  }
9613
- if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
9614
- (_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
9615
- }
9616
9801
  if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
9617
- (_c = clone.user_project) !== null && _c !== void 0 ? _c : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
9802
+ (_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
9618
9803
  }
9619
9804
  return clone;
9620
9805
  }
@@ -9626,7 +9811,6 @@ function fillGlobals(options) {
9626
9811
  *
9627
9812
  * g3-prettier-ignore-file
9628
9813
  */
9629
- const GOOGLE_GENAI_API_REVISION = "2026-05-20";
9630
9814
  class GoogleGenAISecurityProvider {
9631
9815
  constructor(options) {
9632
9816
  this.options = options;
@@ -9644,7 +9828,6 @@ class GoogleGenAIAuthHook {
9644
9828
  }
9645
9829
  async beforeRequest(hookCtx, request) {
9646
9830
  applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
9647
- applyApiRevision(hookCtx, request.headers);
9648
9831
  applyUserProject(hookCtx, request.headers);
9649
9832
  if (hasAuthHeaders(request.headers)) {
9650
9833
  return request;
@@ -9724,12 +9907,6 @@ function applyDefaultHeaders(target, source) {
9724
9907
  }
9725
9908
  }
9726
9909
  }
9727
- function applyApiRevision(hookCtx, headers) {
9728
- var _a;
9729
- if (headers.get("api-revision") === null) {
9730
- headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
9731
- }
9732
- }
9733
9910
  function applyUserProject(hookCtx, headers) {
9734
9911
  if (hookCtx.options.user_project !== undefined &&
9735
9912
  headers.get("x-goog-user-project") === null) {
@@ -10261,7 +10438,7 @@ function serverURLFromOptions(options) {
10261
10438
  return new URL(u);
10262
10439
  }
10263
10440
  const SDK_METADATA = {
10264
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai",
10441
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
10265
10442
  };
10266
10443
 
10267
10444
  /**
@@ -13995,6 +14172,29 @@ function codeExecutionResultToVertex$2(fromObject) {
13995
14172
  }
13996
14173
  return toObject;
13997
14174
  }
14175
+ function computerUseToVertex$1(fromObject) {
14176
+ const toObject = {};
14177
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
14178
+ if (fromEnvironment != null) {
14179
+ setValueByPath(toObject, ['environment'], fromEnvironment);
14180
+ }
14181
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
14182
+ 'excludedPredefinedFunctions',
14183
+ ]);
14184
+ if (fromExcludedPredefinedFunctions != null) {
14185
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
14186
+ }
14187
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
14188
+ 'enablePromptInjectionDetection',
14189
+ ]);
14190
+ if (fromEnablePromptInjectionDetection != null) {
14191
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
14192
+ }
14193
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
14194
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14195
+ }
14196
+ return toObject;
14197
+ }
13998
14198
  function contentToMldev$2(fromObject) {
13999
14199
  const toObject = {};
14000
14200
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -14179,7 +14379,7 @@ function generationConfigToVertex$1(fromObject) {
14179
14379
  }
14180
14380
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14181
14381
  if (fromSpeechConfig != null) {
14182
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
14382
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
14183
14383
  }
14184
14384
  const fromStopSequences = getValueByPath(fromObject, [
14185
14385
  'stopSequences',
@@ -14209,6 +14409,21 @@ function generationConfigToVertex$1(fromObject) {
14209
14409
  undefined) {
14210
14410
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14211
14411
  }
14412
+ const fromResponseFormat = getValueByPath(fromObject, [
14413
+ 'responseFormat',
14414
+ ]);
14415
+ if (fromResponseFormat != null) {
14416
+ let transformedList = fromResponseFormat;
14417
+ if (Array.isArray(transformedList)) {
14418
+ transformedList = transformedList.map((item) => {
14419
+ return item;
14420
+ });
14421
+ }
14422
+ setValueByPath(toObject, ['responseFormat'], transformedList);
14423
+ }
14424
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
14425
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
14426
+ }
14212
14427
  return toObject;
14213
14428
  }
14214
14429
  function googleMapsToMldev$2(fromObject) {
@@ -14422,7 +14637,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
14422
14637
  }
14423
14638
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14424
14639
  if (parentObject !== undefined && fromSpeechConfig != null) {
14425
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
14640
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
14426
14641
  }
14427
14642
  const fromThinkingConfig = getValueByPath(fromObject, [
14428
14643
  'thinkingConfig',
@@ -14711,6 +14926,22 @@ function mcpServerToVertex$1(fromObject) {
14711
14926
  }
14712
14927
  return toObject;
14713
14928
  }
14929
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
14930
+ const toObject = {};
14931
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
14932
+ 'speakerVoiceConfigs',
14933
+ ]);
14934
+ if (fromSpeakerVoiceConfigs != null) {
14935
+ let transformedList = fromSpeakerVoiceConfigs;
14936
+ if (Array.isArray(transformedList)) {
14937
+ transformedList = transformedList.map((item) => {
14938
+ return speakerVoiceConfigToVertex$1(item);
14939
+ });
14940
+ }
14941
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
14942
+ }
14943
+ return toObject;
14944
+ }
14714
14945
  function partToMldev$2(fromObject) {
14715
14946
  const toObject = {};
14716
14947
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -14852,6 +15083,26 @@ function partToVertex$2(fromObject) {
14852
15083
  }
14853
15084
  return toObject;
14854
15085
  }
15086
+ function replicatedVoiceConfigToVertex$1(fromObject) {
15087
+ const toObject = {};
15088
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
15089
+ if (fromMimeType != null) {
15090
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
15091
+ }
15092
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
15093
+ 'voiceSampleAudio',
15094
+ ]);
15095
+ if (fromVoiceSampleAudio != null) {
15096
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
15097
+ }
15098
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
15099
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
15100
+ }
15101
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
15102
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
15103
+ }
15104
+ return toObject;
15105
+ }
14855
15106
  function safetySettingToMldev$2(fromObject) {
14856
15107
  const toObject = {};
14857
15108
  const fromCategory = getValueByPath(fromObject, ['category']);
@@ -14878,6 +15129,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
14878
15129
  }
14879
15130
  return toObject;
14880
15131
  }
15132
+ function speakerVoiceConfigToVertex$1(fromObject) {
15133
+ const toObject = {};
15134
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
15135
+ if (fromSpeaker != null) {
15136
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
15137
+ }
15138
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15139
+ if (fromVoiceConfig != null) {
15140
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
15141
+ }
15142
+ return toObject;
15143
+ }
15144
+ function speechConfigToVertex$1(fromObject) {
15145
+ const toObject = {};
15146
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
15147
+ if (fromVoiceConfig != null) {
15148
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
15149
+ }
15150
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
15151
+ if (fromLanguageCode != null) {
15152
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
15153
+ }
15154
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
15155
+ 'multiSpeakerVoiceConfig',
15156
+ ]);
15157
+ if (fromMultiSpeakerVoiceConfig != null) {
15158
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
15159
+ }
15160
+ return toObject;
15161
+ }
14881
15162
  function toolToMldev$2(fromObject) {
14882
15163
  const toObject = {};
14883
15164
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -14943,6 +15224,9 @@ function toolToMldev$2(fromObject) {
14943
15224
  }
14944
15225
  setValueByPath(toObject, ['mcpServers'], transformedList);
14945
15226
  }
15227
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
15228
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
15229
+ }
14946
15230
  return toObject;
14947
15231
  }
14948
15232
  function toolToVertex$1(fromObject) {
@@ -14953,7 +15237,7 @@ function toolToVertex$1(fromObject) {
14953
15237
  }
14954
15238
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
14955
15239
  if (fromComputerUse != null) {
14956
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
15240
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex$1(fromComputerUse));
14957
15241
  }
14958
15242
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
14959
15243
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -15016,6 +15300,10 @@ function toolToVertex$1(fromObject) {
15016
15300
  }
15017
15301
  setValueByPath(toObject, ['mcpServers'], transformedList);
15018
15302
  }
15303
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
15304
+ if (fromExaAiSearch != null) {
15305
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
15306
+ }
15019
15307
  return toObject;
15020
15308
  }
15021
15309
  function usageMetadataFromVertex(fromObject) {
@@ -15122,6 +15410,22 @@ function voiceActivityFromVertex(fromObject) {
15122
15410
  }
15123
15411
  return toObject;
15124
15412
  }
15413
+ function voiceConfigToVertex$1(fromObject) {
15414
+ const toObject = {};
15415
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
15416
+ 'replicatedVoiceConfig',
15417
+ ]);
15418
+ if (fromReplicatedVoiceConfig != null) {
15419
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
15420
+ }
15421
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
15422
+ 'prebuiltVoiceConfig',
15423
+ ]);
15424
+ if (fromPrebuiltVoiceConfig != null) {
15425
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
15426
+ }
15427
+ return toObject;
15428
+ }
15125
15429
 
15126
15430
  /**
15127
15431
  * @license
@@ -15297,6 +15601,29 @@ function computeTokensResponseFromVertex(fromObject, _rootObject) {
15297
15601
  }
15298
15602
  return toObject;
15299
15603
  }
15604
+ function computerUseToVertex(fromObject, _rootObject) {
15605
+ const toObject = {};
15606
+ const fromEnvironment = getValueByPath(fromObject, ['environment']);
15607
+ if (fromEnvironment != null) {
15608
+ setValueByPath(toObject, ['environment'], fromEnvironment);
15609
+ }
15610
+ const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
15611
+ 'excludedPredefinedFunctions',
15612
+ ]);
15613
+ if (fromExcludedPredefinedFunctions != null) {
15614
+ setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
15615
+ }
15616
+ const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
15617
+ 'enablePromptInjectionDetection',
15618
+ ]);
15619
+ if (fromEnablePromptInjectionDetection != null) {
15620
+ setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
15621
+ }
15622
+ if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
15623
+ throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
15624
+ }
15625
+ return toObject;
15626
+ }
15300
15627
  function contentEmbeddingFromVertex(fromObject, rootObject) {
15301
15628
  const toObject = {};
15302
15629
  const fromValues = getValueByPath(fromObject, ['values']);
@@ -16352,7 +16679,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
16352
16679
  }
16353
16680
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
16354
16681
  if (fromSpeechConfig != null) {
16355
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
16682
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
16356
16683
  }
16357
16684
  const fromAudioTimestamp = getValueByPath(fromObject, [
16358
16685
  'audioTimestamp',
@@ -17239,7 +17566,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
17239
17566
  }
17240
17567
  return toObject;
17241
17568
  }
17242
- function generationConfigToVertex(fromObject, _rootObject) {
17569
+ function generationConfigToVertex(fromObject, rootObject) {
17243
17570
  const toObject = {};
17244
17571
  const fromModelSelectionConfig = getValueByPath(fromObject, [
17245
17572
  'modelSelectionConfig',
@@ -17335,7 +17662,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
17335
17662
  }
17336
17663
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
17337
17664
  if (fromSpeechConfig != null) {
17338
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
17665
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
17339
17666
  }
17340
17667
  const fromStopSequences = getValueByPath(fromObject, [
17341
17668
  'stopSequences',
@@ -17365,6 +17692,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
17365
17692
  undefined) {
17366
17693
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
17367
17694
  }
17695
+ const fromResponseFormat = getValueByPath(fromObject, [
17696
+ 'responseFormat',
17697
+ ]);
17698
+ if (fromResponseFormat != null) {
17699
+ let transformedList = fromResponseFormat;
17700
+ if (Array.isArray(transformedList)) {
17701
+ transformedList = transformedList.map((item) => {
17702
+ return item;
17703
+ });
17704
+ }
17705
+ setValueByPath(toObject, ['responseFormat'], transformedList);
17706
+ }
17707
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
17708
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
17709
+ }
17368
17710
  return toObject;
17369
17711
  }
17370
17712
  function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
@@ -17802,6 +18144,22 @@ function modelFromVertex(fromObject, rootObject) {
17802
18144
  }
17803
18145
  return toObject;
17804
18146
  }
18147
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
18148
+ const toObject = {};
18149
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
18150
+ 'speakerVoiceConfigs',
18151
+ ]);
18152
+ if (fromSpeakerVoiceConfigs != null) {
18153
+ let transformedList = fromSpeakerVoiceConfigs;
18154
+ if (Array.isArray(transformedList)) {
18155
+ transformedList = transformedList.map((item) => {
18156
+ return speakerVoiceConfigToVertex(item);
18157
+ });
18158
+ }
18159
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
18160
+ }
18161
+ return toObject;
18162
+ }
17805
18163
  function partToMldev$1(fromObject, rootObject) {
17806
18164
  const toObject = {};
17807
18165
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -18111,6 +18469,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
18111
18469
  }
18112
18470
  return toObject;
18113
18471
  }
18472
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
18473
+ const toObject = {};
18474
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
18475
+ if (fromMimeType != null) {
18476
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
18477
+ }
18478
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
18479
+ 'voiceSampleAudio',
18480
+ ]);
18481
+ if (fromVoiceSampleAudio != null) {
18482
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
18483
+ }
18484
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
18485
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
18486
+ }
18487
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
18488
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
18489
+ }
18490
+ return toObject;
18491
+ }
18114
18492
  function safetyAttributesFromMldev(fromObject, _rootObject) {
18115
18493
  const toObject = {};
18116
18494
  const fromCategories = getValueByPath(fromObject, [
@@ -18260,6 +18638,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
18260
18638
  }
18261
18639
  return toObject;
18262
18640
  }
18641
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
18642
+ const toObject = {};
18643
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
18644
+ if (fromSpeaker != null) {
18645
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
18646
+ }
18647
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
18648
+ if (fromVoiceConfig != null) {
18649
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
18650
+ }
18651
+ return toObject;
18652
+ }
18653
+ function speechConfigToVertex(fromObject, rootObject) {
18654
+ const toObject = {};
18655
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
18656
+ if (fromVoiceConfig != null) {
18657
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
18658
+ }
18659
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
18660
+ if (fromLanguageCode != null) {
18661
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
18662
+ }
18663
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
18664
+ 'multiSpeakerVoiceConfig',
18665
+ ]);
18666
+ if (fromMultiSpeakerVoiceConfig != null) {
18667
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
18668
+ }
18669
+ return toObject;
18670
+ }
18263
18671
  function toolConfigToMldev(fromObject, rootObject) {
18264
18672
  const toObject = {};
18265
18673
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -18365,6 +18773,9 @@ function toolToMldev$1(fromObject, rootObject) {
18365
18773
  }
18366
18774
  setValueByPath(toObject, ['mcpServers'], transformedList);
18367
18775
  }
18776
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
18777
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
18778
+ }
18368
18779
  return toObject;
18369
18780
  }
18370
18781
  function toolToVertex(fromObject, rootObject) {
@@ -18375,7 +18786,7 @@ function toolToVertex(fromObject, rootObject) {
18375
18786
  }
18376
18787
  const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
18377
18788
  if (fromComputerUse != null) {
18378
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
18789
+ setValueByPath(toObject, ['computerUse'], computerUseToVertex(fromComputerUse));
18379
18790
  }
18380
18791
  if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
18381
18792
  throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
@@ -18438,6 +18849,10 @@ function toolToVertex(fromObject, rootObject) {
18438
18849
  }
18439
18850
  setValueByPath(toObject, ['mcpServers'], transformedList);
18440
18851
  }
18852
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
18853
+ if (fromExaAiSearch != null) {
18854
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
18855
+ }
18441
18856
  return toObject;
18442
18857
  }
18443
18858
  function tunedModelInfoFromMldev(fromObject, _rootObject) {
@@ -18749,6 +19164,22 @@ function videoToVertex(fromObject, _rootObject) {
18749
19164
  }
18750
19165
  return toObject;
18751
19166
  }
19167
+ function voiceConfigToVertex(fromObject, rootObject) {
19168
+ const toObject = {};
19169
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
19170
+ 'replicatedVoiceConfig',
19171
+ ]);
19172
+ if (fromReplicatedVoiceConfig != null) {
19173
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
19174
+ }
19175
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
19176
+ 'prebuiltVoiceConfig',
19177
+ ]);
19178
+ if (fromPrebuiltVoiceConfig != null) {
19179
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
19180
+ }
19181
+ return toObject;
19182
+ }
18752
19183
 
18753
19184
  /**
18754
19185
  * @license
@@ -19311,10 +19742,27 @@ class Live {
19311
19742
  onopenResolve({});
19312
19743
  };
19313
19744
  const apiClient = this.apiClient;
19745
+ let sessionResolved = false;
19746
+ const messageQueue = [];
19747
+ let setupCompleteResolve = () => { };
19748
+ const setupCompletePromise = new Promise((resolve) => {
19749
+ setupCompleteResolve = resolve;
19750
+ });
19314
19751
  const websocketCallbacks = {
19315
19752
  onopen: onopenAwaitedCallback,
19316
19753
  onmessage: (event) => {
19317
- void handleWebSocketMessage(apiClient, callbacks.onmessage, event);
19754
+ void handleWebSocketMessage(apiClient, (msg) => {
19755
+ if (msg.setupComplete && !session.setupComplete) {
19756
+ session.setupComplete = msg.setupComplete;
19757
+ setupCompleteResolve({});
19758
+ }
19759
+ if (sessionResolved) {
19760
+ callbacks.onmessage(msg);
19761
+ }
19762
+ else {
19763
+ messageQueue.push(msg);
19764
+ }
19765
+ }, event);
19318
19766
  },
19319
19767
  onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
19320
19768
  },
@@ -19376,8 +19824,14 @@ class Live {
19376
19824
  clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
19377
19825
  }
19378
19826
  delete clientMessage['config'];
19827
+ const session = new Session(conn, this.apiClient);
19379
19828
  conn.send(JSON.stringify(clientMessage));
19380
- return new Session(conn, this.apiClient);
19829
+ await setupCompletePromise;
19830
+ sessionResolved = true;
19831
+ for (const msg of messageQueue) {
19832
+ callbacks.onmessage(msg);
19833
+ }
19834
+ return session;
19381
19835
  }
19382
19836
  // TODO: b/416041229 - Abstract this method to a common place.
19383
19837
  isCallableTool(tool) {
@@ -19771,7 +20225,7 @@ class Models extends BaseModule {
19771
20225
  this.generateContent = async (params) => {
19772
20226
  var _a, _b, _c, _d, _e;
19773
20227
  const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
19774
- this.maybeMoveToResponseJsonSchem(params);
20228
+ this.maybeMoveToResponseJsonSchema(params);
19775
20229
  if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
19776
20230
  return await this.generateContentInternal(transformedParams);
19777
20231
  }
@@ -19863,7 +20317,7 @@ class Models extends BaseModule {
19863
20317
  */
19864
20318
  this.generateContentStream = async (params) => {
19865
20319
  var _a, _b, _c, _d, _e;
19866
- this.maybeMoveToResponseJsonSchem(params);
20320
+ this.maybeMoveToResponseJsonSchema(params);
19867
20321
  if (shouldDisableAfc(params.config)) {
19868
20322
  const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
19869
20323
  return await this.generateContentStreamInternal(transformedParams);
@@ -20088,7 +20542,7 @@ class Models extends BaseModule {
20088
20542
  * To maintain backward compatibility, we move the data that was treated as
20089
20543
  * JSON schema from the responseSchema field to the responseJsonSchema field.
20090
20544
  */
20091
- maybeMoveToResponseJsonSchem(params) {
20545
+ maybeMoveToResponseJsonSchema(params) {
20092
20546
  if (params.config && params.config.responseSchema) {
20093
20547
  if (!params.config.responseJsonSchema) {
20094
20548
  if (Object.keys(params.config.responseSchema).includes('$schema')) {
@@ -20190,7 +20644,7 @@ class Models extends BaseModule {
20190
20644
  throw new Error('Function call name was not returned by the model.');
20191
20645
  }
20192
20646
  if (!afcTools.has(part.functionCall.name)) {
20193
- 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}`);
20647
+ 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}`);
20194
20648
  }
20195
20649
  else {
20196
20650
  const responseParts = yield __await(afcTools
@@ -21906,6 +22360,9 @@ function toolToMldev(fromObject) {
21906
22360
  }
21907
22361
  setValueByPath(toObject, ['mcpServers'], transformedList);
21908
22362
  }
22363
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
22364
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
22365
+ }
21909
22366
  return toObject;
21910
22367
  }
21911
22368
 
@@ -23000,6 +23457,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
23000
23457
  if (fromTopP != null) {
23001
23458
  setValueByPath(toObject, ['topP'], fromTopP);
23002
23459
  }
23460
+ const fromResponseFormat = getValueByPath(fromObject, [
23461
+ 'responseFormat',
23462
+ ]);
23463
+ if (fromResponseFormat != null) {
23464
+ let transformedList = fromResponseFormat;
23465
+ if (Array.isArray(transformedList)) {
23466
+ transformedList = transformedList.map((item) => {
23467
+ return item;
23468
+ });
23469
+ }
23470
+ setValueByPath(toObject, ['responseFormat'], transformedList);
23471
+ }
23003
23472
  return toObject;
23004
23473
  }
23005
23474
  function getTuningJobParametersToMldev(fromObject, _rootObject) {
@@ -24123,5 +24592,5 @@ class GoogleGenAI {
24123
24592
  }
24124
24593
  }
24125
24594
 
24126
- 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 };
24595
+ 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 };
24127
24596
  //# sourceMappingURL=index.mjs.map