@google/genai 1.19.0 → 1.20.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 +56 -1
- package/dist/index.cjs +72 -1
- package/dist/index.mjs +73 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +72 -1
- package/dist/node/index.mjs +73 -2
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +56 -1
- package/dist/web/index.mjs +73 -2
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +56 -1
- package/package.json +4 -1
package/dist/node/index.cjs
CHANGED
|
@@ -1172,6 +1172,33 @@ exports.VideoGenerationReferenceType = void 0;
|
|
|
1172
1172
|
*/
|
|
1173
1173
|
VideoGenerationReferenceType["STYLE"] = "STYLE";
|
|
1174
1174
|
})(exports.VideoGenerationReferenceType || (exports.VideoGenerationReferenceType = {}));
|
|
1175
|
+
/** Enum for the mask mode of a video generation mask. */
|
|
1176
|
+
exports.VideoGenerationMaskMode = void 0;
|
|
1177
|
+
(function (VideoGenerationMaskMode) {
|
|
1178
|
+
/**
|
|
1179
|
+
* The image mask contains a masked rectangular region which is
|
|
1180
|
+
applied on the first frame of the input video. The object described in
|
|
1181
|
+
the prompt is inserted into this region and will appear in subsequent
|
|
1182
|
+
frames.
|
|
1183
|
+
*/
|
|
1184
|
+
VideoGenerationMaskMode["INSERT"] = "INSERT";
|
|
1185
|
+
/**
|
|
1186
|
+
* The image mask is used to determine an object in the
|
|
1187
|
+
first video frame to track. This object is removed from the video.
|
|
1188
|
+
*/
|
|
1189
|
+
VideoGenerationMaskMode["REMOVE"] = "REMOVE";
|
|
1190
|
+
/**
|
|
1191
|
+
* The image mask is used to determine a region in the
|
|
1192
|
+
video. Objects in this region will be removed.
|
|
1193
|
+
*/
|
|
1194
|
+
VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
|
|
1195
|
+
/**
|
|
1196
|
+
* The image mask contains a masked rectangular region where
|
|
1197
|
+
the input video will go. The remaining area will be generated. Video
|
|
1198
|
+
masks are not supported.
|
|
1199
|
+
*/
|
|
1200
|
+
VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
|
|
1201
|
+
})(exports.VideoGenerationMaskMode || (exports.VideoGenerationMaskMode = {}));
|
|
1175
1202
|
/** Enum that controls the compression quality of the generated videos. */
|
|
1176
1203
|
exports.VideoCompressionQuality = void 0;
|
|
1177
1204
|
(function (VideoCompressionQuality) {
|
|
@@ -1201,6 +1228,26 @@ exports.FileSource = void 0;
|
|
|
1201
1228
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1202
1229
|
FileSource["GENERATED"] = "GENERATED";
|
|
1203
1230
|
})(exports.FileSource || (exports.FileSource = {}));
|
|
1231
|
+
/** The reason why the turn is complete. */
|
|
1232
|
+
exports.TurnCompleteReason = void 0;
|
|
1233
|
+
(function (TurnCompleteReason) {
|
|
1234
|
+
/**
|
|
1235
|
+
* Default value. Reason is unspecified.
|
|
1236
|
+
*/
|
|
1237
|
+
TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
|
|
1238
|
+
/**
|
|
1239
|
+
* The function call generated by the model is invalid.
|
|
1240
|
+
*/
|
|
1241
|
+
TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
|
|
1242
|
+
/**
|
|
1243
|
+
* The response is rejected by the model.
|
|
1244
|
+
*/
|
|
1245
|
+
TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
|
|
1246
|
+
/**
|
|
1247
|
+
* Needs more input from the user.
|
|
1248
|
+
*/
|
|
1249
|
+
TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
|
|
1250
|
+
})(exports.TurnCompleteReason || (exports.TurnCompleteReason = {}));
|
|
1204
1251
|
/** Server content modalities. */
|
|
1205
1252
|
exports.MediaModality = void 0;
|
|
1206
1253
|
(function (MediaModality) {
|
|
@@ -9409,6 +9456,18 @@ function liveServerContentFromMldev(fromObject) {
|
|
|
9409
9456
|
if (fromUrlContextMetadata != null) {
|
|
9410
9457
|
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
9411
9458
|
}
|
|
9459
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
9460
|
+
'turnCompleteReason',
|
|
9461
|
+
]);
|
|
9462
|
+
if (fromTurnCompleteReason != null) {
|
|
9463
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
9464
|
+
}
|
|
9465
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
9466
|
+
'waitingForInput',
|
|
9467
|
+
]);
|
|
9468
|
+
if (fromWaitingForInput != null) {
|
|
9469
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
9470
|
+
}
|
|
9412
9471
|
return toObject;
|
|
9413
9472
|
}
|
|
9414
9473
|
function liveServerToolCallFromMldev(fromObject) {
|
|
@@ -9969,6 +10028,18 @@ function liveServerContentFromVertex(fromObject) {
|
|
|
9969
10028
|
if (fromOutputTranscription != null) {
|
|
9970
10029
|
setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
|
|
9971
10030
|
}
|
|
10031
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
10032
|
+
'turnCompleteReason',
|
|
10033
|
+
]);
|
|
10034
|
+
if (fromTurnCompleteReason != null) {
|
|
10035
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
10036
|
+
}
|
|
10037
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
10038
|
+
'waitingForInput',
|
|
10039
|
+
]);
|
|
10040
|
+
if (fromWaitingForInput != null) {
|
|
10041
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
10042
|
+
}
|
|
9972
10043
|
return toObject;
|
|
9973
10044
|
}
|
|
9974
10045
|
function liveServerToolCallFromVertex(fromObject) {
|
|
@@ -14312,7 +14383,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
14312
14383
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
14313
14384
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
14314
14385
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
14315
|
-
const SDK_VERSION = '1.
|
|
14386
|
+
const SDK_VERSION = '1.20.0'; // x-release-please-version
|
|
14316
14387
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
14317
14388
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
14318
14389
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
package/dist/node/index.mjs
CHANGED
|
@@ -1150,6 +1150,33 @@ var VideoGenerationReferenceType;
|
|
|
1150
1150
|
*/
|
|
1151
1151
|
VideoGenerationReferenceType["STYLE"] = "STYLE";
|
|
1152
1152
|
})(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
|
|
1153
|
+
/** Enum for the mask mode of a video generation mask. */
|
|
1154
|
+
var VideoGenerationMaskMode;
|
|
1155
|
+
(function (VideoGenerationMaskMode) {
|
|
1156
|
+
/**
|
|
1157
|
+
* The image mask contains a masked rectangular region which is
|
|
1158
|
+
applied on the first frame of the input video. The object described in
|
|
1159
|
+
the prompt is inserted into this region and will appear in subsequent
|
|
1160
|
+
frames.
|
|
1161
|
+
*/
|
|
1162
|
+
VideoGenerationMaskMode["INSERT"] = "INSERT";
|
|
1163
|
+
/**
|
|
1164
|
+
* The image mask is used to determine an object in the
|
|
1165
|
+
first video frame to track. This object is removed from the video.
|
|
1166
|
+
*/
|
|
1167
|
+
VideoGenerationMaskMode["REMOVE"] = "REMOVE";
|
|
1168
|
+
/**
|
|
1169
|
+
* The image mask is used to determine a region in the
|
|
1170
|
+
video. Objects in this region will be removed.
|
|
1171
|
+
*/
|
|
1172
|
+
VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
|
|
1173
|
+
/**
|
|
1174
|
+
* The image mask contains a masked rectangular region where
|
|
1175
|
+
the input video will go. The remaining area will be generated. Video
|
|
1176
|
+
masks are not supported.
|
|
1177
|
+
*/
|
|
1178
|
+
VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
|
|
1179
|
+
})(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
|
|
1153
1180
|
/** Enum that controls the compression quality of the generated videos. */
|
|
1154
1181
|
var VideoCompressionQuality;
|
|
1155
1182
|
(function (VideoCompressionQuality) {
|
|
@@ -1179,6 +1206,26 @@ var FileSource;
|
|
|
1179
1206
|
FileSource["UPLOADED"] = "UPLOADED";
|
|
1180
1207
|
FileSource["GENERATED"] = "GENERATED";
|
|
1181
1208
|
})(FileSource || (FileSource = {}));
|
|
1209
|
+
/** The reason why the turn is complete. */
|
|
1210
|
+
var TurnCompleteReason;
|
|
1211
|
+
(function (TurnCompleteReason) {
|
|
1212
|
+
/**
|
|
1213
|
+
* Default value. Reason is unspecified.
|
|
1214
|
+
*/
|
|
1215
|
+
TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
|
|
1216
|
+
/**
|
|
1217
|
+
* The function call generated by the model is invalid.
|
|
1218
|
+
*/
|
|
1219
|
+
TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
|
|
1220
|
+
/**
|
|
1221
|
+
* The response is rejected by the model.
|
|
1222
|
+
*/
|
|
1223
|
+
TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
|
|
1224
|
+
/**
|
|
1225
|
+
* Needs more input from the user.
|
|
1226
|
+
*/
|
|
1227
|
+
TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
|
|
1228
|
+
})(TurnCompleteReason || (TurnCompleteReason = {}));
|
|
1182
1229
|
/** Server content modalities. */
|
|
1183
1230
|
var MediaModality;
|
|
1184
1231
|
(function (MediaModality) {
|
|
@@ -9387,6 +9434,18 @@ function liveServerContentFromMldev(fromObject) {
|
|
|
9387
9434
|
if (fromUrlContextMetadata != null) {
|
|
9388
9435
|
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
9389
9436
|
}
|
|
9437
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
9438
|
+
'turnCompleteReason',
|
|
9439
|
+
]);
|
|
9440
|
+
if (fromTurnCompleteReason != null) {
|
|
9441
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
9442
|
+
}
|
|
9443
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
9444
|
+
'waitingForInput',
|
|
9445
|
+
]);
|
|
9446
|
+
if (fromWaitingForInput != null) {
|
|
9447
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
9448
|
+
}
|
|
9390
9449
|
return toObject;
|
|
9391
9450
|
}
|
|
9392
9451
|
function liveServerToolCallFromMldev(fromObject) {
|
|
@@ -9947,6 +10006,18 @@ function liveServerContentFromVertex(fromObject) {
|
|
|
9947
10006
|
if (fromOutputTranscription != null) {
|
|
9948
10007
|
setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
|
|
9949
10008
|
}
|
|
10009
|
+
const fromTurnCompleteReason = getValueByPath(fromObject, [
|
|
10010
|
+
'turnCompleteReason',
|
|
10011
|
+
]);
|
|
10012
|
+
if (fromTurnCompleteReason != null) {
|
|
10013
|
+
setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
|
|
10014
|
+
}
|
|
10015
|
+
const fromWaitingForInput = getValueByPath(fromObject, [
|
|
10016
|
+
'waitingForInput',
|
|
10017
|
+
]);
|
|
10018
|
+
if (fromWaitingForInput != null) {
|
|
10019
|
+
setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
|
|
10020
|
+
}
|
|
9950
10021
|
return toObject;
|
|
9951
10022
|
}
|
|
9952
10023
|
function liveServerToolCallFromVertex(fromObject) {
|
|
@@ -14290,7 +14361,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
14290
14361
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
14291
14362
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
14292
14363
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
14293
|
-
const SDK_VERSION = '1.
|
|
14364
|
+
const SDK_VERSION = '1.20.0'; // x-release-please-version
|
|
14294
14365
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
14295
14366
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
14296
14367
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -19898,5 +19969,5 @@ function getApiKeyFromEnv() {
|
|
|
19898
19969
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
19899
19970
|
}
|
|
19900
19971
|
|
|
19901
|
-
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationReferenceType, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19972
|
+
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TuningMode, TurnCompleteReason, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
19902
19973
|
//# sourceMappingURL=index.mjs.map
|