@google/genai 1.46.0 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -470,38 +470,18 @@ var Type;
470
470
  */
471
471
  Type["NULL"] = "NULL";
472
472
  })(Type || (Type = {}));
473
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
474
- var PhishBlockThreshold;
475
- (function (PhishBlockThreshold) {
476
- /**
477
- * Defaults to unspecified.
478
- */
479
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
480
- /**
481
- * Blocks Low and above confidence URL that is risky.
482
- */
483
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
484
- /**
485
- * Blocks Medium and above confidence URL that is risky.
486
- */
487
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
488
- /**
489
- * Blocks High and above confidence URL that is risky.
490
- */
491
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
492
- /**
493
- * Blocks Higher and above confidence URL that is risky.
494
- */
495
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
473
+ /** The environment being operated. */
474
+ var Environment;
475
+ (function (Environment) {
496
476
  /**
497
- * Blocks Very high and above confidence URL that is risky.
477
+ * Defaults to browser.
498
478
  */
499
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
479
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
500
480
  /**
501
- * Blocks Extremely high confidence URL that is risky.
481
+ * Operates in a web browser.
502
482
  */
503
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
504
- })(PhishBlockThreshold || (PhishBlockThreshold = {}));
483
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
484
+ })(Environment || (Environment = {}));
505
485
  /** Type of auth scheme. This enum is not supported in Gemini API. */
506
486
  var AuthType;
507
487
  (function (AuthType) {
@@ -572,6 +552,38 @@ var ApiSpec;
572
552
  */
573
553
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
574
554
  })(ApiSpec || (ApiSpec = {}));
555
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
556
+ var PhishBlockThreshold;
557
+ (function (PhishBlockThreshold) {
558
+ /**
559
+ * Defaults to unspecified.
560
+ */
561
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
562
+ /**
563
+ * Blocks Low and above confidence URL that is risky.
564
+ */
565
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
566
+ /**
567
+ * Blocks Medium and above confidence URL that is risky.
568
+ */
569
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
570
+ /**
571
+ * Blocks High and above confidence URL that is risky.
572
+ */
573
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
574
+ /**
575
+ * Blocks Higher and above confidence URL that is risky.
576
+ */
577
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
578
+ /**
579
+ * Blocks Very high and above confidence URL that is risky.
580
+ */
581
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
582
+ /**
583
+ * Blocks Extremely high confidence URL that is risky.
584
+ */
585
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
586
+ })(PhishBlockThreshold || (PhishBlockThreshold = {}));
575
587
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
576
588
  var Behavior;
577
589
  (function (Behavior) {
@@ -631,6 +643,10 @@ var ThinkingLevel;
631
643
  * Unspecified thinking level.
632
644
  */
633
645
  ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
646
+ /**
647
+ * MINIMAL thinking level.
648
+ */
649
+ ThinkingLevel["MINIMAL"] = "MINIMAL";
634
650
  /**
635
651
  * Low thinking level.
636
652
  */
@@ -643,10 +659,6 @@ var ThinkingLevel;
643
659
  * High thinking level.
644
660
  */
645
661
  ThinkingLevel["HIGH"] = "HIGH";
646
- /**
647
- * MINIMAL thinking level.
648
- */
649
- ThinkingLevel["MINIMAL"] = "MINIMAL";
650
662
  })(ThinkingLevel || (ThinkingLevel = {}));
651
663
  /** Enum that controls the generation of people. */
652
664
  var PersonGeneration;
@@ -664,6 +676,22 @@ var PersonGeneration;
664
676
  */
665
677
  PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
666
678
  })(PersonGeneration || (PersonGeneration = {}));
679
+ /** Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This enum is not supported in Gemini API. */
680
+ var ProminentPeople;
681
+ (function (ProminentPeople) {
682
+ /**
683
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
684
+ */
685
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
686
+ /**
687
+ * Allows the model to generate images of prominent people.
688
+ */
689
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
690
+ /**
691
+ * Prevents the model from generating images of prominent people.
692
+ */
693
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
694
+ })(ProminentPeople || (ProminentPeople = {}));
667
695
  /** The harm category to be blocked. */
