@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/genai.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. */
|
|
@@ -3713,6 +3790,13 @@ declare interface Image_2 {
|
|
|
3713
3790
|
}
|
|
3714
3791
|
export { Image_2 as Image }
|
|
3715
3792
|
|
|
3793
|
+
/** The image generation configuration to be used in GenerateContentConfig. */
|
|
3794
|
+
export declare interface ImageConfig {
|
|
3795
|
+
/** Aspect ratio of the generated images. Supported values are
|
|
3796
|
+
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */
|
|
3797
|
+
aspectRatio?: string;
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3716
3800
|
/** Enum that specifies the language of the text in the prompt. */
|
|
3717
3801
|
export declare enum ImagePromptLanguage {
|
|
3718
3802
|
/**
|
|
@@ -4292,6 +4376,11 @@ export declare interface LiveConnectConfig {
|
|
|
4292
4376
|
/** The speech generation configuration.
|
|
4293
4377
|
*/
|
|
4294
4378
|
speechConfig?: SpeechConfig;
|
|
4379
|
+
/** Config for thinking features.
|
|
4380
|
+
An error will be returned if this field is set for models that don't
|
|
4381
|
+
support thinking.
|
|
4382
|
+
*/
|
|
4383
|
+
thinkingConfig?: ThinkingConfig;
|
|
4295
4384
|
/** If enabled, the model will detect emotions and adapt its responses accordingly. */
|
|
4296
4385
|
enableAffectiveDialog?: boolean;
|
|
4297
4386
|
/** The user provided system instructions for the model.
|
|
@@ -5873,7 +5962,7 @@ export declare interface RecontextImageSource {
|
|
|
5873
5962
|
productImages?: ProductImage[];
|
|
5874
5963
|
}
|
|
5875
5964
|
|
|
5876
|
-
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
|
|
5965
|
+
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage | ContentReferenceImage;
|
|
5877
5966
|
|
|
5878
5967
|
/** Private class that represents a Reference image that is sent to API. */
|
|
5879
5968
|
declare interface ReferenceImageAPIInternal {
|
|
@@ -6757,7 +6846,7 @@ export declare interface Tool {
|
|
|
6757
6846
|
/** Optional. Tool to support the model interacting directly with the
|
|
6758
6847
|
computer. If enabled, it automatically populates computer-use specific
|
|
6759
6848
|
Function Declarations. */
|
|
6760
|
-
computerUse?:
|
|
6849
|
+
computerUse?: ComputerUse;
|
|
6761
6850
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6762
6851
|
codeExecution?: ToolCodeExecution;
|
|
6763
6852
|
}
|
|
@@ -6766,12 +6855,6 @@ export declare interface Tool {
|
|
|
6766
6855
|
export declare interface ToolCodeExecution {
|
|
6767
6856
|
}
|
|
6768
6857
|
|
|
6769
|
-
/** Tool to support computer use. */
|
|
6770
|
-
export declare interface ToolComputerUse {
|
|
6771
|
-
/** Required. The environment being operated. */
|
|
6772
|
-
environment?: Environment;
|
|
6773
|
-
}
|
|
6774
|
-
|
|
6775
6858
|
/** Tool config.
|
|
6776
6859
|
|
|
6777
6860
|
This config is shared for all tools provided in the request.
|
|
@@ -6926,6 +7009,8 @@ export declare interface TuningJob {
|
|
|
6926
7009
|
serviceAccount?: string;
|
|
6927
7010
|
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
6928
7011
|
tunedModelDisplayName?: string;
|
|
7012
|
+
/** Tuning Spec for Veo Tuning. */
|
|
7013
|
+
veoTuningSpec?: VeoTuningSpec;
|
|
6929
7014
|
}
|
|
6930
7015
|
|
|
6931
7016
|
/** Tuning mode. */
|
|
@@ -7009,6 +7094,22 @@ declare class Tunings extends BaseModule {
|
|
|
7009
7094
|
private tuneMldevInternal;
|
|
7010
7095
|
}
|
|
7011
7096
|
|
|
7097
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7098
|
+
export declare enum TuningTask {
|
|
7099
|
+
/**
|
|
7100
|
+
* Default value. This value is unused.
|
|
7101
|
+
*/
|
|
7102
|
+
TUNING_TASK_UNSPECIFIED = "TUNING_TASK_UNSPECIFIED",
|
|
7103
|
+
/**
|
|
7104
|
+
* Tuning task for image to video.
|
|
7105
|
+
*/
|
|
7106
|
+
TUNING_TASK_I2V = "TUNING_TASK_I2V",
|
|
7107
|
+
/**
|
|
7108
|
+
* Tuning task for text to video.
|
|
7109
|
+
*/
|
|
7110
|
+
TUNING_TASK_T2V = "TUNING_TASK_T2V"
|
|
7111
|
+
}
|
|
7112
|
+
|
|
7012
7113
|
export declare interface TuningValidationDataset {
|
|
7013
7114
|
/** GCS URI of the file containing validation dataset in JSONL format. */
|
|
7014
7115
|
gcsUri?: string;
|
|
@@ -7119,6 +7220,7 @@ declare namespace types {
|
|
|
7119
7220
|
JobState,
|
|
7120
7221
|
TuningMode,
|
|
7121
7222
|
AdapterSize,
|
|
7223
|
+
TuningTask,
|
|
7122
7224
|
FeatureSelectionPreference,
|
|
7123
7225
|
Behavior,
|
|
7124
7226
|
DynamicRetrievalConfigMode,
|
|
@@ -7153,6 +7255,9 @@ declare namespace types {
|
|
|
7153
7255
|
FunctionCall,
|
|
7154
7256
|
CodeExecutionResult,
|
|
7155
7257
|
ExecutableCode,
|
|
7258
|
+
FunctionResponseBlob,
|
|
7259
|
+
FunctionResponseFileData,
|
|
7260
|
+
FunctionResponsePart,
|
|
7156
7261
|
FunctionResponse,
|
|
7157
7262
|
Part,
|
|
7158
7263
|
Content,
|
|
@@ -7174,7 +7279,7 @@ declare namespace types {
|
|
|
7174
7279
|
AuthConfig,
|
|
7175
7280
|
GoogleMaps,
|
|
7176
7281
|
UrlContext,
|
|
7177
|
-
|
|
7282
|
+
ComputerUse,
|
|
7178
7283
|
ApiAuthApiKeyConfig,
|
|
7179
7284
|
ApiAuth,
|
|
7180
7285
|
ExternalApiElasticSearchParams,
|
|
@@ -7204,6 +7309,7 @@ declare namespace types {
|
|
|
7204
7309
|
SpeechConfig,
|
|
7205
7310
|
AutomaticFunctionCallingConfig,
|
|
7206
7311
|
ThinkingConfig,
|
|
7312
|
+
ImageConfig,
|
|
7207
7313
|
GenerationConfigRoutingConfigAutoRoutingMode,
|
|
7208
7314
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
7209
7315
|
GenerationConfigRoutingConfig,
|
|
@@ -7326,6 +7432,8 @@ declare namespace types {
|
|
|
7326
7432
|
TuningDataStats,
|
|
7327
7433
|
EncryptionSpec,
|
|
7328
7434
|
PartnerModelTuningSpec,
|
|
7435
|
+
VeoHyperParameters,
|
|
7436
|
+
VeoTuningSpec,
|
|
7329
7437
|
TuningJob,
|
|
7330
7438
|
ListTuningJobsConfig,
|
|
7331
7439
|
ListTuningJobsParameters,
|
|
@@ -7409,6 +7517,7 @@ declare namespace types {
|
|
|
7409
7517
|
ControlReferenceImage,
|
|
7410
7518
|
StyleReferenceImage,
|
|
7411
7519
|
SubjectReferenceImage,
|
|
7520
|
+
ContentReferenceImage,
|
|
7412
7521
|
LiveServerSetupComplete,
|
|
7413
7522
|
Transcription,
|
|
7414
7523
|
LiveServerContent,
|
|
@@ -7702,6 +7811,26 @@ export declare interface UsageMetadata {
|
|
|
7702
7811
|
trafficType?: TrafficType;
|
|
7703
7812
|
}
|
|
7704
7813
|
|
|
7814
|
+
/** Hyperparameters for Veo. */
|
|
7815
|
+
export declare interface VeoHyperParameters {
|
|
7816
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
7817
|
+
epochCount?: string;
|
|
7818
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
7819
|
+
learningRateMultiplier?: number;
|
|
7820
|
+
/** Optional. The tuning task. Either I2V or T2V. */
|
|
7821
|
+
tuningTask?: TuningTask;
|
|
7822
|
+
}
|
|
7823
|
+
|
|
7824
|
+
/** Tuning Spec for Veo Model Tuning. */
|
|
7825
|
+
export declare interface VeoTuningSpec {
|
|
7826
|
+
/** Optional. Hyperparameters for Veo. */
|
|
7827
|
+
hyperParameters?: VeoHyperParameters;
|
|
7828
|
+
/** 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. */
|
|
7829
|
+
trainingDatasetUri?: string;
|
|
7830
|
+
/** 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. */
|
|
7831
|
+
validationDatasetUri?: string;
|
|
7832
|
+
}
|
|
7833
|
+
|
|
7705
7834
|
/** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
|
|
7706
7835
|
export declare interface VertexAISearch {
|
|
7707
7836
|
/** 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. */
|