@google/genai 1.20.0 → 1.22.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 +139 -10
- package/dist/index.cjs +6924 -6844
- package/dist/index.mjs +6921 -6845
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +6924 -6844
- package/dist/node/index.mjs +6921 -6845
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +139 -10
- package/dist/web/index.mjs +6921 -6845
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +139 -10
- package/package.json +1 -1
package/dist/node/node.d.ts
CHANGED
|
@@ -1069,6 +1069,18 @@ export declare interface CodeExecutionResult {
|
|
|
1069
1069
|
output?: string;
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
|
+
/** Tool to support computer use. */
|
|
1073
|
+
export declare interface ComputerUse {
|
|
1074
|
+
/** Required. The environment being operated. */
|
|
1075
|
+
environment?: Environment;
|
|
1076
|
+
/** By default, predefined functions are included in the final model call.
|
|
1077
|
+
Some of them can be explicitly excluded from being automatically included.
|
|
1078
|
+
This can serve two purposes:
|
|
1079
|
+
1. Using a more restricted / different action space.
|
|
1080
|
+
2. Improving the definitions / instructions of predefined functions. */
|
|
1081
|
+
excludedPredefinedFunctions?: string[];
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1072
1084
|
/** Optional parameters for computing tokens. */
|
|
1073
1085
|
export declare interface ComputeTokensConfig {
|
|
1074
1086
|
/** Used to override HTTP request options. */
|
|
@@ -1137,6 +1149,23 @@ export declare interface ContentEmbeddingStatistics {
|
|
|
1137
1149
|
|
|
1138
1150
|
export declare type ContentListUnion = Content | Content[] | PartUnion | PartUnion[];
|
|
1139
1151
|
|
|
1152
|
+
/** A content reference image.
|
|
1153
|
+
|
|
1154
|
+
A content reference image represents a subject to reference (ex. person,
|
|
1155
|
+
product, animal) provided by the user. It can optionally be provided in
|
|
1156
|
+
addition to a style reference image (ex. background, style reference).
|
|
1157
|
+
*/
|
|
1158
|
+
export declare class ContentReferenceImage {
|
|
1159
|
+
/** The reference image for the editing operation. */
|
|
1160
|
+
referenceImage?: Image_2;
|
|
1161
|
+
/** The id of the reference image. */
|
|
1162
|
+
referenceId?: number;
|
|
1163
|
+
/** The type of the reference image. Only set by the SDK. */
|
|
1164
|
+
referenceType?: string;
|
|
1165
|
+
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
1166
|
+
toReferenceImageAPI(): ReferenceImageAPIInternal;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1140
1169
|
export declare type ContentUnion = Content | PartUnion[] | PartUnion;
|
|
1141
1170
|
|
|
1142
1171
|
/** Enables context window compression -- mechanism managing model context window so it does not exceed given length. */
|
|
@@ -2327,7 +2356,11 @@ export declare enum FinishReason {
|
|
|
2327
2356
|
/**
|
|
2328
2357
|
* The tool call generated by the model is invalid.
|
|
2329
2358
|
*/
|
|
2330
|
-
UNEXPECTED_TOOL_CALL = "UNEXPECTED_TOOL_CALL"
|
|
2359
|
+
UNEXPECTED_TOOL_CALL = "UNEXPECTED_TOOL_CALL",
|
|
2360
|
+
/**
|
|
2361
|
+
* Image generation stopped because the generated images have prohibited content.
|
|
2362
|
+
*/
|
|
2363
|
+
IMAGE_PROHIBITED_CONTENT = "IMAGE_PROHIBITED_CONTENT"
|
|
2331
2364
|
}
|
|
2332
2365
|
|
|
2333
2366
|
/** A function call. */
|
|
@@ -2401,6 +2434,9 @@ export declare class FunctionResponse {
|
|
|
2401
2434
|
willContinue?: boolean;
|
|
2402
2435
|
/** 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
2436
|
scheduling?: FunctionResponseScheduling;
|
|
2437
|
+
/** List of parts that constitute a function response. Each part may
|
|
2438
|
+
have a different IANA MIME type. */
|
|
2439
|
+
parts?: FunctionResponsePart[];
|
|
2404
2440
|
/** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
|
|
2405
2441
|
id?: string;
|
|
2406
2442
|
/** Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. */
|
|
@@ -2409,6 +2445,44 @@ export declare class FunctionResponse {
|
|
|
2409
2445
|
response?: Record<string, unknown>;
|
|
2410
2446
|
}
|
|
2411
2447
|
|
|
2448
|
+
/** Raw media bytes for function response.
|
|
2449
|
+
|
|
2450
|
+
Text should not be sent as raw bytes, use the FunctionResponse.response
|
|
2451
|
+
field.
|
|
2452
|
+
*/
|
|
2453
|
+
export declare class FunctionResponseBlob {
|
|
2454
|
+
/** Required. The IANA standard MIME type of the source data. */
|
|
2455
|
+
mimeType?: string;
|
|
2456
|
+
/** Required. Inline media bytes.
|
|
2457
|
+
* @remarks Encoded as base64 string. */
|
|
2458
|
+
data?: string;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
/** URI based data for function response. */
|
|
2462
|
+
export declare class FunctionResponseFileData {
|
|
2463
|
+
/** Required. URI. */
|
|
2464
|
+
fileUri?: string;
|
|
2465
|
+
/** Required. The IANA standard MIME type of the source data. */
|
|
2466
|
+
mimeType?: string;
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
/** A datatype containing media that is part of a `FunctionResponse` message.
|
|
2470
|
+
|
|
2471
|
+
A `FunctionResponsePart` consists of data which has an associated datatype. A
|
|
2472
|
+
`FunctionResponsePart` can only contain one of the accepted types in
|
|
2473
|
+
`FunctionResponsePart.data`.
|
|
2474
|
+
|
|
2475
|
+
A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
|
|
2476
|
+
type and subtype of the media if the `inline_data` field is filled with raw
|
|
2477
|
+
bytes.
|
|
2478
|
+
*/
|
|
2479
|
+
export declare class FunctionResponsePart {
|
|
2480
|
+
/** Optional. Inline media bytes. */
|
|
2481
|
+
inlineData?: FunctionResponseBlob;
|
|
2482
|
+
/** Optional. URI based data. */
|
|
2483
|
+
fileData?: FunctionResponseFileData;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2412
2486
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
2413
2487
|
export declare enum FunctionResponseScheduling {
|
|
2414
2488
|
/**
|
|
@@ -2592,6 +2666,9 @@ export declare interface GenerateContentConfig {
|
|
|
2592
2666
|
/** The thinking features configuration.
|
|
2593
2667
|
*/
|
|
2594
2668
|
thinkingConfig?: ThinkingConfig;
|
|
2669
|
+
/** The image generation configuration.
|
|
2670
|
+
*/
|
|
2671
|
+
imageConfig?: ImageConfig;
|
|
2595
2672
|
}
|
|
2596
2673
|
|
|
2597
2674
|
/** Config for models.generate_content parameters. */
|
|
@@ -3725,6 +3802,13 @@ declare interface Image_2 {
|
|
|
3725
3802
|
}
|
|
3726
3803
|
export { Image_2 as Image }
|
|
3727
3804
|
|
|
3805
|
+
/** The image generation configuration to be used in GenerateContentConfig. */
|
|
3806
|
+
export declare interface ImageConfig {
|
|
3807
|
+
/** Aspect ratio of the generated images. Supported values are
|
|
3808
|
+
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */
|
|
3809
|
+
aspectRatio?: string;
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3728
3812
|
/** Enum that specifies the language of the text in the prompt. */
|
|
3729
3813
|
export declare enum ImagePromptLanguage {
|
|
3730
3814
|
/**
|
|
@@ -4304,6 +4388,11 @@ export declare interface LiveConnectConfig {
|
|
|
4304
4388
|
/** The speech generation configuration.
|
|
4305
4389
|
*/
|
|
4306
4390
|
speechConfig?: SpeechConfig;
|
|
4391
|
+
/** Config for thinking features.
|
|
4392
|
+
An error will be returned if this field is set for models that don't
|
|
4393
|
+
support thinking.
|
|
4394
|
+
*/
|
|
4395
|
+
thinkingConfig?: ThinkingConfig;
|
|
4307
4396
|
/** If enabled, the model will detect emotions and adapt its responses accordingly. */
|
|
4308
4397
|
enableAffectiveDialog?: boolean;
|
|
4309
4398
|
/** The user provided system instructions for the model.
|
|
@@ -5885,7 +5974,7 @@ export declare interface RecontextImageSource {
|
|
|
5885
5974
|
productImages?: ProductImage[];
|
|
5886
5975
|
}
|
|
5887
5976
|
|
|
5888
|
-
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
|
|
5977
|
+
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage | ContentReferenceImage;
|
|
5889
5978
|
|
|
5890
5979
|
/** Private class that represents a Reference image that is sent to API. */
|
|
5891
5980
|
declare interface ReferenceImageAPIInternal {
|
|
@@ -6769,7 +6858,7 @@ export declare interface Tool {
|
|
|
6769
6858
|
/** Optional. Tool to support the model interacting directly with the
|
|
6770
6859
|
computer. If enabled, it automatically populates computer-use specific
|
|
6771
6860
|
Function Declarations. */
|
|
6772
|
-
computerUse?:
|
|
6861
|
+
computerUse?: ComputerUse;
|
|
6773
6862
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6774
6863
|
codeExecution?: ToolCodeExecution;
|
|
6775
6864
|
}
|
|
@@ -6778,12 +6867,6 @@ export declare interface Tool {
|
|
|
6778
6867
|
export declare interface ToolCodeExecution {
|
|
6779
6868
|
}
|
|
6780
6869
|
|
|
6781
|
-
/** Tool to support computer use. */
|
|
6782
|
-
export declare interface ToolComputerUse {
|
|
6783
|
-
/** Required. The environment being operated. */
|
|
6784
|
-
environment?: Environment;
|
|
6785
|
-
}
|
|
6786
|
-
|
|
6787
6870
|
/** Tool config.
|
|
6788
6871
|
|
|
6789
6872
|
This config is shared for all tools provided in the request.
|
|
@@ -6938,6 +7021,8 @@ export declare interface TuningJob {
|
|
|
6938
7021
|
serviceAccount?: string;
|
|
6939
7022
|
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
6940
7023
|
tunedModelDisplayName?: string;
|
|
7024
|
+
/** Tuning Spec for Veo Tuning. */
|
|
7025
|
+
veoTuningSpec?: VeoTuningSpec;
|
|
6941
7026
|
}
|
|
6942
7027
|
|
|
6943
7028
|
/** Tuning mode. */
|
|
@@ -7021,6 +7106,22 @@ declare class Tunings extends BaseModule {
|
|
|
7021
7106
|
private tuneMldevInternal;
|
|
7022
7107
|
}
|
|
7023
7108
|
|
|
7109
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7110
|
+
export declare enum TuningTask {
|
|
7111
|
+
/**
|
|
7112
|
+
* Default value. This value is unused.
|
|
7113
|
+
*/
|
|
7114
|
+
TUNING_TASK_UNSPECIFIED = "TUNING_TASK_UNSPECIFIED",
|
|
7115
|
+
/**
|
|
7116
|
+
* Tuning task for image to video.
|
|
7117
|
+
*/
|
|
7118
|
+
TUNING_TASK_I2V = "TUNING_TASK_I2V",
|
|
7119
|
+
/**
|
|
7120
|
+
* Tuning task for text to video.
|
|
7121
|
+
*/
|
|
7122
|
+
TUNING_TASK_T2V = "TUNING_TASK_T2V"
|
|
7123
|
+
}
|
|
7124
|
+
|
|
7024
7125
|
export declare interface TuningValidationDataset {
|
|
7025
7126
|
/** GCS URI of the file containing validation dataset in JSONL format. */
|
|
7026
7127
|
gcsUri?: string;
|
|
@@ -7131,6 +7232,7 @@ declare namespace types {
|
|
|
7131
7232
|
JobState,
|
|
7132
7233
|
TuningMode,
|
|
7133
7234
|
AdapterSize,
|
|
7235
|
+
TuningTask,
|
|
7134
7236
|
FeatureSelectionPreference,
|
|
7135
7237
|
Behavior,
|
|
7136
7238
|
DynamicRetrievalConfigMode,
|
|
@@ -7165,6 +7267,9 @@ declare namespace types {
|
|
|
7165
7267
|
FunctionCall,
|
|
7166
7268
|
CodeExecutionResult,
|
|
7167
7269
|
ExecutableCode,
|
|
7270
|
+
FunctionResponseBlob,
|
|
7271
|
+
FunctionResponseFileData,
|
|
7272
|
+
FunctionResponsePart,
|
|
7168
7273
|
FunctionResponse,
|
|
7169
7274
|
Part,
|
|
7170
7275
|
Content,
|
|
@@ -7186,7 +7291,7 @@ declare namespace types {
|
|
|
7186
7291
|
AuthConfig,
|
|
7187
7292
|
GoogleMaps,
|
|
7188
7293
|
UrlContext,
|
|
7189
|
-
|
|
7294
|
+
ComputerUse,
|
|
7190
7295
|
ApiAuthApiKeyConfig,
|
|
7191
7296
|
ApiAuth,
|
|
7192
7297
|
ExternalApiElasticSearchParams,
|
|
@@ -7216,6 +7321,7 @@ declare namespace types {
|
|
|
7216
7321
|
SpeechConfig,
|
|
7217
7322
|
AutomaticFunctionCallingConfig,
|
|
7218
7323
|
ThinkingConfig,
|
|
7324
|
+
ImageConfig,
|
|
7219
7325
|
GenerationConfigRoutingConfigAutoRoutingMode,
|
|
7220
7326
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
7221
7327
|
GenerationConfigRoutingConfig,
|
|
@@ -7338,6 +7444,8 @@ declare namespace types {
|
|
|
7338
7444
|
TuningDataStats,
|
|
7339
7445
|
EncryptionSpec,
|
|
7340
7446
|
PartnerModelTuningSpec,
|
|
7447
|
+
VeoHyperParameters,
|
|
7448
|
+
VeoTuningSpec,
|
|
7341
7449
|
TuningJob,
|
|
7342
7450
|
ListTuningJobsConfig,
|
|
7343
7451
|
ListTuningJobsParameters,
|
|
@@ -7421,6 +7529,7 @@ declare namespace types {
|
|
|
7421
7529
|
ControlReferenceImage,
|
|
7422
7530
|
StyleReferenceImage,
|
|
7423
7531
|
SubjectReferenceImage,
|
|
7532
|
+
ContentReferenceImage,
|
|
7424
7533
|
LiveServerSetupComplete,
|
|
7425
7534
|
Transcription,
|
|
7426
7535
|
LiveServerContent,
|
|
@@ -7714,6 +7823,26 @@ export declare interface UsageMetadata {
|
|
|
7714
7823
|
trafficType?: TrafficType;
|
|
7715
7824
|
}
|
|
7716
7825
|
|
|
7826
|
+
/** Hyperparameters for Veo. */
|
|
7827
|
+
export declare interface VeoHyperParameters {
|
|
7828
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
7829
|
+
epochCount?: string;
|
|
7830
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
7831
|
+
learningRateMultiplier?: number;
|
|
7832
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7833
|
+
tuningTask?: TuningTask;
|
|
7834
|
+
}
|
|
7835
|
+
|
|
7836
|
+
/** Tuning Spec for Veo Model Tuning. */
|
|
7837
|
+
export declare interface VeoTuningSpec {
|
|
7838
|
+
/** Optional. Hyperparameters for Veo. */
|
|
7839
|
+
hyperParameters?: VeoHyperParameters;
|
|
7840
|
+
/** Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */
|
|
7841
|
+
trainingDatasetUri?: string;
|
|
7842
|
+
/** Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */
|
|
7843
|
+
validationDatasetUri?: string;
|
|
7844
|
+
}
|
|
7845
|
+
|
|
7717
7846
|
/** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
|
|
7718
7847
|
export declare interface VertexAISearch {
|
|
7719
7848
|
/** Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used. */
|