@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 CHANGED
@@ -4706,6 +4706,12 @@ export declare interface LiveServerContent {
4706
4706
  outputTranscription?: Transcription;
4707
4707
  /** Metadata related to url context retrieval tool. */
4708
4708
  urlContextMetadata?: UrlContextMetadata;
4709
+ /** Reason for the turn is complete. */
4710
+ turnCompleteReason?: TurnCompleteReason;
4711
+ /** If true, indicates that the model is not generating content because
4712
+ it is waiting for more input from the user, e.g. because it expects the
4713
+ user to continue talking. */
4714
+ waitingForInput?: boolean;
4709
4715
  }
4710
4716
 
4711
4717
  /** Server will not be able to service client soon. */
@@ -7010,6 +7016,26 @@ export declare interface TuningValidationDataset {
7010
7016
  vertexDatasetResource?: string;
7011
7017
  }
7012
7018
 
7019
+ /** The reason why the turn is complete. */
7020
+ export declare enum TurnCompleteReason {
7021
+ /**
7022
+ * Default value. Reason is unspecified.
7023
+ */
7024
+ TURN_COMPLETE_REASON_UNSPECIFIED = "TURN_COMPLETE_REASON_UNSPECIFIED",
7025
+ /**
7026
+ * The function call generated by the model is invalid.
7027
+ */
7028
+ MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
7029
+ /**
7030
+ * The response is rejected by the model.
7031
+ */
7032
+ RESPONSE_REJECTED = "RESPONSE_REJECTED",
7033
+ /**
7034
+ * Needs more input from the user.
7035
+ */
7036
+ NEED_MORE_INPUT = "NEED_MORE_INPUT"
7037
+ }
7038
+
7013
7039
  /** Options about which input is included in the user's turn. */
7014
7040
  export declare enum TurnCoverage {
7015
7041
  /**
@@ -7107,9 +7133,11 @@ declare namespace types {
7107
7133
  EditMode,
7108
7134
  SegmentMode,
7109
7135
  VideoGenerationReferenceType,
7136
+ VideoGenerationMaskMode,
7110
7137
  VideoCompressionQuality,
7111
7138
  FileState,
7112
7139
  FileSource,
7140
+ TurnCompleteReason,
7113
7141
  MediaModality,
7114
7142
  StartSensitivity,
7115
7143
  EndSensitivity,
@@ -7752,7 +7780,34 @@ export declare interface VideoGenerationMask {
7752
7780
  /** Describes how the mask will be used. Inpainting masks must
7753
7781
  match the aspect ratio of the input video. Outpainting masks can be
7754
7782
  either 9:16 or 16:9. */
7755
- maskMode?: string;
7783
+ maskMode?: VideoGenerationMaskMode;
7784
+ }
7785
+
7786
+ /** Enum for the mask mode of a video generation mask. */
7787
+ export declare enum VideoGenerationMaskMode {
7788
+ /**
7789
+ * The image mask contains a masked rectangular region which is
7790
+ applied on the first frame of the input video. The object described in
7791
+ the prompt is inserted into this region and will appear in subsequent
7792
+ frames.
7793
+ */
7794
+ INSERT = "INSERT",
7795
+ /**
7796
+ * The image mask is used to determine an object in the
7797
+ first video frame to track. This object is removed from the video.
7798
+ */
7799
+ REMOVE = "REMOVE",
7800
+ /**
7801
+ * The image mask is used to determine a region in the
7802
+ video. Objects in this region will be removed.
7803
+ */
7804
+ REMOVE_STATIC = "REMOVE_STATIC",
7805
+ /**
7806
+ * The image mask contains a masked rectangular region where
7807
+ the input video will go. The remaining area will be generated. Video
7808
+ masks are not supported.
7809
+ */
7810
+ OUTPAINT = "OUTPAINT"
7756
7811
  }
7757
7812
 
7758
7813
  /** A reference image for video generation. */
package/dist/index.cjs CHANGED
@@ -1116,6 +1116,33 @@ exports.VideoGenerationReferenceType = void 0;
1116
1116
  */
1117
1117
  VideoGenerationReferenceType["STYLE"] = "STYLE";
