@google/genai 1.15.0 → 1.16.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.
@@ -817,6 +817,27 @@ export declare interface CancelBatchJobParameters {
817
817
  config?: CancelBatchJobConfig;
818
818
  }
819
819
 
820
+ /** Optional parameters for tunings.cancel method. */
821
+ export declare interface CancelTuningJobConfig {
822
+ /** Used to override HTTP request options. */
823
+ httpOptions?: HttpOptions;
824
+ /** Abort signal which can be used to cancel the request.
825
+
826
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
827
+ operation will not cancel the request in the service. You will still
828
+ be charged usage for any applicable operations.
829
+ */
830
+ abortSignal?: AbortSignal;
831
+ }
832
+
833
+ /** Parameters for the cancel method. */
834
+ export declare interface CancelTuningJobParameters {
835
+ /** The resource name of the tuning job. */
836
+ name: string;
837
+ /** Optional parameters for the request. */
838
+ config?: CancelTuningJobConfig;
839
+ }
840
+
820
841
  /** A response candidate generated from the model. */
821
842
  export declare interface Candidate {
822
843
  /** Contains the multi-part content of the response.
@@ -1561,6 +1582,8 @@ export declare interface DeleteCachedContentParameters {
1561
1582
 
1562
1583
  /** Empty response for caches.delete method. */
1563
1584
  export declare class DeleteCachedContentResponse {
1585
+ /** Used to retain the full HTTP response. */
1586
+ sdkHttpResponse?: HttpResponse;
1564
1587
  }
1565
1588
 
1566
1589
  /** Used to override the default configuration. */
@@ -1586,6 +1609,8 @@ export declare interface DeleteFileParameters {
1586
1609
 
1587
1610
  /** Response for the delete file method. */
1588
1611
  export declare class DeleteFileResponse {
1612
+ /** Used to retain the full HTTP response. */
1613
+ sdkHttpResponse?: HttpResponse;
1589
1614
  }
1590
1615
 
1591
1616
  /** Configuration for deleting a tuned model. */
@@ -1609,6 +1634,8 @@ export declare interface DeleteModelParameters {
1609
1634
  }
1610
1635
 
1611
1636
  export declare class DeleteModelResponse {
1637
+ /** Used to retain the full HTTP response. */
1638
+ sdkHttpResponse?: HttpResponse;
1612
1639
  }
1613
1640
 
1614
1641
  /** The return value of delete operation. */
@@ -2268,7 +2295,11 @@ export declare enum FunctionCallingConfigMode {
2268
2295
  /**
2269
2296
  * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
2270
2297
  */
2271
- NONE = "NONE"
2298
+ NONE = "NONE",
2299
+ /**
2300
+ * Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations".
2301
+ */
2302
+ VALIDATED = "VALIDATED"
2272
2303
  }
2273
2304
 
2274
2305
  /** Defines a function that the model can generate JSON inputs for.
@@ -2866,7 +2897,7 @@ export declare interface GenerateVideosConfig {
2866
2897
  compressionQuality?: VideoCompressionQuality;
2867
2898
  }
2868
2899
 
2869
- /** A video generation long-running operation. */
2900
+ /** A video generation operation. */
2870
2901
  export declare class GenerateVideosOperation implements Operation<GenerateVideosResponse> {
2871
2902
  /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
2872
2903
  name?: string;
@@ -2876,7 +2907,7 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
2876
2907
  done?: boolean;
2877
2908
  /** The error result of the operation in case of failure or cancellation. */
2878
2909
  error?: Record<string, unknown>;
2879
- /** The response if the operation is successful. */
2910
+ /** The generated videos. */
2880
2911
  response?: GenerateVideosResponse;
2881
2912
  /** The full HTTP response. */
2882
2913
  sdkHttpResponse?: HttpResponse;
@@ -2900,6 +2931,8 @@ export declare interface GenerateVideosParameters {
2900
2931
  /** The input video for video extension use cases.
2901
2932
  Optional if prompt or image is provided. */
2902
2933
  video?: Video;
2934
+ /** A set of source input(s) for video generation. */
2935
+ source?: GenerateVideosSource;
2903
2936
  /** Configuration for generating videos. */
2904
2937
  config?: GenerateVideosConfig;
2905
2938
  }
@@ -2914,6 +2947,19 @@ export declare class GenerateVideosResponse {
2914
2947
  raiMediaFilteredReasons?: string[];
2915
2948
  }
2916
2949
 
2950
+ /** A set of source input(s) for video generation. */
2951
+ export declare interface GenerateVideosSource {
2952
+ /** The text prompt for generating the videos.
2953
+ Optional if image or video is provided. */
2954
+ prompt?: string;
2955
+ /** The input image for generating the videos.
2956
+ Optional if prompt or video is provided. */
2957
+ image?: Image_2;
2958
+ /** The input video for video extension use cases.
2959
+ Optional if prompt or image is provided. */
2960
+ video?: Video;
2961
+ }
2962
+
2917
2963
  /** Generation config. */
2918
2964
  export declare interface GenerationConfig {
2919
2965
  /** Optional. Config for model selection. */
@@ -3097,7 +3143,6 @@ export declare interface GetOperationParameters {
3097
3143
  config?: GetOperationConfig;
3098
3144
  }
3099
3145
 
3100
- /** Optional parameters for tunings.get method. */
3101
3146
  export declare interface GetTuningJobConfig {
3102
3147
  /** Used to override HTTP request options. */
3103
3148
  httpOptions?: HttpOptions;
@@ -4664,6 +4709,7 @@ export declare interface LiveServerSessionResumptionUpdate {
4664
4709
  lastConsumedClientMessageIndex?: string;
4665
4710
  }
4666
4711
 
4712
+ /** Sent in response to a `LiveGenerateContentSetup` message from the client. */
4667
4713
  export declare interface LiveServerSetupComplete {
4668
4714
  /** The session id of the live session. */
4669
4715
  sessionId?: string;
@@ -5062,7 +5108,9 @@ export declare class Models extends BaseModule {
5062
5108
  * ```ts
5063
5109
  * const operation = await ai.models.generateVideos({
5064
5110
  * model: 'veo-2.0-generate-001',
5065
- * prompt: 'A neon hologram of a cat driving at top speed',
5111
+ * source: {
5112
+ * prompt: 'A neon hologram of a cat driving at top speed',
5113
+ * },
5066
5114
  * config: {
5067
5115
  * numberOfVideos: 1
5068
5116
  * });
@@ -5348,10 +5396,10 @@ export declare interface OperationFromAPIResponseParameters {
5348
5396
 
5349
5397
  /** Parameters for the get method of the operations module. */
5350
5398
  export declare interface OperationGetParameters<T, U extends Operation<T>> {
5351
- /** The operation to be retrieved. */
5352
- operation: U;
5353
5399
  /** Used to override the default configuration. */
5354
5400
  config?: GetOperationConfig;
5401
+ /** The operation to be retrieved. */
5402
+ operation: U;
5355
5403
  }
5356
5404
 
5357
5405
  export declare class Operations extends BaseModule {
@@ -5750,6 +5798,8 @@ export declare interface RecontextImageConfig {
5750
5798
  /** Whether allow to generate person images, and restrict to specific
5751
5799
  ages. */
5752
5800
  personGeneration?: PersonGeneration;
5801
+ /** Whether to add a SynthID watermark to the generated images. */
5802
+ addWatermark?: boolean;
5753
5803
  /** MIME type of the generated image. */
5754
5804
  outputMimeType?: string;
5755
5805
  /** Compression quality of the generated image (for ``image/jpeg``
@@ -6634,7 +6684,7 @@ export declare class Tokens extends BaseModule {
6634
6684
 
6635
6685
  /** Tokens info with a list of tokens and the corresponding list of token ids. */
6636
6686
  export declare interface TokensInfo {
6637
- /** Optional. Optional fields for the role from the corresponding Content. */
6687
+ /** Optional fields for the role from the corresponding Content. */
6638
6688
  role?: string;
6639
6689
  /** A list of token ids from the input. */
6640
6690
  tokenIds?: string[];
@@ -6901,6 +6951,18 @@ declare class Tunings extends BaseModule {
6901
6951
  tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
6902
6952
  private getInternal;
6903
6953
  private listInternal;
6954
+ /**
6955
+ * Cancels a tuning job.
6956
+ *
6957
+ * @param params - The parameters for the cancel request.
6958
+ * @return The empty response returned by the API.
6959
+ *
6960
+ * @example
6961
+ * ```ts
6962
+ * await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
6963
+ * ```
6964
+ */
6965
+ cancel(params: types.CancelTuningJobParameters): Promise<void>;
6904
6966
  private tuneInternal;
6905
6967
  private tuneMldevInternal;
6906
6968
  }
@@ -7008,6 +7070,7 @@ declare namespace types {
7008
7070
  SubjectReferenceType,
7009
7071
  EditMode,
7010
7072
  SegmentMode,
7073
+ VideoGenerationReferenceType,
7011
7074
  VideoCompressionQuality,
7012
7075
  FileState,
7013
7076
  FileSource,
@@ -7169,11 +7232,14 @@ declare namespace types {
7169
7232
  TokensInfo,
7170
7233
  ComputeTokensResponse,
7171
7234
  Video,
7235
+ GenerateVideosSource,
7172
7236
  VideoGenerationReferenceImage,
7173
7237
  GenerateVideosConfig,
7174
7238
  GenerateVideosParameters,
7175
7239
  GeneratedVideo,
7176
7240
  GenerateVideosResponse,
7241
+ Operation,
7242
+ GenerateVideosOperation,
7177
7243
  GetTuningJobConfig,
7178
7244
  GetTuningJobParameters,
7179
7245
  TunedModelCheckpoint,
@@ -7199,6 +7265,8 @@ declare namespace types {
7199
7265
  ListTuningJobsConfig,
7200
7266
  ListTuningJobsParameters,
7201
7267
  ListTuningJobsResponse,
7268
+ CancelTuningJobConfig,
7269
+ CancelTuningJobParameters,
7202
7270
  TuningExample,
7203
7271
  TuningDataset,
7204
7272
  TuningValidationDataset,
@@ -7279,10 +7347,7 @@ declare namespace types {
7279
7347
  LiveServerGoAway,
7280
7348
  LiveServerSessionResumptionUpdate,
7281
7349
  LiveServerMessage,
7282
- OperationGetParameters,
7283
7350
  OperationFromAPIResponseParameters,
7284
- Operation,
7285
- GenerateVideosOperation,
7286
7351
  AutomaticActivityDetection,
7287
7352
  RealtimeInputConfig,
7288
7353
  SessionResumptionConfig,
@@ -7326,6 +7391,7 @@ declare namespace types {
7326
7391
  LiveConnectConstraints,
7327
7392
  CreateAuthTokenConfig,
7328
7393
  CreateAuthTokenParameters,
7394
+ OperationGetParameters,
7329
7395
  CreateTuningJobParameters,
7330
7396
  BlobImageUnion,
7331
7397
  PartUnion,
@@ -7456,6 +7522,8 @@ export declare interface UpscaleImageConfig {
7456
7522
  be charged usage for any applicable operations.
7457
7523
  */
7458
7524
  abortSignal?: AbortSignal;
7525
+ /** Cloud Storage URI used to store the generated images. */
7526
+ outputGcsUri?: string;
7459
7527
  /** Whether to include a reason for filtered-out images in the
7460
7528
  response. */
7461
7529
  includeRaiReason?: boolean;
@@ -7640,9 +7708,23 @@ export declare interface VideoGenerationReferenceImage {
7640
7708
  */
7641
7709
  image?: Image_2;
7642
7710
  /** The type of the reference image, which defines how the reference
7643
- image will be used to generate the video. Supported values are 'asset'
7644
- or 'style'. */
7645
- referenceType?: string;
7711
+ image will be used to generate the video. */
7712
+ referenceType?: VideoGenerationReferenceType;
7713
+ }
7714
+
7715
+ /** Enum for the reference type of a video generation reference image. */
7716
+ export declare enum VideoGenerationReferenceType {
7717
+ /**
7718
+ * A reference image that provides assets to the generated video,
7719
+ such as the scene, an object, a character, etc.
7720
+ */
7721
+ ASSET = "ASSET",
7722
+ /**
7723
+ * A reference image that provides aesthetics including colors,
7724
+ lighting, texture, etc., to be used as the style of the generated video,
7725
+ such as 'anime', 'photography', 'origami', etc.
7726
+ */
7727
+ STYLE = "STYLE"
7646
7728
  }
7647
7729
 
7648
7730
  /** Describes how the video in the Part should be used by the model. */