@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/web/web.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;
|
|
@@ -4657,6 +4702,7 @@ export declare interface LiveServerSessionResumptionUpdate {
|
|
|
4657
4702
|
lastConsumedClientMessageIndex?: string;
|
|
4658
4703
|
}
|
|
4659
4704
|
|
|
4705
|
+
/** Sent in response to a `LiveGenerateContentSetup` message from the client. */
|
|
4660
4706
|
export declare interface LiveServerSetupComplete {
|
|
4661
4707
|
/** The session id of the live session. */
|
|
4662
4708
|
sessionId?: string;
|
|
@@ -5055,7 +5101,9 @@ export declare class Models extends BaseModule {
|
|
|
5055
5101
|
* ```ts
|
|
5056
5102
|
* const operation = await ai.models.generateVideos({
|
|
5057
5103
|
* model: 'veo-2.0-generate-001',
|
|
5058
|
-
*
|
|
5104
|
+
* source: {
|
|
5105
|
+
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5106
|
+
* },
|
|
5059
5107
|
* config: {
|
|
5060
5108
|
* numberOfVideos: 1
|
|
5061
5109
|
* });
|
|
@@ -5341,10 +5389,10 @@ export declare interface OperationFromAPIResponseParameters {
|
|
|
5341
5389
|
|
|
5342
5390
|
/** Parameters for the get method of the operations module. */
|
|
5343
5391
|
export declare interface OperationGetParameters<T, U extends Operation<T>> {
|
|
5344
|
-
/** The operation to be retrieved. */
|
|
5345
|
-
operation: U;
|
|
5346
5392
|
/** Used to override the default configuration. */
|
|
5347
5393
|
config?: GetOperationConfig;
|
|
5394
|
+
/** The operation to be retrieved. */
|
|
5395
|
+
operation: U;
|
|
5348
5396
|
}
|
|
5349
5397
|
|
|
5350
5398
|
export declare class Operations extends BaseModule {
|
|
@@ -5743,6 +5791,8 @@ export declare interface RecontextImageConfig {
|
|
|
5743
5791
|
/** Whether allow to generate person images, and restrict to specific
|
|
5744
5792
|
ages. */
|
|
5745
5793
|
personGeneration?: PersonGeneration;
|
|
5794
|
+
/** Whether to add a SynthID watermark to the generated images. */
|
|
5795
|
+
addWatermark?: boolean;
|
|
5746
5796
|
/** MIME type of the generated image. */
|
|
5747
5797
|
outputMimeType?: string;
|
|
5748
5798
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
@@ -6627,7 +6677,7 @@ export declare class Tokens extends BaseModule {
|
|
|
6627
6677
|
|
|
6628
6678
|
/** Tokens info with a list of tokens and the corresponding list of token ids. */
|
|
6629
6679
|
export declare interface TokensInfo {
|
|
6630
|
-
/** Optional
|
|
6680
|
+
/** Optional fields for the role from the corresponding Content. */
|
|
6631
6681
|
role?: string;
|
|
6632
6682
|
/** A list of token ids from the input. */
|
|
6633
6683
|
tokenIds?: string[];
|
|
@@ -6894,6 +6944,18 @@ declare class Tunings extends BaseModule {
|
|
|
6894
6944
|
tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
|
|
6895
6945
|
private getInternal;
|
|
6896
6946
|
private listInternal;
|
|
6947
|
+
/**
|
|
6948
|
+
* Cancels a tuning job.
|
|
6949
|
+
*
|
|
6950
|
+
* @param params - The parameters for the cancel request.
|
|
6951
|
+
* @return The empty response returned by the API.
|
|
6952
|
+
*
|
|
6953
|
+
* @example
|
|
6954
|
+
* ```ts
|
|
6955
|
+
* await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
|
|
6956
|
+
* ```
|
|
6957
|
+
*/
|
|
6958
|
+
cancel(params: types.CancelTuningJobParameters): Promise<void>;
|
|
6897
6959
|
private tuneInternal;
|
|
6898
6960
|
private tuneMldevInternal;
|
|
6899
6961
|
}
|
|
@@ -7001,6 +7063,7 @@ declare namespace types {
|
|
|
7001
7063
|
SubjectReferenceType,
|
|
7002
7064
|
EditMode,
|
|
7003
7065
|
SegmentMode,
|
|
7066
|
+
VideoGenerationReferenceType,
|
|
7004
7067
|
VideoCompressionQuality,
|
|
7005
7068
|
FileState,
|
|
7006
7069
|
FileSource,
|
|
@@ -7162,11 +7225,14 @@ declare namespace types {
|
|
|
7162
7225
|
TokensInfo,
|
|
7163
7226
|
ComputeTokensResponse,
|
|
7164
7227
|
Video,
|
|
7228
|
+
GenerateVideosSource,
|
|
7165
7229
|
VideoGenerationReferenceImage,
|
|
7166
7230
|
GenerateVideosConfig,
|
|
7167
7231
|
GenerateVideosParameters,
|
|
7168
7232
|
GeneratedVideo,
|
|
7169
7233
|
GenerateVideosResponse,
|
|
7234
|
+
Operation,
|
|
7235
|
+
GenerateVideosOperation,
|
|
7170
7236
|
GetTuningJobConfig,
|
|
7171
7237
|
GetTuningJobParameters,
|
|
7172
7238
|
TunedModelCheckpoint,
|
|
@@ -7192,6 +7258,8 @@ declare namespace types {
|
|
|
7192
7258
|
ListTuningJobsConfig,
|
|
7193
7259
|
ListTuningJobsParameters,
|
|
7194
7260
|
ListTuningJobsResponse,
|
|
7261
|
+
CancelTuningJobConfig,
|
|
7262
|
+
CancelTuningJobParameters,
|
|
7195
7263
|
TuningExample,
|
|
7196
7264
|
TuningDataset,
|
|
7197
7265
|
TuningValidationDataset,
|
|
@@ -7272,10 +7340,7 @@ declare namespace types {
|
|
|
7272
7340
|
LiveServerGoAway,
|
|
7273
7341
|
LiveServerSessionResumptionUpdate,
|
|
7274
7342
|
LiveServerMessage,
|
|
7275
|
-
OperationGetParameters,
|
|
7276
7343
|
OperationFromAPIResponseParameters,
|
|
7277
|
-
Operation,
|
|
7278
|
-
GenerateVideosOperation,
|
|
7279
7344
|
AutomaticActivityDetection,
|
|
7280
7345
|
RealtimeInputConfig,
|
|
7281
7346
|
SessionResumptionConfig,
|
|
@@ -7319,6 +7384,7 @@ declare namespace types {
|
|
|
7319
7384
|
LiveConnectConstraints,
|
|
7320
7385
|
CreateAuthTokenConfig,
|
|
7321
7386
|
CreateAuthTokenParameters,
|
|
7387
|
+
OperationGetParameters,
|
|
7322
7388
|
CreateTuningJobParameters,
|
|
7323
7389
|
BlobImageUnion,
|
|
7324
7390
|
PartUnion,
|
|
@@ -7449,6 +7515,8 @@ export declare interface UpscaleImageConfig {
|
|
|
7449
7515
|
be charged usage for any applicable operations.
|
|
7450
7516
|
*/
|
|
7451
7517
|
abortSignal?: AbortSignal;
|
|
7518
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
7519
|
+
outputGcsUri?: string;
|
|
7452
7520
|
/** Whether to include a reason for filtered-out images in the
|
|
7453
7521
|
response. */
|
|
7454
7522
|
includeRaiReason?: boolean;
|
|
@@ -7633,9 +7701,23 @@ export declare interface VideoGenerationReferenceImage {
|
|
|
7633
7701
|
*/
|
|
7634
7702
|
image?: Image_2;
|
|
7635
7703
|
/** The type of the reference image, which defines how the reference
|
|
7636
|
-
image will be used to generate the video.
|
|
7637
|
-
|
|
7638
|
-
|
|
7704
|
+
image will be used to generate the video. */
|
|
7705
|
+
referenceType?: VideoGenerationReferenceType;
|
|
7706
|
+
}
|
|
7707
|
+
|
|
7708
|
+
/** Enum for the reference type of a video generation reference image. */
|
|
7709
|
+
export declare enum VideoGenerationReferenceType {
|
|
7710
|
+
/**
|
|
7711
|
+
* A reference image that provides assets to the generated video,
|
|
7712
|
+
such as the scene, an object, a character, etc.
|
|
7713
|
+
*/
|
|
7714
|
+
ASSET = "ASSET",
|
|
7715
|
+
/**
|
|
7716
|
+
* A reference image that provides aesthetics including colors,
|
|
7717
|
+
lighting, texture, etc., to be used as the style of the generated video,
|
|
7718
|
+
such as 'anime', 'photography', 'origami', etc.
|
|
7719
|
+
*/
|
|
7720
|
+
STYLE = "STYLE"
|
|
7639
7721
|
}
|
|
7640
7722
|
|
|
7641
7723
|
/** Describes how the video in the Part should be used by the model. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/genai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.mjs",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"prettier": "3.3.3",
|
|
95
95
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
96
96
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
97
|
-
"test-server-sdk": "^0.2.
|
|
97
|
+
"test-server-sdk": "^0.2.7",
|
|
98
98
|
"ts-node": "^10.9.2",
|
|
99
99
|
"tslib": "^2.8.1",
|
|
100
100
|
"tsx": "^4.19.4",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"ws": "^8.18.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@modelcontextprotocol/sdk": "^1.11.
|
|
112
|
+
"@modelcontextprotocol/sdk": "^1.11.4"
|
|
113
113
|
},
|
|
114
114
|
"peerDependenciesMeta": {
|
|
115
115
|
"@modelcontextprotocol/sdk": {
|