@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.
@@ -416,26 +416,6 @@ var Type;
416
416
  */
417
417
  Type["NULL"] = "NULL";
418
418
  })(Type || (Type = {}));
419
- /** The environment being operated. */
420
- var Environment;
421
- (function (Environment) {
422
- /**
423
- * Defaults to browser.
424
- */
425
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
426
- /**
427
- * Operates in a web browser.
428
- */
429
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
430
- /**
431
- * Operates in a mobile environment.
432
- */
433
- Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
434
- /**
435
- * Operates in a desktop environment.
436
- */
437
- Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
438
- })(Environment || (Environment = {}));
439
419
  /** Type of auth scheme. This enum is not supported in Gemini API. */
440
420
  var AuthType;
441
421
  (function (AuthType) {
@@ -506,6 +486,62 @@ var ApiSpec;
506
486
  */
507
487
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
508
488
  })(ApiSpec || (ApiSpec = {}));
489
+ /** The environment being operated. */
490
+ var Environment;
491
+ (function (Environment) {
492
+ /**
493
+ * Defaults to browser.
494
+ */
495
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
496
+ /**
497
+ * Operates in a web browser.
498
+ */
499
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
500
+ /**
501
+ * Operates in a mobile environment.
502
+ */
503
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
504
+ /**
505
+ * Operates in a desktop environment.
506
+ */
507
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
508
+ })(Environment || (Environment = {}));
509
+ /** SafetyPolicy */
510
+ var SafetyPolicy;
511
+ (function (SafetyPolicy) {
512
+ /**
513
+ * Unspecified safety policy.
514
+ */
515
+ SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
516
+ /**
517
+ * Safety policy for financial transactions.
518
+ */
519
+ SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
520
+ /**
521
+ * Safety policy for sensitive data modification.
522
+ */
523
+ SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
524
+ /**
525
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
526
+ */
527
+ SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
528
+ /**
529
+ * Safety policy for account creation.
530
+ */
531
+ SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
532
+ /**
533
+ * Safety policy for data modification.
534
+ */
535
+ SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
536
+ /**
537
+ * Safety policy for user consent management.
538
+ */
539
+ SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
540
+ /**
541
+ * Safety policy for legal terms and agreements.
542
+ */
543
+ SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
544
+ })(SafetyPolicy || (SafetyPolicy = {}));
509
545
  /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
510
546
  var PhishBlockThreshold;
