@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.
@@ -4718,6 +4718,12 @@ export declare interface LiveServerContent {
4718
4718
  outputTranscription?: Transcription;
4719
4719
  /** Metadata related to url context retrieval tool. */
4720
4720
  urlContextMetadata?: UrlContextMetadata;
4721
+ /** Reason for the turn is complete. */
4722
+ turnCompleteReason?: TurnCompleteReason;
4723
+ /** If true, indicates that the model is not generating content because
4724
+ it is waiting for more input from the user, e.g. because it expects the
4725
+ user to continue talking. */
4726
+ waitingForInput?: boolean;
4721
4727
  }
4722
4728
 
4723
4729
  /** Server will not be able to service client soon. */
@@ -7022,6 +7028,26 @@ export declare interface TuningValidationDataset {
7022
7028
  vertexDatasetResource?: string;
7023
7029
  }
7024
7030
 
7031
+ /** The reason why the turn is complete. */
7032
+ export declare enum TurnCompleteReason {
7033
+ /**
7034
+ * Default value. Reason is unspecified.
7035
+ */
7036
+ TURN_COMPLETE_REASON_UNSPECIFIED = "TURN_COMPLETE_REASON_UNSPECIFIED",
7037
+ /**
7038
+ * The function call generated by the model is invalid.
7039
+ */
7040
+ MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
7041
+ /**
7042
+ * The response is rejected by the model.
7043
+ */
7044
+ RESPONSE_REJECTED = "RESPONSE_REJECTED",
7045
+ /**
7046
+ * Needs more input from the user.
7047
+ */
7048
+ NEED_MORE_INPUT = "NEED_MORE_INPUT"
7049
+ }
7050
+
7025
7051
  /** Options about which input is included in the user's turn. */
7026
7052
  export declare enum TurnCoverage {
7027
7053
  /**
@@ -7119,9 +7145,11 @@ declare namespace types {
7119
7145
  EditMode,
7120
7146
  SegmentMode,
7121
7147
  VideoGenerationReferenceType,
7148
+ VideoGenerationMaskMode,
7122
7149
  VideoCompressionQuality,
7123
7150
  FileState,
7124
7151
  FileSource,
7152
+ TurnCompleteReason,
7125
7153
  MediaModality,
7126
7154
  StartSensitivity,
7127
7155
  EndSensitivity,
@@ -7764,7 +7792,34 @@ export declare interface VideoGenerationMask {
7764
7792
  /** Describes how the mask will be used. Inpainting masks must
7765
7793
  match the aspect ratio of the input video. Outpainting masks can be
7766
7794
  either 9:16 or 16:9. */
7767
- maskMode?: string;
7795
+ maskMode?: VideoGenerationMaskMode;
7796
+ }
7797
+
7798
+ /** Enum for the mask mode of a video generation mask. */
7799
+ export declare enum VideoGenerationMaskMode {
7800
+ /**
7801
+ * The image mask contains a masked rectangular region which is
7802
+ applied on the first frame of the input video. The object described in
7803
+ the prompt is inserted into this region and will appear in subsequent
7804
+ frames.
7805
+ */
7806
+ INSERT = "INSERT",
7807
+ /**
7808
+ * The image mask is used to determine an object in the
7809
+ first video frame to track. This object is removed from the video.
7810
+ */
7811
+ REMOVE = "REMOVE",
7812
+ /**
7813
+ * The image mask is used to determine a region in the
7814
+ video. Objects in this region will be removed.
7815
+ */
7816
+ REMOVE_STATIC = "REMOVE_STATIC",
7817
+ /**
7818
+ * The image mask contains a masked rectangular region where
7819
+ the input video will go. The remaining area will be generated. Video
7820
+ masks are not supported.
7821
+ */
7822
+ OUTPAINT = "OUTPAINT"
7768
7823
  }
7769
7824
 
7770
7825
  /** A reference image for video generation. */
@@ -1144,6 +1144,33 @@ var VideoGenerationReferenceType;
1144
1144
  */
1145
1145
  VideoGenerationReferenceType["STYLE"] = "STYLE";
1146
1146
  })(VideoGenerationReferenceType || (VideoGenerationReferenceType = {}));
