@google/genai 1.46.0 → 1.48.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.
@@ -491,38 +491,18 @@ var Type;
491
491
  */
492
492
  Type["NULL"] = "NULL";
493
493
  })(Type || (Type = {}));
494
- /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
495
- var PhishBlockThreshold;
496
- (function (PhishBlockThreshold) {
497
- /**
498
- * Defaults to unspecified.
499
- */
500
- PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
501
- /**
502
- * Blocks Low and above confidence URL that is risky.
503
- */
504
- PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
505
- /**
506
- * Blocks Medium and above confidence URL that is risky.
507
- */
508
- PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
509
- /**
510
- * Blocks High and above confidence URL that is risky.
511
- */
512
- PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
513
- /**
514
- * Blocks Higher and above confidence URL that is risky.
515
- */
516
- PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
494
+ /** The environment being operated. */
495
+ var Environment;
496
+ (function (Environment) {
517
497
  /**
518
- * Blocks Very high and above confidence URL that is risky.
498
+ * Defaults to browser.
519
499
  */
520
- PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
500
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
521
501
  /**
522
- * Blocks Extremely high confidence URL that is risky.
502
+ * Operates in a web browser.
523
503
  */
524
- PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
525
- })(PhishBlockThreshold || (PhishBlockThreshold = {}));
504
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
505
+ })(Environment || (Environment = {}));
526
506
  /** Type of auth scheme. This enum is not supported in Gemini API. */
527
507
  var AuthType;
528
508
  (function (AuthType) {
@@ -593,6 +573,38 @@ var ApiSpec;
593
573
  */
594
574
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
595
575
  })(ApiSpec || (ApiSpec = {}));
576
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
577
+ var PhishBlockThreshold;
578
+ (function (PhishBlockThreshold) {
579
+ /**
580
+ * Defaults to unspecified.
581
+ */
582
+ PhishBlockThreshold["PHISH_BLOCK_THRESHOLD_UNSPECIFIED"] = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED";
583
+ /**
584
+ * Blocks Low and above confidence URL that is risky.
585
+ */
586
+ PhishBlockThreshold["BLOCK_LOW_AND_ABOVE"] = "BLOCK_LOW_AND_ABOVE";
587
+ /**
588
+ * Blocks Medium and above confidence URL that is risky.
589
+ */
590
+ PhishBlockThreshold["BLOCK_MEDIUM_AND_ABOVE"] = "BLOCK_MEDIUM_AND_ABOVE";
591
+ /**
592
+ * Blocks High and above confidence URL that is risky.
593
+ */
594
+ PhishBlockThreshold["BLOCK_HIGH_AND_ABOVE"] = "BLOCK_HIGH_AND_ABOVE";
595
+ /**
596
+ * Blocks Higher and above confidence URL that is risky.
597
+ */
598
+ PhishBlockThreshold["BLOCK_HIGHER_AND_ABOVE"] = "BLOCK_HIGHER_AND_ABOVE";
599
+ /**
600
+ * Blocks Very high and above confidence URL that is risky.
601
+ */
602
+ PhishBlockThreshold["BLOCK_VERY_HIGH_AND_ABOVE"] = "BLOCK_VERY_HIGH_AND_ABOVE";
603
+ /**
604
+ * Blocks Extremely high confidence URL that is risky.
605
+ */
606
+ PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
607
+ })(PhishBlockThreshold || (PhishBlockThreshold = {}));
596
608
  /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
597
609
  var Behavior;
598
610
  (function (Behavior) {
@@ -652,6 +664,10 @@ var ThinkingLevel;
652
664
  * Unspecified thinking level.
653
665
  */
654
666
  ThinkingLevel["THINKING_LEVEL_UNSPECIFIED"] = "THINKING_LEVEL_UNSPECIFIED";
667
+ /**
668
+ * MINIMAL thinking level.
669
+ */
670
+ ThinkingLevel["MINIMAL"] = "MINIMAL";
655
671
  /**
656
672
  * Low thinking level.
657
673
  */
@@ -664,10 +680,6 @@ var ThinkingLevel;
664
680
  * High thinking level.
665
681
  */
666
682
  ThinkingLevel["HIGH"] = "HIGH";
667
- /**
668
- * MINIMAL thinking level.
669
- */
670
- ThinkingLevel["MINIMAL"] = "MINIMAL";
671
683
  })(ThinkingLevel || (ThinkingLevel = {}));
672
684
  /** Enum that controls the generation of people. */
673
685
  var PersonGeneration;
@@ -685,6 +697,22 @@ var PersonGeneration;
685
697
  */
686
698
  PersonGeneration["ALLOW_ALL"] = "ALLOW_ALL";
687
699
  })(PersonGeneration || (PersonGeneration = {}));
