@google/genai 1.6.0 → 1.8.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.
@@ -66,6 +66,20 @@ export declare enum AdapterSize {
66
66
  ADAPTER_SIZE_THIRTY_TWO = "ADAPTER_SIZE_THIRTY_TWO"
67
67
  }
68
68
 
69
+ /** The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. */
70
+ export declare interface ApiAuth {
71
+ /** The API secret. */
72
+ apiKeyConfig?: ApiAuthApiKeyConfig;
73
+ }
74
+
75
+ /** The API secret. */
76
+ export declare interface ApiAuthApiKeyConfig {
77
+ /** Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} */
78
+ apiKeySecretVersion?: string;
79
+ /** The API key string. Either this or `api_key_secret_version` must be set. */
80
+ apiKeyString?: string;
81
+ }
82
+
69
83
  /**
70
84
  * The ApiClient class is used to send requests to the Gemini API or Vertex AI
71
85
  * endpoints.
@@ -222,9 +236,26 @@ export declare interface ApiKeyConfig {
222
236
  apiKeyString?: string;
223
237
  }
224
238
 
239
+ /** The API spec that the external API implements. */
240
+ export declare enum ApiSpec {
241
+ /**
242
+ * Unspecified API spec. This value should not be used.
243
+ */
244
+ API_SPEC_UNSPECIFIED = "API_SPEC_UNSPECIFIED",
245
+ /**
246
+ * Simple search API spec.
247
+ */
248
+ SIMPLE_SEARCH = "SIMPLE_SEARCH",
249
+ /**
250
+ * Elastic search API spec.
251
+ */
252
+ ELASTIC_SEARCH = "ELASTIC_SEARCH"
253
+ }
254
+
225
255
  /** Representation of an audio chunk. */
