@google/genai 2.10.0 → 2.12.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/genai.d.ts +1623 -595
- package/dist/index.cjs +1296 -179
- package/dist/index.mjs +1292 -180
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1347 -230
- package/dist/node/index.mjs +1343 -231
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +1623 -595
- package/dist/tokenizer/node.cjs +157 -53
- package/dist/tokenizer/node.d.ts +204 -4
- package/dist/tokenizer/node.mjs +157 -53
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +158 -54
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +308 -67
- package/dist/vertex_internal/index.js +158 -54
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +1343 -231
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +1623 -595
- package/package.json +2 -9
|
@@ -574,7 +574,7 @@ var PhishBlockThreshold;
|
|
|
574
574
|
*/
|
|
575
575
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
576
576
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
577
|
-
/** Specifies the function Behavior.
|
|
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. */
|
|
578
578
|
var Behavior;
|
|
579
579
|
(function (Behavior) {
|
|
580
580
|
/**
|
|
@@ -1088,6 +1088,110 @@ var Modality;
|
|
|
1088
1088
|
*/
|
|
1089
1089
|
Modality["VIDEO"] = "VIDEO";
|
|
1090
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 = {}));
|
|
1091
1195
|
/** Tuning mode. This enum is not supported in Gemini API. */
|
|
1092
1196
|
var TuningMode;
|
|
1093
1197
|
(function (TuningMode) {
|
|
@@ -1136,6 +1240,58 @@ var AdapterSize;
|
|
|
1136
1240
|
*/
|
|
1137
1241
|
AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
|
|
1138
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 = {}));
|
|
1139
1295
|
/** Job state. */
|
|
1140
1296
|
var JobState;
|
|
1141
1297
|
(function (JobState) {
|
|
@@ -1620,58 +1776,6 @@ var ImageResizeMode;
|
|
|
1620
1776
|
*/
|
|
1621
1777
|
ImageResizeMode["PAD"] = "PAD";
|
|
1622
1778
|
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1623
|
-
/** Defines how to parse sample response. */
|
|
1624
|
-
var ResponseParseType;
|
|
1625
|
-
(function (ResponseParseType) {
|
|
1626
|
-
/**
|
|
1627
|
-
* Default value. This value is unused.
|
|
1628
|
-
*/
|
|
1629
|
-
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1630
|
-
/**
|
|
1631
|
-
* Use the sample response as is.
|
|
1632
|
-
*/
|
|
1633
|
-
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1634
|
-
/**
|
|
1635
|
-
* Use regex to extract the important part of sample response.
|
|
1636
|
-
*/
|
|
1637
|
-
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1638
|
-
})(ResponseParseType || (ResponseParseType = {}));
|
|
1639
|
-
/** Match operation to use for evaluation. */
|
|
1640
|
-
var MatchOperation;
|
|
1641
|
-
(function (MatchOperation) {
|
|
1642
|
-
/**
|
|
1643
|
-
* Default value. This value is unused.
|
|
1644
|
-
*/
|
|
1645
|
-
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1646
|
-
/**
|
|
1647
|
-
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1648
|
-
*/
|
|
1649
|
-
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1650
|
-
/**
|
|
1651
|
-
* `expression` is a substring of target.
|
|
1652
|
-
*/
|
|
1653
|
-
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1654
|
-
/**
|
|
1655
|
-
* `expression` is an exact match of target.
|
|
1656
|
-
*/
|
|
1657
|
-
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1658
|
-
})(MatchOperation || (MatchOperation = {}));
|
|
1659
|
-
/** Represents how much to think for the tuning job. */
|
|
1660
|
-
var ReinforcementTuningThinkingLevel;
|
|
1661
|
-
(function (ReinforcementTuningThinkingLevel) {
|
|
1662
|
-
/**
|
|
1663
|
-
* Unspecified thinking level.
|
|
1664
|
-
*/
|
|
1665
|
-
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1666
|
-
/**
|
|
1667
|
-
* Little to no thinking.
|
|
1668
|
-
*/
|
|
1669
|
-
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1670
|
-
/**
|
|
1671
|
-
* High thinking level.
|
|
1672
|
-
*/
|
|
1673
|
-
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1674
|
-
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1675
1779
|
/** Enum representing the tuning method. */
|
|
1676
1780
|
var TuningMethod;
|
|
1677
1781
|
(function (TuningMethod) {
|
|
@@ -2182,7 +2286,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
2182
2286
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
2183
2287
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
2184
2288
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
2185
|
-
const SDK_VERSION = '2.
|
|
2289
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
2186
2290
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
2187
2291
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
2188
2292
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|