@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.
@@ -437,26 +437,6 @@ var Type;
437
437
  */
438
438
  Type["NULL"] = "NULL";
439
439
  })(Type || (Type = {}));
440
- /** The environment being operated. */
441
- var Environment;
442
- (function (Environment) {
443
- /**
444
- * Defaults to browser.
445
- */
446
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
447
- /**
448
- * Operates in a web browser.
449
- */
450
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
451
- /**
452
- * Operates in a mobile environment.
453
- */
454
- Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
455
- /**
456
- * Operates in a desktop environment.
457
- */
458
- Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
459
- })(Environment || (Environment = {}));
460
440
  /** Type of auth scheme. This enum is not supported in Gemini API. */
461
441
  var AuthType;
462
442
  (function (AuthType) {
@@ -527,6 +507,62 @@ var ApiSpec;
527
507
  */
528
508
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
529
509
  })(ApiSpec || (ApiSpec = {}));
510
+ /** The environment being operated. */
511
+ var Environment;
512
+ (function (Environment) {
513
+ /**
514
+ * Defaults to browser.
515
+ */
516
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
517
+ /**
518
+ * Operates in a web browser.
519
+ */
520
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
521
+ /**
522
+ * Operates in a mobile environment.
523
+ */
524
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
525
+ /**
526
+ * Operates in a desktop environment.
527
+ */
528
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
529
+ })(Environment || (Environment = {}));
530
+ /** SafetyPolicy */
531
+ var SafetyPolicy;
532
+ (function (SafetyPolicy) {
533
+ /**
534
+ * Unspecified safety policy.
535
+ */
536
+ SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
537
+ /**
538
+ * Safety policy for financial transactions.
539
+ */
540
+ SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
541
+ /**
542
+ * Safety policy for sensitive data modification.
543
+ */
544
+ SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
545
+ /**
546
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
547
+ */
548
+ SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
549
+ /**
550
+ * Safety policy for account creation.
551
+ */
552
+ SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
553
+ /**
554
+ * Safety policy for data modification.
555
+ */
556
+ SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
557
+ /**
558
+ * Safety policy for user consent management.
559
+ */
560
+ SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
561
+ /**
562
+ * Safety policy for legal terms and agreements.
563
+ */
564
+ SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
565
+ })(SafetyPolicy || (SafetyPolicy = {}));
530
566
  /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
531
567
  var PhishBlockThreshold;
532
568
  (function (PhishBlockThreshold) {
@@ -559,7 +595,7 @@ var PhishBlockThreshold;
559
595
  */
560
596
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
561
597
  })(PhishBlockThreshold || (PhishBlockThreshold = {}));
562
- /** 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. */
598
+ /** 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. */
563
599
  var Behavior;
564
600
  (function (Behavior) {
565
601
  /**
@@ -1073,6 +1109,110 @@ var Modality;
1073
1109
  */
1074
1110
  Modality["VIDEO"] = "VIDEO";
1075
1111
  })(Modality || (Modality = {}));
1112
+ /** Delivery mode for the generated content. */
1113
+ var Delivery;
1114
+ (function (Delivery) {
1115
+ /**
1116
+ * Default value. This value is unused.
1117
+ */
1118
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1119
+ /**
1120
+ * Generated bytes are returned inline in the response.
1121
+ */
1122
+ Delivery["INLINE"] = "INLINE";
1123
+ /**
1124
+ * Generated content is stored and a URI is returned.
1125
+ */
1126
+ Delivery["URI"] = "URI";
1127
+ })(Delivery || (Delivery = {}));
1128
+ /** The aspect ratio for the image output. */
1129
+ var AspectRatio;
1130
+ (function (AspectRatio) {
1131
+ /**
1132
+ * Default value. This value is unused.
1133
+ */
1134
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1135
+ /**
1136
+ * 1:1 aspect ratio.
1137
+ */
1138
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1139
+ /**
1140
+ * 2:3 aspect ratio.
1141
+ */
1142
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1143
+ /**
1144
+ * 3:2 aspect ratio.
1145
+ */
1146
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1147
+ /**
1148
+ * 3:4 aspect ratio.
1149
+ */
1150
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1151
+ /**
1152
+ * 4:3 aspect ratio.
1153
+ */
1154
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1155
+ /**
1156
+ * 4:5 aspect ratio.
1157
+ */
1158
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1159
+ /**
1160
+ * 5:4 aspect ratio.
1161
+ */
1162
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1163
+ /**
1164
+ * 9:16 aspect ratio.
1165
+ */
1166
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1167
+ /**
1168
+ * 16:9 aspect ratio.
1169
+ */
1170
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1171
+ /**
1172
+ * 21:9 aspect ratio.
1173
+ */
1174
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1175
+ /**
1176
+ * 1:8 aspect ratio.
1177
+ */
1178
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1179
+ /**
1180
+ * 8:1 aspect ratio.
1181
+ */
1182
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1183
+ /**
1184
+ * 1:4 aspect ratio.
1185
+ */
1186
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1187
+ /**
1188
+ * 4:1 aspect ratio.
1189
+ */
1190
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1191
+ })(AspectRatio || (AspectRatio = {}));
1192
+ /** The size of the image output. */
1193
+ var ImageSize;
1194
+ (function (ImageSize) {
1195
+ /**
1196
+ * Default value. This value is unused.
1197
+ */
1198
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1199
+ /**
1200
+ * 512px image size.
1201
+ */
1202
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1203
+ /**
1204
+ * 1K image size.
1205
+ */
1206
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1207
+ /**
1208
+ * 2K image size.
1209
+ */
1210
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1211
+ /**
1212
+ * 4K image size.
1213
+ */
1214
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1215
+ })(ImageSize || (ImageSize = {}));
1076
1216
  /** Tuning mode. This enum is not supported in Gemini API. */