700
+ /** 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. */
701
+ var ProminentPeople;
702
+ (function (ProminentPeople) {
703
+ /**
704
+ * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
705
+ */
706
+ ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
707
+ /**
708
+ * Allows the model to generate images of prominent people.
709
+ */
710
+ ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
711
+ /**
712
+ * Prevents the model from generating images of prominent people.
713
+ */
714
+ ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
715
+ })(ProminentPeople || (ProminentPeople = {}));
688
716
  /** The harm category to be blocked. */
689
717
  var HarmCategory;
690
718
  (function (HarmCategory) {
@@ -1003,6 +1031,42 @@ var Modality;
1003
1031
  */
1004
1032
  Modality["AUDIO"] = "AUDIO";
1005
1033
  })(Modality || (Modality = {}));
1034
+ /** The stage of the underlying model. This enum is not supported in Vertex AI. */
1035
+ var ModelStage;
1036
+ (function (ModelStage) {
1037
+ /**
1038
+ * Unspecified model stage.
1039
+ */
1040
+ ModelStage["MODEL_STAGE_UNSPECIFIED"] = "MODEL_STAGE_UNSPECIFIED";
1041
+ /**
1042
+ * The underlying model is subject to lots of tunings.
1043
+ */
1044
+ ModelStage["UNSTABLE_EXPERIMENTAL"] = "UNSTABLE_EXPERIMENTAL";
1045
+ /**
1046
+ * Models in this stage are for experimental purposes only.
1047
+ */
1048
+ ModelStage["EXPERIMENTAL"] = "EXPERIMENTAL";
1049
+ /**
1050
+ * Models in this stage are more mature than experimental models.
1051
+ */
1052
+ ModelStage["PREVIEW"] = "PREVIEW";
1053
+ /**
1054
+ * Models in this stage are considered stable and ready for production use.
1055
+ */
1056
+ ModelStage["STABLE"] = "STABLE";
1057
+ /**
1058
+ * 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.
1059
+ */
1060
+ ModelStage["LEGACY"] = "LEGACY";
1061
+ /**
1062
+ * Models in this stage are deprecated. These models cannot be used.
1063
+ */
1064
+ ModelStage["DEPRECATED"] = "DEPRECATED";
1065
+ /**
1066
+ * Models in this stage are retired. These models cannot be used.
1067
+ */
1068
+ ModelStage["RETIRED"] = "RETIRED";
1069
+ })(ModelStage || (ModelStage = {}));
1006
1070
  /** The media resolution to use. */
1007
1071
  var MediaResolution;
1008
1072
  (function (MediaResolution) {
@@ -1239,6 +1303,26 @@ var TuningTask;
1239
1303
  */
1240
1304
  TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
1241
1305
  })(TuningTask || (TuningTask = {}));
1306
+ /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
1307
+ var DocumentState;
1308
+ (function (DocumentState) {
1309
+ /**
1310
+ * The default value. This value is used if the state is omitted.
1311
+ */
1312
+ DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1313
+ /**
1314
+ * Some `Chunks` of the `Document` are being processed (embedding and vector storage).
1315
+ */
1316
+ DocumentState["STATE_PENDING"] = "STATE_PENDING";
1317
+ /**
1318
+ * All `Chunks` of the `Document` is processed and available for querying.
1319
+ */
1320
+ DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1321
+ /**
1322
+ * Some `Chunks` of the `Document` failed processing.
1323
+ */
1324
+ DocumentState["STATE_FAILED"] = "STATE_FAILED";
1325
+ })(DocumentState || (DocumentState = {}));
1242
1326
  /** The tokenization quality used for given media. */
1243
1327
  var PartMediaResolutionLevel;
1244
1328
  (function (PartMediaResolutionLevel) {
@@ -1303,42 +1387,34 @@ var ResourceScope;
1303
1387
  */
1304
1388
  ResourceScope["COLLECTION"] = "COLLECTION";
1305
1389
  })(ResourceScope || (ResourceScope = {}));