1118
1118
  })(exports.VideoGenerationReferenceType || (exports.VideoGenerationReferenceType = {}));
1119
+ /** Enum for the mask mode of a video generation mask. */
1120
+ exports.VideoGenerationMaskMode = void 0;
1121
+ (function (VideoGenerationMaskMode) {
1122
+ /**
1123
+ * The image mask contains a masked rectangular region which is
1124
+ applied on the first frame of the input video. The object described in
1125
+ the prompt is inserted into this region and will appear in subsequent
1126
+ frames.
1127
+ */
1128
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1129
+ /**
1130
+ * The image mask is used to determine an object in the
1131
+ first video frame to track. This object is removed from the video.
1132
+ */
1133
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1134
+ /**
1135
+ * The image mask is used to determine a region in the
1136
+ video. Objects in this region will be removed.
1137
+ */
1138
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1139
+ /**
1140
+ * The image mask contains a masked rectangular region where
1141
+ the input video will go. The remaining area will be generated. Video
1142
+ masks are not supported.
1143
+ */
1144
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1145
+ })(exports.VideoGenerationMaskMode || (exports.VideoGenerationMaskMode = {}));
1119
1146
  /** Enum that controls the compression quality of the generated videos. */
1120
1147
  exports.VideoCompressionQuality = void 0;
1121
1148
  (function (VideoCompressionQuality) {
@@ -1145,6 +1172,26 @@ exports.FileSource = void 0;
1145
1172
  FileSource["UPLOADED"] = "UPLOADED";
1146
1173
  FileSource["GENERATED"] = "GENERATED";
1147
1174
  })(exports.FileSource || (exports.FileSource = {}));
1175
+ /** The reason why the turn is complete. */
1176
+ exports.TurnCompleteReason = void 0;
1177
+ (function (TurnCompleteReason) {
1178
+ /**
1179
+ * Default value. Reason is unspecified.
1180
+ */
1181
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1182
+ /**
1183
+ * The function call generated by the model is invalid.
1184
+ */
1185
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1186
+ /**
1187
+ * The response is rejected by the model.
1188
+ */
1189
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1190
+ /**
1191
+ * Needs more input from the user.
1192
+ */
1193
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1194
+ })(exports.TurnCompleteReason || (exports.TurnCompleteReason = {}));
1148
1195
  /** Server content modalities. */
1149
1196
  exports.MediaModality = void 0;
1150
1197
  (function (MediaModality) {
@@ -7198,7 +7245,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7198
7245
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7199
7246
  const USER_AGENT_HEADER = 'User-Agent';
7200
7247
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7201
- const SDK_VERSION = '1.19.0'; // x-release-please-version
7248
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
7202
7249
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7203
7250
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7204
7251
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10050,6 +10097,18 @@ function liveServerContentFromMldev(fromObject) {
10050
10097
  if (fromUrlContextMetadata != null) {
10051
10098
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
10052
10099
  }
10100
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10101
+ 'turnCompleteReason',
10102
+ ]);
10103
+ if (fromTurnCompleteReason != null) {
10104
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10105
+ }
10106
+ const fromWaitingForInput = getValueByPath(fromObject, [
10107
+ 'waitingForInput',
10108
+ ]);
10109
+ if (fromWaitingForInput != null) {
10110
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10111
+ }
10053
10112
  return toObject;
10054
10113
  }
10055
10114
  function liveServerToolCallFromMldev(fromObject) {
@@ -10610,6 +10669,18 @@ function liveServerContentFromVertex(fromObject) {
10610
10669
  if (fromOutputTranscription != null) {
10611
10670
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
10612
10671
  }
10672
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10673
+ 'turnCompleteReason',
10674
+ ]);
10675
+ if (fromTurnCompleteReason != null) {
10676
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10677
+ }
10678
+ const fromWaitingForInput = getValueByPath(fromObject, [
10679
+ 'waitingForInput',
10680
+ ]);
10681
+ if (fromWaitingForInput != null) {
10682
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10683
+ }
10613
10684
  return toObject;
10614
10685
  }