668
696
  var HarmCategory;
669
697
  (function (HarmCategory) {
@@ -982,6 +1010,42 @@ var Modality;
982
1010
  */
983
1011
  Modality["AUDIO"] = "AUDIO";
984
1012
  })(Modality || (Modality = {}));
1013
+ /** The stage of the underlying model. This enum is not supported in Vertex AI. */
1014
+ var ModelStage;
1015
+ (function (ModelStage) {
1016
+ /**
1017
+ * Unspecified model stage.
1018
+ */
1019
+ ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
1020
+ /**
1021
+ * The underlying model is subject to lots of tunings.
1022
+ */
1023
+ ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
1024
+ /**
1025
+ * Models in this stage are for experimental purposes only.
1026
+ */
1027
+ ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
1028
+ /**
1029
+ * Models in this stage are more mature than experimental models.
1030
+ */
1031
+ ModelStage["PREVIEW"] = "PREVIEW";
1032
+ /**
1033
+ * Models in this stage are considered stable and ready for production use.
1034
+ */
1035
+ ModelStage["STABLE"] = "STABLE";
1036
+ /**
1037
+ * If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model.
1038
+ */
1039
+ ModelStage["LEGACY"] = "LEGACY";
1040
+ /**
1041
+ * Models in this stage are deprecated. These models cannot be used.
1042
+ */
1043
+ ModelStage["DEPRECATED"] = "DEPRECATED";
1044
+ /**
1045
+ * Models in this stage are retired. These models cannot be used.
1046
+ */
1047
+ ModelStage["RETIRED"] = "RETIRED";
1048
+ })(ModelStage || (ModelStage = {}));
985
1049
  /** The media resolution to use. */
986
1050
  var MediaResolution;
987
1051
  (function (MediaResolution) {
@@ -1218,6 +1282,26 @@ var TuningTask;
1218
1282
  */
1219
1283
  TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
1220
1284
  })(TuningTask || (TuningTask = {}));
1285
+ /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
1286
+ var DocumentState;
1287
+ (function (DocumentState) {
1288
+ /**
1289
+ * The default value. This value is used if the state is omitted.
1290
+ */
1291
+ DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1292
+ /**
1293
+ * Some `Chunks` of the `Document` are being processed (embedding and vector storage).
1294
+ */
1295
+ DocumentState["STATE_PENDING"] = "STATE_PENDING";
1296
+ /**
1297
+ * All `Chunks` of the `Document` is processed and available for querying.
1298
+ */
1299
+ DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1300
+ /**
1301
+ * Some `Chunks` of the `Document` failed processing.
1302
+ */
1303
+ DocumentState["STATE_FAILED"] = "STATE_FAILED";
1304
+ })(DocumentState || (DocumentState = {}));
1221
1305
  /** The tokenization quality used for given media. */
1222
1306
  var PartMediaResolutionLevel;
1223
1307
  (function (PartMediaResolutionLevel) {
@@ -1282,42 +1366,34 @@ var ResourceScope;
1282
1366
  */
1283
1367
  ResourceScope["COLLECTION"] = "COLLECTION";
1284
1368
  })(ResourceScope || (ResourceScope = {}));
