@google/genai 1.13.0 → 1.15.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/README.md +24 -0
- package/dist/genai.d.ts +308 -47
- package/dist/index.cjs +507 -84
- package/dist/index.mjs +507 -85
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +507 -84
- package/dist/node/index.mjs +507 -85
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +308 -47
- package/dist/web/index.mjs +507 -85
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +308 -47
- package/package.json +1 -1
package/dist/web/web.d.ts
CHANGED
|
@@ -1425,6 +1425,8 @@ export declare interface CreateTuningJobConfig {
|
|
|
1425
1425
|
learningRateMultiplier?: number;
|
|
1426
1426
|
/** If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. */
|
|
1427
1427
|
exportLastCheckpointOnly?: boolean;
|
|
1428
|
+
/** The optional checkpoint id of the pre-tuned model to use for tuning, if applicable. */
|
|
1429
|
+
preTunedModelCheckpointId?: string;
|
|
1428
1430
|
/** Adapter size for tuning. */
|
|
1429
1431
|
adapterSize?: AdapterSize;
|
|
1430
1432
|
/** The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. */
|
|
@@ -1435,7 +1437,7 @@ export declare interface CreateTuningJobConfig {
|
|
|
1435
1437
|
|
|
1436
1438
|
/** Supervised fine-tuning job creation parameters - optional fields. */
|
|
1437
1439
|
export declare interface CreateTuningJobParameters {
|
|
1438
|
-
/** The base model that is being tuned, e.g., "gemini-
|
|
1440
|
+
/** The base model that is being tuned, e.g., "gemini-2.5-flash". */
|
|
1439
1441
|
baseModel: string;
|
|
1440
1442
|
/** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1441
1443
|
trainingDataset: TuningDataset;
|
|
@@ -1443,6 +1445,18 @@ export declare interface CreateTuningJobParameters {
|
|
|
1443
1445
|
config?: CreateTuningJobConfig;
|
|
1444
1446
|
}
|
|
1445
1447
|
|
|
1448
|
+
/** Supervised fine-tuning job creation parameters - optional fields. */
|
|
1449
|
+
export declare interface CreateTuningJobParametersPrivate {
|
|
1450
|
+
/** The base model that is being tuned, e.g., "gemini-2.5-flash". */
|
|
1451
|
+
baseModel?: string;
|
|
1452
|
+
/** The PreTunedModel that is being tuned. */
|
|
1453
|
+
preTunedModel?: PreTunedModel;
|
|
1454
|
+
/** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1455
|
+
trainingDataset: TuningDataset;
|
|
1456
|
+
/** Configuration for the tuning job. */
|
|
1457
|
+
config?: CreateTuningJobConfig;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1446
1460
|
/**
|
|
1447
1461
|
* Creates a `Content` object with a user role from a `PartListUnion` object or `string`.
|
|
1448
1462
|
*/
|
|
@@ -1612,34 +1626,6 @@ export declare interface DistillationDataStats {
|
|
|
1612
1626
|
trainingDatasetStats?: DatasetStats;
|
|
1613
1627
|
}
|
|
1614
1628
|
|
|
1615
|
-
/** Hyperparameters for Distillation. */
|
|
1616
|
-
export declare interface DistillationHyperParameters {
|
|
1617
|
-
/** Optional. Adapter size for distillation. */
|
|
1618
|
-
adapterSize?: AdapterSize;
|
|
1619
|
-
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
1620
|
-
epochCount?: string;
|
|
1621
|
-
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
1622
|
-
learningRateMultiplier?: number;
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
/** Tuning Spec for Distillation. */
|
|
1626
|
-
export declare interface DistillationSpec {
|
|
1627
|
-
/** The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
|
|
1628
|
-
baseTeacherModel?: string;
|
|
1629
|
-
/** Optional. Hyperparameters for Distillation. */
|
|
1630
|
-
hyperParameters?: DistillationHyperParameters;
|
|
1631
|
-
/** Deprecated. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts. */
|
|
1632
|
-
pipelineRootDirectory?: string;
|
|
1633
|
-
/** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". Deprecated. Use base_model instead. */
|
|
1634
|
-
studentModel?: string;
|
|
1635
|
-
/** Deprecated. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1636
|
-
trainingDatasetUri?: string;
|
|
1637
|
-
/** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */
|
|
1638
|
-
tunedTeacherModelSource?: string;
|
|
1639
|
-
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1640
|
-
validationDatasetUri?: string;
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
1629
|
export declare type DownloadableFileUnion = string | File_2 | GeneratedVideo | Video;
|
|
1644
1630
|
|
|
1645
1631
|
declare interface Downloader {
|
|
@@ -1895,9 +1881,19 @@ export declare enum EndSensitivity {
|
|
|
1895
1881
|
|
|
1896
1882
|
/** Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. */
|
|
1897
1883
|
export declare interface EnterpriseWebSearch {
|
|
1884
|
+
/** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. */
|
|
1885
|
+
excludeDomains?: string[];
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/** An entity representing the segmented area. */
|
|
1889
|
+
export declare interface EntityLabel {
|
|
1890
|
+
/** The label of the segmented entity. */
|
|
1891
|
+
label?: string;
|
|
1892
|
+
/** The confidence score of the detected label. */
|
|
1893
|
+
score?: number;
|
|
1898
1894
|
}
|
|
1899
1895
|
|
|
1900
|
-
/**
|
|
1896
|
+
/** The environment being operated. */
|
|
1901
1897
|
export declare enum Environment {
|
|
1902
1898
|
/**
|
|
1903
1899
|
* Defaults to browser.
|
|
@@ -2331,6 +2327,22 @@ export declare enum FunctionResponseScheduling {
|
|
|
2331
2327
|
INTERRUPT = "INTERRUPT"
|
|
2332
2328
|
}
|
|
2333
2329
|
|
|
2330
|
+
/** Input example for preference optimization. */
|
|
2331
|
+
export declare interface GeminiPreferenceExample {
|
|
2332
|
+
/** List of completions for a given prompt. */
|
|
2333
|
+
completions?: GeminiPreferenceExampleCompletion[];
|
|
2334
|
+
/** Multi-turn contents that represents the Prompt. */
|
|
2335
|
+
contents?: Content[];
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
/** Completion and its preference score. */
|
|
2339
|
+
export declare interface GeminiPreferenceExampleCompletion {
|
|
2340
|
+
/** Single turn completion for the given prompt. */
|
|
2341
|
+
completion?: Content;
|
|
2342
|
+
/** The score for the given completion. */
|
|
2343
|
+
score?: number;
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2334
2346
|
/** Optional model configuration parameters.
|
|
2335
2347
|
|
|
2336
2348
|
For more information, see `Content generation parameters
|
|
@@ -2698,6 +2710,14 @@ export declare interface GeneratedImage {
|
|
|
2698
2710
|
enhancedPrompt?: string;
|
|
2699
2711
|
}
|
|
2700
2712
|
|
|
2713
|
+
/** A generated image mask. */
|
|
2714
|
+
export declare interface GeneratedImageMask {
|
|
2715
|
+
/** The generated image mask. */
|
|
2716
|
+
mask?: Image_2;
|
|
2717
|
+
/** The detected entities on the segmented area. */
|
|
2718
|
+
labels?: EntityLabel[];
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2701
2721
|
/** A generated video. */
|
|
2702
2722
|
export declare interface GeneratedVideo {
|
|
2703
2723
|
/** The output video */
|
|
@@ -2836,6 +2856,12 @@ export declare interface GenerateVideosConfig {
|
|
|
2836
2856
|
generateAudio?: boolean;
|
|
2837
2857
|
/** Image to use as the last frame of generated videos. Only supported for image to video use cases. */
|
|
2838
2858
|
lastFrame?: Image_2;
|
|
2859
|
+
/** The images to use as the references to generate the videos.
|
|
2860
|
+
If this field is provided, the text prompt field must also be provided.
|
|
2861
|
+
The image, video, or last_frame field are not supported. Each image must
|
|
2862
|
+
be associated with a type. Veo 2 supports up to 3 asset images *or* 1
|
|
2863
|
+
style image. */
|
|
2864
|
+
referenceImages?: VideoGenerationReferenceImage[];
|
|
2839
2865
|
/** Compression quality of the generated videos. */
|
|
2840
2866
|
compressionQuality?: VideoCompressionQuality;
|
|
2841
2867
|
}
|
|
@@ -2960,7 +2986,7 @@ export declare interface GenerationConfigRoutingConfigManualRoutingMode {
|
|
|
2960
2986
|
export declare interface GenerationConfigThinkingConfig {
|
|
2961
2987
|
/** Optional. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. */
|
|
2962
2988
|
includeThoughts?: boolean;
|
|
2963
|
-
/** Optional. Indicates the thinking budget in tokens.
|
|
2989
|
+
/** Optional. Indicates the thinking budget in tokens. */
|
|
2964
2990
|
thinkingBudget?: number;
|
|
2965
2991
|
}
|
|
2966
2992
|
|
|
@@ -3229,6 +3255,9 @@ export declare interface GoogleSearch {
|
|
|
3229
3255
|
If customers set a start time, they must set an end time (and vice versa).
|
|
3230
3256
|
*/
|
|
3231
3257
|
timeRangeFilter?: Interval;
|
|
3258
|
+
/** Optional. List of domains to be excluded from the search results.
|
|
3259
|
+
The default limit is 2000 domains. */
|
|
3260
|
+
excludeDomains?: string[];
|
|
3232
3261
|
}
|
|
3233
3262
|
|
|
3234
3263
|
/** Tool to retrieve public web data for grounding, powered by Google. */
|
|
@@ -3249,14 +3278,64 @@ export declare interface GoogleTypeDate {
|
|
|
3249
3278
|
|
|
3250
3279
|
/** Grounding chunk. */
|
|
3251
3280
|
export declare interface GroundingChunk {
|
|
3281
|
+
/** Grounding chunk from Google Maps. */
|
|
3282
|
+
maps?: GroundingChunkMaps;
|
|
3252
3283
|
/** Grounding chunk from context retrieved by the retrieval tools. */
|
|
3253
3284
|
retrievedContext?: GroundingChunkRetrievedContext;
|
|
3254
3285
|
/** Grounding chunk from the web. */
|
|
3255
3286
|
web?: GroundingChunkWeb;
|
|
3256
3287
|
}
|
|
3257
3288
|
|
|
3289
|
+
/** Chunk from Google Maps. */
|
|
3290
|
+
export declare interface GroundingChunkMaps {
|
|
3291
|
+
/** Sources used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as uris to flag content. */
|
|
3292
|
+
placeAnswerSources?: GroundingChunkMapsPlaceAnswerSources;
|
|
3293
|
+
/** This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place. */
|
|
3294
|
+
placeId?: string;
|
|
3295
|
+
/** Text of the chunk. */
|
|
3296
|
+
text?: string;
|
|
3297
|
+
/** Title of the chunk. */
|
|
3298
|
+
title?: string;
|
|
3299
|
+
/** URI reference of the chunk. */
|
|
3300
|
+
uri?: string;
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
/** Sources used to generate the place answer. */
|
|
3304
|
+
export declare interface GroundingChunkMapsPlaceAnswerSources {
|
|
3305
|
+
/** A link where users can flag a problem with the generated answer. */
|
|
3306
|
+
flagContentUri?: string;
|
|
3307
|
+
/** Snippets of reviews that are used to generate the answer. */
|
|
3308
|
+
reviewSnippets?: GroundingChunkMapsPlaceAnswerSourcesReviewSnippet[];
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
/** Author attribution for a photo or review. */
|
|
3312
|
+
export declare interface GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution {
|
|
3313
|
+
/** Name of the author of the Photo or Review. */
|
|
3314
|
+
displayName?: string;
|
|
3315
|
+
/** Profile photo URI of the author of the Photo or Review. */
|
|
3316
|
+
photoUri?: string;
|
|
3317
|
+
/** URI of the author of the Photo or Review. */
|
|
3318
|
+
uri?: string;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
/** Encapsulates a review snippet. */
|
|
3322
|
+
export declare interface GroundingChunkMapsPlaceAnswerSourcesReviewSnippet {
|
|
3323
|
+
/** This review's author. */
|
|
3324
|
+
authorAttribution?: GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution;
|
|
3325
|
+
/** A link where users can flag a problem with the review. */
|
|
3326
|
+
flagContentUri?: string;
|
|
3327
|
+
/** A link to show the review on Google Maps. */
|
|
3328
|
+
googleMapsUri?: string;
|
|
3329
|
+
/** A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. */
|
|
3330
|
+
relativePublishTimeDescription?: string;
|
|
3331
|
+
/** A reference representing this place review which may be used to look up this place review again. */
|
|
3332
|
+
review?: string;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3258
3335
|
/** Chunk from context retrieved by the retrieval tools. */
|
|
3259
3336
|
export declare interface GroundingChunkRetrievedContext {
|
|
3337
|
+
/** Output only. The full document name for the referenced Vertex AI Search document. */
|
|
3338
|
+
documentName?: string;
|
|
3260
3339
|
/** Additional context for the RAG retrieval result. This is only populated when using the RAG retrieval tool. */
|
|
3261
3340
|
ragChunk?: RagChunk;
|
|
3262
3341
|
/** Text of the attribution. */
|
|
@@ -3279,6 +3358,8 @@ export declare interface GroundingChunkWeb {
|
|
|
3279
3358
|
|
|
3280
3359
|
/** Metadata returned to client when grounding is enabled. */
|
|
3281
3360
|
export declare interface GroundingMetadata {
|
|
3361
|
+
/** Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding. */
|
|
3362
|
+
googleMapsWidgetContextToken?: string;
|
|
3282
3363
|
/** List of supporting references retrieved from specified grounding source. */
|
|
3283
3364
|
groundingChunks?: GroundingChunk[];
|
|
3284
3365
|
/** Optional. List of grounding support. */
|
|
@@ -5073,6 +5154,27 @@ export declare class Models extends BaseModule {
|
|
|
5073
5154
|
* ```
|
|
5074
5155
|
*/
|
|
5075
5156
|
recontextImage(params: types.RecontextImageParameters): Promise<types.RecontextImageResponse>;
|
|
5157
|
+
/**
|
|
5158
|
+
* Segments an image, creating a mask of a specified area.
|
|
5159
|
+
*
|
|
5160
|
+
* @param params - The parameters for segmenting an image.
|
|
5161
|
+
* @return The response from the API.
|
|
5162
|
+
*
|
|
5163
|
+
* @example
|
|
5164
|
+
* ```ts
|
|
5165
|
+
* const response = await ai.models.segmentImage({
|
|
5166
|
+
* model: 'image-segmentation-001',
|
|
5167
|
+
* source: {
|
|
5168
|
+
* image: image,
|
|
5169
|
+
* },
|
|
5170
|
+
* config: {
|
|
5171
|
+
* mode: 'foreground',
|
|
5172
|
+
* },
|
|
5173
|
+
* });
|
|
5174
|
+
* console.log(response?.generatedMasks?.[0]?.mask?.imageBytes);
|
|
5175
|
+
* ```
|
|
5176
|
+
*/
|
|
5177
|
+
segmentImage(params: types.SegmentImageParameters): Promise<types.SegmentImageResponse>;
|
|
5076
5178
|
/**
|
|
5077
5179
|
* Fetches information about a model by name.
|
|
5078
5180
|
*
|
|
@@ -5477,6 +5579,36 @@ export declare interface PrebuiltVoiceConfig {
|
|
|
5477
5579
|
voiceName?: string;
|
|
5478
5580
|
}
|
|
5479
5581
|
|
|
5582
|
+
/** Statistics computed for datasets used for preference optimization. */
|
|
5583
|
+
export declare interface PreferenceOptimizationDataStats {
|
|
5584
|
+
/** Output only. Dataset distributions for scores variance per example. */
|
|
5585
|
+
scoreVariancePerExampleDistribution?: DatasetDistribution;
|
|
5586
|
+
/** Output only. Dataset distributions for scores. */
|
|
5587
|
+
scoresDistribution?: DatasetDistribution;
|
|
5588
|
+
/** Output only. Number of billable tokens in the tuning dataset. */
|
|
5589
|
+
totalBillableTokenCount?: string;
|
|
5590
|
+
/** Output only. Number of examples in the tuning dataset. */
|
|
5591
|
+
tuningDatasetExampleCount?: string;
|
|
5592
|
+
/** Output only. Number of tuning steps for this Tuning Job. */
|
|
5593
|
+
tuningStepCount?: string;
|
|
5594
|
+
/** Output only. Sample user examples in the training dataset. */
|
|
5595
|
+
userDatasetExamples?: GeminiPreferenceExample[];
|
|
5596
|
+
/** Output only. Dataset distributions for the user input tokens. */
|
|
5597
|
+
userInputTokenDistribution?: DatasetDistribution;
|
|
5598
|
+
/** Output only. Dataset distributions for the user output tokens. */
|
|
5599
|
+
userOutputTokenDistribution?: DatasetDistribution;
|
|
5600
|
+
}
|
|
5601
|
+
|
|
5602
|
+
/** A pre-tuned model for continuous tuning. */
|
|
5603
|
+
export declare interface PreTunedModel {
|
|
5604
|
+
/** Output only. The name of the base model this PreTunedModel was tuned from. */
|
|
5605
|
+
baseModel?: string;
|
|
5606
|
+
/** Optional. The source checkpoint id. If not specified, the default checkpoint will be used. */
|
|
5607
|
+
checkpointId?: string;
|
|
5608
|
+
/** The resource name of the Model. E.g., a model resource name with a specified version id or alias: `projects/{project}/locations/{location}/models/{model}@{version_id}` `projects/{project}/locations/{location}/models/{model}@{alias}` Or, omit the version id to use the default version: `projects/{project}/locations/{location}/models/{model}` */
|
|
5609
|
+
tunedModelName?: string;
|
|
5610
|
+
}
|
|
5611
|
+
|
|
5480
5612
|
/** Config for proactivity features. */
|
|
5481
5613
|
export declare interface ProactivityConfig {
|
|
5482
5614
|
/** If enabled, the model can reject responding to the last prompt. For
|
|
@@ -5885,6 +6017,12 @@ export declare interface Schema {
|
|
|
5885
6017
|
|
|
5886
6018
|
export declare type SchemaUnion = Schema | unknown;
|
|
5887
6019
|
|
|
6020
|
+
/** An image mask representing a brush scribble. */
|
|
6021
|
+
export declare interface ScribbleImage {
|
|
6022
|
+
/** The brush scribble to guide segmentation. Valid for the interactive mode. */
|
|
6023
|
+
image?: Image_2;
|
|
6024
|
+
}
|
|
6025
|
+
|
|
5888
6026
|
/** Google search entry point. */
|
|
5889
6027
|
export declare interface SearchEntryPoint {
|
|
5890
6028
|
/** Optional. Web content snippet that can be embedded in a web page or an app webview. */
|
|
@@ -5906,6 +6044,75 @@ export declare interface Segment {
|
|
|
5906
6044
|
text?: string;
|
|
5907
6045
|
}
|
|
5908
6046
|
|
|
6047
|
+
/** Configuration for segmenting an image. */
|
|
6048
|
+
export declare interface SegmentImageConfig {
|
|
6049
|
+
/** Used to override HTTP request options. */
|
|
6050
|
+
httpOptions?: HttpOptions;
|
|
6051
|
+
/** Abort signal which can be used to cancel the request.
|
|
6052
|
+
|
|
6053
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
6054
|
+
operation will not cancel the request in the service. You will still
|
|
6055
|
+
be charged usage for any applicable operations.
|
|
6056
|
+
*/
|
|
6057
|
+
abortSignal?: AbortSignal;
|
|
6058
|
+
/** The segmentation mode to use. */
|
|
6059
|
+
mode?: SegmentMode;
|
|
6060
|
+
/** The maximum number of predictions to return up to, by top
|
|
6061
|
+
confidence score. */
|
|
6062
|
+
maxPredictions?: number;
|
|
6063
|
+
/** The confidence score threshold for the detections as a decimal
|
|
6064
|
+
value. Only predictions with a confidence score higher than this
|
|
6065
|
+
threshold will be returned. */
|
|
6066
|
+
confidenceThreshold?: number;
|
|
6067
|
+
/** A decimal value representing how much dilation to apply to the
|
|
6068
|
+
masks. 0 for no dilation. 1.0 means the masked area covers the whole
|
|
6069
|
+
image. */
|
|
6070
|
+
maskDilation?: number;
|
|
6071
|
+
/** The binary color threshold to apply to the masks. The threshold
|
|
6072
|
+
can be set to a decimal value between 0 and 255 non-inclusive.
|
|
6073
|
+
Set to -1 for no binary color thresholding. */
|
|
6074
|
+
binaryColorThreshold?: number;
|
|
6075
|
+
}
|
|
6076
|
+
|
|
6077
|
+
/** The parameters for segmenting an image. */
|
|
6078
|
+
export declare interface SegmentImageParameters {
|
|
6079
|
+
/** ID of the model to use. For a list of models, see `Google models
|
|
6080
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_. */
|
|
6081
|
+
model: string;
|
|
6082
|
+
/** A set of source input(s) for image segmentation. */
|
|
6083
|
+
source: SegmentImageSource;
|
|
6084
|
+
/** Configuration for image segmentation. */
|
|
6085
|
+
config?: SegmentImageConfig;
|
|
6086
|
+
}
|
|
6087
|
+
|
|
6088
|
+
/** The output images response. */
|
|
6089
|
+
export declare class SegmentImageResponse {
|
|
6090
|
+
/** List of generated image masks.
|
|
6091
|
+
*/
|
|
6092
|
+
generatedMasks?: GeneratedImageMask[];
|
|
6093
|
+
}
|
|
6094
|
+
|
|
6095
|
+
/** A set of source input(s) for image segmentation. */
|
|
6096
|
+
export declare interface SegmentImageSource {
|
|
6097
|
+
/** A text prompt for guiding the model during image segmentation.
|
|
6098
|
+
Required for prompt mode and semantic mode, disallowed for other modes. */
|
|
6099
|
+
prompt?: string;
|
|
6100
|
+
/** The image to be segmented. */
|
|
6101
|
+
image?: Image_2;
|
|
6102
|
+
/** The brush scribble to guide segmentation.
|
|
6103
|
+
Required for the interactive mode, disallowed for other modes. */
|
|
6104
|
+
scribbleImage?: ScribbleImage;
|
|
6105
|
+
}
|
|
6106
|
+
|
|
6107
|
+
/** Enum that represents the segmentation mode. */
|
|
6108
|
+
export declare enum SegmentMode {
|
|
6109
|
+
FOREGROUND = "FOREGROUND",
|
|
6110
|
+
BACKGROUND = "BACKGROUND",
|
|
6111
|
+
PROMPT = "PROMPT",
|
|
6112
|
+
SEMANTIC = "SEMANTIC",
|
|
6113
|
+
INTERACTIVE = "INTERACTIVE"
|
|
6114
|
+
}
|
|
6115
|
+
|
|
5909
6116
|
/** Parameters for sending a message within a chat session.
|
|
5910
6117
|
|
|
5911
6118
|
These parameters are used with the `chat.sendMessage()` method.
|
|
@@ -6209,9 +6416,13 @@ export declare enum SubjectReferenceType {
|
|
|
6209
6416
|
export declare interface SupervisedHyperParameters {
|
|
6210
6417
|
/** Optional. Adapter size for tuning. */
|
|
6211
6418
|
adapterSize?: AdapterSize;
|
|
6419
|
+
/** Optional. Batch size for tuning. This feature is only available for open source models. */
|
|
6420
|
+
batchSize?: string;
|
|
6212
6421
|
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
6213
6422
|
epochCount?: string;
|
|
6214
|
-
/** Optional.
|
|
6423
|
+
/** Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models. */
|
|
6424
|
+
learningRate?: number;
|
|
6425
|
+
/** Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models. */
|
|
6215
6426
|
learningRateMultiplier?: number;
|
|
6216
6427
|
}
|
|
6217
6428
|
|
|
@@ -6283,6 +6494,8 @@ export declare interface SupervisedTuningSpec {
|
|
|
6283
6494
|
hyperParameters?: SupervisedHyperParameters;
|
|
6284
6495
|
/** 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. */
|
|
6285
6496
|
trainingDatasetUri?: string;
|
|
6497
|
+
/** Tuning mode. */
|
|
6498
|
+
tuningMode?: TuningMode;
|
|
6286
6499
|
/** 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. */
|
|
6287
6500
|
validationDatasetUri?: string;
|
|
6288
6501
|
}
|
|
@@ -6442,10 +6655,12 @@ export declare interface Tool {
|
|
|
6442
6655
|
googleMaps?: GoogleMaps;
|
|
6443
6656
|
/** Optional. Tool to support URL context retrieval. */
|
|
6444
6657
|
urlContext?: UrlContext;
|
|
6658
|
+
/** Optional. Tool to support the model interacting directly with the
|
|
6659
|
+
computer. If enabled, it automatically populates computer-use specific
|
|
6660
|
+
Function Declarations. */
|
|
6661
|
+
computerUse?: ToolComputerUse;
|
|
6445
6662
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6446
6663
|
codeExecution?: ToolCodeExecution;
|
|
6447
|
-
/** Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations. */
|
|
6448
|
-
computerUse?: ToolComputerUse;
|
|
6449
6664
|
}
|
|
6450
6665
|
|
|
6451
6666
|
/** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. */
|
|
@@ -6500,7 +6715,7 @@ export declare interface Transcription {
|
|
|
6500
6715
|
}
|
|
6501
6716
|
|
|
6502
6717
|
export declare interface TunedModel {
|
|
6503
|
-
/** Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}
|
|
6718
|
+
/** Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}@{version_id}` When tuning from a base model, the version_id will be 1. For continuous tuning, the version id will be incremented by 1 from the last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}` */
|
|
6504
6719
|
model?: string;
|
|
6505
6720
|
/** Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`. */
|
|
6506
6721
|
endpoint?: string;
|
|
@@ -6551,6 +6766,8 @@ export declare interface TuningDataset {
|
|
|
6551
6766
|
export declare interface TuningDataStats {
|
|
6552
6767
|
/** Output only. Statistics for distillation. */
|
|
6553
6768
|
distillationDataStats?: DistillationDataStats;
|
|
6769
|
+
/** Output only. Statistics for preference optimization. */
|
|
6770
|
+
preferenceOptimizationDataStats?: PreferenceOptimizationDataStats;
|
|
6554
6771
|
/** The SFT Tuning data stats. */
|
|
6555
6772
|
supervisedTuningDataStats?: SupervisedTuningDataStats;
|
|
6556
6773
|
}
|
|
@@ -6586,6 +6803,8 @@ export declare interface TuningJob {
|
|
|
6586
6803
|
baseModel?: string;
|
|
6587
6804
|
/** Output only. The tuned model resources associated with this TuningJob. */
|
|
6588
6805
|
tunedModel?: TunedModel;
|
|
6806
|
+
/** The pre-tuned model for continuous tuning. */
|
|
6807
|
+
preTunedModel?: PreTunedModel;
|
|
6589
6808
|
/** Tuning Spec for Supervised Fine Tuning. */
|
|
6590
6809
|
supervisedTuningSpec?: SupervisedTuningSpec;
|
|
6591
6810
|
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
@@ -6594,24 +6813,38 @@ export declare interface TuningJob {
|
|
|
6594
6813
|
encryptionSpec?: EncryptionSpec;
|
|
6595
6814
|
/** Tuning Spec for open sourced and third party Partner models. */
|
|
6596
6815
|
partnerModelTuningSpec?: PartnerModelTuningSpec;
|
|
6597
|
-
/**
|
|
6598
|
-
|
|
6816
|
+
/** Optional. The user-provided path to custom model weights. Set this field to tune a custom model. The path must be a Cloud Storage directory that contains the model weights in .safetensors format along with associated model metadata files. If this field is set, the base_model field must still be set to indicate which base model the custom model is derived from. This feature is only available for open source models. */
|
|
6817
|
+
customBaseModel?: string;
|
|
6599
6818
|
/** Output only. The Experiment associated with this TuningJob. */
|
|
6600
6819
|
experiment?: string;
|
|
6601
6820
|
/** Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */
|
|
6602
6821
|
labels?: Record<string, string>;
|
|
6822
|
+
/** Optional. Cloud Storage path to the directory where tuning job outputs are written to. This field is only available and required for open source models. */
|
|
6823
|
+
outputUri?: string;
|
|
6603
6824
|
/** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
|
|
6604
6825
|
pipelineJob?: string;
|
|
6605
|
-
/** Output only. Reserved for future use. */
|
|
6606
|
-
satisfiesPzi?: boolean;
|
|
6607
|
-
/** Output only. Reserved for future use. */
|
|
6608
|
-
satisfiesPzs?: boolean;
|
|
6609
6826
|
/** The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account. */
|
|
6610
6827
|
serviceAccount?: string;
|
|
6611
6828
|
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
6612
6829
|
tunedModelDisplayName?: string;
|
|
6613
6830
|
}
|
|
6614
6831
|
|
|
6832
|
+
/** Tuning mode. */
|
|
6833
|
+
export declare enum TuningMode {
|
|
6834
|
+
/**
|
|
6835
|
+
* Tuning mode is unspecified.
|
|
6836
|
+
*/
|
|
6837
|
+
TUNING_MODE_UNSPECIFIED = "TUNING_MODE_UNSPECIFIED",
|
|
6838
|
+
/**
|
|
6839
|
+
* Full fine-tuning mode.
|
|
6840
|
+
*/
|
|
6841
|
+
TUNING_MODE_FULL = "TUNING_MODE_FULL",
|
|
6842
|
+
/**
|
|
6843
|
+
* PEFT adapter tuning mode.
|
|
6844
|
+
*/
|
|
6845
|
+
TUNING_MODE_PEFT_ADAPTER = "TUNING_MODE_PEFT_ADAPTER"
|
|
6846
|
+
}
|
|
6847
|
+
|
|
6615
6848
|
/** A long-running operation. */
|
|
6616
6849
|
export declare interface TuningOperation {
|
|
6617
6850
|
/** Used to retain the full HTTP response. */
|
|
@@ -6744,7 +6977,6 @@ declare namespace types {
|
|
|
6744
6977
|
Mode,
|
|
6745
6978
|
AuthType,
|
|
6746
6979
|
ApiSpec,
|
|
6747
|
-
Environment,
|
|
6748
6980
|
UrlRetrievalStatus,
|
|
6749
6981
|
FinishReason,
|
|
6750
6982
|
HarmProbability,
|
|
@@ -6754,10 +6986,12 @@ declare namespace types {
|
|
|
6754
6986
|
Modality,
|
|
6755
6987
|
MediaResolution,
|
|
6756
6988
|
JobState,
|
|
6989
|
+
TuningMode,
|
|
6757
6990
|
AdapterSize,
|
|
6758
6991
|
FeatureSelectionPreference,
|
|
6759
6992
|
Behavior,
|
|
6760
6993
|
DynamicRetrievalConfigMode,
|
|
6994
|
+
Environment,
|
|
6761
6995
|
FunctionCallingConfigMode,
|
|
6762
6996
|
SafetyFilterLevel,
|
|
6763
6997
|
PersonGeneration,
|
|
@@ -6766,6 +7000,7 @@ declare namespace types {
|
|
|
6766
7000
|
ControlReferenceType,
|
|
6767
7001
|
SubjectReferenceType,
|
|
6768
7002
|
EditMode,
|
|
7003
|
+
SegmentMode,
|
|
6769
7004
|
VideoCompressionQuality,
|
|
6770
7005
|
FileState,
|
|
6771
7006
|
FileSource,
|
|
@@ -6805,6 +7040,7 @@ declare namespace types {
|
|
|
6805
7040
|
AuthConfig,
|
|
6806
7041
|
GoogleMaps,
|
|
6807
7042
|
UrlContext,
|
|
7043
|
+
ToolComputerUse,
|
|
6808
7044
|
ApiAuthApiKeyConfig,
|
|
6809
7045
|
ApiAuth,
|
|
6810
7046
|
ExternalApiElasticSearchParams,
|
|
@@ -6822,7 +7058,6 @@ declare namespace types {
|
|
|
6822
7058
|
VertexRagStore,
|
|
6823
7059
|
Retrieval,
|
|
6824
7060
|
ToolCodeExecution,
|
|
6825
|
-
ToolComputerUse,
|
|
6826
7061
|
Tool,
|
|
6827
7062
|
FunctionCallingConfig,
|
|
6828
7063
|
LatLng,
|
|
@@ -6847,6 +7082,10 @@ declare namespace types {
|
|
|
6847
7082
|
CitationMetadata,
|
|
6848
7083
|
UrlMetadata,
|
|
6849
7084
|
UrlContextMetadata,
|
|
7085
|
+
GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution,
|
|
7086
|
+
GroundingChunkMapsPlaceAnswerSourcesReviewSnippet,
|
|
7087
|
+
GroundingChunkMapsPlaceAnswerSources,
|
|
7088
|
+
GroundingChunkMaps,
|
|
6850
7089
|
RagChunkPageSpan,
|
|
6851
7090
|
RagChunk,
|
|
6852
7091
|
GroundingChunkRetrievedContext,
|
|
@@ -6892,6 +7131,13 @@ declare namespace types {
|
|
|
6892
7131
|
RecontextImageConfig,
|
|
6893
7132
|
RecontextImageParameters,
|
|
6894
7133
|
RecontextImageResponse,
|
|
7134
|
+
ScribbleImage,
|
|
7135
|
+
SegmentImageSource,
|
|
7136
|
+
SegmentImageConfig,
|
|
7137
|
+
SegmentImageParameters,
|
|
7138
|
+
EntityLabel,
|
|
7139
|
+
GeneratedImageMask,
|
|
7140
|
+
SegmentImageResponse,
|
|
6895
7141
|
GetModelConfig,
|
|
6896
7142
|
GetModelParameters,
|
|
6897
7143
|
Endpoint,
|
|
@@ -6916,6 +7162,7 @@ declare namespace types {
|
|
|
6916
7162
|
TokensInfo,
|
|
6917
7163
|
ComputeTokensResponse,
|
|
6918
7164
|
Video,
|
|
7165
|
+
VideoGenerationReferenceImage,
|
|
6919
7166
|
GenerateVideosConfig,
|
|
6920
7167
|
GenerateVideosParameters,
|
|
6921
7168
|
GeneratedVideo,
|
|
@@ -6925,20 +7172,22 @@ declare namespace types {
|
|
|
6925
7172
|
TunedModelCheckpoint,
|
|
6926
7173
|
TunedModel,
|
|
6927
7174
|
GoogleRpcStatus,
|
|
7175
|
+
PreTunedModel,
|
|
6928
7176
|
SupervisedHyperParameters,
|
|
6929
7177
|
SupervisedTuningSpec,
|
|
6930
7178
|
DatasetDistributionDistributionBucket,
|
|
6931
7179
|
DatasetDistribution,
|
|
6932
7180
|
DatasetStats,
|
|
6933
7181
|
DistillationDataStats,
|
|
7182
|
+
GeminiPreferenceExampleCompletion,
|
|
7183
|
+
GeminiPreferenceExample,
|
|
7184
|
+
PreferenceOptimizationDataStats,
|
|
6934
7185
|
SupervisedTuningDatasetDistributionDatasetBucket,
|
|
6935
7186
|
SupervisedTuningDatasetDistribution,
|
|
6936
7187
|
SupervisedTuningDataStats,
|
|
6937
7188
|
TuningDataStats,
|
|
6938
7189
|
EncryptionSpec,
|
|
6939
7190
|
PartnerModelTuningSpec,
|
|
6940
|
-
DistillationHyperParameters,
|
|
6941
|
-
DistillationSpec,
|
|
6942
7191
|
TuningJob,
|
|
6943
7192
|
ListTuningJobsConfig,
|
|
6944
7193
|
ListTuningJobsParameters,
|
|
@@ -6947,7 +7196,7 @@ declare namespace types {
|
|
|
6947
7196
|
TuningDataset,
|
|
6948
7197
|
TuningValidationDataset,
|
|
6949
7198
|
CreateTuningJobConfig,
|
|
6950
|
-
|
|
7199
|
+
CreateTuningJobParametersPrivate,
|
|
6951
7200
|
TuningOperation,
|
|
6952
7201
|
CreateCachedContentConfig,
|
|
6953
7202
|
CreateCachedContentParameters,
|
|
@@ -7039,8 +7288,8 @@ declare namespace types {
|
|
|
7039
7288
|
ActivityStart,
|
|
7040
7289
|
ActivityEnd,
|
|
7041
7290
|
LiveClientRealtimeInput,
|
|
7042
|
-
LiveSendRealtimeInputParameters,
|
|
7043
7291
|
LiveClientToolResponse,
|
|
7292
|
+
LiveSendRealtimeInputParameters,
|
|
7044
7293
|
LiveClientMessage,
|
|
7045
7294
|
LiveConnectConfig,
|
|
7046
7295
|
LiveConnectParameters,
|
|
@@ -7070,6 +7319,7 @@ declare namespace types {
|
|
|
7070
7319
|
LiveConnectConstraints,
|
|
7071
7320
|
CreateAuthTokenConfig,
|
|
7072
7321
|
CreateAuthTokenParameters,
|
|
7322
|
+
CreateTuningJobParameters,
|
|
7073
7323
|
BlobImageUnion,
|
|
7074
7324
|
PartUnion,
|
|
7075
7325
|
PartListUnion,
|
|
@@ -7377,6 +7627,17 @@ export declare enum VideoCompressionQuality {
|
|
|
7377
7627
|
LOSSLESS = "LOSSLESS"
|
|
7378
7628
|
}
|
|
7379
7629
|
|
|
7630
|
+
/** A reference image for video generation. */
|
|
7631
|
+
export declare interface VideoGenerationReferenceImage {
|
|
7632
|
+
/** The reference image.
|
|
7633
|
+
*/
|
|
7634
|
+
image?: Image_2;
|
|
7635
|
+
/** The type of the reference image, which defines how the reference
|
|
7636
|
+
image will be used to generate the video. Supported values are 'asset'
|
|
7637
|
+
or 'style'. */
|
|
7638
|
+
referenceType?: string;
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7380
7641
|
/** Describes how the video in the Part should be used by the model. */
|
|
7381
7642
|
export declare interface VideoMetadata {
|
|
7382
7643
|
/** The frame rate of the video sent to the model. If not specified, the
|