@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/web/web.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. */
|
|
@@ -3718,6 +3795,13 @@ declare interface Image_2 {
|
|
|
3718
3795
|
}
|
|
3719
3796
|
export { Image_2 as Image }
|
|
3720
3797
|
|
|
3798
|
+
/** The image generation configuration to be used in GenerateContentConfig. */
|
|
3799
|
+
export declare interface ImageConfig {
|
|
3800
|
+
/** Aspect ratio of the generated images. Supported values are
|
|
3801
|
+
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */
|
|
3802
|
+
aspectRatio?: string;
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3721
3805
|
/** Enum that specifies the language of the text in the prompt. */
|
|
3722
3806
|
export declare enum ImagePromptLanguage {
|
|
3723
3807
|
/**
|
|
@@ -4297,6 +4381,11 @@ export declare interface LiveConnectConfig {
|
|
|
4297
4381
|
/** The speech generation configuration.
|
|
4298
4382
|
*/
|
|
4299
4383
|
speechConfig?: SpeechConfig;
|
|
4384
|
+
/** Config for thinking features.
|
|
4385
|
+
An error will be returned if this field is set for models that don't
|
|
4386
|
+
support thinking.
|
|
4387
|
+
*/
|
|
4388
|
+
thinkingConfig?: ThinkingConfig;
|
|
4300
4389
|
/** If enabled, the model will detect emotions and adapt its responses accordingly. */
|
|
4301
4390
|
enableAffectiveDialog?: boolean;
|
|
4302
4391
|
/** The user provided system instructions for the model.
|
|
@@ -5878,7 +5967,7 @@ export declare interface RecontextImageSource {
|
|
|
5878
5967
|
productImages?: ProductImage[];
|
|
5879
5968
|
}
|
|
5880
5969
|
|
|
5881
|
-
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
|
|
5970
|
+
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage | ContentReferenceImage;
|
|
5882
5971
|
|
|
5883
5972
|
/** Private class that represents a Reference image that is sent to API. */
|
|
5884
5973
|
declare interface ReferenceImageAPIInternal {
|
|
@@ -6762,7 +6851,7 @@ export declare interface Tool {
|
|
|
6762
6851
|
/** Optional. Tool to support the model interacting directly with the
|
|
6763
6852
|
computer. If enabled, it automatically populates computer-use specific
|
|
6764
6853
|
Function Declarations. */
|
|
6765
|
-
computerUse?:
|
|
6854
|
+
computerUse?: ComputerUse;
|
|
6766
6855
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6767
6856
|
codeExecution?: ToolCodeExecution;
|
|
6768
6857
|
}
|
|
@@ -6771,12 +6860,6 @@ export declare interface Tool {
|
|
|
6771
6860
|
export declare interface ToolCodeExecution {
|
|
6772
6861
|
}
|
|
6773
6862
|
|
|
6774
|
-
/** Tool to support computer use. */
|
|
6775
|
-
export declare interface ToolComputerUse {
|
|
6776
|
-
/** Required. The environment being operated. */
|
|
6777
|
-
environment?: Environment;
|
|
6778
|
-
}
|
|
6779
|
-
|
|
6780
6863
|
/** Tool config.
|
|
6781
6864
|
|
|
6782
6865
|
This config is shared for all tools provided in the request.
|
|
@@ -6931,6 +7014,8 @@ export declare interface TuningJob {
|
|
|
6931
7014
|
serviceAccount?: string;
|
|
6932
7015
|
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
6933
7016
|
tunedModelDisplayName?: string;
|
|
7017
|
+
/** Tuning Spec for Veo Tuning. */
|
|
7018
|
+
veoTuningSpec?: VeoTuningSpec;
|
|
6934
7019
|
}
|
|
6935
7020
|
|
|
6936
7021
|
/** Tuning mode. */
|
|
@@ -7014,6 +7099,22 @@ declare class Tunings extends BaseModule {
|
|
|
7014
7099
|
private tuneMldevInternal;
|
|
7015
7100
|
}
|
|
7016
7101
|
|
|
7102
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7103
|
+
export declare enum TuningTask {
|
|
7104
|
+
/**
|
|
7105
|
+
* Default value. This value is unused.
|
|
7106
|
+
*/
|
|
7107
|
+
TUNING_TASK_UNSPECIFIED = "TUNING_TASK_UNSPECIFIED",
|
|
7108
|
+
/**
|
|
7109
|
+
* Tuning task for image to video.
|
|
7110
|
+
*/
|
|
7111
|
+
TUNING_TASK_I2V = "TUNING_TASK_I2V",
|
|
7112
|
+
/**
|
|
7113
|
+
* Tuning task for text to video.
|
|
7114
|
+
*/
|
|
7115
|
+
TUNING_TASK_T2V = "TUNING_TASK_T2V"
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7017
7118
|
export declare interface TuningValidationDataset {
|
|
7018
7119
|
/** GCS URI of the file containing validation dataset in JSONL format. */
|
|
7019
7120
|
gcsUri?: string;
|
|
@@ -7124,6 +7225,7 @@ declare namespace types {
|
|
|
7124
7225
|
JobState,
|
|
7125
7226
|
TuningMode,
|
|
7126
7227
|
AdapterSize,
|
|
7228
|
+
TuningTask,
|
|
7127
7229
|
FeatureSelectionPreference,
|
|
7128
7230
|
Behavior,
|
|
7129
7231
|
DynamicRetrievalConfigMode,
|
|
@@ -7158,6 +7260,9 @@ declare namespace types {
|
|
|
7158
7260
|
FunctionCall,
|
|
7159
7261
|
CodeExecutionResult,
|
|
7160
7262
|
ExecutableCode,
|
|
7263
|
+
FunctionResponseBlob,
|
|
7264
|
+
FunctionResponseFileData,
|
|
7265
|
+
FunctionResponsePart,
|
|
7161
7266
|
FunctionResponse,
|
|
7162
7267
|
Part,
|
|
7163
7268
|
Content,
|
|
@@ -7179,7 +7284,7 @@ declare namespace types {
|
|
|
7179
7284
|
AuthConfig,
|
|
7180
7285
|
GoogleMaps,
|
|
7181
7286
|
UrlContext,
|
|
7182
|
-
|
|
7287
|
+
ComputerUse,
|
|
7183
7288
|
ApiAuthApiKeyConfig,
|
|
7184
7289
|
ApiAuth,
|
|
7185
7290
|
ExternalApiElasticSearchParams,
|
|
@@ -7209,6 +7314,7 @@ declare namespace types {
|
|
|
7209
7314
|
SpeechConfig,
|
|
7210
7315
|
AutomaticFunctionCallingConfig,
|
|
7211
7316
|
ThinkingConfig,
|
|
7317
|
+
ImageConfig,
|
|
7212
7318
|
GenerationConfigRoutingConfigAutoRoutingMode,
|
|
7213
7319
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
7214
7320
|
GenerationConfigRoutingConfig,
|
|
@@ -7331,6 +7437,8 @@ declare namespace types {
|
|
|
7331
7437
|
TuningDataStats,
|
|
7332
7438
|
EncryptionSpec,
|
|
7333
7439
|
PartnerModelTuningSpec,
|
|
7440
|
+
VeoHyperParameters,
|
|
7441
|
+
VeoTuningSpec,
|
|
7334
7442
|
TuningJob,
|
|
7335
7443
|
ListTuningJobsConfig,
|
|
7336
7444
|
ListTuningJobsParameters,
|
|
@@ -7414,6 +7522,7 @@ declare namespace types {
|
|
|
7414
7522
|
ControlReferenceImage,
|
|
7415
7523
|
StyleReferenceImage,
|
|
7416
7524
|
SubjectReferenceImage,
|
|
7525
|
+
ContentReferenceImage,
|
|
7417
7526
|
LiveServerSetupComplete,
|
|
7418
7527
|
Transcription,
|
|
7419
7528
|
LiveServerContent,
|
|
@@ -7707,6 +7816,26 @@ export declare interface UsageMetadata {
|
|
|
7707
7816
|
trafficType?: TrafficType;
|
|
7708
7817
|
}
|
|
7709
7818
|
|
|
7819
|
+
/** Hyperparameters for Veo. */
|
|
7820
|
+
export declare interface VeoHyperParameters {
|
|
7821
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
7822
|
+
epochCount?: string;
|
|
7823
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
7824
|
+
learningRateMultiplier?: number;
|
|
7825
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7826
|
+
tuningTask?: TuningTask;
|
|
7827
|
+
}
|
|
7828
|
+
|
|
7829
|
+
/** Tuning Spec for Veo Model Tuning. */
|
|
7830
|
+
export declare interface VeoTuningSpec {
|
|
7831
|
+
/** Optional. Hyperparameters for Veo. */
|
|
7832
|
+
hyperParameters?: VeoHyperParameters;
|
|
7833
|
+
/** 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. */
|
|
7834
|
+
trainingDatasetUri?: string;
|
|
7835
|
+
/** 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. */
|
|
7836
|
+
validationDatasetUri?: string;
|
|
7837
|
+
}
|
|
7838
|
+
|
|
7710
7839
|
/** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
|
|
7711
7840
|
export declare interface VertexAISearch {
|
|
7712
7841
|
/** 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. */
|