1147
+ /** Enum for the mask mode of a video generation mask. */
1148
+ var VideoGenerationMaskMode;
1149
+ (function (VideoGenerationMaskMode) {
1150
+ /**
1151
+ * The image mask contains a masked rectangular region which is
1152
+ applied on the first frame of the input video. The object described in
1153
+ the prompt is inserted into this region and will appear in subsequent
1154
+ frames.
1155
+ */
1156
+ VideoGenerationMaskMode["INSERT"] = "INSERT";
1157
+ /**
1158
+ * The image mask is used to determine an object in the
1159
+ first video frame to track. This object is removed from the video.
1160
+ */
1161
+ VideoGenerationMaskMode["REMOVE"] = "REMOVE";
1162
+ /**
1163
+ * The image mask is used to determine a region in the
1164
+ video. Objects in this region will be removed.
1165
+ */
1166
+ VideoGenerationMaskMode["REMOVE_STATIC"] = "REMOVE_STATIC";
1167
+ /**
1168
+ * The image mask contains a masked rectangular region where
1169
+ the input video will go. The remaining area will be generated. Video
1170
+ masks are not supported.
1171
+ */
1172
+ VideoGenerationMaskMode["OUTPAINT"] = "OUTPAINT";
1173
+ })(VideoGenerationMaskMode || (VideoGenerationMaskMode = {}));
1147
1174
  /** Enum that controls the compression quality of the generated videos. */
1148
1175
  var VideoCompressionQuality;
1149
1176
  (function (VideoCompressionQuality) {
@@ -1173,6 +1200,26 @@ var FileSource;
1173
1200
  FileSource["UPLOADED"] = "UPLOADED";
1174
1201
  FileSource["GENERATED"] = "GENERATED";
1175
1202
  })(FileSource || (FileSource = {}));
1203
+ /** The reason why the turn is complete. */
1204
+ var TurnCompleteReason;
1205
+ (function (TurnCompleteReason) {
1206
+ /**
1207
+ * Default value. Reason is unspecified.
1208
+ */
1209
+ TurnCompleteReason["TURN_COMPLETE_REASON_UNSPECIFIED"] = "TURN_COMPLETE_REASON_UNSPECIFIED";
1210
+ /**
1211
+ * The function call generated by the model is invalid.
1212
+ */
1213
+ TurnCompleteReason["MALFORMED_FUNCTION_CALL"] = "MALFORMED_FUNCTION_CALL";
1214
+ /**
1215
+ * The response is rejected by the model.
1216
+ */
1217
+ TurnCompleteReason["RESPONSE_REJECTED"] = "RESPONSE_REJECTED";
1218
+ /**
1219
+ * Needs more input from the user.
1220
+ */
1221
+ TurnCompleteReason["NEED_MORE_INPUT"] = "NEED_MORE_INPUT";
1222
+ })(TurnCompleteReason || (TurnCompleteReason = {}));
1176
1223
  /** Server content modalities. */
1177
1224
  var MediaModality;
1178
1225
  (function (MediaModality) {
@@ -9381,6 +9428,18 @@ function liveServerContentFromMldev(fromObject) {
9381
9428
  if (fromUrlContextMetadata != null) {
9382
9429
  setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9383
9430
  }
9431
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
9432
+ 'turnCompleteReason',
9433
+ ]);
9434
+ if (fromTurnCompleteReason != null) {
9435
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
9436
+ }
9437
+ const fromWaitingForInput = getValueByPath(fromObject, [
9438
+ 'waitingForInput',
9439
+ ]);
9440
+ if (fromWaitingForInput != null) {
9441
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
9442
+ }
9384
9443
  return toObject;
9385
9444
  }
9386
9445
  function liveServerToolCallFromMldev(fromObject) {
@@ -9941,6 +10000,18 @@ function liveServerContentFromVertex(fromObject) {
9941
10000
  if (fromOutputTranscription != null) {
9942
10001
  setValueByPath(toObject, ['outputTranscription'], transcriptionFromVertex(fromOutputTranscription));
9943
10002
  }
10003
+ const fromTurnCompleteReason = getValueByPath(fromObject, [
10004
+ 'turnCompleteReason',
10005
+ ]);
10006
+ if (fromTurnCompleteReason != null) {
10007
+ setValueByPath(toObject, ['turnCompleteReason'], fromTurnCompleteReason);
10008
+ }
10009
+ const fromWaitingForInput = getValueByPath(fromObject, [
10010
+ 'waitingForInput',
10011
+ ]);
10012
+ if (fromWaitingForInput != null) {
10013
+ setValueByPath(toObject, ['waitingForInput'], fromWaitingForInput);
10014
+ }
9944
10015
  return toObject;
9945
10016
  }
9946
10017
  function liveServerToolCallFromVertex(fromObject) {
@@ -14284,7 +14355,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
14284
14355
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
14285
14356
  const USER_AGENT_HEADER = 'User-Agent';
14286
14357
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
14287
- const SDK_VERSION = '1.19.0'; // x-release-please-version
14358
+ const SDK_VERSION = '1.20.0'; // x-release-please-version
14288
14359
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
14289
14360
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
14290
14361
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -19560,5 +19631,5 @@ class GoogleGenAI {
19560
19631
  }
19561
19632
  }
19562
19633
 
19563
- 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 };
19634
+ 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 };
19564
19635
  //# sourceMappingURL=index.mjs.map