511
547
  (function (PhishBlockThreshold) {
@@ -538,7 +574,7 @@ var PhishBlockThreshold;
538
574
  */
539
575
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
540
576
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
541
- /** 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. */
577
+ /** 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. */
542
578
  var Behavior;
543
579
  (function (Behavior) {
544
580
  /**
@@ -1052,6 +1088,110 @@ var Modality;
1052
1088
  */
1053
1089
  Modality["VIDEO"] = "VIDEO";
1054
1090
  })(Modality || (Modality = {}));
1091
+ /** Delivery mode for the generated content. */
1092
+ var Delivery;
1093
+ (function (Delivery) {
1094
+ /**
1095
+ * Default value. This value is unused.
1096
+ */
1097
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1098
+ /**
1099
+ * Generated bytes are returned inline in the response.
1100
+ */
1101
+ Delivery["INLINE"] = "INLINE";
1102
+ /**
1103
+ * Generated content is stored and a URI is returned.
1104
+ */
1105
+ Delivery["URI"] = "URI";
1106
+ })(Delivery || (Delivery = {}));
1107
+ /** The aspect ratio for the image output. */
1108
+ var AspectRatio;
1109
+ (function (AspectRatio) {
1110
+ /**
1111
+ * Default value. This value is unused.
1112
+ */
1113
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1114
+ /**
1115
+ * 1:1 aspect ratio.
1116
+ */
1117
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1118
+ /**
1119
+ * 2:3 aspect ratio.
1120
+ */
1121
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1122
+ /**
1123
+ * 3:2 aspect ratio.
1124
+ */
1125
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1126
+ /**
1127
+ * 3:4 aspect ratio.
1128
+ */
1129
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1130
+ /**
1131
+ * 4:3 aspect ratio.
1132
+ */
1133
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1134
+ /**
1135
+ * 4:5 aspect ratio.
1136
+ */
1137
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1138
+ /**
1139
+ * 5:4 aspect ratio.
1140
+ */
1141
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1142
+ /**
1143
+ * 9:16 aspect ratio.
1144
+ */
1145
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1146
+ /**
1147
+ * 16:9 aspect ratio.
1148
+ */
1149
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1150
+ /**
1151
+ * 21:9 aspect ratio.
1152
+ */
1153
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1154
+ /**
1155
+ * 1:8 aspect ratio.
1156
+ */
1157
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1158
+ /**
1159
+ * 8:1 aspect ratio.
1160
+ */
1161
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1162
+ /**
1163
+ * 1:4 aspect ratio.
1164
+ */
1165
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1166
+ /**
1167
+ * 4:1 aspect ratio.
1168
+ */
1169
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1170
+ })(AspectRatio || (AspectRatio = {}));
1171
+ /** The size of the image output. */
1172
+ var ImageSize;
1173
+ (function (ImageSize) {
1174
+ /**
1175
+ * Default value. This value is unused.
1176
+ */
1177
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1178
+ /**
1179
+ * 512px image size.
1180
+ */
1181
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1182
+ /**
1183
+ * 1K image size.
1184
+ */
1185
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1186
+ /**
1187
+ * 2K image size.
1188
+ */
1189
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1190
+ /**
1191
+ * 4K image size.
1192
+ */
1193
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1194
+ })(ImageSize || (ImageSize = {}));
1055
1195
  /** Tuning mode. This enum is not supported in Gemini API. */
1056
1196
  var TuningMode;
1057
1197
  (function (TuningMode) {
@@ -1100,6 +1240,58 @@ var AdapterSize;
1100
1240
  */
1101
1241
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1102
1242
  })(AdapterSize || (AdapterSize = {}));
1243
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1244
+ var ResponseParseType;
1245
+ (function (ResponseParseType) {
1246
+ /**
1247
+ * Default value. Fallback to IDENTITY
1248
+ */
1249
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1250
+ /**
1251
+ * Returns the sample response as is.
1252
+ */
1253
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1254
+ /**
1255
+ * 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.
1256
+ */
1257
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1258
+ })(ResponseParseType || (ResponseParseType = {}));
1259
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1260
+ var MatchOperation;
1261
+ (function (MatchOperation) {
1262
+ /**
1263
+ * Default value. A user error will be returned if not set.
1264
+ */
1265
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1266
+ /**
1267
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1268
+ */
1269
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1270
+ /**
1271
+ * The match operation returns `true` if expression is a substring of the target.
1272
+ */
1273
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1274
+ /**
1275
+ * The match operation returns `true` expression is an exact match of the target.
1276
+ */
1277
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1278
+ })(MatchOperation || (MatchOperation = {}));
1279
+ /** Represents how much to think for the tuning job. */
1280
+ var ReinforcementTuningThinkingLevel;
1281
+ (function (ReinforcementTuningThinkingLevel) {
1282
+ /**
1283
+ * Unspecified thinking level.
1284
+ */
1285
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1286
+ /**
1287
+ * Little to no thinking.
1288
+ */
1289
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1290
+ /**
1291
+ * High thinking level.
1292
+ */
1293
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1294
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1103
1295
  /** Job state. */
1104
1296
  var JobState;
1105
1297
  (function (JobState) {
@@ -1584,58 +1776,6 @@ var ImageResizeMode;
1584
1776
  */
1585
1777
  ImageResizeMode["PAD"] = "PAD";
1586
1778
  })(ImageResizeMode || (ImageResizeMode = {}));
1587
- /** Defines how to parse sample response. */
1588
- var ResponseParseType;
1589
- (function (ResponseParseType) {
1590
- /**
1591
- * Default value. This value is unused.
1592
- */
1593
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1594
- /**
1595
- * Use the sample response as is.
1596
- */
1597
- ResponseParseType["IDENTITY"] = "IDENTITY";
1598
- /**
1599
- * Use regex to extract the important part of sample response.
1600
- */
1601
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1602
- })(ResponseParseType || (ResponseParseType = {}));
1603
- /** Match operation to use for evaluation. */
1604
- var MatchOperation;
1605
- (function (MatchOperation) {
1606
- /**
1607
- * Default value. This value is unused.
1608
- */
1609
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1610
- /**
1611
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1612
- */
1613
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1614
- /**
1615
- * `expression` is a substring of target.
1616
- */
1617
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1618
- /**
1619
- * `expression` is an exact match of target.
1620
- */
1621
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1622
- })(MatchOperation || (MatchOperation = {}));
1623
- /** Represents how much to think for the tuning job. */
1624
- var ReinforcementTuningThinkingLevel;
1625
- (function (ReinforcementTuningThinkingLevel) {
1626
- /**
1627
- * Unspecified thinking level.
1628
- */
1629
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1630
- /**
1631
- * Little to no thinking.
1632
- */
1633
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1634
- /**
1635
- * High thinking level.
1636
- */
1637
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1638
- })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1639
1779
  /** Enum representing the tuning method. */
1640
1780
  var TuningMethod;
1641
1781
  (function (TuningMethod) {
@@ -2146,7 +2286,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
2146
2286
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
2147
2287
  const USER_AGENT_HEADER = 'User-Agent';
2148
2288
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
2149
- const SDK_VERSION = '2.9.0'; // x-release-please-version
2289
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
2150
2290
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
2151
2291
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
2152
2292
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';