10615
10686
  function liveServerToolCallFromVertex(fromObject) {
package/dist/index.mjs CHANGED
@@ -1114,6 +1114,33 @@ var VideoGenerationReferenceType;
1114
1114
  */
1115
1115
  VideoGenerationReferenceType["STYLE"] = "STYLE";
1116
1116
  })(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
1117
+ /** Enum for the mask mode of a video generation mask. */
1118
+ var VideoGenerationMaskMode;
1119
+ (function (VideoGenerationMaskMode) {
1120
+ /**
1121
+ * The image mask contains a masked rectangular region which is
1122
+ applied on the first frame of the input video. The object described in
1123
+ the prompt is inserted into this region and will appear in subsequent
1124
+ frames.
1125
+ */
1126
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1127
+ /**
1128
+ * The image mask is used to determine an object in the
1129
+ first video frame to track. This object is removed from the video.
1130
+ */
1131
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1132
+ /**
1133
+ * The image mask is used to determine a region in the
1134
+ video. Objects in this region will be removed.
1135
+ */
1136
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1137
+ /**
1138
+ * The image mask contains a masked rectangular region where
1139
+ the input video will go. The remaining area will be generated. Video
1140
+ masks are not supported.
1141
+ */
1142
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1143
+ })(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
1117
1144
  /** Enum that controls the compression quality of the generated videos. */
1118
1145
  var VideoCompressionQuality;
1119
1146
  (function (VideoCompressionQuality) {
@@ -1143,6 +1170,26 @@ var FileSource;
1143
1170
  FileSource["UPLOADED"] = "UPLOADED";
1144
1171
  FileSource["GENERATED"] = "GENERATED";
1145
1172
  })(FileSource || (FileSource = {}));
1173
+ /** The reason why the turn is complete. */
1174
+ var TurnCompleteReason;
1175
+ (function (TurnCompleteReason) {
1176
+ /**
1177
+ * Default value. Reason is unspecified.
1178
+ */
1179
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1180
+ /**
1181
+ * The function call generated by the model is invalid.
1182
+ */
1183
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1184
+ /**
1185
+ * The response is rejected by the model.
1186
+ */
1187
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1188
+ /**
1189
+ * Needs more input from the user.
1190
+ */
1191
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1192
+ })(TurnCompleteReason || (TurnCompleteReason = {}));
1146
1193
  /** Server content modalities. */
1147
1194
  var MediaModality;
1148
1195
  (function (MediaModality) {
@@ -7196,7 +7243,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7196
7243
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7197
7244
  const USER_AGENT_HEADER = 'User-Agent';
7198
7245
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7199
- const SDK_VERSION = '1.19.0'; // x-release-please-version
7246
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
7200
7247
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7201
7248
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7202
7249
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10048,6 +10095,18 @@ function liveServerContentFromMldev(fromObject) {
10048
10095
  if (fromUrlContextMetadata != null) {
10049
10096
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
10050
10097
  }
10098
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10099
+ 'turnCompleteReason',
10100
+ ]);
10101
+ if (fromTurnCompleteReason != null) {
10102
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10103
+ }
10104
+ const fromWaitingForInput = getValueByPath(fromObject, [
10105
+ 'waitingForInput',
10106
+ ]);
10107
+ if (fromWaitingForInput != null) {
10108
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10109
+ }
10051
10110
  return toObject;
10052
10111
  }
10053
10112
  function liveServerToolCallFromMldev(fromObject) {
@@ -10608,6 +10667,18 @@ function liveServerContentFromVertex(fromObject) {
10608
10667
  if (fromOutputTranscription != null) {
10609
10668
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
10610
10669
  }
10670
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10671
+ 'turnCompleteReason',
10672
+ ]);
10673
+ if (fromTurnCompleteReason != null) {
10674
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10675
+ }
10676
+ const fromWaitingForInput = getValueByPath(fromObject, [
10677
+ 'waitingForInput',
10678
+ ]);
10679
+ if (fromWaitingForInput != null) {
10680
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10681
+ }
10611
10682
  return toObject;
10612
10683
  }
10613
10684
  function liveServerToolCallFromVertex(fromObject) {
@@ -19500,5 +19571,5 @@ class GoogleGenAI {
19500
19571
  }
19501
19572
  }
19502
19573
 
19503
- 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 };
19574
+ 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 };
19504
19575
  //# sourceMappingURL=index.mjs.map