226
256
  export declare interface AudioChunk {
227
- /** Raw byets of audio data. */
257
+ /** Raw bytes of audio data.
258
+ * @remarks Encoded as base64 string. */
228
259
  data?: string;
229
260
  /** MIME type of the audio chunk. */
230
261
  mimeType?: string;
@@ -384,6 +415,174 @@ export declare interface BaseUrlParameters {
384
415
  vertexUrl?: string;
385
416
  }
386
417
 
418
+ export declare class Batches extends BaseModule {
419
+ private readonly apiClient;
420
+ constructor(apiClient: ApiClient);
421
+ /**
422
+ * Create batch job.
423
+ *
424
+ * @param params - The parameters for create batch job request.
425
+ * @return The created batch job.
426
+ *
427
+ * @example
428
+ * ```ts
429
+ * const response = await ai.batches.create({
430
+ * model: 'gemini-2.0-flash',
431
+ * src: {gcsUri: 'gs://bucket/path/to/file.jsonl', format: 'jsonl'},
432
+ * config: {
433
+ * dest: {gcsUri: 'gs://bucket/path/output/directory', format: 'jsonl'},
434
+ * }
435
+ * });
436
+ * console.log(response);
437
+ * ```
438
+ */
439
+ create: (params: types.CreateBatchJobParameters) => Promise<types.BatchJob>;
440
+ /**
441
+ * Lists batch job configurations.
442
+ *
443
+ * @param params - The parameters for the list request.
444
+ * @return The paginated results of the list of batch jobs.
445
+ *
446
+ * @example
447
+ * ```ts
448
+ * const batchJobs = await ai.batches.list({config: {'pageSize': 2}});
449
+ * for await (const batchJob of batchJobs) {
450
+ * console.log(batchJob);
451
+ * }
452
+ * ```
453
+ */
454
+ list: (params?: types.ListBatchJobsParameters) => Promise<Pager<types.BatchJob>>;
455
+ /**
456
+ * Internal method to create batch job.
457
+ *
458
+ * @param params - The parameters for create batch job request.
459
+ * @return The created batch job.
460
+ *
461
+ */
462
+ private createInternal;
463
+ /**
464
+ * Gets batch job configurations.
465
+ *
466
+ * @param params - The parameters for the get request.
467
+ * @return The batch job.
468
+ *
469
+ * @example
470
+ * ```ts
471
+ * await ai.batches.get({name: '...'}); // The server-generated resource name.
472
+ * ```
473
+ */
474
+ get(params: types.GetBatchJobParameters): Promise<types.BatchJob>;
475
+ /**
476
+ * Cancels a batch job.
477
+ *
478
+ * @param params - The parameters for the cancel request.
479
+ * @return The empty response returned by the API.
480
+ *
481
+ * @example
482
+ * ```ts
483
+ * await ai.batches.cancel({name: '...'}); // The server-generated resource name.
484
+ * ```
485
+ */
486
+ cancel(params: types.CancelBatchJobParameters): Promise<void>;
487
+ private listInternal;
488
+ /**
489
+ * Deletes a batch job.
490
+ *
491
+ * @param params - The parameters for the delete request.
492
+ * @return The empty response returned by the API.
493
+ *
494
+ * @example
495
+ * ```ts
496
+ * await ai.batches.delete({name: '...'}); // The server-generated resource name.
497
+ * ```
498
+ */
499
+ delete(params: types.DeleteBatchJobParameters): Promise<types.DeleteResourceJob>;
500
+ }
501
+
502
+ /** Config for batches.create return value. */
503
+ export declare interface BatchJob {
504
+ /** The resource name of the BatchJob. Output only.".
505
+ */
506
+ name?: string;
507
+ /** The display name of the BatchJob.
508
+ */
509
+ displayName?: string;
510
+ /** The state of the BatchJob.
511
+ */
512
+ state?: JobState;
513
+ /** Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED. */
514
+ error?: JobError;
515
+ /** The time when the BatchJob was created.
516
+ */
517
+ createTime?: string;
518
+ /** Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state. */
519
+ startTime?: string;
520
+ /** The time when the BatchJob was completed.
521
+ */
522
+ endTime?: string;
523
+ /** The time when the BatchJob was last updated.
524
+ */
525
+ updateTime?: string;
526
+ /** The name of the model that produces the predictions via the BatchJob.
527
+ */
528
+ model?: string;
529
+ /** Configuration for the input data.
530
+ */
531
+ src?: BatchJobSource;
532
+ /** Configuration for the output data.
533
+ */
534
+ dest?: BatchJobDestination;
535
+ }
536
+
537
+ /** Config for `des` parameter. */
538
+ export declare interface BatchJobDestination {
539
+ /** Storage format of the output files. Must be one of:
540
+ 'jsonl', 'bigquery'.
541
+ */
542
+ format?: string;
543
+ /** The Google Cloud Storage URI to the output file.
544
+ */
545
+ gcsUri?: string;
546
+ /** The BigQuery URI to the output table.
547
+ */
548
+ bigqueryUri?: string;
549
+ /** The Gemini Developer API's file resource name of the output data
550
+ (e.g. "files/12345"). The file will be a JSONL file with a single response
551
+ per line. The responses will be GenerateContentResponse messages formatted
552
+ as JSON. The responses will be written in the same order as the input
553
+ requests.
554
+ */
555
+ fileName?: string;
556
+ /** The responses to the requests in the batch. Returned when the batch was
557
+ built using inlined requests. The responses will be in the same order as
558
+ the input requests.
559
+ */
560
+ inlinedResponses?: InlinedResponse[];
561
+ }
562
+
563
+ /** Config for `src` parameter. */
564
+ export declare interface BatchJobSource {
565
+ /** Storage format of the input files. Must be one of:
566
+ 'jsonl', 'bigquery'.
567
+ */
568
+ format?: string;
569
+ /** The Google Cloud Storage URIs to input files.
570
+ */
571
+ gcsUri?: string[];
572
+ /** The BigQuery URI to input table.
573
+ */
574
+ bigqueryUri?: string;
575
+ /** The Gemini Developer API's file resource name of the input data
576
+ (e.g. "files/12345").
577
+ */
578
+ fileName?: string;
579
+ /** The Gemini Developer API's inlined input data to run batch job.
580
+ */
581
+ inlinedRequests?: InlinedRequest[];
582
+ }
583
+
584
+ export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
585
+
387
586
  /** Defines the function behavior. Defaults to `BLOCKING`. */
388
587
  export declare enum Behavior {
389
588
  /**
@@ -404,7 +603,8 @@ export declare enum Behavior {
404
603
  declare interface Blob_2 {
405
604
  /** 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. */
406
605
  displayName?: string;
407
- /** Required. Raw bytes. */
606
+ /** Required. Raw bytes.
607
+ * @remarks Encoded as base64 string. */
408
608
  data?: string;
409
609
  /** Required. The IANA standard MIME type of the source data. */
410
610
  mimeType?: string;
@@ -434,7 +634,11 @@ export declare enum BlockedReason {
434
634
  /**
435
635
  * Candidates blocked due to prohibited content.
436
636
  */
437
- PROHIBITED_CONTENT = "PROHIBITED_CONTENT"
637
+ PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
638
+ /**
639
+ * Candidates blocked due to unsafe image generation content.
640
+ */
641
+ IMAGE_SAFETY = "IMAGE_SAFETY"
438
642
  }
439
643
 
440
644
  /** A resource used in LLM queries for users to explicitly specify what to cache. */
@@ -587,6 +791,30 @@ export declare interface CallableToolConfig {
587
791
  timeout?: number;
588
792
  }
589
793
 
794
+ /** Optional parameters. */
795
+ export declare interface CancelBatchJobConfig {
796
+ /** Used to override HTTP request options. */
797
+ httpOptions?: HttpOptions;
798
+ /** Abort signal which can be used to cancel the request.
799
+
800
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
801
+ operation will not cancel the request in the service. You will still
802
+ be charged usage for any applicable operations.
803
+ */
804
+ abortSignal?: AbortSignal;
805
+ }
806
+
807
+ /** Config for batches.cancel parameters. */
808
+ export declare interface CancelBatchJobParameters {
809
+ /** A fully-qualified BatchJob resource name or ID.
810
+ Example: "projects/.../locations/.../batchPredictionJobs/456"
811
+ or "456" when project and location are initialized in the client.
812
+ */
813
+ name: string;
814
+ /** Optional parameters for the request. */
815
+ config?: CancelBatchJobConfig;
816
+ }
817
+
590
818
  /** A response candidate generated from the model. */
591
819
  export declare interface Candidate {
592
820
  /** Contains the multi-part content of the response.
@@ -776,7 +1004,7 @@ export declare interface CitationMetadata {
776
1004
  citations?: Citation[];
777
1005
  }
778
1006
 
779
- /** Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode]. */
1007
+ /** Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */
780
1008
  export declare interface CodeExecutionResult {
781
1009
  /** Required. Outcome of the code execution. */
782
1010
  outcome?: Outcome;
@@ -984,6 +1212,40 @@ export declare interface CreateAuthTokenParameters {
984
1212
  config?: CreateAuthTokenConfig;
985
1213
  }
986
1214
 
1215
+ /** Config for optional parameters. */
1216
+ export declare interface CreateBatchJobConfig {
1217
+ /** Used to override HTTP request options. */
1218
+ httpOptions?: HttpOptions;
1219
+ /** Abort signal which can be used to cancel the request.
1220
+
1221
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
1222
+ operation will not cancel the request in the service. You will still
1223
+ be charged usage for any applicable operations.
1224
+ */
1225
+ abortSignal?: AbortSignal;
1226
+ /** The user-defined name of this BatchJob.
1227
+ */
1228
+ displayName?: string;
1229
+ /** GCS or BigQuery URI prefix for the output predictions. Example:
1230
+ "gs://path/to/output/data" or "bq://projectId.bqDatasetId.bqTableId".
1231
+ */
1232
+ dest?: string;
1233
+ }
1234
+
1235
+ /** Config for batches.create parameters. */
1236
+ export declare interface CreateBatchJobParameters {
1237
+ /** The name of the model to produces the predictions via the BatchJob.
1238
+ */
1239
+ model?: string;
1240
+ /** GCS URI(-s) or BigQuery URI to your input data to run batch job.
1241
+ Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
1242
+ */
1243
+ src: BatchJobSourceUnion;
1244
+ /** Optional parameters for creating a BatchJob.
1245
+ */
1246
+ config?: CreateBatchJobConfig;
1247
+ }
1248
+
987
1249
  /** Optional configuration for cached content creation. */
988
1250
  export declare interface CreateCachedContentConfig {
989
1251
  /** Used to override HTTP request options. */
@@ -1230,6 +1492,30 @@ export declare interface DatasetStats {
1230
1492
  userOutputTokenDistribution?: DatasetDistribution;
1231
1493
  }
1232
1494
 
1495
+ /** Optional parameters for models.get method. */
1496
+ export declare interface DeleteBatchJobConfig {
1497
+ /** Used to override HTTP request options. */
1498
+ httpOptions?: HttpOptions;
1499
+ /** Abort signal which can be used to cancel the request.
1500
+
1501
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
1502
+ operation will not cancel the request in the service. You will still
1503
+ be charged usage for any applicable operations.
1504
+ */
1505
+ abortSignal?: AbortSignal;
1506
+ }
1507
+
1508
+ /** Config for batches.delete parameters. */
1509
+ export declare interface DeleteBatchJobParameters {
1510
+ /** A fully-qualified BatchJob resource name or ID.
1511
+ Example: "projects/.../locations/.../batchPredictionJobs/456"
1512
+ or "456" when project and location are initialized in the client.
1513
+ */
1514
+ name: string;
1515
+ /** Optional parameters for the request. */
1516
+ config?: DeleteBatchJobConfig;
1517
+ }
1518
+
1233
1519
  /** Optional parameters for caches.delete method. */
1234
1520
  export declare interface DeleteCachedContentConfig {
1235
1521
  /** Used to override HTTP request options. */
@@ -1305,6 +1591,13 @@ export declare interface DeleteModelParameters {
1305
1591
  export declare class DeleteModelResponse {
1306
1592
  }
1307
1593
 
1594
+ /** The return value of delete operation. */
1595
+ export declare interface DeleteResourceJob {
1596
+ name?: string;
1597
+ done?: boolean;
1598
+ error?: JobError;
1599
+ }
1600
+
1308
1601
  /** Statistics computed for datasets used for distillation. */
1309
1602
  export declare interface DistillationDataStats {
1310
1603
  /** Output only. Statistics computed for the training dataset. */
@@ -1415,7 +1708,8 @@ export declare interface EditImageConfig {
1415
1708
  /** Number of images to generate.
1416
1709
  */
1417
1710
  numberOfImages?: number;
1418
- /** Aspect ratio of the generated images.
1711
+ /** Aspect ratio of the generated images. Supported values are
1712
+ "1:1", "3:4", "4:3", "9:16", and "16:9".
1419
1713
  */
1420
1714
  aspectRatio?: string;
1421
1715
  /** Controls how much the model adheres to the text prompt. Large
@@ -1588,7 +1882,19 @@ export declare enum EndSensitivity {
1588
1882
  export declare interface EnterpriseWebSearch {
1589
1883
  }
1590
1884
 
1591
- /** 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]. */
1885
+ /** Required. The environment being operated. */
1886
+ export declare enum Environment {
1887
+ /**
1888
+ * Defaults to browser.
1889
+ */
1890
+ ENVIRONMENT_UNSPECIFIED = "ENVIRONMENT_UNSPECIFIED",
1891
+ /**
1892
+ * Operates in a web browser.
1893
+ */
1894
+ ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER"
1895
+ }
1896
+
1897
+ /** Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. */
1592
1898
  export declare interface ExecutableCode {
1593
1899
  /** Required. The code to be executed. */
1594
1900
  code?: string;
@@ -1596,6 +1902,36 @@ export declare interface ExecutableCode {
1596
1902
  language?: Language;
1597
1903
  }
1598
1904
 
1905
+ /** Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. */
1906
+ export declare interface ExternalApi {
1907
+ /** The authentication config to access the API. Deprecated. Please use auth_config instead. */
1908
+ apiAuth?: ApiAuth;
1909
+ /** The API spec that the external API implements. */
1910
+ apiSpec?: ApiSpec;
1911
+ /** The authentication config to access the API. */
1912
+ authConfig?: AuthConfig;
1913
+ /** Parameters for the elastic search API. */
1914
+ elasticSearchParams?: ExternalApiElasticSearchParams;
1915
+ /** The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search */
1916
+ endpoint?: string;
1917
+ /** Parameters for the simple search API. */
1918
+ simpleSearchParams?: ExternalApiSimpleSearchParams;
1919
+ }
1920
+
1921
+ /** The search parameters to use for the ELASTIC_SEARCH spec. */
1922
+ export declare interface ExternalApiElasticSearchParams {
1923
+ /** The ElasticSearch index to use. */
1924
+ index?: string;
1925
+ /** Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param. */
1926
+ numHits?: number;
1927
+ /** The ElasticSearch search template to use. */
1928
+ searchTemplate?: string;
1929
+ }
1930
+
1931
+ /** The search parameters to use for SIMPLE_SEARCH spec. */
1932
+ export declare interface ExternalApiSimpleSearchParams {
1933
+ }
1934
+
1599
1935
  /** Options for feature selection preference. */
1600
1936
  export declare enum FeatureSelectionPreference {
1601
1937
  FEATURE_SELECTION_PREFERENCE_UNSPECIFIED = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
@@ -2068,6 +2404,22 @@ export declare interface GenerateContentConfig {
2068
2404
  Compatible mimetypes: `application/json`: Schema for JSON response.
2069
2405
  */
2070
2406
  responseSchema?: SchemaUnion;
2407
+ /** Optional. Output schema of the generated response.
2408
+ This is an alternative to `response_schema` that accepts [JSON
2409
+ Schema](https://json-schema.org/). If set, `response_schema` must be
2410
+ omitted, but `response_mime_type` is required. While the full JSON Schema
2411
+ may be sent, not all features are supported. Specifically, only the
2412
+ following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor`
2413
+ - `type` - `format` - `title` - `description` - `enum` (for strings and
2414
+ numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` -
2415
+ `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) -
2416
+ `properties` - `additionalProperties` - `required` The non-standard
2417
+ `propertyOrdering` property may also be set. Cyclic references are
2418
+ unrolled to a limited degree and, as such, may only be used within
2419
+ non-required properties. (Nullable properties are not sufficient.) If
2420
+ `$ref` is set on a sub-schema, no other properties, except for than those
2421
+ starting as a `$`, may be set. */
2422
+ responseJsonSchema?: unknown;
2071
2423
  /** Configuration for model router requests.
2072
2424
  */
2073
2425
  routingConfig?: GenerationConfigRoutingConfig;
@@ -2356,7 +2708,8 @@ export declare interface GenerateImagesConfig {
2356
2708
  /** Number of images to generate.
2357
2709
  */
2358
2710
  numberOfImages?: number;
2359
- /** Aspect ratio of the generated images.
2711
+ /** Aspect ratio of the generated images. Supported values are
2712
+ "1:1", "3:4", "4:3", "9:16", and "16:9".
2360
2713
  */
2361
2714
  aspectRatio?: string;
2362
2715
  /** Controls how much the model adheres to the text prompt. Large
@@ -2461,6 +2814,8 @@ export declare interface GenerateVideosConfig {
2461
2814
  generateAudio?: boolean;
2462
2815
  /** Image to use as the last frame of generated videos. Only supported for image to video use cases. */
2463
2816
  lastFrame?: Image_2;
2817
+ /** Compression quality of the generated videos. */
2818
+ compressionQuality?: VideoCompressionQuality;
2464
2819
  }
2465
2820
 
2466
2821
  /** A video generation operation. */
@@ -2512,6 +2867,8 @@ export declare interface GenerationConfig {
2512
2867
  audioTimestamp?: boolean;
2513
2868
  /** Optional. Number of candidates to generate. */
2514
2869
  candidateCount?: number;
2870
+ /** Optional. If enabled, the model will detect emotions and adapt its responses accordingly. */
2871
+ enableAffectiveDialog?: boolean;
2515
2872
  /** Optional. Frequency penalties. */
2516
2873
  frequencyPenalty?: number;
2517
2874
  /** Optional. Logit probabilities. */
@@ -2522,6 +2879,8 @@ export declare interface GenerationConfig {
2522
2879
  mediaResolution?: MediaResolution;
2523
2880
  /** Optional. Positive penalties. */
2524
2881
  presencePenalty?: number;
2882
+ /** Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. */
2883
+ responseJsonSchema?: unknown;
2525
2884
  /** Optional. If true, export the logprobs results in response. */
2526
2885
  responseLogprobs?: boolean;
2527
2886
  /** Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. */
@@ -2530,8 +2889,6 @@ export declare interface GenerationConfig {
2530
2889
  responseModalities?: Modality[];
2531
2890
  /** Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response. */
2532
2891
  responseSchema?: Schema;
2533
- /** Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. */
2534
- responseJsonSchema?: unknown;
2535
2892
  /** Optional. Routing configuration. */
2536
2893
  routingConfig?: GenerationConfigRoutingConfig;
2537
2894
  /** Optional. Seed. */
@@ -2578,6 +2935,30 @@ export declare interface GenerationConfigThinkingConfig {
2578
2935
  thinkingBudget?: number;
2579
2936
  }
2580
2937
 
2938
+ /** Optional parameters. */
2939
+ export declare interface GetBatchJobConfig {
2940
+ /** Used to override HTTP request options. */
2941
+ httpOptions?: HttpOptions;
2942
+ /** Abort signal which can be used to cancel the request.
2943
+
2944
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
2945
+ operation will not cancel the request in the service. You will still
2946
+ be charged usage for any applicable operations.
2947
+ */
2948
+ abortSignal?: AbortSignal;
2949
+ }
2950
+
2951
+ /** Config for batches.get parameters. */
2952
+ export declare interface GetBatchJobParameters {
2953
+ /** A fully-qualified BatchJob resource name or ID.
2954
+ Example: "projects/.../locations/.../batchPredictionJobs/456"
2955
+ or "456" when project and location are initialized in the client.
2956
+ */
2957
+ name: string;
2958
+ /** Optional parameters for the request. */
2959
+ config?: GetBatchJobConfig;
2960
+ }
2961
+
2581
2962
  /** Optional parameters for caches.get method. */
2582
2963
  export declare interface GetCachedContentConfig {
2583
2964
  /** Used to override HTTP request options. */
@@ -2731,6 +3112,7 @@ export declare class GoogleGenAI {
2731
3112
  private readonly apiVersion?;
2732
3113
  readonly models: Models;
2733
3114
  readonly live: Live;
3115
+ readonly batches: Batches;
2734
3116
  readonly chats: Chats;
2735
3117
  readonly caches: Caches;
2736
3118
  readonly files: Files;
@@ -2891,7 +3273,7 @@ export declare interface GroundingMetadata {
2891
3273
 
2892
3274
  /** Grounding support. */
2893
3275
  export declare interface GroundingSupport {
2894
- /** Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. */
3276
+ /** Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For Gemini 2.5 and after, this list will be empty and should be ignored. */
2895
3277
  confidenceScores?: number[];
2896
3278
  /** A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. */
2897
3279
  groundingChunkIndices?: number[];
@@ -2968,7 +3350,23 @@ export declare enum HarmCategory {
2968
3350
  /**
2969
3351
  * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
2970
3352
  */
2971
- HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
3353
+ HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY",
3354
+ /**
3355
+ * The harm category is image hate.
3356
+ */
3357
+ HARM_CATEGORY_IMAGE_HATE = "HARM_CATEGORY_IMAGE_HATE",
3358
+ /**
3359
+ * The harm category is image dangerous content.
3360
+ */
3361
+ HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",
3362
+ /**
3363
+ * The harm category is image harassment.
3364
+ */
3365
+ HARM_CATEGORY_IMAGE_HARASSMENT = "HARM_CATEGORY_IMAGE_HARASSMENT",
3366
+ /**
3367
+ * The harm category is image sexually explicit content.
3368
+ */
3369
+ HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"
2972
3370
  }
2973
3371
 
2974
3372
  /** Output only. Harm probability levels in the content. */
@@ -3102,7 +3500,8 @@ declare interface Image_2 {
3102
3500
  gcsUri?: string;
3103
3501
  /** The image bytes data. ``Image`` can contain a value for this field
3104
3502
  or the ``gcs_uri`` field but not both.
3105
- */
3503
+
3504
+ * @remarks Encoded as base64 string. */
3106
3505
  imageBytes?: string;
3107
3506
  /** The MIME type of the image. */
3108
3507
  mimeType?: string;
@@ -3118,6 +3517,29 @@ export declare enum ImagePromptLanguage {
3118
3517
  hi = "hi"
3119
3518
  }
3120
3519
 
3520
+ /** Config for inlined request. */
3521
+ export declare interface InlinedRequest {
3522
+ /** ID of the model to use. For a list of models, see `Google models
3523
+ <https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_. */
3524
+ model?: string;
3525
+ /** Content of the request.
3526
+ */
3527
+ contents?: ContentListUnion;
3528
+ /** Configuration that contains optional model parameters.
3529
+ */
3530
+ config?: GenerateContentConfig;
3531
+ }
3532
+
3533
+ /** Config for `inlined_responses` parameter. */
3534
+ export declare class InlinedResponse {
3535
+ /** The response to the request.
3536
+ */
3537
+ response?: GenerateContentResponse;
3538
+ /** The error encountered while processing the request.
3539
+ */
3540
+ error?: JobError;
3541
+ }
3542
+
3121
3543
  /** Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
3122
3544
 
3123
3545
  The start time must be less than or equal to the end time.
@@ -3132,7 +3554,17 @@ export declare interface Interval {
3132
3554
  endTime?: string;
3133
3555
  }
3134
3556
 
3135
- /** Output only. The detailed state of the job. */
3557
+ /** Job error. */
3558
+ export declare interface JobError {
3559
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
3560
+ details?: string[];
3561
+ /** The status code. */
3562
+ code?: number;
3563
+ /** A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field. */
3564
+ message?: string;
3565
+ }
3566
+
3567
+ /** Job state. */
3136
3568
  export declare enum JobState {
3137
3569
  /**
3138
3570
  * The job state is unspecified.
@@ -3175,7 +3607,7 @@ export declare enum JobState {
3175
3607
  */
3176
3608
  JOB_STATE_EXPIRED = "JOB_STATE_EXPIRED",
3177
3609
  /**
3178
- * The job is being updated. Only jobs in the `RUNNING` state can be updated. After updating, the job goes back to the `RUNNING` state.
3610
+ * The job is being updated. Only jobs in the `JOB_STATE_RUNNING` state can be updated. After updating, the job goes back to the `JOB_STATE_RUNNING` state.
3179
3611
  */
3180
3612
  JOB_STATE_UPDATING = "JOB_STATE_UPDATING",
3181
3613
  /**
@@ -3210,6 +3642,33 @@ export declare interface LatLng {
3210
3642
  longitude?: number;
3211
3643
  }
3212
3644
 
3645
+ /** Config for optional parameters. */
3646
+ export declare interface ListBatchJobsConfig {
3647
+ /** Used to override HTTP request options. */
3648
+ httpOptions?: HttpOptions;
3649
+ /** Abort signal which can be used to cancel the request.
3650
+
3651
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
3652
+ operation will not cancel the request in the service. You will still
3653
+ be charged usage for any applicable operations.
3654
+ */
3655
+ abortSignal?: AbortSignal;
3656
+ pageSize?: number;
3657
+ pageToken?: string;
3658
+ filter?: string;
3659
+ }
3660
+
3661
+ /** Config for batches.list parameters. */
3662
+ export declare interface ListBatchJobsParameters {
3663
+ config?: ListBatchJobsConfig;
3664
+ }
3665
+
3666
+ /** Config for batches.list return value. */
3667
+ export declare class ListBatchJobsResponse {
3668
+ nextPageToken?: string;
3669
+ batchJobs?: BatchJob[];
3670
+ }
3671
+
3213
3672
  /** Config for caches.list method. */
3214
3673
  export declare interface ListCachedContentsConfig {
3215
3674
  /** Used to override HTTP request options. */
@@ -4054,6 +4513,8 @@ export declare interface LiveServerSessionResumptionUpdate {
4054
4513
  }
4055
4514
 
4056
4515
  export declare interface LiveServerSetupComplete {
4516
+ /** The session id of the live session. */
4517
+ sessionId?: string;
4057
4518
  }
4058
4519
 
4059
4520
  /** Request for the client to execute the `function_calls` and return the responses with the matching `id`s. */
@@ -4787,7 +5248,8 @@ export declare interface Part {
4787
5248
  inlineData?: Blob_2;
4788
5249
  /** Optional. URI based data. */
4789
5250
  fileData?: FileData;
4790
- /** An opaque signature for the thought so it can be reused in subsequent requests. */
5251
+ /** An opaque signature for the thought so it can be reused in subsequent requests.
5252
+ * @remarks Encoded as base64 string. */
4791
5253
  thoughtSignature?: string;
4792
5254
  /** Optional. Result of executing the [ExecutableCode]. */
4793
5255
  codeExecutionResult?: CodeExecutionResult;
@@ -4817,8 +5279,17 @@ export declare type PartUnion = Part | string;
4817
5279
 
4818
5280
  /** Enum that controls the generation of people. */
4819
5281
  export declare enum PersonGeneration {
5282
+ /**
5283
+ * Block generation of images of people.
5284
+ */
4820
5285
  DONT_ALLOW = "DONT_ALLOW",
5286
+ /**
5287
+ * Generate images of adults, but not children.
5288
+ */
4821
5289
  ALLOW_ADULT = "ALLOW_ADULT",
5290
+ /**
5291
+ * Generate images that include adults and children.
5292
+ */
4822
5293
  ALLOW_ALL = "ALLOW_ALL"
4823
5294
  }
4824
5295
 
@@ -4983,6 +5454,8 @@ export declare class ReplayResponse {
4983
5454
  export declare interface Retrieval {
4984
5455
  /** Optional. Deprecated. This option is no longer supported. */
4985
5456
  disableAttribution?: boolean;
5457
+ /** Use data source powered by external API for grounding. */
5458
+ externalApi?: ExternalApi;
4986
5459
  /** Set to use data source powered by Vertex AI Search. */
4987
5460
  vertexAiSearch?: VertexAISearch;
4988
5461
  /** Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService. */
@@ -5031,6 +5504,8 @@ export declare interface SafetyRating {
5031
5504
  blocked?: boolean;
5032
5505
  /** Output only. Harm category. */
5033
5506
  category?: HarmCategory;
5507
+ /** Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. */
5508
+ overwrittenThreshold?: HarmBlockThreshold;
5034
5509
  /** Output only. Harm probability levels in the content. */
5035
5510
  probability?: HarmProbability;
5036
5511
  /** Output only. Harm probability score. */
@@ -5167,7 +5642,8 @@ export declare type SchemaUnion = Schema | unknown;
5167
5642
  export declare interface SearchEntryPoint {
5168
5643
  /** Optional. Web content snippet that can be embedded in a web page or an app webview. */
5169
5644
  renderedContent?: string;
5170
- /** Optional. Base64 encoded JSON representing array of tuple. */
5645
+ /** Optional. Base64 encoded JSON representing array of tuple.
5646
+ * @remarks Encoded as base64 string. */
5171
5647
  sdkBlob?: string;
5172
5648
  }
5173
5649
 
@@ -5488,7 +5964,7 @@ export declare interface SupervisedHyperParameters {
5488
5964
  adapterSize?: AdapterSize;
5489
5965
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */
5490
5966
  epochCount?: string;
5491
- /** Optional. Multiplier for adjusting the default learning rate. */
5967
+ /** Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. */
5492
5968
  learningRateMultiplier?: number;
5493
5969
  }
5494
5970
 
@@ -5558,9 +6034,9 @@ export declare interface SupervisedTuningSpec {
5558
6034
  exportLastCheckpointOnly?: boolean;
5559
6035
  /** Optional. Hyperparameters for SFT. */
5560
6036
  hyperParameters?: SupervisedHyperParameters;
5561
- /** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
6037
+ /** 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. */
5562
6038
  trainingDatasetUri?: string;
5563
- /** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
6039
+ /** 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. */
5564
6040
  validationDatasetUri?: string;
5565
6041
  }
5566
6042
 
@@ -5689,7 +6165,8 @@ export declare interface TokensInfo {
5689
6165
  role?: string;
5690
6166
  /** A list of token ids from the input. */
5691
6167
  tokenIds?: string[];
5692
- /** A list of tokens from the input. */
6168
+ /** A list of tokens from the input.
6169
+ * @remarks Encoded as base64 string. */
5693
6170
  tokens?: string[];
5694
6171
  }
5695
6172
 
@@ -5714,12 +6191,20 @@ export declare interface Tool {
5714
6191
  urlContext?: UrlContext;
5715
6192
  /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
5716
6193
  codeExecution?: ToolCodeExecution;
6194
+ /** Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations. */
6195
+ computerUse?: ToolComputerUse;
5717
6196
  }
5718
6197
 
5719
6198
  /** 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. */
5720
6199
  export declare interface ToolCodeExecution {
5721
6200
  }
5722
6201
 
6202
+ /** Tool to support computer use. */
6203
+ export declare interface ToolComputerUse {
6204
+ /** Required. The environment being operated. */
6205
+ environment?: Environment;
6206
+ }
6207
+
5723
6208
  /** Tool config.
5724
6209
 
5725
6210
  This config is shared for all tools provided in the request.
@@ -5803,6 +6288,8 @@ export declare interface TunedModelInfo {
5803
6288
  export declare interface TuningDataset {
5804
6289
  /** GCS URI of the file containing training dataset in JSONL format. */
5805
6290
  gcsUri?: string;
6291
+ /** The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'. */
6292
+ vertexDatasetResource?: string;
5806
6293
  /** Inline examples with simple input/output text. */
5807
6294
  examples?: TuningExample[];
5808
6295
  }
@@ -5860,6 +6347,10 @@ export declare interface TuningJob {
5860
6347
  labels?: Record<string, string>;
5861
6348
  /** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
5862
6349
  pipelineJob?: string;
6350
+ /** Output only. Reserved for future use. */
6351
+ satisfiesPzi?: boolean;
6352
+ /** Output only. Reserved for future use. */
6353
+ satisfiesPzs?: boolean;
5863
6354
  /** 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. */
5864
6355
  serviceAccount?: string;
5865
6356
  /** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
@@ -5908,6 +6399,8 @@ declare class Tunings extends BaseModule {
5908
6399
  export declare interface TuningValidationDataset {
5909
6400
  /** GCS URI of the file containing validation dataset in JSONL format. */
5910
6401
  gcsUri?: string;
6402
+ /** The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'. */
6403
+ vertexDatasetResource?: string;
5911
6404
  }
5912
6405
 
5913
6406
  /** Options about which input is included in the user's turn. */
@@ -5981,6 +6474,9 @@ declare namespace types {
5981
6474
  HarmBlockThreshold,
5982
6475
  Mode,
5983
6476
  AuthType,
6477
+ ApiSpec,
6478
+ Environment,
6479
+ UrlRetrievalStatus,
5984
6480
  FinishReason,
5985
6481
  HarmProbability,
5986
6482
  HarmSeverity,
@@ -5994,7 +6490,6 @@ declare namespace types {
5994
6490
  Behavior,
5995
6491
  DynamicRetrievalConfigMode,
5996
6492
  FunctionCallingConfigMode,
5997
- UrlRetrievalStatus,
5998
6493
  SafetyFilterLevel,
5999
6494
  PersonGeneration,
6000
6495
  ImagePromptLanguage,
@@ -6002,6 +6497,7 @@ declare namespace types {
6002
6497
  ControlReferenceType,
6003
6498
  SubjectReferenceType,
6004
6499
  EditMode,
6500
+ VideoCompressionQuality,
6005
6501
  FileState,
6006
6502
  FileSource,
6007
6503
  MediaModality,
@@ -6039,6 +6535,11 @@ declare namespace types {
6039
6535
  AuthConfig,
6040
6536
  GoogleMaps,
6041
6537
  UrlContext,
6538
+ ApiAuthApiKeyConfig,
6539
+ ApiAuth,
6540
+ ExternalApiElasticSearchParams,
6541
+ ExternalApiSimpleSearchParams,
6542
+ ExternalApi,
6042
6543
  VertexAISearchDataStoreSpec,
6043
6544
  VertexAISearch,
6044
6545
  VertexRagStoreRagResource,
@@ -6051,6 +6552,7 @@ declare namespace types {
6051
6552
  VertexRagStore,
6052
6553
  Retrieval,
6053
6554
  ToolCodeExecution,
6555
+ ToolComputerUse,
6054
6556
  Tool,
6055
6557
  FunctionCallingConfig,
6056
6558
  LatLng,
@@ -6200,6 +6702,24 @@ declare namespace types {
6200
6702
  DeleteFileConfig,
6201
6703
  DeleteFileParameters,
6202
6704
  DeleteFileResponse,
6705
+ InlinedRequest,
6706
+ BatchJobSource,
6707
+ JobError,
6708
+ InlinedResponse,
6709
+ BatchJobDestination,
6710
+ CreateBatchJobConfig,
6711
+ CreateBatchJobParameters,
6712
+ BatchJob,
6713
+ GetBatchJobConfig,
6714
+ GetBatchJobParameters,
6715
+ CancelBatchJobConfig,
6716
+ CancelBatchJobParameters,
6717
+ ListBatchJobsConfig,
6718
+ ListBatchJobsParameters,
6719
+ ListBatchJobsResponse,
6720
+ DeleteBatchJobConfig,
6721
+ DeleteBatchJobParameters,
6722
+ DeleteResourceJob,
6203
6723
  GetOperationConfig,
6204
6724
  GetOperationParameters,
6205
6725
  FetchPredictOperationConfig,
@@ -6282,7 +6802,8 @@ declare namespace types {
6282
6802
  SpeechConfigUnion,
6283
6803
  ToolUnion,
6284
6804
  ToolListUnion,
6285
- DownloadableFileUnion
6805
+ DownloadableFileUnion,
6806
+ BatchJobSourceUnion
6286
6807
  }
6287
6808
  }
6288
6809
 
@@ -6408,6 +6929,15 @@ export declare interface UpscaleImageConfig {
6408
6929
  /** The level of compression if the ``output_mime_type`` is
6409
6930
  ``image/jpeg``. */
6410
6931
  outputCompressionQuality?: number;
6932
+ /** Whether to add an image enhancing step before upscaling.
6933
+ It is expected to suppress the noise and JPEG compression artifacts
6934
+ from the input image. */
6935
+ enhanceInputImage?: boolean;
6936
+ /** With a higher image preservation factor, the original image
6937
+ pixels are more respected. With a lower image preservation factor, the
6938
+ output image will have be more different from the input image, but
6939
+ with finer details and less noise. */
6940
+ imagePreservationFactor?: number;
6411
6941
  }
6412
6942
 
6413
6943
  /** User-facing config UpscaleImageParameters. */
@@ -6538,12 +7068,27 @@ export declare interface VertexRagStoreRagResource {
6538
7068
  export declare interface Video {
6539
7069
  /** Path to another storage. */
6540
7070
  uri?: string;
6541
- /** Video bytes. */
7071
+ /** Video bytes.
7072
+ * @remarks Encoded as base64 string. */
6542
7073
  videoBytes?: string;
6543
7074
  /** Video encoding, for example "video/mp4". */
6544
7075
  mimeType?: string;
6545
7076
  }
6546
7077
 
7078
+ /** Enum that controls the compression quality of the generated videos. */
7079
+ export declare enum VideoCompressionQuality {
7080
+ /**
7081
+ * Optimized video compression quality. This will produce videos
7082
+ with a compressed, smaller file size.
7083
+ */
7084
+ OPTIMIZED = "OPTIMIZED",
7085
+ /**
7086
+ * Lossless video compression quality. This will produce videos
7087
+ with a larger file size.
7088
+ */
7089
+ LOSSLESS = "LOSSLESS"
7090
+ }
7091
+
6547
7092
  /** Describes how the video in the Part should be used by the model. */
6548
7093
  export declare interface VideoMetadata {
6549
7094
  /** The frame rate of the video sent to the model. If not specified, the