1306
- /** Options for feature selection preference. */
1307
- var FeatureSelectionPreference;
1308
- (function (FeatureSelectionPreference) {
1309
- FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1310
- FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1311
- FeatureSelectionPreference["BALANCED"] = "BALANCED";
1312
- FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1313
- })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1314
- /** The environment being operated. */
1315
- var Environment;
1316
- (function (Environment) {
1390
+ /** Pricing and performance service tier. */
1391
+ var ServiceTier;
1392
+ (function (ServiceTier) {
1317
1393
  /**
1318
- * Defaults to browser.
1394
+ * Default service tier, which is standard.
1319
1395
  */
1320
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
1396
+ ServiceTier["UNSPECIFIED"] = "unspecified";
1321
1397
  /**
1322
- * Operates in a web browser.
1398
+ * Flex service tier.
1323
1399
  */
1324
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
1325
- })(Environment || (Environment = {}));
1326
- /** Enum for controlling whether the model can generate images of prominent people (celebrities). */
1327
- var ProminentPeople;
1328
- (function (ProminentPeople) {
1329
- /**
1330
- * Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
1331
- */
1332
- ProminentPeople["PROMINENT_PEOPLE_UNSPECIFIED"] = "PROMINENT_PEOPLE_UNSPECIFIED";
1400
+ ServiceTier["FLEX"] = "flex";
1333
1401
  /**
1334
- * Allows the model to generate images of prominent people.
1402
+ * Standard service tier.
1335
1403
  */
1336
- ProminentPeople["ALLOW_PROMINENT_PEOPLE"] = "ALLOW_PROMINENT_PEOPLE";
1404
+ ServiceTier["STANDARD"] = "standard";
1337
1405
  /**
1338
- * Prevents the model from generating images of prominent people.
1406
+ * Priority service tier.
1339
1407
  */
1340
- ProminentPeople["BLOCK_PROMINENT_PEOPLE"] = "BLOCK_PROMINENT_PEOPLE";
1341
- })(ProminentPeople || (ProminentPeople = {}));
1408
+ ServiceTier["PRIORITY"] = "priority";
1409
+ })(ServiceTier || (ServiceTier = {}));
1410
+ /** Options for feature selection preference. */
1411
+ var FeatureSelectionPreference;
1412
+ (function (FeatureSelectionPreference) {
1413
+ FeatureSelectionPreference["FEATURE_SELECTION_PREFERENCE_UNSPECIFIED"] = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED";
1414
+ FeatureSelectionPreference["PRIORITIZE_QUALITY"] = "PRIORITIZE_QUALITY";
1415
+ FeatureSelectionPreference["BALANCED"] = "BALANCED";
1416
+ FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
1417
+ })(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
1342
1418
  /** Enum representing the Vertex embedding API to use. */
1343
1419
  var EmbeddingApiType;
1344
1420
  (function (EmbeddingApiType) {
@@ -1513,14 +1589,6 @@ var TuningMethod;
1513
1589
  */
1514
1590
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1515
1591
  })(TuningMethod || (TuningMethod = {}));
1516
- /** State for the lifecycle of a Document. */
1517
- var DocumentState;
1518
- (function (DocumentState) {
1519
- DocumentState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
1520
- DocumentState["STATE_PENDING"] = "STATE_PENDING";
1521
- DocumentState["STATE_ACTIVE"] = "STATE_ACTIVE";
1522
- DocumentState["STATE_FAILED"] = "STATE_FAILED";
1523
- })(DocumentState || (DocumentState = {}));
1524
1592
  /** State for the lifecycle of a File. */
1525
1593
  var FileState;
1526
1594
  (function (FileState) {
@@ -1680,6 +1748,10 @@ var TurnCoverage;
1680
1748
  * The users turn includes all realtime input since the last turn, including inactivity (e.g. silence on the audio stream).
1681
1749
  */
1682
1750
  TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
1751
+ /**
1752
+ * Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.
1753
+ */
1754
+ TurnCoverage["TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"] = "TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO";
1683
1755
  })(TurnCoverage || (TurnCoverage = {}));
1684
1756
  /** Scale of the generated music. */
1685
1757
  var Scale;
@@ -1806,7 +1878,6 @@ class HttpResponse {
1806
1878
  class UploadToFileSearchStoreOperation {
1807
1879
  /**
1808
1880
  * Instantiates an Operation of the same type as the one being called with the fields set from the API response.
1809
- * @internal
1810
1881
  */
1811
1882
  _fromAPIResponse({ apiResponse, _isVertexAI, }) {
1812
1883
  const operation = new UploadToFileSearchStoreOperation();
@@ -1826,7 +1897,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
1826
1897
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
1827
1898
  const USER_AGENT_HEADER = 'User-Agent';
1828
1899
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
1829
- const SDK_VERSION = '1.46.0'; // x-release-please-version
1900
+ const SDK_VERSION = '1.48.0'; // x-release-please-version
1830
1901
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
1831
1902
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
1832
1903
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -1886,6 +1957,11 @@ class ApiClient {
1886
1957
  // Vertex Express or global endpoint case.
1887
1958
  initHttpOptions.baseUrl = 'https://aiplatform.googleapis.com/';
1888
1959
  }
1960
+ else if (this.clientOptions.project &&
1961
+ this.clientOptions.location &&
1962
+ this.clientOptions.location === 'us') {
1963
+ initHttpOptions.baseUrl = `https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`;
1964
+ }
1889
1965
  else if (this.clientOptions.project && this.clientOptions.location) {
1890
1966
  initHttpOptions.baseUrl = `https://${this.clientOptions.location}-aiplatform.googleapis.com/`;
1891
1967
  }