1285
- /** Options for feature selection preference. */
1286
- var FeatureSelectionPreference;
1287
- (function (FeatureSelectionPreference) {
1288
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1289
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1290
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1291
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1292
- })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1293
- /** The environment being operated. */
1294
- var Environment;
1295
- (function (Environment) {
1369
+ /** Pricing and performance service tier. */
1370
+ var ServiceTier;
1371
+ (function (ServiceTier) {
1296
1372
  /**
1297
- * Defaults to browser.
1373
+ * Default service tier, which is standard.
1298
1374
  */
1299
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1375
+ ServiceTier["SERVICE_TIER_UNSPECIFIED"] = "SERVICE_TIER_UNSPECIFIED";
1300
1376
  /**
1301
- * Operates in a web browser.
1377
+ * Flex service tier.
1302
1378
  */
1303
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1304
- })(Environment || (Environment = {}));
1305
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1306
- var ProminentPeople;
1307
- (function (ProminentPeople) {
1308
- /**
1309
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1310
- */
1311
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1379
+ ServiceTier["SERVICE_TIER_FLEX"] = "SERVICE_TIER_FLEX";
1312
1380
  /**
1313
- * Allows the model to generate images of prominent people.
1381
+ * Standard service tier.
1314
1382
  */
1315
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1383
+ ServiceTier["SERVICE_TIER_STANDARD"] = "SERVICE_TIER_STANDARD";
1316
1384
  /**
1317
- * Prevents the model from generating images of prominent people.
1385
+ * Priority service tier.
1318
1386
  */
1319
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1320
- })(ProminentPeople || (ProminentPeople = {}));
1387
+ ServiceTier["SERVICE_TIER_PRIORITY"] = "SERVICE_TIER_PRIORITY";
1388
+ })(ServiceTier || (ServiceTier = {}));
1389
+ /** Options for feature selection preference. */
1390
+ var FeatureSelectionPreference;
1391
+ (function (FeatureSelectionPreference) {
1392
+ FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1393
+ FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1394
+ FeatureSelectionPreference["BALANCED"] = "BALANCED";
1395
+ FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1396
+ })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1321
1397
  /** Enum representing the Vertex embedding API to use. */
1322
1398
  var EmbeddingApiType;
1323
1399
  (function (EmbeddingApiType) {
@@ -1492,14 +1568,6 @@ var TuningMethod;
1492
1568
  */
1493
1569
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1494
1570
  })(TuningMethod || (TuningMethod = {}));
1495
- /** State for the lifecycle of a Document. */
1496
- var DocumentState;
1497
- (function (DocumentState) {
1498
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1499
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1500
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1501
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1502
- })(DocumentState || (DocumentState = {}));
1503
1571
  /** State for the lifecycle of a File. */
1504
1572
  var FileState;
1505
1573
  (function (FileState) {
@@ -1659,6 +1727,10 @@ var TurnCoverage;
1659
1727
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1660
1728
  */
1661
1729
  TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
1730
+ /**
1731
+ * Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
1732
+ */
1733
+ TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
1662
1734
  })(TurnCoverage || (TurnCoverage = {}));
1663
1735
  /** Scale of the generated music. */
1664
1736
  var Scale;
@@ -1785,7 +1857,6 @@ class HttpResponse {
1785
1857
  class UploadToFileSearchStoreOperation {
1786
1858
  /**
1787
1859
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
1788
- * @internal
1789
1860
  */
1790
1861
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
1791
1862
  const operation = new UploadToFileSearchStoreOperation();
@@ -1805,7 +1876,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
1805
1876
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
1806
1877
  const USER_AGENT_HEADER = 'User-Agent';
1807
1878
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
1808
- const SDK_VERSION = '1.46.0'; // x-release-please-version
1879
+ const SDK_VERSION = '1.47.0'; // x-release-please-version
1809
1880
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
1810
1881
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
1811
1882
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -1865,6 +1936,11 @@ class ApiClient {
1865
1936
  // Vertex Express or global endpoint case.
1866
1937
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
1867
1938
  }
1939
+ else if (this.clientOptions.project &&
1940
+ this.clientOptions.location &&
1941
+ this.clientOptions.location === 'us') {
1942
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
1943
+ }
1868
1944
  else if (this.clientOptions.project && this.clientOptions.location) {
1869
1945
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
1870
1946
  }