@google/genai 1.19.0 → 1.21.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/web/web.d.ts CHANGED
@@ -1137,6 +1137,23 @@ export declare interface ContentEmbeddingStatistics {
1137
1137
 
1138
1138
  export declare type ContentListUnion = Content | Content[] | PartUnion | PartUnion[];
1139
1139
 
1140
+ /** A content reference image.
1141
+
1142
+ A content reference image represents a subject to reference (ex. person,
1143
+ product, animal) provided by the user. It can optionally be provided in
1144
+ addition to a style reference image (ex. background, style reference).
1145
+ */
1146
+ export declare class ContentReferenceImage {
1147
+ /** The reference image for the editing operation. */
1148
+ referenceImage?: Image_2;
1149
+ /** The id of the reference image. */
1150
+ referenceId?: number;
1151
+ /** The type of the reference image. Only set by the SDK. */
1152
+ referenceType?: string;
1153
+ /** Internal method to convert to ReferenceImageAPIInternal. */
1154
+ toReferenceImageAPI(): ReferenceImageAPIInternal;
1155
+ }
1156
+
1140
1157
  export declare type ContentUnion = Content | PartUnion[] | PartUnion;
1141
1158
 
1142
1159
  /** Enables context window compression -- mechanism managing model context window so it does not exceed given length. */
@@ -2401,6 +2418,9 @@ export declare class FunctionResponse {
2401
2418
  willContinue?: boolean;
2402
2419
  /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
2403
2420
  scheduling?: FunctionResponseScheduling;
2421
+ /** List of parts that constitute a function response. Each part may
2422
+ have a different IANA MIME type. */
2423
+ parts?: FunctionResponsePart[];
2404
2424
  /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
2405
2425
  id?: string;
2406
2426
  /** Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. */
@@ -2409,6 +2429,44 @@ export declare class FunctionResponse {
2409
2429
  response?: Record<string, unknown>;
2410
2430
  }
2411
2431
 
2432
+ /** Raw media bytes for function response.
2433
+
2434
+ Text should not be sent as raw bytes, use the FunctionResponse.response
2435
+ field.
2436
+ */
2437
+ export declare class FunctionResponseBlob {
2438
+ /** Required. The IANA standard MIME type of the source data. */
2439
+ mimeType?: string;
2440
+ /** Required. Inline media bytes.
2441
+ * @remarks Encoded as base64 string. */
2442
+ data?: string;
2443
+ }
2444
+
2445
+ /** URI based data for function response. */
2446
+ export declare class FunctionResponseFileData {
2447
+ /** Required. URI. */
2448
+ fileUri?: string;
2449
+ /** Required. The IANA standard MIME type of the source data. */
2450
+ mimeType?: string;
2451
+ }
2452
+
2453
+ /** A datatype containing media that is part of a `FunctionResponse` message.
2454
+
2455
+ A `FunctionResponsePart` consists of data which has an associated datatype. A
2456
+ `FunctionResponsePart` can only contain one of the accepted types in
2457
+ `FunctionResponsePart.data`.
2458
+
2459
+ A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
2460
+ type and subtype of the media if the `inline_data` field is filled with raw
2461
+ bytes.
2462
+ */
2463
+ export declare class FunctionResponsePart {
2464
+ /** Optional. Inline media bytes. */
2465
+ inlineData?: FunctionResponseBlob;
2466
+ /** Optional. URI based data. */
2467
+ fileData?: FunctionResponseFileData;
2468
+ }
2469
+
2412
2470
  /** Specifies how the response should be scheduled in the conversation. */
2413
2471
  export declare enum FunctionResponseScheduling {
2414
2472
  /**
@@ -4711,6 +4769,12 @@ export declare interface LiveServerContent {
4711
4769
  outputTranscription?: Transcription;
4712
4770
  /** Metadata related to url context retrieval tool. */
4713
4771
  urlContextMetadata?: UrlContextMetadata;
4772
+ /** Reason for the turn is complete. */
4773
+ turnCompleteReason?: TurnCompleteReason;
4774
+ /** If true, indicates that the model is not generating content because
4775
+ it is waiting for more input from the user, e.g. because it expects the
4776
+ user to continue talking. */
4777
+ waitingForInput?: boolean;
4714
4778
  }
4715
4779
 
4716
4780
  /** Server will not be able to service client soon. */
@@ -5872,7 +5936,7 @@ export declare interface RecontextImageSource {
5872
5936
  productImages?: ProductImage[];
5873
5937
  }
5874
5938
 
5875
- export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
5939
+ export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage | ContentReferenceImage;
5876
5940
 
5877
5941
  /** Private class that represents a Reference image that is sent to API. */
5878
5942
  declare interface ReferenceImageAPIInternal {
@@ -6769,6 +6833,12 @@ export declare interface ToolCodeExecution {
6769
6833
  export declare interface ToolComputerUse {
6770
6834
  /** Required. The environment being operated. */
6771
6835
  environment?: Environment;
6836
+ /** By default, predefined functions are included in the final model call.
6837
+ Some of them can be explicitly excluded from being automatically included.
6838
+ This can serve two purposes:
6839
+ 1. Using a more restricted / different action space.
6840
+ 2. Improving the definitions / instructions of predefined functions. */
6841
+ excludedPredefinedFunctions?: string[];
6772
6842
  }
6773
6843
 
6774
6844
  /** Tool config.
@@ -7015,6 +7085,26 @@ export declare interface TuningValidationDataset {
7015
7085
  vertexDatasetResource?: string;
7016
7086
  }
7017
7087
 
7088
+ /** The reason why the turn is complete. */
7089
+ export declare enum TurnCompleteReason {
7090
+ /**
7091
+ * Default value. Reason is unspecified.
7092
+ */
7093
+ TURN_COMPLETE_REASON_UNSPECIFIED = "TURN_COMPLETE_REASON_UNSPECIFIED",
7094
+ /**
7095
+ * The function call generated by the model is invalid.
7096
+ */
7097
+ MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL",
7098
+ /**
7099
+ * The response is rejected by the model.
7100
+ */
7101
+ RESPONSE_REJECTED = "RESPONSE_REJECTED",
7102
+ /**
7103
+ * Needs more input from the user.
7104
+ */
7105
+ NEED_MORE_INPUT = "NEED_MORE_INPUT"
7106
+ }
7107
+
7018
7108
  /** Options about which input is included in the user's turn. */
7019
7109
  export declare enum TurnCoverage {
7020
7110
  /**
@@ -7112,9 +7202,11 @@ declare namespace types {
7112
7202
  EditMode,
7113
7203
  SegmentMode,
7114
7204
  VideoGenerationReferenceType,
7205
+ VideoGenerationMaskMode,
7115
7206
  VideoCompressionQuality,
7116
7207
  FileState,
7117
7208
  FileSource,
7209
+ TurnCompleteReason,
7118
7210
  MediaModality,
7119
7211
  StartSensitivity,
7120
7212
  EndSensitivity,
@@ -7130,6 +7222,9 @@ declare namespace types {
7130
7222
  FunctionCall,
7131
7223
  CodeExecutionResult,
7132
7224
  ExecutableCode,
7225
+ FunctionResponseBlob,
7226
+ FunctionResponseFileData,
7227
+ FunctionResponsePart,
7133
7228
  FunctionResponse,
7134
7229
  Part,
7135
7230
  Content,
@@ -7386,6 +7481,7 @@ declare namespace types {
7386
7481
  ControlReferenceImage,
7387
7482
  StyleReferenceImage,
7388
7483
  SubjectReferenceImage,
7484
+ ContentReferenceImage,
7389
7485
  LiveServerSetupComplete,
7390
7486
  Transcription,
7391
7487
  LiveServerContent,
@@ -7757,7 +7853,34 @@ export declare interface VideoGenerationMask {
7757
7853
  /** Describes how the mask will be used. Inpainting masks must
7758
7854
  match the aspect ratio of the input video. Outpainting masks can be
7759
7855
  either 9:16 or 16:9. */
7760
- maskMode?: string;
7856
+ maskMode?: VideoGenerationMaskMode;
7857
+ }
7858
+
7859
+ /** Enum for the mask mode of a video generation mask. */
7860
+ export declare enum VideoGenerationMaskMode {
7861
+ /**
7862
+ * The image mask contains a masked rectangular region which is
7863
+ applied on the first frame of the input video. The object described in
7864
+ the prompt is inserted into this region and will appear in subsequent
7865
+ frames.
7866
+ */
7867
+ INSERT = "INSERT",
7868
+ /**
7869
+ * The image mask is used to determine an object in the
7870
+ first video frame to track. This object is removed from the video.
7871
+ */
7872
+ REMOVE = "REMOVE",
7873
+ /**
7874
+ * The image mask is used to determine a region in the
7875
+ video. Objects in this region will be removed.
7876
+ */
7877
+ REMOVE_STATIC = "REMOVE_STATIC",
7878
+ /**
7879
+ * The image mask contains a masked rectangular region where
7880
+ the input video will go. The remaining area will be generated. Video
7881
+ masks are not supported.
7882
+ */
7883
+ OUTPAINT = "OUTPAINT"
7761
7884
  }
7762
7885
 
7763
7886
  /** A reference image for video generation. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",
@@ -61,6 +61,9 @@
61
61
  "engines": {
62
62
  "node": ">=20.0.0"
63
63
  },
64
+ "overrides": {
65
+ "tmp": "^0.2.4"
66
+ },
64
67
  "files": [
65
68
  "dist/genai.d.ts",
66
69
  "dist/index.mjs",