@google/genai 0.12.0 → 0.14.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.
@@ -41,6 +41,21 @@ export declare enum AdapterSize {
41
41
  declare class ApiClient {
42
42
  readonly clientOptions: ApiClientInitOptions;
43
43
  constructor(opts: ApiClientInitOptions);
44
+ /**
45
+ * Determines the base URL for Vertex AI based on project and location.
46
+ * Uses the global endpoint if location is 'global' or if project/location
47
+ * are not specified (implying API key usage).
48
+ * @private
49
+ */
50
+ private baseUrlFromProjectLocation;
51
+ /**
52
+ * Normalizes authentication parameters for Vertex AI.
53
+ * If project and location are provided, API key is cleared.
54
+ * If project and location are not provided (implying API key usage),
55
+ * project and location are cleared.
56
+ * @private
57
+ */
58
+ private normalizeAuthParameters;
44
59
  isVertexAI(): boolean;
45
60
  getProject(): string | undefined;
46
61
  getLocation(): string | undefined;
@@ -77,6 +92,13 @@ declare class ApiClient {
77
92
  * @throws An error if the `mimeType` is not provided and can not be inferred,
78
93
  */
79
94
  uploadFile(file: string | Blob, config?: UploadFileConfig): Promise<File_2>;
95
+ /**
96
+ * Downloads a file asynchronously to the specified path.
97
+ *
98
+ * @params params - The parameters for the download request, see {@link
99
+ * DownloadFileParameters}
100
+ */
101
+ downloadFile(params: DownloadFileParameters): Promise<void>;
80
102
  private fetchUploadUrl;
81
103
  }
82
104
 
@@ -95,6 +117,12 @@ declare interface ApiClientInitOptions {
95
117
  * creating a client, will be set through the Node_client or Web_client.
96
118
  */
97
119
  uploader: Uploader;
120
+ /**
121
+ * Optional. The downloader to use for downloading files. This field is
122
+ * required for creating a client, will be set through the Node_client or
123
+ * Web_client.
124
+ */
125
+ downloader: Downloader;
98
126
  /**
99
127
  * Optional. The Google Cloud project ID for Vertex AI users.
100
128
  * It is not the numeric project name.
@@ -132,6 +160,12 @@ declare interface ApiClientInitOptions {
132
160
  userAgentExtra?: string;
133
161
  }
134
162
 
163
+ /** Config for authentication with API key. */
164
+ export declare interface ApiKeyConfig {
165
+ /** The API key to be used in the request directly. */
166
+ apiKeyString?: string;
167
+ }
168
+
135
169
  /** The audio transcription configuration in Setup. */
136
170
  export declare interface AudioTranscriptionConfig {
137
171
  }
@@ -153,6 +187,61 @@ declare interface Auth {
153
187
  addAuthHeaders(headers: Headers): Promise<void>;
154
188
  }
155
189
 
190
+ /** Auth configuration to run the extension. */
191
+ export declare interface AuthConfig {
192
+ /** Config for API key auth. */
193
+ apiKeyConfig?: ApiKeyConfig;
194
+ /** Type of auth scheme. */
195
+ authType?: AuthType;
196
+ /** Config for Google Service Account auth. */
197
+ googleServiceAccountConfig?: AuthConfigGoogleServiceAccountConfig;
198
+ /** Config for HTTP Basic auth. */
199
+ httpBasicAuthConfig?: AuthConfigHttpBasicAuthConfig;
200
+ /** Config for user oauth. */
201
+ oauthConfig?: AuthConfigOauthConfig;
202
+ /** Config for user OIDC auth. */
203
+ oidcConfig?: AuthConfigOidcConfig;
204
+ }
205
+
206
+ /** Config for Google Service Account Authentication. */
207
+ export declare interface AuthConfigGoogleServiceAccountConfig {
208
+ /** Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension. */
209
+ serviceAccount?: string;
210
+ }
211
+
212
+ /** Config for HTTP Basic Authentication. */
213
+ export declare interface AuthConfigHttpBasicAuthConfig {
214
+ /** Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */
215
+ credentialSecret?: string;
216
+ }
217
+
218
+ /** Config for user oauth. */
219
+ export declare interface AuthConfigOauthConfig {
220
+ /** Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */
221
+ accessToken?: string;
222
+ /** The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account. */
223
+ serviceAccount?: string;
224
+ }
225
+
226
+ /** Config for user OIDC auth. */
227
+ export declare interface AuthConfigOidcConfig {
228
+ /** OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */
229
+ idToken?: string;
230
+ /** The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). */
231
+ serviceAccount?: string;
232
+ }
233
+
234
+ /** Type of auth scheme. */
235
+ export declare enum AuthType {
236
+ AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
237
+ NO_AUTH = "NO_AUTH",
238
+ API_KEY_AUTH = "API_KEY_AUTH",
239
+ HTTP_BASIC_AUTH = "HTTP_BASIC_AUTH",
240
+ GOOGLE_SERVICE_ACCOUNT_AUTH = "GOOGLE_SERVICE_ACCOUNT_AUTH",
241
+ OAUTH = "OAUTH",
242
+ OIDC_AUTH = "OIDC_AUTH"
243
+ }
244
+
156
245
  /** Configures automatic detection of activity. */
157
246
  export declare interface AutomaticActivityDetection {
158
247
  /** If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals. */
@@ -185,6 +274,8 @@ export declare interface BaseUrlParameters {
185
274
 
186
275
  /** Content blob. */
187
276
  declare interface Blob_2 {
277
+ /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls. */
278
+ displayName?: string;
188
279
  /** Required. Raw bytes. */
189
280
  data?: string;
190
281
  /** Required. The IANA standard MIME type of the source data. */
@@ -471,6 +562,19 @@ export declare class Chats {
471
562
  create(params: types.CreateChatParameters): Chat;
472
563
  }
473
564
 
565
+ /** Describes the machine learning model version checkpoint. */
566
+ export declare interface Checkpoint {
567
+ /** The ID of the checkpoint.
568
+ */
569
+ checkpointId?: string;
570
+ /** The epoch of the checkpoint.
571
+ */
572
+ epoch?: string;
573
+ /** The step of the checkpoint.
574
+ */
575
+ step?: string;
576
+ }
577
+
474
578
  /** Source attributions for content. */
475
579
  export declare interface Citation {
476
580
  /** Output only. End index into the content. */
@@ -600,7 +704,7 @@ export declare interface ControlReferenceConfig {
600
704
  A control image is an image that represents a sketch image of areas for the
601
705
  model to fill in based on the prompt.
602
706
  */
603
- export declare interface ControlReferenceImage {
707
+ export declare class ControlReferenceImage {
604
708
  /** The reference image for the editing operation. */
605
709
  referenceImage?: Image_2;
606
710
  /** The id of the reference image. */
@@ -609,6 +713,8 @@ export declare interface ControlReferenceImage {
609
713
  referenceType?: string;
610
714
  /** Configuration for the control reference image. */
611
715
  config?: ControlReferenceConfig;
716
+ /** Internal method to convert to ReferenceImageAPIInternal. */
717
+ toReferenceImageAPI(): any;
612
718
  }
613
719
 
614
720
  /** Enum representing the control type of a control reference image. */
@@ -823,6 +929,8 @@ export declare interface CreateTuningJobConfig {
823
929
  epochCount?: number;
824
930
  /** Multiplier for adjusting the default learning rate. */
825
931
  learningRateMultiplier?: number;
932
+ /** If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. */
933
+ exportLastCheckpointOnly?: boolean;
826
934
  /** Adapter size for tuning. */
827
935
  adapterSize?: AdapterSize;
828
936
  /** 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. */
@@ -1005,6 +1113,19 @@ export declare interface DistillationSpec {
1005
1113
  validationDatasetUri?: string;
1006
1114
  }
1007
1115
 
1116
+ export declare type DownloadableFileUnion = string | File_2 | GeneratedVideo | Video;
1117
+
1118
+ declare interface Downloader {
1119
+ /**
1120
+ * Downloads a file to the given location.
1121
+ *
1122
+ * @param params The parameters for downloading the file.
1123
+ * @param apiClient The ApiClient to use for uploading.
1124
+ * @return A Promises that resolves when the download is complete.
1125
+ */
1126
+ download(params: DownloadFileParameters, apiClient: ApiClient): Promise<void>;
1127
+ }
1128
+
1008
1129
  /** Used to override the default configuration. */
1009
1130
  export declare interface DownloadFileConfig {
1010
1131
  /** Used to override HTTP request options. */
@@ -1018,6 +1139,16 @@ export declare interface DownloadFileConfig {
1018
1139
  abortSignal?: AbortSignal;
1019
1140
  }
1020
1141
 
1142
+ /** Parameters used to download a file. */
1143
+ export declare interface DownloadFileParameters {
1144
+ /** The file to download. It can be a file name, a file object or a generated video. */
1145
+ file: DownloadableFileUnion;
1146
+ /** Location where the file should be downloaded to. */
1147
+ downloadPath: string;
1148
+ /** Configuration to for the download operation. */
1149
+ config?: DownloadFileConfig;
1150
+ }
1151
+
1021
1152
  /** Describes the options to customize dynamic retrieval. */
1022
1153
  export declare interface DynamicRetrievalConfig {
1023
1154
  /** The mode of the predictor to be used in dynamic retrieval. */
@@ -1032,6 +1163,100 @@ export declare enum DynamicRetrievalConfigMode {
1032
1163
  MODE_DYNAMIC = "MODE_DYNAMIC"
1033
1164
  }
1034
1165
 
1166
+ /** Configuration for editing an image. */
1167
+ export declare interface EditImageConfig {
1168
+ /** Used to override HTTP request options. */
1169
+ httpOptions?: HttpOptions;
1170
+ /** Abort signal which can be used to cancel the request.
1171
+
1172
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
1173
+ operation will not cancel the request in the service. You will still
1174
+ be charged usage for any applicable operations.
1175
+ */
1176
+ abortSignal?: AbortSignal;
1177
+ /** Cloud Storage URI used to store the generated images.
1178
+ */
1179
+ outputGcsUri?: string;
1180
+ /** Description of what to discourage in the generated images.
1181
+ */
1182
+ negativePrompt?: string;
1183
+ /** Number of images to generate.
1184
+ */
1185
+ numberOfImages?: number;
1186
+ /** Aspect ratio of the generated images.
1187
+ */
1188
+ aspectRatio?: string;
1189
+ /** Controls how much the model adheres to the text prompt. Large
1190
+ values increase output and prompt alignment, but may compromise image
1191
+ quality.
1192
+ */
1193
+ guidanceScale?: number;
1194
+ /** Random seed for image generation. This is not available when
1195
+ ``add_watermark`` is set to true.
1196
+ */
1197
+ seed?: number;
1198
+ /** Filter level for safety filtering.
1199
+ */
1200
+ safetyFilterLevel?: SafetyFilterLevel;
1201
+ /** Allows generation of people by the model.
1202
+ */
1203
+ personGeneration?: PersonGeneration;
1204
+ /** Whether to report the safety scores of each generated image and
1205
+ the positive prompt in the response.
1206
+ */
1207
+ includeSafetyAttributes?: boolean;
1208
+ /** Whether to include the Responsible AI filter reason if the image
1209
+ is filtered out of the response.
1210
+ */
1211
+ includeRaiReason?: boolean;
1212
+ /** Language of the text in the prompt.
1213
+ */
1214
+ language?: ImagePromptLanguage;
1215
+ /** MIME type of the generated image.
1216
+ */
1217
+ outputMimeType?: string;
1218
+ /** Compression quality of the generated image (for ``image/jpeg``
1219
+ only).
1220
+ */
1221
+ outputCompressionQuality?: number;
1222
+ /** Describes the editing mode for the request. */
1223
+ editMode?: EditMode;
1224
+ /** The number of sampling steps. A higher value has better image
1225
+ quality, while a lower value has better latency. */
1226
+ baseSteps?: number;
1227
+ }
1228
+
1229
+ /** Parameters for the request to edit an image. */
1230
+ export declare interface EditImageParameters {
1231
+ /** The model to use. */
1232
+ model: string;
1233
+ /** A text description of the edit to apply to the image. */
1234
+ prompt: string;
1235
+ /** The reference images for Imagen 3 editing. */
1236
+ referenceImages: ReferenceImage[];
1237
+ /** Configuration for editing. */
1238
+ config?: EditImageConfig;
1239
+ }
1240
+
1241
+ /** Response for the request to edit an image. */
1242
+ export declare class EditImageResponse {
1243
+ /** Generated images. */
1244
+ generatedImages?: GeneratedImage[];
1245
+ }
1246
+
1247
+ /** Enum representing the Imagen 3 Edit mode. */
1248
+ export declare enum EditMode {
1249
+ EDIT_MODE_DEFAULT = "EDIT_MODE_DEFAULT",
1250
+ EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
1251
+ EDIT_MODE_INPAINT_INSERTION = "EDIT_MODE_INPAINT_INSERTION",
1252
+ EDIT_MODE_OUTPAINT = "EDIT_MODE_OUTPAINT",
1253
+ EDIT_MODE_CONTROLLED_EDITING = "EDIT_MODE_CONTROLLED_EDITING",
1254
+ EDIT_MODE_STYLE = "EDIT_MODE_STYLE",
1255
+ EDIT_MODE_BGSWAP = "EDIT_MODE_BGSWAP",
1256
+ EDIT_MODE_PRODUCT_IMAGE = "EDIT_MODE_PRODUCT_IMAGE"
1257
+ }
1258
+
1259
+ /** Optional parameters for the embed_content method. */
1035
1260
  export declare interface EmbedContentConfig {
1036
1261
  /** Used to override HTTP request options. */
1037
1262
  httpOptions?: HttpOptions;
@@ -1118,6 +1343,10 @@ export declare enum EndSensitivity {
1118
1343
  END_SENSITIVITY_LOW = "END_SENSITIVITY_LOW"
1119
1344
  }
1120
1345
 
1346
+ /** Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. */
1347
+ export declare interface EnterpriseWebSearch {
1348
+ }
1349
+
1121
1350
  /** Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [FunctionDeclaration] tool and [FunctionCallingConfig] mode is set to [Mode.CODE]. */
1122
1351
  export declare interface ExecutableCode {
1123
1352
  /** Required. The code to be executed. */
@@ -1261,6 +1490,23 @@ export declare class Files extends BaseModule {
1261
1490
  * ```
1262
1491
  */
1263
1492
  upload(params: types.UploadFileParameters): Promise<types.File>;
1493
+ /**
1494
+ * Downloads a remotely stored file asynchronously to a location specified in
1495
+ * the `params` object. This method only works on Node environment, to
1496
+ * download files in the browser, use a browser compliant method like an <a>
1497
+ * tag.
1498
+ *
1499
+ * @param params - The parameters for the download request.
1500
+ *
1501
+ * @example
1502
+ * The following code downloads an example file named "files/mehozpxf877d" as
1503
+ * "file.txt".
1504
+ *
1505
+ * ```ts
1506
+ * await ai.files.download({file: file.name, downloadPath: 'file.txt'});
1507
+ * ```
1508
+ */
1509
+ download(params: types.DownloadFileParameters): Promise<void>;
1264
1510
  private listInternal;
1265
1511
  private createInternal;
1266
1512
  /**
@@ -1477,10 +1723,21 @@ export declare interface GenerateContentConfig {
1477
1723
  random number is used.
1478
1724
  */
1479
1725
  seed?: number;
1480
- /** Output response media type of the generated candidate text.
1726
+ /** Output response mimetype of the generated candidate text.
1727
+ Supported mimetype:
1728
+ - `text/plain`: (default) Text output.
1729
+ - `application/json`: JSON response in the candidates.
1730
+ The model needs to be prompted to output the appropriate response type,
1731
+ otherwise the behavior is undefined.
1732
+ This is a preview feature.
1481
1733
  */
1482
1734
  responseMimeType?: string;
1483
- /** Schema that the generated candidate text must adhere to.
1735
+ /** The `Schema` object allows the definition of input and output data types.
1736
+ These types can be objects, but also primitives and arrays.
1737
+ Represents a select subset of an [OpenAPI 3.0 schema
1738
+ object](https://spec.openapis.org/oas/v3.0.3#schema).
1739
+ If set, a compatible response_mime_type must also be set.
1740
+ Compatible mimetypes: `application/json`: Schema for JSON response.
1484
1741
  */
1485
1742
  responseSchema?: SchemaUnion;
1486
1743
  /** Configuration for model router requests.
@@ -2186,6 +2443,12 @@ export declare interface GoogleGenAIOptions {
2186
2443
  httpOptions?: HttpOptions;
2187
2444
  }
2188
2445
 
2446
+ /** Tool to support Google Maps in Model. */
2447
+ export declare interface GoogleMaps {
2448
+ /** Optional. Auth config for the Google Maps tool. */
2449
+ authConfig?: AuthConfig;
2450
+ }
2451
+
2189
2452
  /** The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). */
2190
2453
  export declare interface GoogleRpcStatus {
2191
2454
  /** The status code, which should be an enum value of google.rpc.Code. */
@@ -2434,6 +2697,20 @@ export declare enum Language {
2434
2697
  PYTHON = "PYTHON"
2435
2698
  }
2436
2699
 
2700
+ /** An object that represents a latitude/longitude pair.
2701
+
2702
+ This is expressed as a pair of doubles to represent degrees latitude and
2703
+ degrees longitude. Unless specified otherwise, this object must conform to the
2704
+ <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
2705
+ WGS84 standard</a>. Values must be within normalized ranges.
2706
+ */
2707
+ export declare interface LatLng {
2708
+ /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
2709
+ latitude?: number;
2710
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
2711
+ longitude?: number;
2712
+ }
2713
+
2437
2714
  /** Config for caches.list method. */
2438
2715
  export declare interface ListCachedContentsConfig {
2439
2716
  /** Used to override HTTP request options. */
@@ -2492,6 +2769,32 @@ export declare class ListFilesResponse {
2492
2769
  files?: File_2[];
2493
2770
  }
2494
2771
 
2772
+ export declare interface ListModelsConfig {
2773
+ /** Used to override HTTP request options. */
2774
+ httpOptions?: HttpOptions;
2775
+ /** Abort signal which can be used to cancel the request.
2776
+
2777
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
2778
+ operation will not cancel the request in the service. You will still
2779
+ be charged usage for any applicable operations.
2780
+ */
2781
+ abortSignal?: AbortSignal;
2782
+ pageSize?: number;
2783
+ pageToken?: string;
2784
+ filter?: string;
2785
+ /** Set true to list base models, false to list tuned models. */
2786
+ queryBase?: boolean;
2787
+ }
2788
+
2789
+ export declare interface ListModelsParameters {
2790
+ config?: ListModelsConfig;
2791
+ }
2792
+
2793
+ export declare class ListModelsResponse {
2794
+ nextPageToken?: string;
2795
+ models?: Model[];
2796
+ }
2797
+
2495
2798
  /** Configuration for the list tuning jobs method. */
2496
2799
  export declare interface ListTuningJobsConfig {
2497
2800
  /** Used to override HTTP request options. */
@@ -2888,7 +3191,7 @@ export declare interface LiveServerGoAway {
2888
3191
  }
2889
3192
 
2890
3193
  /** Response message for API call. */
2891
- export declare interface LiveServerMessage {
3194
+ export declare class LiveServerMessage {
2892
3195
  /** Sent in response to a `LiveClientSetup` message from the client. */
2893
3196
  setupComplete?: LiveServerSetupComplete;
2894
3197
  /** Content generated by the model in response to client messages. */
@@ -2903,6 +3206,23 @@ export declare interface LiveServerMessage {
2903
3206
  goAway?: LiveServerGoAway;
2904
3207
  /** Update of the session resumption state. */
2905
3208
  sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
3209
+ /**
3210
+ * Returns the concatenation of all text parts from the server content if present.
3211
+ *
3212
+ * @remarks
3213
+ * If there are non-text parts in the response, the concatenation of all text
3214
+ * parts will be returned, and a warning will be logged.
3215
+ */
3216
+ get text(): string | undefined;
3217
+ /**
3218
+ * Returns the concatenation of all inline data parts from the server content if present.
3219
+ *
3220
+ * @remarks
3221
+ * If there are non-inline data parts in the
3222
+ * response, the concatenation of all inline data parts will be returned, and
3223
+ * a warning will be logged.
3224
+ */
3225
+ get data(): string | undefined;
2906
3226
  }
2907
3227
 
2908
3228
  /** Update of the session resumption state.
@@ -2922,7 +3242,6 @@ export declare interface LiveServerSessionResumptionUpdate {
2922
3242
  lastConsumedClientMessageIndex?: string;
2923
3243
  }
2924
3244
 
2925
- /** Sent in response to a `LiveGenerateContentSetup` message from the client. */
2926
3245
  export declare interface LiveServerSetupComplete {
2927
3246
  }
2928
3247
 
@@ -2990,7 +3309,7 @@ export declare interface MaskReferenceConfig {
2990
3309
  image. If the user provides a mask image, the mask must be in the same
2991
3310
  dimensions as the raw image.
2992
3311
  */
2993
- export declare interface MaskReferenceImage {
3312
+ export declare class MaskReferenceImage {
2994
3313
  /** The reference image for the editing operation. */
2995
3314
  referenceImage?: Image_2;
2996
3315
  /** The id of the reference image. */
@@ -2999,6 +3318,8 @@ export declare interface MaskReferenceImage {
2999
3318
  referenceType?: string;
3000
3319
  /** Configuration for the mask reference image. */
3001
3320
  config?: MaskReferenceConfig;
3321
+ /** Internal method to convert to ReferenceImageAPIInternal. */
3322
+ toReferenceImageAPI(): any;
3002
3323
  }
3003
3324
 
3004
3325
  /** Enum representing the mask mode of a mask reference image. */
@@ -3076,6 +3397,11 @@ export declare interface Model {
3076
3397
  outputTokenLimit?: number;
3077
3398
  /** List of actions that are supported by the model. */
3078
3399
  supportedActions?: string[];
3400
+ /** The default checkpoint id of a model version.
3401
+ */
3402
+ defaultCheckpointId?: string;
3403
+ /** The checkpoints of the model. */
3404
+ checkpoints?: Checkpoint[];
3079
3405
  }
3080
3406
 
3081
3407
  export declare class Models extends BaseModule {
@@ -3165,9 +3491,7 @@ export declare class Models extends BaseModule {
3165
3491
  /**
3166
3492
  * Generates an image based on a text description and configuration.
3167
3493
  *
3168
- * @param model - The model to use.
3169
- * @param prompt - A text description of the image to generate.
3170
- * @param [config] - The config for image generation.
3494
+ * @param params - The parameters for generating images.
3171
3495
  * @return The response from the API.
3172
3496
  *
3173
3497
  * @example
@@ -3184,6 +3508,49 @@ export declare class Models extends BaseModule {
3184
3508
  * ```
3185
3509
  */
3186
3510
  generateImages: (params: types.GenerateImagesParameters) => Promise<types.GenerateImagesResponse>;
3511
+ list: (params?: types.ListModelsParameters) => Promise<Pager<types.Model>>;
3512
+ /**
3513
+ * Edits an image based on a prompt, list of reference images, and configuration.
3514
+ *
3515
+ * @param params - The parameters for editing an image.
3516
+ * @return The response from the API.
3517
+ *
3518
+ * @example
3519
+ * ```ts
3520
+ * const response = await client.models.editImage({
3521
+ * model: 'imagen-3.0-capability-001',
3522
+ * prompt: 'Generate an image containing a mug with the product logo [1] visible on the side of the mug.',
3523
+ * referenceImages: [subjectReferenceImage]
3524
+ * config: {
3525
+ * numberOfImages: 1,
3526
+ * includeRaiReason: true,
3527
+ * },
3528
+ * });
3529
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
3530
+ * ```
3531
+ */
3532
+ editImage: (params: types.EditImageParameters) => Promise<types.EditImageResponse>;
3533
+ /**
3534
+ * Upscales an image based on an image, upscale factor, and configuration.
3535
+ * Only supported in Vertex AI currently.
3536
+ *
3537
+ * @param params - The parameters for upscaling an image.
3538
+ * @return The response from the API.
3539
+ *
3540
+ * @example
3541
+ * ```ts
3542
+ * const response = await client.models.upscaleImage({
3543
+ * model: 'imagen-3.0-generate-002',
3544
+ * image: image,
3545
+ * upscaleFactor: 'x2',
3546
+ * config: {
3547
+ * includeRaiReason: true,
3548
+ * },
3549
+ * });
3550
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
3551
+ * ```
3552
+ */
3553
+ upscaleImage: (params: types.UpscaleImageParameters) => Promise<types.UpscaleImageResponse>;
3187
3554
  private generateContentInternal;
3188
3555
  private generateContentStreamInternal;
3189
3556
  /**
@@ -3228,6 +3595,8 @@ export declare class Models extends BaseModule {
3228
3595
  * ```
3229
3596
  */
3230
3597
  private generateImagesInternal;
3598
+ private editImageInternal;
3599
+ private upscaleImageInternal;
3231
3600
  /**
3232
3601
  * Fetches information about a model by name.
3233
3602
  *
@@ -3237,6 +3606,7 @@ export declare class Models extends BaseModule {
3237
3606
  * ```
3238
3607
  */
3239
3608
  get(params: types.GetModelParameters): Promise<types.Model>;
3609
+ private listInternal;
3240
3610
  /**
3241
3611
  * Updates a tuned model by its name.
3242
3612
  *
@@ -3520,6 +3890,8 @@ export declare interface Part {
3520
3890
  videoMetadata?: VideoMetadata;
3521
3891
  /** Indicates if the part is thought from the model. */
3522
3892
  thought?: boolean;
3893
+ /** Optional. Inlined bytes data. */
3894
+ inlineData?: Blob_2;
3523
3895
  /** Optional. Result of executing the [ExecutableCode]. */
3524
3896
  codeExecutionResult?: CodeExecutionResult;
3525
3897
  /** Optional. Code generated by the model that is meant to be executed. */
@@ -3530,8 +3902,6 @@ export declare interface Part {
3530
3902
  functionCall?: FunctionCall;
3531
3903
  /** Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model. */
3532
3904
  functionResponse?: FunctionResponse;
3533
- /** Optional. Inlined bytes data. */
3534
- inlineData?: Blob_2;
3535
3905
  /** Optional. Text part (can be code). */
3536
3906
  text?: string;
3537
3907
  }
@@ -3618,13 +3988,15 @@ export declare interface RagRetrievalConfigRankingRankService {
3618
3988
  It can optionally be provided in addition to a mask reference image or
3619
3989
  a style reference image.
3620
3990
  */
3621
- export declare interface RawReferenceImage {
3991
+ export declare class RawReferenceImage {
3622
3992
  /** The reference image for the editing operation. */
3623
3993
  referenceImage?: Image_2;
3624
3994
  /** The id of the reference image. */
3625
3995
  referenceId?: number;
3626
3996
  /** The type of the reference image. Only set by the SDK. */
3627
3997
  referenceType?: string;
3998
+ /** Internal method to convert to ReferenceImageAPIInternal. */
3999
+ toReferenceImageAPI(): any;
3628
4000
  }
3629
4001
 
3630
4002
  /** Marks the end of user activity.
@@ -3641,6 +4013,8 @@ export declare interface RealtimeInputConfig {
3641
4013
  turnCoverage?: TurnCoverage;
3642
4014
  }
3643
4015
 
4016
+ export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
4017
+
3644
4018
  /** Represents a recorded session. */
3645
4019
  export declare interface ReplayFile {
3646
4020
  replayId?: string;
@@ -3679,6 +4053,13 @@ export declare interface Retrieval {
3679
4053
  vertexRagStore?: VertexRagStore;
3680
4054
  }
3681
4055
 
4056
+ /** Retrieval config.
4057
+ */
4058
+ export declare interface RetrievalConfig {
4059
+ /** Optional. The location of the user. */
4060
+ latLng?: LatLng;
4061
+ }
4062
+
3682
4063
  /** Metadata related to retrieval in the grounding flow. */
3683
4064
  export declare interface RetrievalMetadata {
3684
4065
  /** Optional. Score indicating how likely information from Google Search could help answer the prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most likely. This score is only populated when Google Search grounding and dynamic retrieval is enabled. It will be compared to the threshold to determine whether to trigger Google Search. */
@@ -4031,7 +4412,7 @@ export declare interface StyleReferenceConfig {
4031
4412
  A raw reference image can also be provided as a destination for the style to
4032
4413
  be applied to.
4033
4414
  */
4034
- export declare interface StyleReferenceImage {
4415
+ export declare class StyleReferenceImage {
4035
4416
  /** The reference image for the editing operation. */
4036
4417
  referenceImage?: Image_2;
4037
4418
  /** The id of the reference image. */
@@ -4040,6 +4421,8 @@ export declare interface StyleReferenceImage {
4040
4421
  referenceType?: string;
4041
4422
  /** Configuration for the style reference image. */
4042
4423
  config?: StyleReferenceConfig;
4424
+ /** Internal method to convert to ReferenceImageAPIInternal. */
4425
+ toReferenceImageAPI(): any;
4043
4426
  }
4044
4427
 
4045
4428
  /** Configuration for a Subject reference image. */
@@ -4058,7 +4441,7 @@ export declare interface SubjectReferenceConfig {
4058
4441
  A raw reference image can also be provided as a destination for the subject to
4059
4442
  be applied to.
4060
4443
  */
4061
- export declare interface SubjectReferenceImage {
4444
+ export declare class SubjectReferenceImage {
4062
4445
  /** The reference image for the editing operation. */
4063
4446
  referenceImage?: Image_2;
4064
4447
  /** The id of the reference image. */
@@ -4067,6 +4450,7 @@ export declare interface SubjectReferenceImage {
4067
4450
  referenceType?: string;
4068
4451
  /** Configuration for the subject reference image. */
4069
4452
  config?: SubjectReferenceConfig;
4453
+ toReferenceImageAPI(): any;
4070
4454
  }
4071
4455
 
4072
4456
  /** Enum representing the subject type of a subject reference image. */
@@ -4153,6 +4537,8 @@ export declare interface SupervisedTuningSpec {
4153
4537
  trainingDatasetUri?: string;
4154
4538
  /** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
4155
4539
  validationDatasetUri?: string;
4540
+ /** Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. */
4541
+ exportLastCheckpointOnly?: boolean;
4156
4542
  }
4157
4543
 
4158
4544
  export declare interface TestTableFile {
@@ -4210,6 +4596,12 @@ export declare interface Tool {
4210
4596
  googleSearch?: GoogleSearch;
4211
4597
  /** Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search. */
4212
4598
  googleSearchRetrieval?: GoogleSearchRetrieval;
4599
+ /** Optional. Enterprise web search tool type. Specialized retrieval
4600
+ tool that is powered by Vertex AI Search and Sec4 compliance. */
4601
+ enterpriseWebSearch?: EnterpriseWebSearch;
4602
+ /** Optional. Google Maps tool type. Specialized retrieval tool
4603
+ that is powered by Google Maps. */
4604
+ googleMaps?: GoogleMaps;
4213
4605
  /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services. */
4214
4606
  codeExecution?: ToolCodeExecution;
4215
4607
  /** Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 128 function declarations can be provided. */
@@ -4227,6 +4619,8 @@ export declare interface ToolCodeExecution {
4227
4619
  export declare interface ToolConfig {
4228
4620
  /** Optional. Function calling config. */
4229
4621
  functionCallingConfig?: FunctionCallingConfig;
4622
+ /** Optional. Retrieval config. */
4623
+ retrievalConfig?: RetrievalConfig;
4230
4624
  }
4231
4625
 
4232
4626
  export declare type ToolListUnion = Tool[];
@@ -4253,6 +4647,27 @@ export declare interface TunedModel {
4253
4647
  model?: string;
4254
4648
  /** Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`. */
4255
4649
  endpoint?: string;
4650
+ /** The checkpoints associated with this TunedModel.
4651
+ This field is only populated for tuning jobs that enable intermediate
4652
+ checkpoints. */
4653
+ checkpoints?: TunedModelCheckpoint[];
4654
+ }
4655
+
4656
+ /** TunedModelCheckpoint for the Tuned Model of a Tuning Job. */
4657
+ export declare interface TunedModelCheckpoint {
4658
+ /** The ID of the checkpoint.
4659
+ */
4660
+ checkpointId?: string;
4661
+ /** The epoch of the checkpoint.
4662
+ */
4663
+ epoch?: string;
4664
+ /** The step of the checkpoint.
4665
+ */
4666
+ step?: string;
4667
+ /** The Endpoint resource name that the checkpoint is deployed to.
4668
+ Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
4669
+ */
4670
+ endpoint?: string;
4256
4671
  }
4257
4672
 
4258
4673
  /** A tuned machine learning model. */
@@ -4409,6 +4824,7 @@ declare namespace types {
4409
4824
  HarmBlockMethod,
4410
4825
  HarmBlockThreshold,
4411
4826
  Mode,
4827
+ AuthType,
4412
4828
  Type,
4413
4829
  FinishReason,
4414
4830
  HarmProbability,
@@ -4425,23 +4841,24 @@ declare namespace types {
4425
4841
  SafetyFilterLevel,
4426
4842
  PersonGeneration,
4427
4843
  ImagePromptLanguage,
4428
- FileState,
4429
- FileSource,
4430
4844
  MaskReferenceMode,
4431
4845
  ControlReferenceType,
4432
4846
  SubjectReferenceType,
4847
+ EditMode,
4848
+ FileState,
4849
+ FileSource,
4433
4850
  MediaModality,
4434
4851
  StartSensitivity,
4435
4852
  EndSensitivity,
4436
4853
  ActivityHandling,
4437
4854
  TurnCoverage,
4855
+ Blob_2 as Blob,
4438
4856
  VideoMetadata,
4439
4857
  CodeExecutionResult,
4440
4858
  ExecutableCode,
4441
4859
  FileData,
4442
4860
  FunctionCall,
4443
4861
  FunctionResponse,
4444
- Blob_2 as Blob,
4445
4862
  Part,
4446
4863
  Content,
4447
4864
  HttpOptions,
@@ -4450,6 +4867,14 @@ declare namespace types {
4450
4867
  GoogleSearch,
4451
4868
  DynamicRetrievalConfig,
4452
4869
  GoogleSearchRetrieval,
4870
+ EnterpriseWebSearch,
4871
+ ApiKeyConfig,
4872
+ AuthConfigGoogleServiceAccountConfig,
4873
+ AuthConfigHttpBasicAuthConfig,
4874
+ AuthConfigOauthConfig,
4875
+ AuthConfigOidcConfig,
4876
+ AuthConfig,
4877
+ GoogleMaps,
4453
4878
  VertexAISearch,
4454
4879
  VertexRagStoreRagResource,
4455
4880
  RagRetrievalConfigFilter,
@@ -4465,6 +4890,8 @@ declare namespace types {
4465
4890
  FunctionDeclaration,
4466
4891
  Tool,
4467
4892
  FunctionCallingConfig,
4893
+ LatLng,
4894
+ RetrievalConfig,
4468
4895
  ToolConfig,
4469
4896
  PrebuiltVoiceConfig,
4470
4897
  VoiceConfig,
@@ -4495,6 +4922,8 @@ declare namespace types {
4495
4922
  ModalityTokenCount,
4496
4923
  GenerateContentResponseUsageMetadata,
4497
4924
  GenerateContentResponse,
4925
+ ReferenceImage,
4926
+ EditImageParameters,
4498
4927
  EmbedContentConfig,
4499
4928
  EmbedContentParameters,
4500
4929
  ContentEmbeddingStatistics,
@@ -4507,11 +4936,22 @@ declare namespace types {
4507
4936
  SafetyAttributes,
4508
4937
  GeneratedImage,
4509
4938
  GenerateImagesResponse,
4939
+ MaskReferenceConfig,
4940
+ ControlReferenceConfig,
4941
+ StyleReferenceConfig,
4942
+ SubjectReferenceConfig,
4943
+ EditImageConfig,
4944
+ EditImageResponse,
4945
+ UpscaleImageResponse,
4510
4946
  GetModelConfig,
4511
4947
  GetModelParameters,
4512
4948
  Endpoint,
4513
4949
  TunedModelInfo,
4950
+ Checkpoint,
4514
4951
  Model,
4952
+ ListModelsConfig,
4953
+ ListModelsParameters,
4954
+ ListModelsResponse,
4515
4955
  UpdateModelConfig,
4516
4956
  UpdateModelParameters,
4517
4957
  DeleteModelConfig,
@@ -4533,6 +4973,7 @@ declare namespace types {
4533
4973
  GenerateVideosOperation,
4534
4974
  GetTuningJobConfig,
4535
4975
  GetTuningJobParameters,
4976
+ TunedModelCheckpoint,
4536
4977
  TunedModel,
4537
4978
  GoogleRpcStatus,
4538
4979
  SupervisedHyperParameters,
@@ -4601,16 +5042,13 @@ declare namespace types {
4601
5042
  ReplayFile,
4602
5043
  UploadFileConfig,
4603
5044
  DownloadFileConfig,
5045
+ DownloadFileParameters,
4604
5046
  UpscaleImageConfig,
4605
5047
  UpscaleImageParameters,
4606
5048
  RawReferenceImage,
4607
- MaskReferenceConfig,
4608
5049
  MaskReferenceImage,
4609
- ControlReferenceConfig,
4610
5050
  ControlReferenceImage,
4611
- StyleReferenceConfig,
4612
5051
  StyleReferenceImage,
4613
- SubjectReferenceConfig,
4614
5052
  SubjectReferenceImage,
4615
5053
  LiveServerSetupComplete,
4616
5054
  Transcription,
@@ -4632,6 +5070,7 @@ declare namespace types {
4632
5070
  ActivityStart,
4633
5071
  ActivityEnd,
4634
5072
  LiveClientRealtimeInput,
5073
+ LiveSendRealtimeInputParameters,
4635
5074
  LiveClientToolResponse,
4636
5075
  LiveClientMessage,
4637
5076
  LiveConnectConfig,
@@ -4639,7 +5078,6 @@ declare namespace types {
4639
5078
  CreateChatParameters,
4640
5079
  SendMessageParameters,
4641
5080
  LiveSendClientContentParameters,
4642
- LiveSendRealtimeInputParameters,
4643
5081
  LiveSendToolResponseParameters,
4644
5082
  OperationGetParameters,
4645
5083
  BlobImageUnion,
@@ -4649,7 +5087,8 @@ declare namespace types {
4649
5087
  ContentListUnion,
4650
5088
  SchemaUnion,
4651
5089
  SpeechConfigUnion,
4652
- ToolListUnion
5090
+ ToolListUnion,
5091
+ DownloadableFileUnion
4653
5092
  }
4654
5093
  }
4655
5094
 
@@ -4692,6 +5131,7 @@ export declare interface UpdateModelConfig {
4692
5131
  abortSignal?: AbortSignal;
4693
5132
  displayName?: string;
4694
5133
  description?: string;
5134
+ defaultCheckpointId?: string;
4695
5135
  }
4696
5136
 
4697
5137
  /** Configuration for updating a tuned model. */
@@ -4788,6 +5228,11 @@ export declare interface UpscaleImageParameters {
4788
5228
  config?: UpscaleImageConfig;
4789
5229
  }
4790
5230
 
5231
+ export declare class UpscaleImageResponse {
5232
+ /** Generated images. */
5233
+ generatedImages?: GeneratedImage[];
5234
+ }
5235
+
4791
5236
  /** Usage metadata about response(s). */
4792
5237
  export declare interface UsageMetadata {
4793
5238
  /** Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. */