1077
1217
  var TuningMode;
1078
1218
  (function (TuningMode) {
@@ -1121,6 +1261,58 @@ var AdapterSize;
1121
1261
  */
1122
1262
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1123
1263
  })(AdapterSize || (AdapterSize = {}));
1264
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1265
+ var ResponseParseType;
1266
+ (function (ResponseParseType) {
1267
+ /**
1268
+ * Default value. Fallback to IDENTITY
1269
+ */
1270
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1271
+ /**
1272
+ * Returns the sample response as is.
1273
+ */
1274
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1275
+ /**
1276
+ * 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.
1277
+ */
1278
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1279
+ })(ResponseParseType || (ResponseParseType = {}));
1280
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1281
+ var MatchOperation;
1282
+ (function (MatchOperation) {
1283
+ /**
1284
+ * Default value. A user error will be returned if not set.
1285
+ */
1286
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1287
+ /**
1288
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1289
+ */
1290
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1291
+ /**
1292
+ * The match operation returns `true` if expression is a substring of the target.
1293
+ */
1294
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1295
+ /**
1296
+ * The match operation returns `true` expression is an exact match of the target.
1297
+ */
1298
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1299
+ })(MatchOperation || (MatchOperation = {}));
1300
+ /** Represents how much to think for the tuning job. */
1301
+ var ReinforcementTuningThinkingLevel;
1302
+ (function (ReinforcementTuningThinkingLevel) {
1303
+ /**
1304
+ * Unspecified thinking level.
1305
+ */
1306
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1307
+ /**
1308
+ * Little to no thinking.
1309
+ */
1310
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1311
+ /**
1312
+ * High thinking level.
1313
+ */
1314
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1315
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1124
1316
  /** Job state. */
1125
1317
  var JobState;
1126
1318
  (function (JobState) {
@@ -1605,58 +1797,6 @@ var ImageResizeMode;
1605
1797
  */
1606
1798
  ImageResizeMode["PAD"] = "PAD";
1607
1799
  })(ImageResizeMode || (ImageResizeMode = {}));
1608
- /** Defines how to parse sample response. */
1609
- var ResponseParseType;
1610
- (function (ResponseParseType) {
1611
- /**
1612
- * Default value. This value is unused.
1613
- */
1614
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1615
- /**
1616
- * Use the sample response as is.
1617
- */
1618
- ResponseParseType["IDENTITY"] = "IDENTITY";
1619
- /**
1620
- * Use regex to extract the important part of sample response.
1621
- */
1622
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1623
- })(ResponseParseType || (ResponseParseType = {}));
1624
- /** Match operation to use for evaluation. */
1625
- var MatchOperation;
1626
- (function (MatchOperation) {
1627
- /**
1628
- * Default value. This value is unused.
1629
- */
1630
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1631
- /**
1632
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1633
- */
1634
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1635
- /**
1636
- * `expression` is a substring of target.
1637
- */
1638
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1639
- /**
1640
- * `expression` is an exact match of target.
1641
- */
1642
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1643
- })(MatchOperation || (MatchOperation = {}));
1644
- /** Represents how much to think for the tuning job. */
1645
- var ReinforcementTuningThinkingLevel;
1646
- (function (ReinforcementTuningThinkingLevel) {
1647
- /**
1648
- * Unspecified thinking level.
1649
- */
1650
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1651
- /**
1652
- * Little to no thinking.
1653
- */
1654
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1655
- /**
1656
- * High thinking level.
1657
- */
1658
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1659
- })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1660
1800
  /** Enum representing the tuning method. */
1661
1801
  var TuningMethod;
1662
1802
  (function (TuningMethod) {
@@ -2167,7 +2307,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
2167
2307
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
2168
2308
  const USER_AGENT_HEADER = 'User-Agent';
2169
2309
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
2170
- const SDK_VERSION = '2.9.0'; // x-release-please-version
2310
+ const SDK_VERSION = '2.11.0'; // x-release-please-version
2171
2311
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
2172
2312
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
2173
2313
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';