@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.
- package/dist/genai.d.ts +96 -14
- package/dist/index.cjs +295 -89
- package/dist/index.mjs +296 -90
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +296 -90
- package/dist/node/index.mjs +297 -91
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +96 -14
- package/dist/web/index.mjs +296 -90
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +96 -14
- package/package.json +3 -3
package/dist/genai.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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;
|
|
@@ -4652,6 +4697,7 @@ export declare interface LiveServerSessionResumptionUpdate {
|
|
|
4652
4697
|
lastConsumedClientMessageIndex?: string;
|
|
4653
4698
|
}
|
|
4654
4699
|
|
|
4700
|
+
/** Sent in response to a `LiveGenerateContentSetup` message from the client. */
|
|
4655
4701
|
export declare interface LiveServerSetupComplete {
|
|
4656
4702
|
/** The session id of the live session. */
|
|
4657
4703
|
sessionId?: string;
|
|
@@ -5050,7 +5096,9 @@ export declare class Models extends BaseModule {
|
|
|
5050
5096
|
* ```ts
|
|
5051
5097
|
* const operation = await ai.models.generateVideos({
|
|
5052
5098
|
* model: 'veo-2.0-generate-001',
|
|
5053
|
-
*
|
|
5099
|
+
* source: {
|
|
5100
|
+
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5101
|
+
* },
|
|
5054
5102
|
* config: {
|
|
5055
5103
|
* numberOfVideos: 1
|
|
5056
5104
|
* });
|
|
@@ -5336,10 +5384,10 @@ export declare interface OperationFromAPIResponseParameters {
|
|
|
5336
5384
|
|
|
5337
5385
|
/** Parameters for the get method of the operations module. */
|
|
5338
5386
|
export declare interface OperationGetParameters<T, U extends Operation<T>> {
|
|
5339
|
-
/** The operation to be retrieved. */
|
|
5340
|
-
operation: U;
|
|
5341
5387
|
/** Used to override the default configuration. */
|
|
5342
5388
|
config?: GetOperationConfig;
|
|
5389
|
+
/** The operation to be retrieved. */
|
|
5390
|
+
operation: U;
|
|
5343
5391
|
}
|
|
5344
5392
|
|
|
5345
5393
|
export declare class Operations extends BaseModule {
|
|
@@ -5738,6 +5786,8 @@ export declare interface RecontextImageConfig {
|
|
|
5738
5786
|
/** Whether allow to generate person images, and restrict to specific
|
|
5739
5787
|
ages. */
|
|
5740
5788
|
personGeneration?: PersonGeneration;
|
|
5789
|
+
/** Whether to add a SynthID watermark to the generated images. */
|
|
5790
|
+
addWatermark?: boolean;
|
|
5741
5791
|
/** MIME type of the generated image. */
|
|
5742
5792
|
outputMimeType?: string;
|
|
5743
5793
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
@@ -6622,7 +6672,7 @@ export declare class Tokens extends BaseModule {
|
|
|
6622
6672
|
|
|
6623
6673
|
/** Tokens info with a list of tokens and the corresponding list of token ids. */
|
|
6624
6674
|
export declare interface TokensInfo {
|
|
6625
|
-
/** Optional
|
|
6675
|
+
/** Optional fields for the role from the corresponding Content. */
|
|
6626
6676
|
role?: string;
|
|
6627
6677
|
/** A list of token ids from the input. */
|
|
6628
6678
|
tokenIds?: string[];
|
|
@@ -6889,6 +6939,18 @@ declare class Tunings extends BaseModule {
|
|
|
6889
6939
|
tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
|
|
6890
6940
|
private getInternal;
|
|
6891
6941
|
private listInternal;
|
|
6942
|
+
/**
|
|
6943
|
+
* Cancels a tuning job.
|
|
6944
|
+
*
|
|
6945
|
+
* @param params - The parameters for the cancel request.
|
|
6946
|
+
* @return The empty response returned by the API.
|
|
6947
|
+
*
|
|
6948
|
+
* @example
|
|
6949
|
+
* ```ts
|
|
6950
|
+
* await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
|
|
6951
|
+
* ```
|
|
6952
|
+
*/
|
|
6953
|
+
cancel(params: types.CancelTuningJobParameters): Promise<void>;
|
|
6892
6954
|
private tuneInternal;
|
|
6893
6955
|
private tuneMldevInternal;
|
|
6894
6956
|
}
|
|
@@ -6996,6 +7058,7 @@ declare namespace types {
|
|
|
6996
7058
|
SubjectReferenceType,
|
|
6997
7059
|
EditMode,
|
|
6998
7060
|
SegmentMode,
|
|
7061
|
+
VideoGenerationReferenceType,
|
|
6999
7062
|
VideoCompressionQuality,
|
|
7000
7063
|
FileState,
|
|
7001
7064
|
FileSource,
|
|
@@ -7157,11 +7220,14 @@ declare namespace types {
|
|
|
7157
7220
|
TokensInfo,
|
|
7158
7221
|
ComputeTokensResponse,
|
|
7159
7222
|
Video,
|
|
7223
|
+
GenerateVideosSource,
|
|
7160
7224
|
VideoGenerationReferenceImage,
|
|
7161
7225
|
GenerateVideosConfig,
|
|
7162
7226
|
GenerateVideosParameters,
|
|
7163
7227
|
GeneratedVideo,
|
|
7164
7228
|
GenerateVideosResponse,
|
|
7229
|
+
Operation,
|
|
7230
|
+
GenerateVideosOperation,
|
|
7165
7231
|
GetTuningJobConfig,
|
|
7166
7232
|
GetTuningJobParameters,
|
|
7167
7233
|
TunedModelCheckpoint,
|
|
@@ -7187,6 +7253,8 @@ declare namespace types {
|
|
|
7187
7253
|
ListTuningJobsConfig,
|
|
7188
7254
|
ListTuningJobsParameters,
|
|
7189
7255
|
ListTuningJobsResponse,
|
|
7256
|
+
CancelTuningJobConfig,
|
|
7257
|
+
CancelTuningJobParameters,
|
|
7190
7258
|
TuningExample,
|
|
7191
7259
|
TuningDataset,
|
|
7192
7260
|
TuningValidationDataset,
|
|
@@ -7267,10 +7335,7 @@ declare namespace types {
|
|
|
7267
7335
|
LiveServerGoAway,
|
|
7268
7336
|
LiveServerSessionResumptionUpdate,
|
|
7269
7337
|
LiveServerMessage,
|
|
7270
|
-
OperationGetParameters,
|
|
7271
7338
|
OperationFromAPIResponseParameters,
|
|
7272
|
-
Operation,
|
|
7273
|
-
GenerateVideosOperation,
|
|
7274
7339
|
AutomaticActivityDetection,
|
|
7275
7340
|
RealtimeInputConfig,
|
|
7276
7341
|
SessionResumptionConfig,
|
|
@@ -7314,6 +7379,7 @@ declare namespace types {
|
|
|
7314
7379
|
LiveConnectConstraints,
|
|
7315
7380
|
CreateAuthTokenConfig,
|
|
7316
7381
|
CreateAuthTokenParameters,
|
|
7382
|
+
OperationGetParameters,
|
|
7317
7383
|
CreateTuningJobParameters,
|
|
7318
7384
|
BlobImageUnion,
|
|
7319
7385
|
PartUnion,
|
|
@@ -7444,6 +7510,8 @@ export declare interface UpscaleImageConfig {
|
|
|
7444
7510
|
be charged usage for any applicable operations.
|
|
7445
7511
|
*/
|
|
7446
7512
|
abortSignal?: AbortSignal;
|
|
7513
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
7514
|
+
outputGcsUri?: string;
|
|
7447
7515
|
/** Whether to include a reason for filtered-out images in the
|
|
7448
7516
|
response. */
|
|
7449
7517
|
includeRaiReason?: boolean;
|
|
@@ -7628,9 +7696,23 @@ export declare interface VideoGenerationReferenceImage {
|
|
|
7628
7696
|
*/
|
|
7629
7697
|
image?: Image_2;
|
|
7630
7698
|
/** The type of the reference image, which defines how the reference
|
|
7631
|
-
image will be used to generate the video.
|
|
7632
|
-
|
|
7633
|
-
|
|
7699
|
+
image will be used to generate the video. */
|
|
7700
|
+
referenceType?: VideoGenerationReferenceType;
|
|
7701
|
+
}
|
|
7702
|
+
|
|
7703
|
+
/** Enum for the reference type of a video generation reference image. */
|
|
7704
|
+
export declare enum VideoGenerationReferenceType {
|
|
7705
|
+
/**
|
|
7706
|
+
* A reference image that provides assets to the generated video,
|
|
7707
|
+
such as the scene, an object, a character, etc.
|
|
7708
|
+
*/
|
|
7709
|
+
ASSET = "ASSET",
|
|
7710
|
+
/**
|
|
7711
|
+
* A reference image that provides aesthetics including colors,
|
|
7712
|
+
lighting, texture, etc., to be used as the style of the generated video,
|
|
7713
|
+
such as 'anime', 'photography', 'origami', etc.
|
|
7714
|
+
*/
|
|
7715
|
+
STYLE = "STYLE"
|
|
7634
7716
|
}
|
|
7635
7717
|
|
|
7636
7718
|
/** Describes how the video in the Part should be used by the model. */
|